[fix] supplier invoice number fix

This commit is contained in:
Rushabh Mehta 2015-07-14 10:26:50 +05:30
parent 2212ae12d8
commit 1956028ddc

View File

@ -382,7 +382,8 @@ class PurchaseInvoice(BuyingController):
frappe.throw("Supplier Invoice Date cannot be greater than Posting Date") frappe.throw("Supplier Invoice Date cannot be greater than Posting Date")
if self.bill_no: if self.bill_no:
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")): if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no, "fiscal_year": self.fiscal_year}) pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no,
"fiscal_year": self.fiscal_year, "name": ("!=", self.name)})
if pi: if pi:
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi)) frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))