From 4f2832ecd23b5e972d232d21efbbc6a6437f522b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 31 Jul 2015 11:43:50 +0530 Subject: [PATCH] [fix] Allow against purchase invoice against credit amount row --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index dc620edcf0..655f718ce9 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -183,10 +183,10 @@ class JournalEntry(AccountsController): if d.get(against_field): dr_or_cr = "credit" if against_field in ["against_invoice", "against_sales_order"] \ else "debit" - if against_field in ["against_invoice", "against_sales_order"] and flt(d.debit) > 0: + if against_field == "against_sales_order" and flt(d.debit) > 0: frappe.throw(_("Row {0}: Debit entry can not be linked with a {1}").format(d.idx, doctype)) - if against_field in ["against_voucher", "against_purchase_order"] and flt(d.credit) > 0: + if against_field == "against_purchase_order" and flt(d.credit) > 0: frappe.throw(_("Row {0}: Credit entry can not be linked with a {1}").format(d.idx, doctype)) against_voucher = frappe.db.get_value(doctype, d.get(against_field),