Skip to content

Commit

Permalink
Release 0.16 with 2 fixes
Browse files Browse the repository at this point in the history
FIX: field customer_chorus_service_code not declared as required field any more
FIX: avoid crash when fields issuer_siret or issuer_vat_number were empty
  • Loading branch information
alexis-via committed Dec 31, 2019
1 parent c931392 commit ceaf21d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ A video tutorial that shows how to install and use this LibreOffice extension is
Release notes
=============

* Version 0.16 dated December 31st 2019:

* FIX: field *Customer Service Code for Chorus Pro* not declared as required field any more
* FIX: avoid crash when fields *Issuer SIRET* or *Issuer VAT Number* were empty

* Version 0.15 dated Christmas 2019: first public release.

====================
Expand Down
2 changes: 1 addition & 1 deletion extension/description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:d="http://openoffice.org/extensions/description/2006">

<identifier value="com.akretion.factur-x" />
<version value="0.15" />
<version value="0.16" />
<platform value="all" />
<display-name>
<name lang="en">Factur-X Invoice Generator</name>
Expand Down
24 changes: 13 additions & 11 deletions extension/package/libreoffice_facturx_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,23 @@ def generate_facturx_xml(data):
seller = ET.SubElement(trade_agreement, ET.QName(ns['ram'], 'SellerTradeParty'))
seller_name = ET.SubElement(seller, ET.QName(ns['ram'], 'Name'))
seller_name.text = data['issuer_name']
seller_legal_org = ET.SubElement(
seller, ET.QName(ns['ram'], 'SpecifiedLegalOrganization'))
seller_legal_org_id = ET.SubElement(
seller_legal_org, ET.QName(ns['ram'], 'ID'), schemeID='0002')
seller_legal_org_id.text = data['issuer_siret']
if data.get('issuer_siret'):
seller_legal_org = ET.SubElement(
seller, ET.QName(ns['ram'], 'SpecifiedLegalOrganization'))
seller_legal_org_id = ET.SubElement(
seller_legal_org, ET.QName(ns['ram'], 'ID'), schemeID='0002')
seller_legal_org_id.text = data['issuer_siret']
seller_country = ET.SubElement(
seller, ET.QName(ns['ram'], 'PostalTradeAddress'))
seller_country_code = ET.SubElement(
seller_country, ET.QName(ns['ram'], 'CountryID'))
seller_country_code.text = data['issuer_country_code']
seller_tax_reg = ET.SubElement(
seller, ET.QName(ns['ram'], 'SpecifiedTaxRegistration'))
seller_tax_reg_id = ET.SubElement(
seller_tax_reg, ET.QName(ns['ram'], 'ID'), schemeID='VA')
seller_tax_reg_id.text = data['issuer_vat_number']
if data.get('issuer_vat_number'):
seller_tax_reg = ET.SubElement(
seller, ET.QName(ns['ram'], 'SpecifiedTaxRegistration'))
seller_tax_reg_id = ET.SubElement(
seller_tax_reg, ET.QName(ns['ram'], 'ID'), schemeID='VA')
seller_tax_reg_id.text = data['issuer_vat_number']
buyer = ET.SubElement(trade_agreement, ET.QName(ns['ram'], 'BuyerTradeParty'))
buyer_name = ET.SubElement(buyer, ET.QName(ns['ram'], 'Name'))
buyer_name.text = data['customer_name']
Expand Down Expand Up @@ -230,7 +232,7 @@ def get_and_check_data(doc, data_sheet):
},
'customer_chorus_service_code': {
'type': 'char',
'required': True,
'required': False,
'line': 12,
},
'invoice_or_refund': {
Expand Down
Binary file modified factur-x_macro.oxt
Binary file not shown.

0 comments on commit ceaf21d

Please sign in to comment.