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

fix(Sales Invoice): add phone/fax only if profile supports it (backport #50) #52

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
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
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
Loading