Files
schuetz3-erpnext/erpnext/patches/v13_0/update_payment_terms_outstanding.py
Ankush Menat c07713b860 style: bulk format code with black
v13 port because otherwise backports will result in conflicts always
2022-03-29 17:29:34 +05:30

19 lines
374 B
Python

# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
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)
"""
)