Skip to content

Commit

Permalink
[REM] partner_statement: remove blocked related code
Browse files Browse the repository at this point in the history
  • Loading branch information
psugne committed Jan 28, 2025
1 parent 59c3308 commit ec62092
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 94 deletions.
5 changes: 0 additions & 5 deletions partner_statement/report/activity_statement_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ def _write_currency_lines(self, row_pos, sheet, partner, currency, data):
format_distributed = FORMATS["format_distributed"]
current_money_format = FORMATS["current_money_format"]
for line in currency_data.get("lines"):
if line.get("blocked"):
format_tcell_left = FORMATS["format_tcell_left_blocked"]
format_tcell_date_left = FORMATS["format_tcell_date_left_blocked"]
format_distributed = FORMATS["format_distributed_blocked"]
current_money_format = FORMATS["current_money_format_blocked"]
row_pos += 1
name_to_show = (
line.get("name", "") == "/" or not line.get("name", "")
Expand Down
66 changes: 3 additions & 63 deletions partner_statement/report/detailed_activity_statement_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,36 +112,21 @@ def _write_currency_lines(self, row_pos, sheet, partner, currency, data):
FORMATS["current_money_format"],
)
for line in currency_data.get("lines"):
if line.get("blocked") and not line.get("reconciled_line"):
if not line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_blocked"]
format_tcell_date_left = FORMATS["format_tcell_date_left_blocked"]
format_distributed = FORMATS["format_distributed_blocked"]
current_money_format = FORMATS["current_money_format_blocked"]
elif (
line.get("reconciled_line")
and not line.get("blocked")
and not line.get("outside-date-rank")
):
format_tcell_left = FORMATS["format_tcell_left_reconciled"]
format_tcell_date_left = FORMATS["format_tcell_date_left_reconciled"]
format_distributed = FORMATS["format_distributed_reconciled"]
current_money_format = FORMATS["current_money_format_reconciled"]
elif (
line.get("blocked")
and line.get("reconciled_line")
and not line.get("outside-date-rank")
):
format_tcell_left = FORMATS["format_tcell_left_blocked_reconciled"]
format_tcell_date_left = FORMATS[
"format_tcell_date_left_blocked_reconciled"
]
format_distributed = FORMATS["format_distributed_blocked_reconciled"]
current_money_format = FORMATS[
"current_money_format_blocked_reconciled"
]
elif (
line.get("reconciled_line")
and not line.get("blocked")
and line.get("outside-date-rank")
):
format_tcell_left = FORMATS[
Expand All @@ -156,23 +141,6 @@ def _write_currency_lines(self, row_pos, sheet, partner, currency, data):
current_money_format = FORMATS[
"current_money_format_reconciled_outside-date-rank"
]
elif (
line.get("blocked")
and line.get("reconciled_line")
and line.get("outside-date-rank")
):
format_tcell_left = FORMATS[
"format_tcell_left_blocked_reconciled_outside-date-rank"
]
format_tcell_date_left = FORMATS[
"format_tcell_date_left_blocked_reconciled_outside-date-rank"
]
format_distributed = FORMATS[
"format_distributed_blocked_reconciled_outside-date-rank"
]
current_money_format = FORMATS[
"current_money_format_blocked_reconciled_outside-date-rank"
]
else:
format_tcell_left = FORMATS["format_tcell_left"]
format_tcell_date_left = FORMATS["format_tcell_date_left"]
Expand Down Expand Up @@ -286,25 +254,11 @@ def _write_currency_prior_lines(self, row_pos, sheet, partner, currency, data):
format_distributed = FORMATS["format_distributed"]
current_money_format = FORMATS["current_money_format"]
for line in currency_data.get("prior_lines"):
if line.get("blocked") and not line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_blocked"]
format_tcell_date_left = FORMATS["format_tcell_date_left_blocked"]
format_distributed = FORMATS["format_distributed_blocked"]
current_money_format = FORMATS["current_money_format_blocked"]
elif line.get("reconciled_line") and not line.get("blocked"):
if line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_reconciled"]
format_tcell_date_left = FORMATS["format_tcell_date_left_reconciled"]
format_distributed = FORMATS["format_distributed_reconciled"]
current_money_format = FORMATS["current_money_format_reconciled"]
elif line.get("blocked") and line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_blocked_reconciled"]
format_tcell_date_left = FORMATS[
"format_tcell_date_left_blocked_reconciled"
]
format_distributed = FORMATS["format_distributed_blocked_reconciled"]
current_money_format = FORMATS[
"current_money_format_blocked_reconciled"
]
row_pos += 1
name_to_show = (
line.get("name", "") == "/" or not line.get("name", "")
Expand Down Expand Up @@ -407,25 +361,11 @@ def _write_currency_ending_lines(self, row_pos, sheet, partner, currency, data):
format_distributed = FORMATS["format_distributed"]
current_money_format = FORMATS["current_money_format"]
for line in currency_data.get("ending_lines"):
if line.get("blocked") and not line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_blocked"]
format_tcell_date_left = FORMATS["format_tcell_date_left_blocked"]
format_distributed = FORMATS["format_distributed_blocked"]
current_money_format = FORMATS["current_money_format_blocked"]
elif line.get("reconciled_line") and not line.get("blocked"):
if line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_reconciled"]
format_tcell_date_left = FORMATS["format_tcell_date_left_reconciled"]
format_distributed = FORMATS["format_distributed_reconciled"]
current_money_format = FORMATS["current_money_format_reconciled"]
elif line.get("blocked") and line.get("reconciled_line"):
format_tcell_left = FORMATS["format_tcell_left_blocked_reconciled"]
format_tcell_date_left = FORMATS[
"format_tcell_date_left_blocked_reconciled"
]
format_distributed = FORMATS["format_distributed_blocked_reconciled"]
current_money_format = FORMATS[
"current_money_format_blocked_reconciled"
]
row_pos += 1
name_to_show = (
line.get("name", "") == "/" or not line.get("name", "")
Expand Down
5 changes: 0 additions & 5 deletions partner_statement/report/outstanting_statement_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ def _write_currency_lines(self, row_pos, sheet, partner, currency, data):
format_distributed = FORMATS["format_distributed"]
current_money_format = FORMATS["current_money_format"]
for line in currency_data.get("lines"):
if line.get("blocked"):
format_tcell_left = FORMATS["format_tcell_left_blocked"]
format_tcell_date_left = FORMATS["format_tcell_date_left_blocked"]
format_distributed = FORMATS["format_distributed_blocked"]
current_money_format = FORMATS["current_money_format_blocked"]
row_pos += 1
name_to_show = (
line.get("name", "") == "/" or not line.get("name", "")
Expand Down
18 changes: 6 additions & 12 deletions partner_statement/report/report_statement_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ def _get_report_values(self, docids, data=None):
line["currency_id"], currencies, 0.0, 0.0
)
line_currency = currency_dict[line["currency_id"]]
if not line["blocked"]:
line_currency["amount_due"] += line["open_amount"]
line_currency["amount_due"] += line["open_amount"]
line["balance"] = line_currency["amount_due"]
line["date"] = format_date(
line["date"], date_formats.get(partner_id, default_fmt)
Expand All @@ -468,12 +467,10 @@ def _get_report_values(self, docids, data=None):
)
line_currency = currency_dict[line["currency_id"]]
if not is_activity:
if not line["blocked"]:
line_currency["amount_due"] += line[amount_field]
line_currency["amount_due"] += line[amount_field]
line["balance"] = line_currency["amount_due"]
else:
if not line["blocked"]:
line_currency["ending_balance"] += line[amount_field]
line_currency["ending_balance"] += line[amount_field]
line["balance"] = line_currency["ending_balance"]
line["outside-date-rank"] = False
line["date"] = format_date(
Expand All @@ -495,8 +492,7 @@ def _get_report_values(self, docids, data=None):
line2["applied_amount"] = line2["open_amount"]
if line2["date"] >= date_start and line2["date"] <= date_end:
line2["outside-date-rank"] = False
if not line2["blocked"]:
line["applied_amount"] += line2["open_amount"]
line["applied_amount"] += line2["open_amount"]
else:
line2["outside-date-rank"] = True
line2["date"] = format_date(
Expand All @@ -514,17 +510,15 @@ def _get_report_values(self, docids, data=None):
)
if is_activity:
line["open_amount"] = line["amount"] + line["applied_amount"]
if not line["blocked"]:
line_currency["amount_due"] += line["open_amount"]
line_currency["amount_due"] += line["open_amount"]

if is_detailed:
for line_currency in currency_dict.values():
line_currency["amount_due"] = 0.0

for line in ending_lines.get(partner_id, []):
line_currency = currency_dict[line["currency_id"]]
if not line["blocked"]:
line_currency["amount_due"] += line["open_amount"]
line_currency["amount_due"] += line["open_amount"]
line["balance"] = line_currency["amount_due"]
line["date"] = format_date(
line["date"], date_formats.get(partner_id, default_fmt)
Expand Down
7 changes: 0 additions & 7 deletions partner_statement/static/src/scss/layout_statement.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
}
}

.statement-blocked {
background-color: $gray-500 !important;
td:last-child {
background-color: $gray-500 !important;
}
}

.statement-reconciled {
font-size: smaller;
font-style: italic !important;
Expand Down
2 changes: 1 addition & 1 deletion partner_statement/views/activity_statement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<tr
t-foreach="currency['lines']"
t-as="line"
t-att-class="('statement-blocked ' if line['blocked'] else '') + ('statement-reconciled ' if line['reconciled_line'] else '') + ('statement-outside-date-rank' if line['outside-date-rank'] else '')"
t-att-class="('statement-reconciled ' if line['reconciled_line'] else '') + ('statement-outside-date-rank' if line['outside-date-rank'] else '')"
>
<td>
<span
Expand Down
1 change: 0 additions & 1 deletion partner_statement/views/outstanding_statement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<tr
t-foreach="currency[line_type]"
t-as="line"
t-att-class="'statement-blocked' if line['blocked'] else ''"
>
<td>
<span t-out="line['move_id']" />
Expand Down

0 comments on commit ec62092

Please sign in to comment.