feat: add outstanding field in payment schedule

This commit is contained in:
Saqib Ansari
2021-02-10 11:18:57 +05:30
committed by Deepesh Garg
parent 7a3dbe1b72
commit 4b9aed2c0e
3 changed files with 24 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
"description",
"discount_percentage",
"discounted_amount",
"outstanding",
"column_break_3",
"due_date",
"invoice_portion",
@@ -89,12 +90,18 @@
"fieldtype": "Currency",
"label": "Discounted Amount",
"read_only": 1
},
{
"fieldname": "outstanding",
"fieldtype": "Currency",
"label": "Outstanding",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-02-08 12:45:25.734948",
"modified": "2021-02-09 20:47:56.617701",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",

View File

@@ -757,3 +757,4 @@ erpnext.patches.v13_0.setup_fields_for_80g_certificate_and_donation
erpnext.patches.v13_0.rename_membership_settings_to_non_profit_settings
erpnext.patches.v12_0.create_taxable_value_field
erpnext.patches.v12_0.add_company_link_to_einvoice_settings
erpnext.patches.v13_0.update_payment_terms_outstanding

View File

@@ -0,0 +1,15 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
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)
''')