fix: Supplier Invoice Importer fix

This commit is contained in:
Subin Tom 2021-07-23 21:23:48 +05:30
parent 2fc39fcade
commit fac88a3329
2 changed files with 5 additions and 2 deletions

View File

@ -391,5 +391,5 @@ def set_default_accounts(company):
})
company.save()
install_country_fixtures(company.name, company.country)
install_country_fixtures(company.name)
company.create_default_tax_template()

View File

@ -1112,8 +1112,11 @@ class AccountsController(TransactionBase):
for d in self.get("payment_schedule"):
if d.invoice_portion:
d.payment_amount = flt(grand_total * flt(d.invoice_portion / 100), d.precision('payment_amount'))
d.base_payment_amount = flt(base_grand_total * flt(d.invoice_portion / 100), d.precision('payment_amount'))
d.base_payment_amount = flt(base_grand_total * flt(d.invoice_portion / 100), d.precision('base_payment_amount'))
d.outstanding = d.payment_amount
elif not d.invoice_portion:
d.base_payment_amount = flt(base_grand_total * self.get("conversion_rate"), d.precision('base_payment_amount'))
def set_due_date(self):
due_dates = [d.due_date for d in self.get("payment_schedule") if d.due_date]