fix: update advace paid in SO/PO in account currency

This commit is contained in:
ruthra kumar 2022-11-22 12:16:11 +05:30
parent df096688f7
commit bf76b85dfd

View File

@ -1352,12 +1352,12 @@ class AccountsController(TransactionBase):
party = self.customer if self.doctype == "Sales Order" else self.supplier
advance = (
frappe.qb.from_(ple)
.select(ple.account_currency, Abs(Sum(ple.amount)).as_("amount"))
.select(ple.account_currency, Abs(Sum(ple.amount_in_account_currency)).as_("amount"))
.where(
(ple.against_voucher_type == self.doctype)
& (ple.against_voucher_no == self.name)
& (ple.party == party)
& (ple.delinked == 0)
& (ple.docstatus == 1)
& (ple.company == self.company)
)
.run(as_dict=True)