mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-19 11:27:55 +00:00
feat(Bank Reconciliation): Redesign (#24273)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
committed by
GitHub
parent
866cf70d3a
commit
07f40596bc
@@ -7,9 +7,20 @@ import frappe
|
||||
def execute():
|
||||
frappe.reload_doc("accounts", "doctype", "bank_transaction")
|
||||
|
||||
frappe.db.sql(""" UPDATE `tabBank Transaction`
|
||||
SET status = 'Reconciled'
|
||||
WHERE
|
||||
status = 'Settled' and (debit = allocated_amount or credit = allocated_amount)
|
||||
and ifnull(allocated_amount, 0) > 0
|
||||
""")
|
||||
bank_transaction_fields = frappe.get_meta("Bank Transaction").get_valid_columns()
|
||||
|
||||
if 'debit' in bank_transaction_fields:
|
||||
frappe.db.sql(""" UPDATE `tabBank Transaction`
|
||||
SET status = 'Reconciled'
|
||||
WHERE
|
||||
status = 'Settled' and (debit = allocated_amount or credit = allocated_amount)
|
||||
and ifnull(allocated_amount, 0) > 0
|
||||
""")
|
||||
|
||||
elif 'deposit' in bank_transaction_fields:
|
||||
frappe.db.sql(""" UPDATE `tabBank Transaction`
|
||||
SET status = 'Reconciled'
|
||||
WHERE
|
||||
status = 'Settled' and (deposit = allocated_amount or withdrawal = allocated_amount)
|
||||
and ifnull(allocated_amount, 0) > 0
|
||||
""")
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2019, Frappe and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.utils.rename_field import rename_field
|
||||
|
||||
def execute():
|
||||
doctypes = [
|
||||
"Bank Statement Settings",
|
||||
"Bank Statement Settings Item",
|
||||
"Bank Statement Transaction Entry",
|
||||
"Bank Statement Transaction Invoice Item",
|
||||
"Bank Statement Transaction Payment Item",
|
||||
"Bank Statement Transaction Settings Item",
|
||||
"Bank Statement Transaction Settings",
|
||||
]
|
||||
|
||||
for doctype in doctypes:
|
||||
frappe.delete_doc("DocType", doctype, force=1)
|
||||
|
||||
frappe.delete_doc("Page", "bank-reconciliation", force=1)
|
||||
|
||||
rename_field("Bank Transaction", "debit", "deposit")
|
||||
rename_field("Bank Transaction", "credit", "withdrawal")
|
||||
Reference in New Issue
Block a user