Skip to content

Commit

Permalink
[FIX]account_check_report only payment amount shows
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Jun 3, 2019
1 parent 32e1a02 commit 5bb4404
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
3 changes: 1 addition & 2 deletions account_check_report/report/account_check_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,4 @@
report_type="qweb-pdf"
name="account_check_report.check_report"
file="account_check_report.check_report"/>

</odoo>
</odoo>
34 changes: 14 additions & 20 deletions account_check_report/report/report_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ def _get_paid_amount(self, payment, invoice):
for pay in invoice.payment_move_line_ids:
payment_currency_id = False
if invoice.type in ('out_invoice', 'in_refund'):
amount = sum(
[p.amount for p in pay.matched_debit_ids if
p.debit_move_id in invoice.move_id.line_ids
and p.credit_move_id.payment_id == payment])
amount_currency = sum([p.amount_currency for p in
pay.matched_debit_ids if
p.debit_move_id in
invoice.move_id.line_ids
and p.credit_move_id.payment_id
== payment])
amount = 0
amount_currency = 0
for p in pay.matched_debit_ids:
if p in invoice.move_id.line_ids.mapped('matched_credit_ids'):
if p.credit_move_id.payment_id.id == payment.id:
amount += p.amount
amount_currency += amount_currency
if pay.matched_debit_ids:
payment_currency_id = \
all(
Expand All @@ -45,16 +42,13 @@ def _get_paid_amount(self, payment, invoice):
and pay.matched_debit_ids[0].currency_id \
or False
elif invoice.type in ('in_invoice', 'out_refund'):
amount = sum(
[p.amount for p in pay.matched_credit_ids if
p.credit_move_id in invoice.move_id.line_ids
and p.debit_move_id.payment_id == payment])
amount_currency = sum([p.amount_currency for p in
pay.matched_credit_ids if
p.credit_move_id in
invoice.move_id.line_ids
and p.debit_move_id.payment_id
== payment])
amount = 0
amount_currency = 0
for p in pay.matched_credit_ids:
if p in invoice.move_id.line_ids.mapped('matched_debit_ids'):
if p.debit_move_id.payment_id.id == payment.id:
amount += p.amount
amount_currency += amount_currency
if pay.matched_credit_ids:
payment_currency_id = \
all(
Expand Down

0 comments on commit 5bb4404

Please sign in to comment.