Skip to content

Commit

Permalink
Merge pull request #190 from dhongu/15.0-ubl-discount
Browse files Browse the repository at this point in the history
[15.0][FIX] ubl discount: fix allowance total
  • Loading branch information
danila12 authored May 31, 2024
2 parents 393e689 + 1627aae commit ec087b6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion l10n_ro_edi_ubl_discount/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Romania - EDI UBL Line Discount Fix
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:225679b70ba8cc3877399446f6ac80d2662377d48d6dc5f2c45da4c90f4bbd77
!! source digest: sha256:e780daa36965f46e74d66857f33381efc5440db0845e2ca9798317b8a39fe5da
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion l10n_ro_edi_ubl_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Romania - EDI UBL Line Discount Fix",
"license": "AGPL-3",
"version": "15.0.0.0.2",
"version": "15.0.0.0.3",
"author": "Terrabit," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-romania",
"category": "Tools",
Expand Down
13 changes: 11 additions & 2 deletions l10n_ro_edi_ubl_discount/models/account_edi_xml_cius_ro.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ def _export_invoice_vals(self, invoice):
if invoice.move_type == "out_invoice":
# calcul amount fara discount din linii
line_extension_amount = 0.0
line_allowances = 0.0
# vals_in_lines = []
# vals_allowance = []
for line_vals in vals_list["vals"]["invoice_line_vals"]:
value = round_up(line_vals["line_extension_amount"], line_vals["currency_dp"])
value_rounded = round(line_vals["line_extension_amount"], line_vals["currency_dp"] + 1)
value = round_up(value_rounded, line_vals["currency_dp"])
# vals_in_lines.append(value)
line_extension_amount += value
# vals_allowance.append(round(line_vals["allowance_charge_vals"][0]["amount"], line_vals["currency_dp"]))
line_allowances += round(line_vals["allowance_charge_vals"][0]["amount"], line_vals["currency_dp"])
vals_list["vals"]["legal_monetary_total_vals"]["allowance_total_amount"] = line_allowances
vals_list["vals"]["allowance_charge_vals"][0]["amount"] = line_allowances
if vals_list["vals"]["legal_monetary_total_vals"]["line_extension_amount"] != line_extension_amount:
# aplicare corectie:
# total fara discount = suma linii fara discount
Expand All @@ -48,7 +57,7 @@ def _export_invoice_vals(self, invoice):
# calcul total taxe
taxes_total = 0.0
for tax in vals_list["vals"]["tax_total_vals"]:
taxes_total += round_up(tax["tax_amount"], tax["currency_dp"])
taxes_total += round(tax["tax_amount"], tax["currency_dp"])

# total cu taxe = total fara taxe + total taxe
vals_list["vals"]["legal_monetary_total_vals"]["tax_inclusive_amount"] = (
Expand Down
2 changes: 1 addition & 1 deletion l10n_ro_edi_ubl_discount/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ <h1 class="title">Romania - EDI UBL Line Discount Fix</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:225679b70ba8cc3877399446f6ac80d2662377d48d6dc5f2c45da4c90f4bbd77
!! source digest: sha256:e780daa36965f46e74d66857f33381efc5440db0845e2ca9798317b8a39fe5da
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/l10n-romania/tree/15.0/l10n_ro_edi_ubl_discount"><img alt="dhongu/l10n-romania" src="https://img.shields.io/badge/github-dhongu%2Fl10n--romania-lightgray.png?logo=github" /></a></p>
<blockquote>
Expand Down

0 comments on commit ec087b6

Please sign in to comment.