minor fixes
This commit is contained in:
parent
5cbe3441e8
commit
6336ff7323
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user