[fix] validate supplier invoice

- modified to check for the selected supplier only
This commit is contained in:
joezsweet 2017-04-11 09:31:45 +02:00 committed by Nabin Hait
parent 8037a0e3d5
commit 768a888bf2

View File

@ -628,10 +628,12 @@ class PurchaseInvoice(BuyingController):
pi = frappe.db.sql('''select name from `tabPurchase Invoice`
where
bill_no = %(bill_no)s
and supplier = %(supplier)s
and name != %(name)s
and docstatus < 2
and posting_date between %(year_start_date)s and %(year_end_date)s''', {
"bill_no": self.bill_no,
"supplier": self.supplier,
"name": self.name,
"year_start_date": fiscal_year.year_start_date,
"year_end_date": fiscal_year.year_end_date