Skip to content

Commit

Permalink
[IMP] l10n_it_fatturapa_in: payment_term parametric for customer
Browse files Browse the repository at this point in the history
  • Loading branch information
andreampiovesana committed Sep 5, 2024
1 parent 6ec0bf4 commit 43f1a7b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,12 @@ def _get_received_date(self, attachment):
received_date = received_date.date()
return received_date

def _get_payment_term(self, partner):
payment_term_id = False
if partner.property_supplier_payment_term_id:
payment_term_id = partner.property_supplier_payment_term_id.id
return payment_term_id

def _prepare_invoice_values(self, fatt, fatturapa_attachment, FatturaBody, partner):
company = self.env.company
currency = self._get_currency(FatturaBody)
Expand Down Expand Up @@ -1197,6 +1203,7 @@ def _prepare_invoice_values(self, fatt, fatturapa_attachment, FatturaBody, partn
partner,
delivery=delivery_partner,
)
payment_term_id = self._get_payment_term(partner)

invoice_data = {
"e_invoice_received_date": e_invoice_received_date,
Expand All @@ -1212,7 +1219,7 @@ def _prepare_invoice_values(self, fatt, fatturapa_attachment, FatturaBody, partn
"journal_id": purchase_journal.id,
# 'origin': xmlData.datiOrdineAcquisto,
"fiscal_position_id": fiscal_position.id,
"invoice_payment_term_id": partner.property_supplier_payment_term_id.id,
"invoice_payment_term_id": payment_term_id,
"company_id": company.id,
"fatturapa_attachment_in_id": fatturapa_attachment.id,
"narration": comment,
Expand Down

0 comments on commit 43f1a7b

Please sign in to comment.