Skip to content

Commit

Permalink
[IMP] Improved _get_net_pay_amounts to retrieve fields from move_line
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoC0 committed May 14, 2024
1 parent 94e48ae commit e13ed8b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions l10n_it_withholding_tax_financial_report/report/open_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
class OpenItemsReport(models.AbstractModel):
_inherit = "report.account_financial_report.open_items"

def _get_net_pay_amounts(self, move_line, original):
amount_net_pay = original + move_line.withholding_tax_amount
amount_net_pay_residual = amount_net_pay
reconciled_amls = move_line.mapped("matched_debit_ids.debit_move_id")
for line in reconciled_amls:
if not line.withholding_tax_generated_by_move_id:
amount_net_pay_residual += line.debit or line.credit
amount_net_pay_residual = amount_net_pay_residual
return amount_net_pay, amount_net_pay_residual
def _get_net_pay_amounts(self, move_line):
return (
move_line.withholding_tax_amount_net_pay,
move_line.withholding_tax_amount_net_pay_residual,
)

def _get_data(
self,
Expand Down

0 comments on commit e13ed8b

Please sign in to comment.