Browse Source

[FIX] partner ledger, partner balance, open invoices report must all exclude the entries in the opening entries, they are always computed

(lp:c2c-addons/6.1  rev 82)
6.1
Guewen Baconnier @ Camptocamp 12 years ago
parent
commit
0b9adcfc82
  1. 7
      account_financial_report_webkit/report/common_partner_reports.py
  2. 6
      account_financial_report_webkit/report/open_invoices.py
  3. 3
      account_financial_report_webkit/report/partners_ledger.py

7
account_financial_report_webkit/report/common_partner_reports.py

@ -32,7 +32,9 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit):
####################Account move line retrieval helper ########################## ####################Account move line retrieval helper ##########################
def get_partners_move_lines_ids(self, account_id, main_filter, start, stop, target_move, def get_partners_move_lines_ids(self, account_id, main_filter, start, stop, target_move,
exclude_reconcile=False, partner_filter=False):
exclude_reconcile=False,
partner_filter=False,
opening_mode='exclude_opening'):
filter_from = False filter_from = False
if main_filter in ('filter_period', 'filter_no'): if main_filter in ('filter_period', 'filter_no'):
filter_from = 'period' filter_from = 'period'
@ -44,6 +46,7 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit):
start, start,
stop, stop,
target_move, target_move,
opening_mode=opening_mode,
exclude_reconcile=exclude_reconcile, exclude_reconcile=exclude_reconcile,
partner_filter=partner_filter) partner_filter=partner_filter)
@ -78,7 +81,7 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit):
return sql_conditions, search_params return sql_conditions, search_params
def _get_partners_move_line_ids(self, filter_from, account_id, start, stop, target_move, opening_mode='include_opening',
def _get_partners_move_line_ids(self, filter_from, account_id, start, stop, target_move, opening_mode='exclude_opening',
exclude_reconcile=False, partner_filter=False): exclude_reconcile=False, partner_filter=False):
final_res = defaultdict(list) final_res = defaultdict(list)

6
account_financial_report_webkit/report/open_invoices.py

@ -201,15 +201,15 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, CommonPartnersReportHeade
for account_id in accounts_ids: for account_id in accounts_ids:
initial_move_lines_ids_per_partner = initial_move_lines_per_account.get(account_id, {}) initial_move_lines_ids_per_partner = initial_move_lines_per_account.get(account_id, {})
# We get the move line ids of the account depending of the
# way the initial balance was created we include or not opening entries
# We get the move line ids of the account
move_line_ids_per_partner = self.get_partners_move_lines_ids(account_id, move_line_ids_per_partner = self.get_partners_move_lines_ids(account_id,
main_filter, main_filter,
start, start,
stop, stop,
target_move, target_move,
exclude_reconcile=True, exclude_reconcile=True,
partner_filter=partner_filter)
partner_filter=partner_filter,
opening_mode='exclude_opening')
if not initial_move_lines_ids_per_partner and not move_line_ids_per_partner: if not initial_move_lines_ids_per_partner and not move_line_ids_per_partner:
continue continue

3
account_financial_report_webkit/report/partners_ledger.py

@ -184,7 +184,8 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, CommonPartnersReportHeaderWebki
stop, stop,
target_move, target_move,
exclude_reconcile=False, exclude_reconcile=False,
partner_filter=partner_filter)
partner_filter=partner_filter,
opening_mode='exclude_opening')
if not move_line_ids: if not move_line_ids:
continue continue
for partner_id in move_line_ids: for partner_id in move_line_ids:

Loading…
Cancel
Save