Merge pull request #4650 from RicardoJohann/patch-2

Accounts - Bank reconciliation - Workflow and labeling improvements
This commit is contained in:
Nabin Hait 2016-01-20 17:03:06 +05:30
commit 002fa6c1d9
4 changed files with 21 additions and 19 deletions

View File

@ -26,7 +26,7 @@ class BankReconciliation(Document):
t2.parent = t1.name and t2.account = %s
and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1
and ifnull(t1.is_opening, 'No') = 'No' %s
order by t1.posting_date""" %
order by t1.posting_date DESC, t1.name DESC""" %
('%s', '%s', '%s', condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
self.set('journal_entries', [])

View File

@ -16,7 +16,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Voucher ID",
"length": 0,
"no_copy": 0,
@ -31,7 +31,8 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"unique": 0,
"width": "50"
},
{
"allow_on_submit": 0,
@ -56,7 +57,8 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"unique": 0,
"width": "15"
},
{
"allow_on_submit": 0,
@ -67,7 +69,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Debit",
"length": 0,
"no_copy": 0,
@ -93,7 +95,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Credit",
"length": 0,
"no_copy": 0,
@ -143,7 +145,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
@ -268,7 +270,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2015-12-04 11:01:24.286320",
"modified": "2016-01-19 12:06:17.568428",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Detail",

View File

@ -1,8 +1,8 @@
<div style="margin-bottom: 7px;" class="text-center">
<div style="margin-bottom: 7px;">
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __("Bank Reconciliation Statement") %}</h2>
<h4 class="text-center">{%= filters.account %}</h4>
<h4 class="text-center">{%= filters.account && (filters.account + ", "+filters.report_date) || "" %} {%= filters.company %}</h4>
<hr>
<table class="table table-bordered">
<thead>

View File

@ -39,18 +39,18 @@ def execute(filters=None):
+ amounts_not_reflected_in_system
data += [
get_balance_row(_("System Balance"), balance_as_per_system, account_currency),
get_balance_row(_("Bank Statement balance as per General Ledger"), balance_as_per_system, account_currency),
{},
{
"journal_entry": '"' + _("Amounts not reflected in bank") + '"',
"journal_entry": _("Outstanding Cheques and Deposits to clear"),
"debit": total_debit,
"credit": total_credit,
"account_currency": account_currency
},
get_balance_row(_("Amounts not reflected in system"), amounts_not_reflected_in_system,
get_balance_row(_("Cheques and Deposits incorrectly cleared"), amounts_not_reflected_in_system,
account_currency),
{},
get_balance_row(_("Expected balance as per bank"), bank_bal, account_currency)
get_balance_row(_("Calculated Bank Statement balance"), bank_bal, account_currency)
]
return columns, data
@ -129,21 +129,21 @@ def get_entries(filters):
and jvd.account = %(account)s and jv.posting_date <= %(report_date)s
and ifnull(jv.clearance_date, '4000-01-01') > %(report_date)s
and ifnull(jv.is_opening, 'No') = 'No'
order by jv.name DESC""", filters, as_dict=1)
order by jv.posting_date DESC,jv.name DESC""", filters, as_dict=1)
return entries
def get_balance_row(label, amount, account_currency):
if amount > 0:
return {
"journal_entry": '"' + label + '"',
"journal_entry": label,
"debit": amount,
"credit": 0,
"account_currency": account_currency
}
else:
return {
"journal_entry": '"' + label + '"',
"journal_entry": label,
"debit": 0,
"credit": abs(amount),
"account_currency": account_currency