コード例 #1
0
ファイル: supplier.py プロジェクト: Aptronics/erpnext
	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)
コード例 #2
0
ファイル: customer.py プロジェクト: Aptronics/erpnext
	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
コード例 #3
0
	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)
コード例 #4
0
ファイル: customer.py プロジェクト: sumitsitm000/erpnextt
	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"))
コード例 #5
0
    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)
コード例 #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)
コード例 #7
0
	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)
コード例 #8
0
	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)
コード例 #9
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

		# 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)
コード例 #10
0
    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)
コード例 #11
0
ファイル: customer.py プロジェクト: Aptitudetech/ERPNext
	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()
コード例 #12
0
 def validate(self):
     self.flags.is_new_doc = self.is_new()
     validate_party_accounts(self)
コード例 #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()
コード例 #14
0
ファイル: customer.py プロジェクト: shitolepriya/Saloon_erp
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		validate_party_accounts(self)
コード例 #15
0
	def validate(self):
		self.flags.is_new_doc = self.is_new()
		validate_party_accounts(self)
		self.status = get_party_status(self)
コード例 #16
0
ファイル: customer.py プロジェクト: Lewinta/erpnext-v7
 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()