From 63b275c97f74e9590027535e13c1f8a75e75c2bf Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 10:35:35 +0530 Subject: [PATCH 1/2] allowed debit and credit against same acc head --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index c45e1625ac..3892007bb4 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -36,10 +36,12 @@ class DocType: msgprint("GL Entry: Debit or Credit amount is mandatory for %s" % self.doc.account) raise Exception + + # COMMMENTED below to allow zero amount (+ and -) entry in tax table # Debit and credit can not done at the same time - if flt(self.doc.credit) != 0 and flt(self.doc.debit) != 0: - msgprint("Sorry you cannot credit and debit under same account head.") - raise Exception, "Validation Error." + #if flt(self.doc.credit) != 0 and flt(self.doc.debit) != 0: + # msgprint("Sorry you cannot credit and debit under same account head.") + # raise Exception, "Validation Error." # Cost center is required only if transaction made against pl account #-------------------------------------------------------------------- From e73db0e33103fc5d00390c8544c3e318753780fb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 12:26:12 +0530 Subject: [PATCH 2/2] set serial_no status="In Store" if purchase return cancelled --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 1a3e783327..d9196d8718 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -437,8 +437,8 @@ class DocType: if self.doc.purpose == 'Purchase Return': #delete_doc("Serial No", serial_no) serial_doc = Document("Serial No", serial_no) - serial_doc.status = 'Purchase Returned' - serial_doc.docstatus = 2 + serial_doc.status = is_submit and 'Purchase Returned' or 'In Store' + serial_doc.docstatus = is_submit and 2 or 0 serial_doc.save()