Пример #1
0
	def validate(self):
		if self.get("_action") and self._action != "update_after_submit":
			self.set_missing_values(for_validate=True)
		self.validate_date_with_fiscal_year()

		if self.meta.get_field("currency"):
			self.calculate_taxes_and_totals()

			if not self.meta.get_field("is_return") or not self.is_return:
				self.validate_value("base_grand_total", ">=", 0)

			validate_return(self)
			self.set_total_in_words()

		if self.doctype in ("Sales Invoice", "Purchase Invoice") and not self.is_return:
			self.validate_due_date()
			self.validate_advance_entries()

		if self.meta.get_field("taxes_and_charges"):
			self.validate_enabled_taxes_and_charges()

		self.validate_party()
		self.validate_currency()

		if self.meta.get_field("is_recurring"):
			if self.amended_from and self.recurring_id:
				self.recurring_id = None
			if not self.get("__islocal"):
				validate_recurring_document(self)
				convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))

		if self.doctype == 'Purchase Invoice':
			self.validate_paid_amount()
Пример #2
0
    def validate(self):
        if self.get("_action") and self._action != "update_after_submit":
            self.set_missing_values(for_validate=True)
        self.validate_date_with_fiscal_year()

        if self.meta.get_field("currency"):
            self.calculate_taxes_and_totals()
            if not self.meta.get_field("is_return") or not self.is_return:
                self.validate_value("base_grand_total", ">=", 0)

            validate_return(self)
            self.set_total_in_words()

        if self.doctype in ("Sales Invoice",
                            "Purchase Invoice") and not self.is_return:
            self.validate_due_date()

        if self.meta.get_field("taxes_and_charges"):
            self.validate_enabled_taxes_and_charges()

        self.validate_party()
        self.validate_currency()

        if self.meta.get_field("is_recurring") and not self.get("__islocal"):
            validate_recurring_document(self)
            convert_to_recurring(
                self,
                self.get("posting_date") or self.get("transaction_date"))
Пример #3
0
	def on_submit(self):
		self.update_stock_ledger(update_stock = 1)

		self.check_credit(self.grand_total)

		frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.grand_total, self)

		self.update_prevdoc_status('submit')
		frappe.db.set(self, 'status', 'Submitted')
		
		convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)
Пример #4
0
    def on_submit(self):
        self.update_stock_ledger(update_stock=1)

        self.check_credit(self.grand_total)

        frappe.get_doc('Authorization Control').validate_approving_authority(
            self.doctype, self.grand_total, self)

        self.update_prevdoc_status('submit')
        frappe.db.set(self, 'status', 'Submitted')

        convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)
	def on_update_after_submit(self):
		if self.meta.get_field("is_recurring"):
			validate_recurring_document(self)
			convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
	def on_submit(self):
		if self.meta.get_field("is_recurring"):
			convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
Пример #7
0
 def on_update_after_submit(self):
     if self.meta.get_field("is_recurring"):
         validate_recurring_document(self)
         convert_to_recurring(
             self,
             self.get("posting_date") or self.get("transaction_date"))
Пример #8
0
 def on_submit(self):
     if self.meta.get_field("is_recurring"):
         convert_to_recurring(
             self,
             self.get("posting_date") or self.get("transaction_date"))
Пример #9
0
 def on_update_after_submit(self):
     validate_recurring_document(self)
     convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)
Пример #10
0
	def on_update_after_submit(self):
		validate_recurring_document(self)
		convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)