[Fix] System allocated grand total amount instead of non zero rounded total for advanced entry in the sales invoice

This commit is contained in:
Rohit Waghchaure 2018-11-27 12:07:03 +05:30
parent 64b4d98778
commit 6cc2f52fa4

View File

@ -405,7 +405,8 @@ class AccountsController(TransactionBase):
if d.against_order:
allocated_amount = flt(d.amount)
else:
allocated_amount = min(self.grand_total - advance_allocated, d.amount)
amount = self.rounded_total or self.grand_total
allocated_amount = min(amount - advance_allocated, d.amount)
advance_allocated += flt(allocated_amount)
self.append("advances", {