[17.0][IMP] account_financial_report: Set custom intervales in aged report

This commit is contained in:
Carolina Fernandez
2024-04-15 13:37:21 +02:00
committed by chaule97
parent 18a8cef8af
commit 6d6937346a
21 changed files with 1217 additions and 473 deletions

View File

@@ -25,6 +25,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
ag_pb_data[acc_id]["90_days"] = 0.0
ag_pb_data[acc_id]["120_days"] = 0.0
ag_pb_data[acc_id]["older"] = 0.0
for interval_line in self.env.context["age_partner_config"].line_ids:
ag_pb_data[acc_id][interval_line] = 0.0
return ag_pb_data
@api.model
@@ -39,6 +41,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
ag_pb_data[acc_id][prt_id]["120_days"] = 0.0
ag_pb_data[acc_id][prt_id]["older"] = 0.0
ag_pb_data[acc_id][prt_id]["move_lines"] = []
for interval_line in self.env.context["age_partner_config"].line_ids:
ag_pb_data[acc_id][prt_id][interval_line] = 0.0
return ag_pb_data
@api.model
@@ -47,6 +51,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
):
ag_pb_data[acc_id]["residual"] += residual
ag_pb_data[acc_id][prt_id]["residual"] += residual
interval_lines = self.env.context["age_partner_config"].line_ids
today = date_at_object
if not due_date or today <= due_date:
ag_pb_data[acc_id]["current"] += residual
@@ -66,8 +71,34 @@ class AgedPartnerBalanceReport(models.AbstractModel):
else:
ag_pb_data[acc_id]["older"] += residual
ag_pb_data[acc_id][prt_id]["older"] += residual
if due_date:
days_difference = abs((today - due_date).days)
for index, line in enumerate(interval_lines):
lower_limit = (
0 if not index else interval_lines[index - 1].inferior_limit
)
next_line = (
interval_lines[index] if index < len(interval_lines) else None
)
interval_range = self._get_values_for_range_intervals(
lower_limit, next_line.inferior_limit
)
if (
days_difference in interval_range
or days_difference == line.inferior_limit
):
ag_pb_data[acc_id][line] += residual
ag_pb_data[acc_id][prt_id][line] += residual
break
return ag_pb_data
def _get_values_for_range_intervals(self, num1, num2):
min_num = min(num1, num2)
max_num = max(num1, num2)
if abs(num2 - num1) == 1:
return [max_num]
return list(range(min_num + 1, max_num))
def _get_account_partial_reconciled(self, company_id, date_at_object):
domain = [("max_date", ">", date_at_object), ("company_id", "=", company_id)]
fields = [
@@ -235,6 +266,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
"older": 0.0,
}
)
interval_lines = self.env.context["age_partner_config"].line_ids
for interval_line in interval_lines:
ml[interval_line] = 0.0
due_date = ml["due_date"]
amount = ml["residual"]
today = date_at_object
@@ -250,6 +284,24 @@ class AgedPartnerBalanceReport(models.AbstractModel):
ml["120_days"] += amount
else:
ml["older"] += amount
if due_date:
days_difference = abs((today - due_date).days)
for index, interval_line in enumerate(interval_lines):
lower_limit = (
0 if not index else interval_lines[index - 1].inferior_limit
)
next_line = (
interval_lines[index] if index < len(interval_lines) else None
)
interval_range = self._get_values_for_range_intervals(
lower_limit, next_line.inferior_limit
)
if (
days_difference in interval_range
or days_difference == interval_line.inferior_limit
):
ml[interval_line] += amount
break
def _create_account_list(
self,
@@ -261,6 +313,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
date_at_oject,
):
aged_partner_data = []
interval_lines = self.env.context["age_partner_config"].line_ids
for account in accounts_data.values():
acc_id = account["id"]
account.update(
@@ -275,6 +328,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
"partners": [],
}
)
for interval_line in interval_lines:
account[interval_line] = ag_pb_data[acc_id][interval_line]
for prt_id in ag_pb_data[acc_id]:
if isinstance(prt_id, int):
partner = {
@@ -287,6 +342,10 @@ class AgedPartnerBalanceReport(models.AbstractModel):
"120_days": ag_pb_data[acc_id][prt_id]["120_days"],
"older": ag_pb_data[acc_id][prt_id]["older"],
}
for interval_line in interval_lines:
partner[interval_line] = ag_pb_data[acc_id][prt_id][
interval_line
]
if show_move_line_details:
move_lines = []
for ml in ag_pb_data[acc_id][prt_id]["move_lines"]:
@@ -306,6 +365,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
@api.model
def _calculate_percent(self, aged_partner_data):
interval_lines = self.env.context["age_partner_config"].line_ids
for account in aged_partner_data:
if abs(account["residual"]) > 0.01:
total = account["residual"]
@@ -331,6 +391,10 @@ class AgedPartnerBalanceReport(models.AbstractModel):
),
}
)
for interval_line in interval_lines:
account[f"percent_{interval_line.id}"] = abs(
round((account[interval_line] / total) * 100, 2)
)
else:
account.update(
{
@@ -342,6 +406,8 @@ class AgedPartnerBalanceReport(models.AbstractModel):
"percent_older": 0.0,
}
)
for interval_line in interval_lines:
account[f"percent_{interval_line.id}"] = 0.0
return aged_partner_data
def _get_report_values(self, docids, data):
@@ -355,12 +421,17 @@ class AgedPartnerBalanceReport(models.AbstractModel):
date_from = data["date_from"]
only_posted_moves = data["only_posted_moves"]
show_move_line_details = data["show_move_line_details"]
aged_partner_configuration = self.env[
"account.age.report.configuration"
].browse(data["age_partner_config_id"])
(
ag_pb_data,
accounts_data,
partners_data,
journals_data,
) = self._get_move_lines_data(
) = self.with_context(
age_partner_config=aged_partner_configuration
)._get_move_lines_data(
company_id,
account_ids,
partner_ids,
@@ -369,7 +440,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
only_posted_moves,
show_move_line_details,
)
aged_partner_data = self._create_account_list(
aged_partner_data = self.with_context(
age_partner_config=aged_partner_configuration
)._create_account_list(
ag_pb_data,
accounts_data,
partners_data,
@@ -377,7 +450,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
show_move_line_details,
date_at_object,
)
aged_partner_data = self._calculate_percent(aged_partner_data)
aged_partner_data = self.with_context(
age_partner_config=aged_partner_configuration
)._calculate_percent(aged_partner_data)
return {
"doc_ids": [wizard_id],
"doc_model": "open.items.report.wizard",
@@ -388,6 +463,7 @@ class AgedPartnerBalanceReport(models.AbstractModel):
"only_posted_moves": only_posted_moves,
"aged_partner_balance": aged_partner_data,
"show_move_lines_details": show_move_line_details,
"age_partner_config": aged_partner_configuration,
}
def _get_ml_fields(self):

View File

@@ -20,67 +20,84 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
report_name = report_name + suffix
return report_name
def _get_report_columns(self, report):
if not report.show_move_line_details:
return {
0: {"header": _("Partner"), "field": "name", "width": 70},
1: {
"header": _("Residual"),
"field": "residual",
"field_footer_total": "residual",
"type": "amount",
"width": 14,
},
2: {
"header": _("Current"),
"field": "current",
"field_footer_total": "current",
"field_footer_percent": "percent_current",
"type": "amount",
"width": 14,
},
3: {
"header": _("Age ??? 30 d."),
"field": "30_days",
"field_footer_total": "30_days",
"field_footer_percent": "percent_30_days",
"type": "amount",
"width": 14,
},
4: {
"header": _("Age ??? 60 d."),
"field": "60_days",
"field_footer_total": "60_days",
"field_footer_percent": "percent_60_days",
"type": "amount",
"width": 14,
},
5: {
"header": _("Age ??? 90 d."),
"field": "90_days",
"field_footer_total": "90_days",
"field_footer_percent": "percent_90_days",
"type": "amount",
"width": 14,
},
6: {
"header": _("Age ??? 120 d."),
"field": "120_days",
"field_footer_total": "120_days",
"field_footer_percent": "percent_120_days",
"type": "amount",
"width": 14,
},
7: {
"header": _("Older"),
"field": "older",
"field_footer_total": "older",
"field_footer_percent": "percent_older",
"type": "amount",
"width": 14,
},
def _get_report_columns_without_move_line_details(self, report, column_index):
report_columns = {
0: {"header": _("Partner"), "field": "name", "width": 70},
1: {
"header": _("Residual"),
"field": "residual",
"field_footer_total": "residual",
"type": "amount",
"width": 14,
},
2: {
"header": _("Current"),
"field": "current",
"field_footer_total": "current",
"field_footer_percent": "percent_current",
"type": "amount",
"width": 14,
},
}
if not report.age_partner_config_id:
report_columns.update(
{
3: {
"header": _("Age ≤ 30 d."),
"field": "30_days",
"field_footer_total": "30_days",
"field_footer_percent": "percent_30_days",
"type": "amount",
"width": 14,
},
4: {
"header": _("Age ≤ 60 d."),
"field": "60_days",
"field_footer_total": "60_days",
"field_footer_percent": "percent_60_days",
"type": "amount",
"width": 14,
},
5: {
"header": _("Age ≤ 90 d."),
"field": "90_days",
"field_footer_total": "90_days",
"field_footer_percent": "percent_90_days",
"type": "amount",
"width": 14,
},
6: {
"header": _("Age ≤ 120 d."),
"field": "120_days",
"field_footer_total": "120_days",
"field_footer_percent": "percent_120_days",
"type": "amount",
"width": 14,
},
7: {
"header": _("Older"),
"field": "older",
"field_footer_total": "older",
"field_footer_percent": "percent_older",
"type": "amount",
"width": 14,
},
}
)
for interval in report.age_partner_config_id.line_ids:
report_columns[column_index] = {
"header": interval.name,
"field": interval,
"field_footer_total": interval,
"field_footer_percent": f"percent_{interval.id}",
"type": "amount",
"width": 14,
}
return {
column_index += 1
return report_columns
def _get_report_columns_with_move_line_details(self, report, column_index):
report_columns = {
0: {"header": _("Date"), "field": "date", "width": 11},
1: {"header": _("Entry"), "field": "entry", "width": 18},
2: {"header": _("Journal"), "field": "journal", "width": 8},
@@ -105,52 +122,75 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
"type": "amount",
"width": 14,
},
9: {
"header": _("Age ??? 30 d."),
"field": "30_days",
"field_footer_total": "30_days",
"field_footer_percent": "percent_30_days",
"field_final_balance": "30_days",
"type": "amount",
"width": 14,
},
10: {
"header": _("Age ??? 60 d."),
"field": "60_days",
"field_footer_total": "60_days",
"field_footer_percent": "percent_60_days",
"field_final_balance": "60_days",
"type": "amount",
"width": 14,
},
11: {
"header": _("Age ??? 90 d."),
"field": "90_days",
"field_footer_total": "90_days",
"field_footer_percent": "percent_90_days",
"field_final_balance": "90_days",
"type": "amount",
"width": 14,
},
12: {
"header": _("Age ??? 120 d."),
"field": "120_days",
"field_footer_total": "120_days",
"field_footer_percent": "percent_120_days",
"field_final_balance": "120_days",
"type": "amount",
"width": 14,
},
13: {
"header": _("Older"),
"field": "older",
"field_footer_total": "older",
"field_footer_percent": "percent_older",
"field_final_balance": "older",
"type": "amount",
"width": 14,
},
}
if not report.age_partner_config_id:
report_columns.update(
{
9: {
"header": _("Age ≤ 30 d."),
"field": "30_days",
"field_footer_total": "30_days",
"field_footer_percent": "percent_30_days",
"field_final_balance": "30_days",
"type": "amount",
"width": 14,
},
10: {
"header": _("Age ≤ 60 d."),
"field": "60_days",
"field_footer_total": "60_days",
"field_footer_percent": "percent_60_days",
"field_final_balance": "60_days",
"type": "amount",
"width": 14,
},
11: {
"header": _("Age ≤ 90 d."),
"field": "90_days",
"field_footer_total": "90_days",
"field_footer_percent": "percent_90_days",
"field_final_balance": "90_days",
"type": "amount",
"width": 14,
},
12: {
"header": _("Age ≤ 120 d."),
"field": "120_days",
"field_footer_total": "120_days",
"field_footer_percent": "percent_120_days",
"field_final_balance": "120_days",
"type": "amount",
"width": 14,
},
13: {
"header": _("Older"),
"field": "older",
"field_footer_total": "older",
"field_footer_percent": "percent_older",
"field_final_balance": "older",
"type": "amount",
"width": 14,
},
}
)
for interval in report.age_partner_config_id.line_ids:
report_columns[column_index] = {
"header": interval.name,
"field": interval,
"field_footer_total": interval,
"field_footer_percent": f"percent_{interval.id}",
"type": "amount",
"width": 14,
}
column_index += 1
return report_columns
def _get_report_columns(self, report):
if not report.show_move_line_details:
return self._get_report_columns_without_move_line_details(
report, column_index=3
)
return self._get_report_columns_with_move_line_details(report, column_index=9)
def _get_report_filters(self, report):
return [

View File

@@ -116,16 +116,22 @@
<div class="act_as_cell" style="width: 9.64%;">Residual</div>
<!--## current-->
<div class="act_as_cell" style="width: 9.64%;">Not due</div>
<!--## age_30_days-->
<div class="act_as_cell" style="width: 9.64%;">1 - 30 d.</div>
<!--## age_60_days-->
<div class="act_as_cell" style="width: 9.64%;">31 - 60 d.</div>
<!--## age_90_days-->
<div class="act_as_cell" style="width: 9.64%;">61 - 90 d.</div>
<!--## age_120_days-->
<div class="act_as_cell" style="width: 9.64%;">91 - 120 d.</div>
<!--## older-->
<div class="act_as_cell" style="width: 9.64%;">> 120 d.</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell" style="width: 9.64%;">1 - 30 d.</div>
<!--## age_60_days-->
<div class="act_as_cell" style="width: 9.64%;">31 - 60 d.</div>
<!--## age_90_days-->
<div class="act_as_cell" style="width: 9.64%;">61 - 90 d.</div>
<!--## age_120_days-->
<div class="act_as_cell" style="width: 9.64%;">91 - 120 d.</div>
<!--## older-->
<div class="act_as_cell" style="width: 9.64%;">> 120 d.</div>
</t>
<!--## dynamic columns-->
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell"><span t-out="column_dynamic.name" /></div>
</t>
</div>
</div>
</template>
@@ -143,48 +149,58 @@
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## current-->
<!--## current-->
<div class="act_as_cell amount">
<span
<span
t-esc="partner['current']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount">
<span
t-esc="partner['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount">
<span
t-esc="partner['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount">
<span
t-esc="partner['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<span
t-out="partner[column_dynamic]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
</div>
</template>
<template id="report_aged_partner_balance_move_lines">
@@ -218,28 +234,36 @@
<div class="act_as_cell" style="width: 6.00%;">Residual</div>
<!--## current-->
<div class="act_as_cell" style="width: 6.00%;">Current</div>
<!--## age_30_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ??? 30
d.
</div>
<!--## age_60_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ??? 60
d.
</div>
<!--## age_90_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ??? 90
d.
</div>
<!--## age_120_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ??? 120
d.
</div>
<!--## older-->
<div class="act_as_cell" style="width: 6.00%;">Older</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ≤ 30
d.
</div>
<!--## age_60_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ≤ 60
d.
</div>
<!--## age_90_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ≤ 90
d.
</div>
<!--## age_120_days-->
<div class="act_as_cell" style="width: 6.00%;">
Age ≤ 120
d.
</div>
<!--## older-->
<div class="act_as_cell" style="width: 6.00%;">Older</div>
</t>
<!--## current-->
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell">
<span t-esc="column_dynamic.name" />
</div>
</t>
</div>
</div>
<!-- Display each move lines -->
@@ -333,126 +357,149 @@
/>
</span>
</div>
<!--## current-->
<div class="act_as_cell amount">
<t t-if="line['current'] == 0">
<span
<!--## current-->
<div class="act_as_cell amount">
<t t-if="line['current'] == 0">
<span
t-esc="line['current']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
<t
t-out="line['current']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount">
<t t-if="line['30_days'] == 0">
<span
t-esc="line['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['30_days']"
</span>
</t>
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount">
<t t-if="line['30_days'] == 0">
<span
t-esc="line['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount">
<t t-if="line['60_days'] == 0">
<span
t-esc="line['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['60_days']"
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount">
<t t-if="line['60_days'] == 0">
<span
t-esc="line['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount">
<t t-if="line['90_days'] == 0">
<span
t-esc="line['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['90_days']"
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount">
<t t-if="line['90_days'] == 0">
<span
t-esc="line['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount">
<t t-if="line['120_days'] == 0">
<span
t-esc="line['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['120_days']"
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount">
<t t-if="line['120_days'] == 0">
<span
t-esc="line['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## older-->
<div class="act_as_cell amount">
<t t-if="line['older'] == 0">
<span
t-esc="line['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['older']"
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
<!--## older-->
<div class="act_as_cell amount">
<t t-if="line['older'] == 0">
<span
t-esc="line['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
</t>
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<t t-if="line[column_dynamic] == 0">
<span
t-esc="line[column_dynamic]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</t>
<t t-else="">
<span
domain="[('id', 'in', (line['line_rec'] | line['line_rec'].matched_debit_ids.mapped('debit_move_id') | line['line_rec'].matched_credit_ids.mapped('credit_move_id')).ids)]"
res-model="account.move.line"
>
<t
t-out="line[column_dynamic]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</span>
</t>
</div>
</t>
</div>
</t>
</div>
@@ -475,48 +522,58 @@
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## current-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
<!--## current-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['current']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.00%;">
<span
t-esc="partner_cumul_line['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<span
t-esc="partner_cumul_line[column_dynamic]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
</div>
</div>
</template>
@@ -534,48 +591,58 @@
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## current-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
<!--## current-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['current']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span
t-esc="account['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<span
t-esc="account[column_dynamic]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
</t>
<t t-if="show_move_line_details">
<!--## total-->
@@ -589,48 +656,58 @@
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## current-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
<!--## current-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['current']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['30_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['60_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['90_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['120_days']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.00%">
<span
t-esc="account['older']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<span
t-esc="account[column_dynamic]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</div>
</t>
</t>
</div>
<div class="act_as_row" style="font-weight: bold; font-style: italic;">
@@ -642,33 +719,42 @@
<!--## current-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_current']" />
%
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_30_days']" />
%
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_60_days']" />
%
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_90_days']" />
%
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_120_days']" />
%
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_older']" />
%
</div>
%
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_30_days']" />
%
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_60_days']" />
%
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_90_days']" />
%
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_120_days']" />
%
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-esc="account['percent_older']" />
%
</div>
</t>
<!--## current-->
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<span t-esc="account['percent_'+str(column_dynamic.id)]" />
%
</div>
</t>
</t>
<t t-if="show_move_line_details">
<!--## total-->
@@ -680,34 +766,43 @@
<!--## current-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_current']" />
%
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_30_days']" />
%
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_60_days']" />
%
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_90_days']" />
%
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_120_days']" />
%
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_older']" />
%
</div>
</t>
%
</div>
<t t-if="not age_partner_config">
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_30_days']" />
%
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_60_days']" />
%
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_90_days']" />
%
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_120_days']" />
%
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.00%">
<span t-esc="account['percent_older']" />
%
</div>
</t>
<!--## current-->
<t t-foreach="age_partner_config.line_ids" t-as="column_dynamic">
<div class="act_as_cell amount">
<span t-esc="account['percent_'+str(column_dynamic.id)]" />
%
</div>
</t>
</t>
</div>
</div>
</template>