trytond-edocument-ubl 8.0.5__tar.gz → 8.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/PKG-INFO +1 -1
  2. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/edocument.py +5 -29
  3. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/template/2/CreditNote.xml +16 -14
  4. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/template/2/Invoice.xml +13 -13
  5. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tryton.cfg +1 -1
  6. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/.hgignore +0 -0
  7. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/COPYRIGHT +0 -0
  8. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/LICENSE +0 -0
  9. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/__init__.py +0 -0
  10. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/account.py +0 -0
  11. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/account.xml +0 -0
  12. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/document.py +0 -0
  13. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/exceptions.py +0 -0
  14. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/icons/LICENSE +0 -0
  15. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/bg.po +0 -0
  16. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/ca.po +0 -0
  17. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/cs.po +0 -0
  18. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/de.po +0 -0
  19. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/es.po +0 -0
  20. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/es_419.po +0 -0
  21. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/et.po +0 -0
  22. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/fa.po +0 -0
  23. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/fi.po +0 -0
  24. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/fr.po +0 -0
  25. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/hu.po +0 -0
  26. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/id.po +0 -0
  27. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/it.po +0 -0
  28. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/lo.po +0 -0
  29. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/lt.po +0 -0
  30. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/nl.po +0 -0
  31. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/pl.po +0 -0
  32. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/pt.po +0 -0
  33. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/ro.po +0 -0
  34. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/ru.po +0 -0
  35. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/sl.po +0 -0
  36. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/tr.po +0 -0
  37. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/uk.po +0 -0
  38. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/locale/zh_CN.po +0 -0
  39. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/message.xml +0 -0
  40. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/party.py +0 -0
  41. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/pyproject.toml +0 -0
  42. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/template/2/base.xml +0 -0
  43. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/BDNDR-CCTS_CCT_SchemaModule-1.1.xsd +0 -0
  44. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/BDNDR-UnqualifiedDataTypes-1.1.xsd +0 -0
  45. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-CommonAggregateComponents-2.4.xsd +0 -0
  46. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-CommonBasicComponents-2.4.xsd +0 -0
  47. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-CommonExtensionComponents-2.4.xsd +0 -0
  48. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-CommonSignatureComponents-2.4.xsd +0 -0
  49. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-ExtensionContentDataType-2.4.xsd +0 -0
  50. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-QualifiedDataTypes-2.4.xsd +0 -0
  51. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-SignatureAggregateComponents-2.4.xsd +0 -0
  52. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-SignatureBasicComponents-2.4.xsd +0 -0
  53. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-XAdES01903v132-201601-2.4.xsd +0 -0
  54. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-XAdES01903v141-201601-2.4.xsd +0 -0
  55. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-xmldsig-core-schema-2.4.xsd +0 -0
  56. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-xmldsig1-schema-2.4.xsd +0 -0
  57. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/common/UBL-xmldsig11-schema-2.4.xsd +0 -0
  58. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/maindoc/UBL-CreditNote-2.4.xsd +0 -0
  59. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/2.4/maindoc/UBL-Invoice-2.4.xsd +0 -0
  60. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/UBL-CreditNote-2.1-Example.xml +0 -0
  61. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/UBL-Invoice-2.1-Example-Trivial.xml +0 -0
  62. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/UBL-Invoice-2.1-Example.xml +0 -0
  63. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/__init__.py +0 -0
  64. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/scenario_ubl_2_credit_note_parse.json +0 -0
  65. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/scenario_ubl_2_credit_note_parse.rst +0 -0
  66. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/scenario_ubl_2_invoice_parse.json +0 -0
  67. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/scenario_ubl_2_invoice_parse.rst +0 -0
  68. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/scenario_ubl_2_invoice_parse_trivial.rst +0 -0
  69. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/test_module.py +0 -0
  70. {trytond_edocument_ubl-8.0.5 → trytond_edocument_ubl-8.0.7}/tests/test_scenario.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: trytond_edocument_ubl
3
- Version: 8.0.5
3
+ Version: 8.0.7
4
4
  Summary: UBL electronic document for Tryton
5
5
  Project-URL: homepage, https://www.tryton.org/
6
6
  Project-URL: documentation, https://docs.tryton.org/modules-edocument-ubl/
@@ -239,7 +239,7 @@ class Invoice(Model):
239
239
  base += line.base
240
240
  amount += line.amount
241
241
  tax_lines.append(TaxLine(base=base, amount=amount, tax=tax))
242
- yield group, tax_lines, amount
242
+ yield group, tax_lines, tax_amount
243
243
 
244
244
  def _taxes_key(self, line):
245
245
  return ()
@@ -413,21 +413,9 @@ class Invoice(Model):
413
413
  is not None)):
414
414
  invoice.cash_rounding = True
415
415
 
416
- if tax_exlusive_amount := root.findtext(
416
+ if tax_exclusive_amount := root.findtext(
417
417
  './{*}LegalMonetaryTotal/{*}TaxExclusiveAmount'):
418
- untaxed_amount = Decimal(tax_exlusive_amount)
419
-
420
- if allowance_total_amount := root.findtext(
421
- './{*}LegalMonetaryTotal/{*}AllowanceTotalAmount'):
422
- allowance_total_amount = Decimal(allowance_total_amount)
423
- untaxed_amount -= allowance_total_amount
424
-
425
- if charge_total_amount := root.findtext(
426
- './{*}LegalMonetaryTotal/{*}ChargeTotalAmount'):
427
- charge_total_amount = Decimal(charge_total_amount)
428
- untaxed_amount += charge_total_amount
429
-
430
- invoice.source_untaxed_amount = untaxed_amount
418
+ invoice.source_untaxed_amount = Decimal(tax_exclusive_amount)
431
419
 
432
420
  tax_amount = sum(Decimal(amount.text) for amount in root.iterfind(
433
421
  './{*}TaxTotal/{*}TaxAmount'))
@@ -738,21 +726,9 @@ class Invoice(Model):
738
726
  is not None):
739
727
  invoice.cash_rounding = True
740
728
 
741
- if tax_exlusive_amount := root.findtext(
729
+ if tax_exclusive_amount := root.findtext(
742
730
  './{*}LegalMonetaryTotal/{*}TaxExclusiveAmount'):
743
- untaxed_amount = Decimal(tax_exlusive_amount)
744
-
745
- if allowance_total_amount := root.findtext(
746
- './{*}LegalMonetaryTotal/{*}AllowanceTotalAmount'):
747
- allowance_total_amount = Decimal(allowance_total_amount)
748
- untaxed_amount -= allowance_total_amount
749
-
750
- if charge_total_amount := root.findtext(
751
- './{*}LegalMonetaryTotal/{*}ChargeTotalAmount'):
752
- charge_total_amount = Decimal(charge_total_amount)
753
- untaxed_amount += charge_total_amount
754
-
755
- invoice.source_untaxed_amount = -untaxed_amount
731
+ invoice.source_untaxed_amount = -Decimal(tax_exclusive_amount)
756
732
 
757
733
  tax_amount = sum(Decimal(amount.text) for amount in root.iterfind(
758
734
  './{*}TaxTotal/{*}TaxAmount'))
@@ -16,7 +16,9 @@ this repository contains the full copyright notices and license terms. -->
16
16
  </py:if>
17
17
  <cbc:ID>${this.invoice.number}</cbc:ID>
18
18
  <cbc:IssueDate>${this.invoice.invoice_date}</cbc:IssueDate>
19
- <cbc:DueDate>${max(l.maturity_date for l in this.invoice.lines_to_pay if l.maturity_date)}</cbc:DueDate>
19
+ <py:if test="specification != 'peppol-bis-3'">
20
+ <cbc:DueDate>${max(l.maturity_date for l in this.invoice.lines_to_pay if l.maturity_date)}</cbc:DueDate>
21
+ </py:if>
20
22
  <cbc:CreditNoteTypeCode>${this.type_code}</cbc:CreditNoteTypeCode>
21
23
  <cbc:DocumentCurrencyCode>${this.invoice.currency.code}</cbc:DocumentCurrencyCode>
22
24
  <cbc:BuyerReference py:if="this.invoice.reference">${this.invoice.reference}</cbc:BuyerReference>
@@ -90,7 +92,7 @@ this repository contains the full copyright notices and license terms. -->
90
92
  <py:otherwise>
91
93
  <cac:PaymentTerms py:for="line in this.invoice.lines_to_pay">
92
94
  <cbc:Note py:if="this.invoice.payment_term and this.invoice.payment_term.description">${this.invoice.payment_term.description}</cbc:Note>
93
- <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount.normalize(), 'f')}</cbc:Amount>
95
+ <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount, 'f')}</cbc:Amount>
94
96
  <cbc:PaymentDueDate>${line.maturity_date}</cbc:PaymentDueDate>
95
97
  </cac:PaymentTerms>
96
98
  </py:otherwise>
@@ -101,16 +103,16 @@ this repository contains the full copyright notices and license terms. -->
101
103
  <cbc:AllowanceChargeReasonCode py:if="reason_code">${reason_code}</cbc:AllowanceChargeReasonCode>
102
104
  </py:with>
103
105
  <cbc:AllowanceChargeReason>${allowance_charge.product.name}</cbc:AllowanceChargeReason>
104
- <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(abs(allowance_charge.amount).normalize(), 'f')}</cbc:Amount>
106
+ <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(abs(allowance_charge.amount), 'f')}</cbc:Amount>
105
107
  <cac:TaxCategory py:for="tax_line in allowance_charge.invoice_taxes">
106
108
  ${TaxCategory(tax_line.tax)}
107
109
  </cac:TaxCategory>
108
110
  </cac:AllowanceCharge>
109
111
  <cac:TaxTotal py:for="group, lines, amount in this.taxes">
110
- <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-amount).normalize(), 'f')}</cbc:TaxAmount>
112
+ <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-amount, 'f')}</cbc:TaxAmount>
111
113
  <cac:TaxSubtotal py:for="line in lines">
112
- <cbc:TaxableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-line.base).normalize(), 'f')}</cbc:TaxableAmount>
113
- <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-line.amount).normalize(), 'f')}</cbc:TaxAmount>
114
+ <cbc:TaxableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-line.base, 'f')}</cbc:TaxableAmount>
115
+ <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-line.amount, 'f')}</cbc:TaxAmount>
114
116
  <cbc:Percent py:if="line.tax.type == 'percentage' and not (specification or '').startswith('peppol')">${format((line.tax.rate * 100).normalize(), 'f')}</cbc:Percent>
115
117
  <cac:TaxCategory>
116
118
  ${TaxCategory(line.tax)}
@@ -118,19 +120,19 @@ this repository contains the full copyright notices and license terms. -->
118
120
  </cac:TaxSubtotal>
119
121
  </cac:TaxTotal>
120
122
  <cac:LegalMonetaryTotal>
121
- <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-this.invoice.untaxed_amount).normalize(), 'f')}</cbc:LineExtensionAmount>
122
- <cbc:TaxExclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-this.invoice.untaxed_amount).normalize(), 'f')}</cbc:TaxExclusiveAmount>
123
- <cbc:TaxInclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-(this.invoice.untaxed_amount + this.invoice.tax_amount)).normalize(), 'f')}</cbc:TaxInclusiveAmount>
123
+ <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-this.invoice.untaxed_amount, 'f')}</cbc:LineExtensionAmount>
124
+ <cbc:TaxExclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-this.invoice.untaxed_amount, 'f')}</cbc:TaxExclusiveAmount>
125
+ <cbc:TaxInclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-(this.invoice.untaxed_amount + this.invoice.tax_amount), 'f')}</cbc:TaxInclusiveAmount>
124
126
  <py:if test="this.invoice.total_amount != (this.invoice.untaxed_amount + this.invoice.tax_amount)">
125
- <cbc:PayableRoundingAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-(this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount)).normalize(), 'f')}</cbc:PayableRoundingAmount>
127
+ <cbc:PayableRoundingAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-(this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount), 'f')}</cbc:PayableRoundingAmount>
126
128
  </py:if>
127
- <cbc:PrepaidAmount py:if="this.prepaid_amount" py:attrs="{'currencyID': this.invoice.currency.code}">${format((-this.prepaid_amount).normalize(), 'f')}</cbc:PrepaidAmount>
128
- <cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-this.invoice.total_amount + this.prepaid_amount).normalize(), 'f')}</cbc:PayableAmount>
129
+ <cbc:PrepaidAmount py:if="this.prepaid_amount" py:attrs="{'currencyID': this.invoice.currency.code}">${format(-this.prepaid_amount, 'f')}</cbc:PrepaidAmount>
130
+ <cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-this.invoice.total_amount + this.prepaid_amount, 'f')}</cbc:PayableAmount>
129
131
  </cac:LegalMonetaryTotal>
130
132
  <cac:CreditNoteLine py:for="line_id, line in enumerate(this.lines, 1)">
131
133
  <cbc:ID>${line_id}</cbc:ID>
132
- <cbc:CreditedQuantity py:attrs="{'unitCode': line.unit.unece_code if line.unit and line.unit.unece_code else 'ZZ'}">${format(-Decimal(str(line.quantity)), 'f')}</cbc:CreditedQuantity>
133
- <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((-line.amount).normalize(), 'f')}</cbc:LineExtensionAmount>
134
+ <cbc:CreditedQuantity py:attrs="{'unitCode': line.unit.unece_code if line.unit and line.unit.unece_code else 'ZZ'}">${format(-Decimal(str(line.quantity)).normalize(), 'f')}</cbc:CreditedQuantity>
135
+ <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(-line.amount, 'f')}</cbc:LineExtensionAmount>
134
136
  <cac:Item>
135
137
  <cbc:Description py:if="line.description">${line.description}</cbc:Description>
136
138
  <cbc:Name>${line.product.name if line.product else line.summary}</cbc:Name>
@@ -90,7 +90,7 @@ this repository contains the full copyright notices and license terms. -->
90
90
  <py:otherwise>
91
91
  <cac:PaymentTerms py:for="line in this.invoice.lines_to_pay">
92
92
  <cbc:Note py:if="this.invoice.payment_term and this.invoice.payment_term.description">${this.invoice.payment_term.description}</cbc:Note>
93
- <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount.normalize(), 'f')}</cbc:Amount>
93
+ <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount, 'f')}</cbc:Amount>
94
94
  <cbc:PaymentDueDate>${line.maturity_date}</cbc:PaymentDueDate>
95
95
  </cac:PaymentTerms>
96
96
  </py:otherwise>
@@ -101,16 +101,16 @@ this repository contains the full copyright notices and license terms. -->
101
101
  <cbc:AllowanceChargeReasonCode py:if="reason_code">${reason_code}</cbc:AllowanceChargeReasonCode>
102
102
  </py:with>
103
103
  <cbc:AllowanceChargeReason>${allowance_charge.product.name}</cbc:AllowanceChargeReason>
104
- <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(abs(allowance_charge.amount).normalize(), 'f')}</cbc:Amount>
104
+ <cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${format(abs(allowance_charge.amount), 'f')}</cbc:Amount>
105
105
  <cac:TaxCategory py:for="tax_line in allowance_charge.invoice_taxes">
106
106
  ${TaxCategory(tax_line.tax)}
107
107
  </cac:TaxCategory>
108
108
  </cac:AllowanceCharge>
109
109
  <cac:TaxTotal py:for="group, lines, amount in this.taxes">
110
- <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(amount.normalize(), 'f')}</cbc:TaxAmount>
110
+ <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(amount, 'f')}</cbc:TaxAmount>
111
111
  <cac:TaxSubtotal py:for="line in lines">
112
- <cbc:TaxableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.base.normalize(), 'f')}</cbc:TaxableAmount>
113
- <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount.normalize(), 'f')}</cbc:TaxAmount>
112
+ <cbc:TaxableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.base, 'f')}</cbc:TaxableAmount>
113
+ <cbc:TaxAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount, 'f')}</cbc:TaxAmount>
114
114
  <cbc:Percent py:if="line.tax.type == 'percentage' and not (specification or '').startswith('peppol')">${format((line.tax.rate * 100).normalize(), 'f')}</cbc:Percent>
115
115
  <cac:TaxCategory>
116
116
  ${TaxCategory(line.tax)}
@@ -118,19 +118,19 @@ this repository contains the full copyright notices and license terms. -->
118
118
  </cac:TaxSubtotal>
119
119
  </cac:TaxTotal>
120
120
  <cac:LegalMonetaryTotal>
121
- <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.invoice.untaxed_amount.normalize(), 'f')}</cbc:LineExtensionAmount>
122
- <cbc:TaxExclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.invoice.untaxed_amount.normalize(), 'f')}</cbc:TaxExclusiveAmount>
123
- <cbc:TaxInclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((this.invoice.untaxed_amount + this.invoice.tax_amount).normalize(), 'f')}</cbc:TaxInclusiveAmount>
121
+ <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.invoice.untaxed_amount, 'f')}</cbc:LineExtensionAmount>
122
+ <cbc:TaxExclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.invoice.untaxed_amount, 'f')}</cbc:TaxExclusiveAmount>
123
+ <cbc:TaxInclusiveAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((this.invoice.untaxed_amount + this.invoice.tax_amount), 'f')}</cbc:TaxInclusiveAmount>
124
124
  <py:if test="this.invoice.total_amount != (this.invoice.untaxed_amount + this.invoice.tax_amount)">
125
- <cbc:PayableRoundingAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount).normalize(), 'f')}</cbc:PayableRoundingAmount>
125
+ <cbc:PayableRoundingAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount), 'f')}</cbc:PayableRoundingAmount>
126
126
  </py:if>
127
- <cbc:PrepaidAmount py:if="this.prepaid_amount" py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.prepaid_amount.normalize(), 'f')}</cbc:PrepaidAmount>
128
- <cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format((this.invoice.total_amount - this.prepaid_amount).normalize(), 'f')}</cbc:PayableAmount>
127
+ <cbc:PrepaidAmount py:if="this.prepaid_amount" py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.prepaid_amount, 'f')}</cbc:PrepaidAmount>
128
+ <cbc:PayableAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(this.invoice.total_amount - this.prepaid_amount, 'f')}</cbc:PayableAmount>
129
129
  </cac:LegalMonetaryTotal>
130
130
  <cac:InvoiceLine py:for="line_id, line in enumerate(this.lines, 1)">
131
131
  <cbc:ID>${line_id}</cbc:ID>
132
- <cbc:InvoicedQuantity py:attrs="{'unitCode': line.unit.unece_code if line.unit and line.unit.unece_code else 'ZZ'}">${format(Decimal(str(line.quantity)), 'f')}</cbc:InvoicedQuantity>
133
- <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount.normalize(), 'f')}</cbc:LineExtensionAmount>
132
+ <cbc:InvoicedQuantity py:attrs="{'unitCode': line.unit.unece_code if line.unit and line.unit.unece_code else 'ZZ'}">${format(Decimal(str(line.quantity)).normalize(), 'f')}</cbc:InvoicedQuantity>
133
+ <cbc:LineExtensionAmount py:attrs="{'currencyID': this.invoice.currency.code}">${format(line.amount, 'f')}</cbc:LineExtensionAmount>
134
134
  <cac:Item>
135
135
  <cbc:Description py:if="line.description">${line.description}</cbc:Description>
136
136
  <cbc:Name>${line.product.name if line.product else line.summary}</cbc:Name>
@@ -1,5 +1,5 @@
1
1
  [tryton]
2
- version=8.0.5
2
+ version=8.0.7
3
3
  depends:
4
4
  edocument_unece
5
5
  ir