From 2ccfbb82dc776927883ae074781dcaabddb1dc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Faure-Lacroix?= Date: Mon, 30 Mar 2015 21:41:02 +0300 Subject: [PATCH] Fixed a date bug and added amounts in currency... --- .../models/bank_acc_rec_statement.py | 9 ++++- .../report/summary_reconciliation.mako | 33 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/account_banking_reconciliation/models/bank_acc_rec_statement.py b/account_banking_reconciliation/models/bank_acc_rec_statement.py index ccbf185b7..a641e8ac5 100644 --- a/account_banking_reconciliation/models/bank_acc_rec_statement.py +++ b/account_banking_reconciliation/models/bank_acc_rec_statement.py @@ -611,11 +611,18 @@ class bank_acc_rec_statement(orm.Model): dt_ending = datetime.strptime( ending_date, DEFAULT_SERVER_DATE_FORMAT, ) + timedelta(days=-1) + if dt_ending.month == 1: dt_ending = dt_ending.replace(year=dt_ending.year - 1, month=12) else: - dt_ending = dt_ending.replace(month=dt_ending.month - 1) + prev_month = (dt_ending.replace(day=1) - timedelta(days=1)) + + if dt_ending.day <= prev_month.day: + dt_ending = dt_ending.replace(month=dt_ending.month - 1) + else: + dt_ending = prev_month + val['value']['exchange_date'] = dt_ending.strftime( DEFAULT_SERVER_DATE_FORMAT) diff --git a/account_banking_reconciliation/report/summary_reconciliation.mako b/account_banking_reconciliation/report/summary_reconciliation.mako index 1ce92e403..85e641851 100644 --- a/account_banking_reconciliation/report/summary_reconciliation.mako +++ b/account_banking_reconciliation/report/summary_reconciliation.mako @@ -62,7 +62,7 @@ @@ -71,6 +71,9 @@ + @@ -81,11 +84,16 @@ + + @@ -94,6 +102,9 @@ + @@ -102,6 +113,9 @@ + @@ -110,6 +124,9 @@ + @@ -120,11 +137,16 @@ + + @@ -133,6 +155,9 @@ + @@ -141,6 +166,9 @@ + @@ -149,6 +177,9 @@ +
+ colspan="3"> ${_("Summary account:")} ${rec.account_id.code} - ${rec.account_id.name} ${_("Beginning Balance")} + ${formatLang(rec.starting_balance_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.starting_balance, monetary=True, currency_obj=rec.company_id.currency_id)} +
${_("Deposits and Credits")}${" - %s " % int(rec.sum_of_debits_lines)}${_("items")} + ${formatLang(rec.sum_of_debits_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.sum_of_debits, monetary=True, currency_obj=rec.company_id.currency_id)} ${_("Cheques and Debits")}${" - %s " % int(rec.sum_of_credits_lines)}${_("items")} + ${formatLang(-rec.sum_of_credits_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(-rec.sum_of_credits, monetary=True, currency_obj=rec.company_id.currency_id)} ${_("Total Cleared Transactions")} + ${formatLang(rec.cleared_balance_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.cleared_balance, monetary=True, currency_obj=rec.company_id.currency_id)} ${_("Cleared Balance")} + ${formatLang(rec.cleared_balance_in_currency + rec.starting_balance_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.cleared_balance + rec.starting_balance, monetary=True, currency_obj=rec.company_id.currency_id)} +
${_("Deposits and Credits")}${" - %s " % int(rec.sum_of_debits_lines_unclear)}${_("items")} + ${formatLang(rec.sum_of_debits_unclear_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.sum_of_debits_unclear, monetary=True, currency_obj=rec.company_id.currency_id)} ${_("Cheques and Debits")}${" - %s " % int(rec.sum_of_credits_lines_unclear)}${_("items")} + ${formatLang(-rec.sum_of_credits_unclear_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(-rec.sum_of_credits_unclear, monetary=True, currency_obj=rec.company_id.currency_id)} ${_("Total Uncleared Transactions")} + ${formatLang(rec.uncleared_balance_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.uncleared_balance, monetary=True, currency_obj=rec.company_id.currency_id)} ${_("Register Balance as of")}${" %s" % formatLang(rec.ending_date, date=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.starting_balance_in_currency + rec.cleared_balance_in_currency + rec.uncleared_balance_in_currency, monetary=True, currency_obj=rec.company_id.currency_id)} + ${formatLang(rec.starting_balance + rec.cleared_balance + rec.uncleared_balance, monetary=True, currency_obj=rec.company_id.currency_id)}