Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pending payments to reconcile #38091

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

frappe.query_reports["Pending Payments To Reconcile"] = {
"filters": [
{
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"reqd": 1,
"default": frappe.defaults.get_user_default("Company"),
},
{
"fieldname":"party_type",
"label": __("Party Type"),
"fieldtype": "Link",
"options": "Party Type",
"reqd": 1,
"default": "Customer",
}
]
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2023-11-14 15:55:40.927913",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"letter_head": "Fdfsdf",
"letterhead": null,
"modified": "2023-11-14 15:55:50.093163",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pending Payments To Reconcile",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Payment Ledger Entry",
"report_name": "Pending Payments To Reconcile",
"report_type": "Script Report",
"roles": [
{
"role": "Accounts User"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt

# import frappe
from frappe import _

from erpnext.accounts.party import get_partywise_advanced_payment_amount


def execute(filters=None):
columns = get_columns(filters)
data = get_data(filters)
return columns, data


def get_data(filters):
data = []
unreconciled_entries = (
get_partywise_advanced_payment_amount(party_type=[filters.party_type], company=filters.company)
or {}
)

for party, unreconciled_amount in unreconciled_entries.items():
data.append({"party": party, "to_reconcile": unreconciled_amount})

return data


def get_columns(filters):
return [
{
"fieldname": "party",
"label": _(filters.party_type),
"fieldtype": "Link",
"options": filters.party_type,
"width": 250,
},
{
"fieldname": "to_reconcile",
"label": _("To Reconcile"),
"fieldtype": "Currency",
"width": 200,
},
]