From 6336ff7323b0a77438cb23b4a281e8bfb9400069 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 9 Jul 2015 19:48:21 +0530 Subject: [PATCH] minor fixes --- erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py | 3 +-- erpnext/accounts/party.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 7cdb6df153..cf752afc9d 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -759,12 +759,11 @@ class TestSalesInvoice(unittest.TestCase): self.assertRaises(SerialNoDuplicateError, si.cancel) def test_invoice_due_date_against_customers_credit_days(self): - si = create_sales_invoice() # set customer's credit days frappe.db.set_value("Customer", "_Test Customer", "credit_days_based_on", "Fixed Days") frappe.db.set_value("Customer", "_Test Customer", "credit_days", 10) - si.validate() + si = create_sales_invoice() self.assertEqual(si.due_date, add_days(nowdate(), 10)) # set customer's credit days is last day of the next month diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 1f655df79e..0bf014b4d6 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -164,7 +164,7 @@ def get_due_date(posting_date, party_type, party, company): """Set Due Date = Posting Date + Credit Days""" due_date = None if posting_date and party: - due_date = nowdate() + due_date = posting_date if party_type=="Customer": credit_days_based_on, credit_days = get_credit_days(party_type, party, company) if credit_days_based_on == "Fixed Days" and credit_days: