Ejemplo n.º 1
0
    def validate(self):
        super(SalesOrder, self).validate()
        self.validate_order_type()
        self.validate_delivery_date()
        self.validate_proj_cust()
        self.validate_po()
        self.validate_uom_is_integer("stock_uom", "stock_qty")
        self.validate_uom_is_integer("uom", "qty")
        self.validate_for_items()
        self.validate_warehouse()
        self.validate_drop_ship()
        self.validate_serial_no_based_delivery()
        validate_inter_company_party(self.doctype, self.customer, self.company,
                                     self.inter_company_order_reference)

        if self.coupon_code:
            from erpnext.accounts.doctype.pricing_rule.utils import validate_coupon_code
            validate_coupon_code(self.coupon_code)

        from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
        make_packing_list(self)

        self.validate_with_previous_doc()
        self.set_status()

        if not self.billing_status: self.billing_status = 'Not Billed'
        if not self.delivery_status: self.delivery_status = 'Not Delivered'
Ejemplo n.º 2
0
    def validate(self):
        super(PurchaseOrder, self).validate()

        self.set_status()

        # apply tax withholding only if checked and applicable
        self.set_tax_withholding()

        self.validate_supplier()
        self.validate_schedule_date()
        validate_for_items(self)
        self.check_on_hold_or_closed_status()

        self.validate_uom_is_integer("uom", "qty")
        self.validate_uom_is_integer("stock_uom", "stock_qty")

        self.validate_with_previous_doc()
        self.validate_for_subcontracting()
        self.validate_minimum_order_qty()
        self.validate_bom_for_subcontracting_items()
        self.create_raw_materials_supplied("supplied_items")
        self.set_received_qty_for_drop_ship_items()
        validate_inter_company_party(self.doctype, self.supplier, self.company,
                                     self.inter_company_order_reference)
        self.reset_default_field_value("set_warehouse", "items", "warehouse")
    def validate(self):
        self.validate_proj_cust()
        self.validate_for_items()
        validate_inter_company_party(self.doctype, self.customer, self.company,
                                     self.inter_company_order_reference)

        self.validate_with_previous_doc()
        self.set_status()

        if not self.billing_status: self.billing_status = 'Not Billed'
Ejemplo n.º 4
0
    def validate(self):
        if not self.is_opening:
            self.is_opening = 'No'

        self.validate_posting_time()

        # apply tax withholding only if checked and applicable
        self.set_tax_withholding()

        super(PurchaseInvoice, self).validate()

        if not self.is_return:
            self.po_required()
            self.pr_required()
            self.validate_supplier_invoice()

        # validate cash purchase
        if (self.is_paid == 1):
            self.validate_cash()

        # validate service stop date to lie in between start and end date
        validate_service_stop_date(self)

        if self._action == "submit" and self.update_stock:
            self.make_batches('warehouse')

        self.validate_release_date()
        self.check_conversion_rate()
        self.validate_credit_to_acc()
        self.clear_unallocated_advances("Purchase Invoice Advance", "advances")
        self.check_for_closed_status()
        self.validate_with_previous_doc()
        self.validate_uom_is_integer("uom", "qty")
        self.validate_uom_is_integer("stock_uom", "stock_qty")
        self.set_expense_account(for_validate=True)
        self.set_against_expense_account()
        self.validate_write_off_account()
        self.validate_multiple_billing("Purchase Receipt", "pr_detail",
                                       "amount", "items")
        self.validate_fixed_asset()
        self.create_remarks()
        self.set_status()
        validate_inter_company_party(self.doctype, self.supplier, self.company,
                                     self.inter_company_invoice_reference)
Ejemplo n.º 5
0
	def validate(self):
		if not self.is_opening:
			self.is_opening = 'No'

		self.validate_posting_time()

		super(PurchaseInvoice, self).validate()

		# apply tax withholding only if checked and applicable
		self.set_tax_withholding()

		if not self.is_return:
			self.po_required()
			self.pr_required()
			self.validate_supplier_invoice()

		# validate cash purchase
		if (self.is_paid == 1):
			self.validate_cash()

		# validate service stop date to lie in between start and end date
		validate_service_stop_date(self)

		if self._action=="submit" and self.update_stock:
			self.make_batches('warehouse')

		self.validate_release_date()
		self.check_conversion_rate()
		self.validate_credit_to_acc()
		self.clear_unallocated_advances("Purchase Invoice Advance", "advances")
		self.check_for_closed_status()
		self.validate_with_previous_doc()
		self.validate_uom_is_integer("uom", "qty")
		self.validate_uom_is_integer("stock_uom", "stock_qty")
		self.set_expense_account(for_validate=True)
		self.set_against_expense_account()
		self.validate_write_off_account()
		self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "items")
		self.validate_fixed_asset()
		self.create_remarks()
		self.set_status()
		validate_inter_company_party(self.doctype, self.supplier, self.company, self.inter_company_invoice_reference)
Ejemplo n.º 6
0
	def validate(self):
		super(PurchaseOrder, self).validate()

		self.set_status()

		self.validate_supplier()
		self.validate_schedule_date()
		validate_for_items(self)
		self.check_on_hold_or_closed_status()

		self.validate_uom_is_integer("uom", "qty")
		self.validate_uom_is_integer("stock_uom", "stock_qty")

		self.validate_with_previous_doc()
		self.validate_for_subcontracting()
		self.validate_minimum_order_qty()
		self.validate_bom_for_subcontracting_items()
		self.create_raw_materials_supplied("supplied_items")
		self.set_received_qty_for_drop_ship_items()
		validate_inter_company_party(self.doctype, self.supplier, self.company, self.inter_company_order_reference)