From 9b7b9b2e9313bb3d9db95aaa3e5b5f92ef30915e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 10 Jul 2014 18:44:41 +0530 Subject: [PATCH] Bank Reconciliation Statement Print Format --- .../bank_reconciliation_statement.html | 46 +++++++++++++++++++ .../bank_reconciliation_statement.py | 19 ++++---- 2 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html new file mode 100644 index 00000000000..91e07ab7daa --- /dev/null +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html @@ -0,0 +1,46 @@ +

{%= __("Bank Reconciliation Statement") %}

+

{%= filters.account %}

+
+ + + + + + + + + + + + {% for(var i=0, l=data.length; i + + + + + + + {% } else { %} + + + + + + + + {% } %} + {% } %} + +
{%= __("Posting Date") %}{%= __("Journal Voucher") %}{%= __("Reference") %}{%= __("Debit") %}{%= __("Credit") %}
{%= dateutil.str_to_user(data[i].posting_date) %}{%= data[i].journal_voucher %}{%= __("Against") %}: {%= data[i].against_account %} + {% if (data[i].reference) { %} +
{%= __("Reference") %}: {%= data[i].reference %} + {% if (data[i].ref_date) { %} +
{%= __("Reference Date") %}: {%= dateutil.str_to_user(data[i].ref_date) %} + {% } %} + {% } %} + {% if (data[i].clearance_date) { %} +
{%= __("Clearance Date") %}: {%= dateutil.str_to_user(data[i].clearance_date) %} + {% } %} +
{%= format_currency(data[i].debit) %}{%= format_currency(data[i].credit) %}
{%= data[i].journal_voucher %}{%= format_currency(data[i].debit) %}{%= format_currency(data[i].credit) %}
+

Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}

diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py index e87fbd32264..119de09e410 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py @@ -19,28 +19,29 @@ def execute(filters=None): total_debit, total_credit = 0,0 for d in data: - total_debit += flt(d[4]) - total_credit += flt(d[5]) + total_debit += flt(d[2]) + total_credit += flt(d[3]) bank_bal = flt(balance_as_per_company) - flt(total_debit) + flt(total_credit) data += [ get_balance_row("Balance as per company books", balance_as_per_company), - ["", "", "", "Amounts not reflected in bank", total_debit, total_credit], + ["", "Amounts not reflected in bank", total_debit, total_credit, "", "", "", ""], get_balance_row("Balance as per bank", bank_bal) ] return columns, data def get_columns(): - return ["Journal Voucher:Link/Journal Voucher:140", "Posting Date:Date:100", - "Clearance Date:Date:110", "Against Account:Link/Account:200", - "Debit:Currency:120", "Credit:Currency:120" + return ["Posting Date:Date:100", "Journal Voucher:Link/Journal Voucher:200", + "Debit:Currency:120", "Credit:Currency:120", + "Against Account:Link/Account:200", "Reference::100", "Ref Date:Date:110", "Clearance Date:Date:110" ] def get_entries(filters): entries = frappe.db.sql("""select - jv.name, jv.posting_date, jv.clearance_date, jvd.against_account, jvd.debit, jvd.credit + jv.posting_date, jv.name, jvd.debit, jvd.credit, + jvd.against_account, jv.cheque_no, jv.cheque_date, jv.clearance_date from `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv where jvd.parent = jv.name and jv.docstatus=1 @@ -52,6 +53,6 @@ def get_entries(filters): def get_balance_row(label, amount): if amount > 0: - return ["", "", "", label, amount, 0] + return ["", label, amount, 0, "", "", "", ""] else: - return ["", "", "", label, 0, amount] + return ["", label, 0, amount, "", "", "", ""]