brotherton-erpnext/erpnext/patches/v13_0/update_payment_terms_outstanding.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
374 B
Python
Raw Normal View History

# 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(
2022-03-28 13:22:46 +00:00
"""
UPDATE
`tabPayment Schedule` ps
SET
ps.outstanding = (ps.payment_amount - ps.paid_amount)
2022-03-28 13:22:46 +00:00
"""
)