mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge pull request #38541 from frappe/mergify/bp/version-14-hotfix/pr-38148
refactor: convert Payment Reconciliation to virtual doctype (backport #38148)
This commit is contained in:
@@ -203,9 +203,10 @@
|
|||||||
],
|
],
|
||||||
"hide_toolbar": 1,
|
"hide_toolbar": 1,
|
||||||
"icon": "icon-resize-horizontal",
|
"icon": "icon-resize-horizontal",
|
||||||
|
"is_virtual": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-08-15 05:35:50.109290",
|
"modified": "2023-11-17 17:33:55.701726",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation",
|
"name": "Payment Reconciliation",
|
||||||
@@ -230,6 +231,5 @@
|
|||||||
],
|
],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": []
|
||||||
"track_changes": 1
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,58 @@ class PaymentReconciliation(Document):
|
|||||||
self.accounting_dimension_filter_conditions = []
|
self.accounting_dimension_filter_conditions = []
|
||||||
self.ple_posting_date_filter = []
|
self.ple_posting_date_filter = []
|
||||||
|
|
||||||
|
def load_from_db(self):
|
||||||
|
# 'modified' attribute is required for `run_doc_method` to work properly.
|
||||||
|
doc_dict = frappe._dict(
|
||||||
|
{
|
||||||
|
"modified": None,
|
||||||
|
"company": None,
|
||||||
|
"party": None,
|
||||||
|
"party_type": None,
|
||||||
|
"receivable_payable_account": None,
|
||||||
|
"default_advance_account": None,
|
||||||
|
"from_invoice_date": None,
|
||||||
|
"to_invoice_date": None,
|
||||||
|
"invoice_limit": 50,
|
||||||
|
"from_payment_date": None,
|
||||||
|
"to_payment_date": None,
|
||||||
|
"payment_limit": 50,
|
||||||
|
"minimum_invoice_amount": None,
|
||||||
|
"minimum_payment_amount": None,
|
||||||
|
"maximum_invoice_amount": None,
|
||||||
|
"maximum_payment_amount": None,
|
||||||
|
"bank_cash_account": None,
|
||||||
|
"cost_center": None,
|
||||||
|
"payment_name": None,
|
||||||
|
"invoice_name": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
super(Document, self).__init__(doc_dict)
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
return
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_list(args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_count(args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_stats(args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def db_insert(self, *args, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def db_update(self, *args, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def delete(self):
|
||||||
|
pass
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_unreconciled_entries(self):
|
def get_unreconciled_entries(self):
|
||||||
self.get_nonreconciled_payment_entries()
|
self.get_nonreconciled_payment_entries()
|
||||||
|
|||||||
@@ -159,9 +159,10 @@
|
|||||||
"label": "Difference Posting Date"
|
"label": "Difference Posting Date"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"is_virtual": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-10-23 10:44:56.066303",
|
"modified": "2023-11-17 17:33:38.612615",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation Allocation",
|
"name": "Payment Reconciliation Allocation",
|
||||||
|
|||||||
@@ -71,9 +71,10 @@
|
|||||||
"label": "Exchange Rate"
|
"label": "Exchange Rate"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"is_virtual": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-11-08 18:18:02.502149",
|
"modified": "2023-11-17 17:33:45.455166",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation Invoice",
|
"name": "Payment Reconciliation Invoice",
|
||||||
|
|||||||
@@ -107,9 +107,10 @@
|
|||||||
"options": "Cost Center"
|
"options": "Cost Center"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"is_virtual": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-09-03 07:43:29.965353",
|
"modified": "2023-11-17 17:33:34.818530",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation Payment",
|
"name": "Payment Reconciliation Payment",
|
||||||
|
|||||||
@@ -344,13 +344,12 @@ erpnext.patches.v14_0.migrate_deferred_accounts_to_item_defaults
|
|||||||
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
|
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
|
||||||
erpnext.patches.v14_0.rename_over_order_allowance_field
|
erpnext.patches.v14_0.rename_over_order_allowance_field
|
||||||
erpnext.patches.v14_0.migrate_delivery_stop_lock_field
|
erpnext.patches.v14_0.migrate_delivery_stop_lock_field
|
||||||
execute:frappe.db.set_single_value("Payment Reconciliation", "invoice_limit", 50)
|
|
||||||
execute:frappe.db.set_single_value("Payment Reconciliation", "payment_limit", 50)
|
|
||||||
erpnext.patches.v14_0.rename_daily_depreciation_to_depreciation_amount_based_on_num_days_in_month
|
erpnext.patches.v14_0.rename_daily_depreciation_to_depreciation_amount_based_on_num_days_in_month
|
||||||
erpnext.patches.v14_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based
|
erpnext.patches.v14_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based
|
||||||
erpnext.patches.v14_0.add_default_for_repost_settings
|
erpnext.patches.v14_0.add_default_for_repost_settings
|
||||||
erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation
|
erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation
|
||||||
erpnext.patches.v14_0.update_zero_asset_quantity_field
|
erpnext.patches.v14_0.update_zero_asset_quantity_field
|
||||||
execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency", "Each Transaction")
|
execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency", "Each Transaction")
|
||||||
|
erpnext.patches.v14_0.clear_reconciliation_values_from_singles
|
||||||
# below migration patch should always run last
|
# below migration patch should always run last
|
||||||
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
|
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
from frappe import qb
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
"""
|
||||||
|
Clear `tabSingles` and Payment Reconciliation tables of values
|
||||||
|
"""
|
||||||
|
singles = qb.DocType("Singles")
|
||||||
|
qb.from_(singles).delete().where(singles.doctype == "Payment Reconciliation").run()
|
||||||
|
doctypes = [
|
||||||
|
"Payment Reconciliation Invoice",
|
||||||
|
"Payment Reconciliation Payment",
|
||||||
|
"Payment Reconciliation Allocation",
|
||||||
|
]
|
||||||
|
for x in doctypes:
|
||||||
|
dt = qb.DocType(x)
|
||||||
|
qb.from_(dt).delete().run()
|
||||||
Reference in New Issue
Block a user