Merge pull request #16109 from rohitwaghchaure/while_pulling_advanced_entry_system_uses_grand_total

[Fix] System allocated grand total amount instead of non zero rounded total for advanced entry in the sales invoice
This commit is contained in:
Nabin Hait 2018-11-27 13:22:50 +05:30 committed by GitHub
commit e4cc062cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -412,7 +412,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", {