calculate outstanding amount in server side, only if docstatus is 0
This commit is contained in:
@@ -139,7 +139,7 @@ class BuyingController(StockController):
|
||||
self.doc.conversion_rate, self.precision("other_charges_deducted_import"))
|
||||
|
||||
def calculate_outstanding_amount(self):
|
||||
if self.doc.doctype == "Purchase Invoice" and self.doc.docstatus < 2:
|
||||
if self.doc.doctype == "Purchase Invoice" and self.doc.docstatus == 0:
|
||||
self.doc.total_advance = flt(self.doc.total_advance,
|
||||
self.precision("total_advance"))
|
||||
self.doc.total_amount_to_pay = flt(self.doc.grand_total - flt(self.doc.write_off_amount,
|
||||
|
||||
Reference in New Issue
Block a user