Skip to content

Commit

Permalink
fix: support payment terms with due date only
Browse files Browse the repository at this point in the history
Resolves #1
  • Loading branch information
barredterra committed Oct 14, 2024
1 parent e1c7df5 commit 6aafb0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"settlement_section",
"currency",
"taxes",
"due_date",
"payment_terms"
],
"fields": [
Expand Down Expand Up @@ -289,6 +290,12 @@
"fieldname": "seller_section",
"fieldtype": "Section Break",
"label": "Seller"
},
{
"fieldname": "due_date",
"fieldtype": "Date",
"label": "Due Date",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
Expand All @@ -299,7 +306,7 @@
"link_fieldname": "e_invoice_import"
}
],
"modified": "2024-10-01 16:42:46.133199",
"modified": "2024-10-14 10:33:22.117790",
"modified_by": "Administrator",
"module": "European e-Invoice",
"name": "E Invoice Import",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ def parse_tax(self, tax: "ApplicableTradeTax"):
t.calculated_amount = float(tax.calculated_amount._value)

def parse_payment_term(self, term: "PaymentTerms"):
if not term.partial_amount.children:
self.due_date = term.due._value
return

t = self.append("payment_terms")
t.due = term.due._value
partial_amount = [row[0] for row in term.partial_amount.children if row[1] == self.currency][0]
Expand Down

0 comments on commit 6aafb0f

Please sign in to comment.