From 3cd9b312689ccdadbc31ad8cc244dc0273070722 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 28 Sep 2012 16:14:38 +0530 Subject: [PATCH] due date based on credit days in pur invoice --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index d9c3fb149f5..257d02b7893 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -66,7 +66,9 @@ class DocType(TransactionBase): def get_cust(self): ret = {} if self.doc.credit_to: - ret['supplier'] = get_value('Account',self.doc.credit_to,'master_name') + acc = get_value('Account',self.doc.credit_to,['master_name', 'credit_days']) + ret['supplier'] = acc[0] + ret['due_date'] = add_days(cstr(self.doc.posting_date), acc and cint(acc[1]) or 0) return ret