Example #1
0
    def validate(self):
        super(SalesOrder, self).validate()

        self.validate_order_type()
        self.validate_delivery_date()
        self.validate_mandatory()
        self.validate_proj_cust()
        self.validate_po()
        self.validate_uom_is_integer("stock_uom", "qty")
        self.validate_for_items()
        self.validate_warehouse()

        from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
        make_packing_list(self, 'sales_order_details')

        self.validate_with_previous_doc()

        if not self.status:
            self.status = "Draft"

        from erpnext.utilities import validate_status
        validate_status(self.status,
                        ["Draft", "Submitted", "Stopped", "Cancelled"])

        if not self.billing_status: self.billing_status = 'Not Billed'
        if not self.delivery_status: self.delivery_status = 'Not Delivered'

        validate_recurring_document(self)
	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()
Example #3
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"))
Example #4
0
	def validate(self):
		super(SalesOrder, self).validate()

		self.validate_order_type()
		self.validate_delivery_date()
		self.validate_mandatory()
		self.validate_proj_cust()
		self.validate_po()
		self.validate_uom_is_integer("stock_uom", "qty")
		self.validate_for_items()
		self.validate_warehouse()

		from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
		make_packing_list(self,'sales_order_details')

		self.validate_with_previous_doc()

		if not self.status:
			self.status = "Draft"

		from erpnext.utilities import validate_status
		validate_status(self.status, ["Draft", "Submitted", "Stopped",
			"Cancelled"])

		if not self.billing_status: self.billing_status = 'Not Billed'
		if not self.delivery_status: self.delivery_status = 'Not Delivered'

		validate_recurring_document(self)
Example #5
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()
			self.validate_value("grand_total", ">=", 0)
			self.set_total_in_words()

		self.validate_for_freezed_account()

		if self.meta.get_field("is_recurring"):
			validate_recurring_document(self)
	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("is_recurring"):
			validate_recurring_document(self)

		if self.meta.get_field("taxes_and_charges"):
			self.validate_enabled_taxes_and_charges()
	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"))
Example #8
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"))
Example #9
0
 def on_update_after_submit(self):
     validate_recurring_document(self)
     convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)
Example #10
0
	def on_update_after_submit(self):
		validate_recurring_document(self)
		convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)