Beispiel #1
0
	def validate(self):
		# validation for Naming Series mandatory field...
		if frappe.defaults.get_global_default('supp_master_name') == 'Naming Series':
			if not self.naming_series:
				msgprint(_("Series is mandatory"), raise_exception=1)

		validate_party_accounts(self)
Beispiel #2
0
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		self.flags.old_lead = self.lead_name
		validate_party_accounts(self)
		self.validate_credit_limit_on_change()
		self.set_loyalty_program()
		self.check_customer_group_change()

		# set loyalty program tier
		if frappe.db.exists('Customer', self.name):
			customer = frappe.get_doc('Customer', self.name)
			if self.loyalty_program == customer.loyalty_program and not self.loyalty_program_tier:
				self.loyalty_program_tier = customer.loyalty_program_tier
	def validate(self):
		self.set_full_name()
		validate_party_accounts(self)
		if self.inpatient_visit_charge_item:
			validate_service_item(self.inpatient_visit_charge_item, 'Configure a service Item for Inpatient Consulting Charge Item')
		if self.op_consulting_charge_item:
			validate_service_item(self.op_consulting_charge_item, 'Configure a service Item for Out Patient Consulting Charge Item')

		if self.user_id:
			self.validate_user_id()
		else:
			existing_user_id = frappe.db.get_value('Healthcare Practitioner', self.name, 'user_id')
			if existing_user_id:
				frappe.permissions.remove_user_permission(
					'Healthcare Practitioner', self.name, existing_user_id)
Beispiel #4
0
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		self.flags.old_lead = self.lead_name
		validate_party_accounts(self)
		self.validate_credit_limit_on_change()
		self.set_loyalty_program()
		self.check_customer_group_change()

		# set loyalty program tier
		if frappe.db.exists('Customer', self.name):
			customer = frappe.get_doc('Customer', self.name)
			if self.loyalty_program == customer.loyalty_program and not self.loyalty_program_tier:
				self.loyalty_program_tier = customer.loyalty_program_tier

		if self.sales_team:
			if sum([member.allocated_percentage or 0 for member in self.sales_team]) != 100:
				frappe.throw(_("Total contribution percentage should be equal to 100"))
    def validate(self):
        validate_party_accounts(self)

        if self.user_id:
            self.validate_for_enabled_user_id()
            self.validate_duplicate_user_id()
            existing_user_id = frappe.db.get_value("Healthcare Practitioner",
                                                   self.name, "user_id")
            if self.user_id != existing_user_id:
                frappe.permissions.remove_user_permission(
                    "Healthcare Practitioner", self.name, existing_user_id)

        else:
            existing_user_id = frappe.db.get_value("Healthcare Practitioner",
                                                   self.name, "user_id")
            if existing_user_id:
                frappe.permissions.remove_user_permission(
                    "Healthcare Practitioner", self.name, existing_user_id)
Beispiel #6
0
    def validate(self):
        self.validate_schedule_and_time()
        validate_party_accounts(self)

        if self.user_id:
            self.validate_for_enabled_user_id()
            self.validate_duplicate_user_id()
            existing_user_id = frappe.db.get_value("Physician", self.name,
                                                   "user_id")
            if self.user_id != existing_user_id:
                frappe.permissions.remove_user_permission(
                    "Physician", self.name, existing_user_id)

        else:
            existing_user_id = frappe.db.get_value("Physician", self.name,
                                                   "user_id")
            if existing_user_id:
                frappe.permissions.remove_user_permission(
                    "Physician", self.name, existing_user_id)
	def validate(self):
		validate_party_accounts(self)
		if self.inpatient_visit_charge_item:
			validate_service_item(self.inpatient_visit_charge_item, "Configure a service Item for Inpatient Visit Charge Item")
		if self.op_consulting_charge_item:
			validate_service_item(self.op_consulting_charge_item, "Configure a service Item for Out Patient Consulting Charge Item")

		if self.user_id:
			self.validate_for_enabled_user_id()
			self.validate_duplicate_user_id()
			existing_user_id = frappe.db.get_value("Healthcare Practitioner", self.name, "user_id")
			if self.user_id != existing_user_id:
				frappe.permissions.remove_user_permission(
					"Healthcare Practitioner", self.name, existing_user_id)

		else:
			existing_user_id = frappe.db.get_value("Healthcare Practitioner", self.name, "user_id")
			if existing_user_id:
				frappe.permissions.remove_user_permission(
					"Healthcare Practitioner", self.name, existing_user_id)
	def validate(self):
		validate_party_accounts(self)
		if self.inpatient_visit_charge_item:
			validate_service_item(self.inpatient_visit_charge_item, "Configure a service Item for Inpatient Visit Charge Item")
		if self.op_consulting_charge_item:
			validate_service_item(self.op_consulting_charge_item, "Configure a service Item for Out Patient Consulting Charge Item")

		if self.user_id:
			self.validate_for_enabled_user_id()
			self.validate_duplicate_user_id()
			existing_user_id = frappe.db.get_value("Healthcare Practitioner", self.name, "user_id")
			if self.user_id != existing_user_id:
				frappe.permissions.remove_user_permission(
					"Healthcare Practitioner", self.name, existing_user_id)

		else:
			existing_user_id = frappe.db.get_value("Healthcare Practitioner", self.name, "user_id")
			if existing_user_id:
				frappe.permissions.remove_user_permission(
					"Healthcare Practitioner", self.name, existing_user_id)
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		self.flags.old_lead = self.lead_name
		validate_party_accounts(self)
		self.validate_credit_limit_on_change()
		self.set_loyalty_program()
		self.check_customer_group_change()

		# set loyalty program tier
		if frappe.db.exists('Customer', self.name):
			customer = frappe.get_doc('Customer', self.name)
			if self.loyalty_program == customer.loyalty_program and not self.loyalty_program_tier:
				self.loyalty_program_tier = customer.loyalty_program_tier

		# save new customer system number
		if(self.status == "Active"):
			check_required_details(self)
		else: 
			pass
		# add customers system number n save
		add_customer_system_no(self)
		save_new_system_no(self)
    def validate(self):
        self.flags.is_new_doc = self.is_new()
        validate_party_accounts(self)
        #start entering of code by poorvi on 28-12-2016
        if not (self.customer_contact_number or self.landline_mobile_2):
            frappe.throw(
                "Enter either Customer Contact Number ( Mobile 1 ) or Landline / Mobile 2"
            )
#end of entering code by poorvi on 28-12-2016

#Start entering of code by Poorvi on 30-09-20016
        var4 = frappe.db.get_value(
            "Customer",
            {"customer_contact_number": (self.customer_contact_number)})
        var5 = unicode(var4) or u''
        var6 = frappe.db.get_value(
            "Customer",
            {"customer_contact_number":
             (self.customer_contact_number)}, "customer_name")
        if var5 != "None" and self.name != var5:
            frappe.throw("Customer with contact no " +
                         self.customer_contact_number +
                         " already exists \n Customer ID : " + var5 +
                         "\n Customer Name : " + var6)
Beispiel #11
0
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		self.flags.old_lead = self.lead_name
		validate_party_accounts(self)
		self.validate_credit_limit_on_change()
Beispiel #12
0
 def validate(self):
     self.flags.is_new_doc = self.is_new()
     validate_party_accounts(self)
Beispiel #13
0
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		self.flags.old_lead = self.lead_name
		validate_party_accounts(self)
		self.validate_credit_limit_on_change()
		self.check_customer_group_change()
Beispiel #14
0
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		validate_party_accounts(self)
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		validate_party_accounts(self)
		self.status = get_party_status(self)
Beispiel #16
0
 def validate(self):
     self.flags.is_new_doc = self.is_new()
     self.flags.old_lead = self.lead_name
     validate_party_accounts(self)
     self.status = get_party_status(self)
     self.validate_credit_limit_on_change()