Skip to content

Commit

Permalink
fix(Sales Invoice): add phone/fax only if profile supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Jan 9, 2025
1 parent c19fb7c commit 644ae9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eu_einvoice/european_e_invoice/custom/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ def _set_seller_contact(self):
if self.seller_contact.phone:
seller_contact_phone = self.seller_contact.phone

if seller_contact_phone:
if seller_contact_phone and self.profile >= EInvoiceProfile.EN16931:
self.doc.trade.agreement.seller.contact.telephone.number = seller_contact_phone

if self.company.fax:
if self.company.fax and self.profile >= EInvoiceProfile.EXTENDED:
self.doc.trade.agreement.seller.contact.fax.number = self.company.fax

def _set_buyer(self):
Expand Down Expand Up @@ -331,7 +331,7 @@ def _set_buyer_contact(self):
if self.invoice.contact_email:
self.doc.trade.agreement.buyer.contact.email.address = self.invoice.contact_email

if buyer_contact_phone:
if buyer_contact_phone and self.profile >= EInvoiceProfile.EN16931:
self.doc.trade.agreement.buyer.contact.telephone.number = buyer_contact_phone

def _add_line_item(self, item: SalesInvoiceItem):
Expand Down

0 comments on commit 644ae9e

Please sign in to comment.