Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: 12.0 import customer facturae disable validation fix customer iban #4

Open
wants to merge 18 commits into
base: 12.0
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Resolved bug that prevents invoice parsing when there is not acc_number
  • Loading branch information
cesarlr committed Feb 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 78665e213d402fdbe48a696c6fc7658397ff9376
Original file line number Diff line number Diff line change
@@ -97,7 +97,8 @@ def parse_facturae_invoice(self, xml_root, xsd_file):
invoice.find('Items').findall('InvoiceLine')
]
attachments = {}
acc_number = invoice.find('PaymentDetails/Installment/AccountToBeDebited/AccountNumber').text
acc_number = invoice.find('PaymentDetails/Installment/AccountToBeDebited/AccountNumber')
acc_number = acc_number and acc_number.value
res = {
'type': inv_type,
'partner': partner_dict,
@@ -112,7 +113,7 @@ def parse_facturae_invoice(self, xml_root, xsd_file):
'amount_total': amount_total,
'check_total': amount_total,
'amount_untaxed': amount_untaxed,
'iban': str(IBAN.generate('ES',acc_number[0:4],acc_number[8:20],acc_number[4:8])),
'iban': acc_number and str(IBAN.generate('ES',acc_number[0:4],acc_number[8:20],acc_number[4:8])),
'bic': False,
'lines': res_lines,
'attachments': attachments,