2021-03-31 09:33:53 +00:00
|
|
|
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
|
|
|
|
# MIT License. See license.txt
|
|
|
|
|
2021-09-02 11:14:59 +00:00
|
|
|
|
2021-03-31 09:33:53 +00:00
|
|
|
import frappe
|
|
|
|
|
2021-09-02 11:14:59 +00:00
|
|
|
|
2021-03-31 09:33:53 +00:00
|
|
|
def execute():
|
|
|
|
frappe.reload_doc("accounts", "doctype", "Payment Schedule")
|
|
|
|
if frappe.db.count('Payment Schedule'):
|
|
|
|
frappe.db.sql('''
|
|
|
|
UPDATE
|
|
|
|
`tabPayment Schedule` ps
|
|
|
|
SET
|
|
|
|
ps.outstanding = (ps.payment_amount - ps.paid_amount)
|
|
|
|
''')
|