Skip to content

Commit

Permalink
add client vat id number in bill if available
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalfox committed Dec 12, 2020
1 parent 0dae012 commit e0a44c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crm/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def __init__(self, *args, **kwargs):
"<a role='button' class='btn btn-default' href='%s' target='_blank'><span class='glyphicon glyphicon-plus'></span></a>" % reverse(
"crm:contact_create"))),
"alignment",
"vat_id",
"billing_name",
FieldWithButtons(
"billing_contact",
Expand Down Expand Up @@ -195,7 +196,7 @@ class Meta:
def __init__(self, *args, **kwargs):
super(CompanyForm, self).__init__(*args, **kwargs)
self.helper.layout = Layout(
Div(Column("name", "code", "businessOwner", "web", "legal_description", css_class="col-md-6"),
Div(Column("name", "code", "businessOwner", "vat_id", "web", "legal_description", css_class="col-md-6"),
get_address_column(show_banner=False), css_class="row"),
self.submit)
self.inline_helper.layout = Layout(Fieldset(_("Company"),
Expand Down
14 changes: 11 additions & 3 deletions templates/billing/bill.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@
<strong>N° {{ bill.bill_id }} / {{ bill.creation_date }}</strong></div>

{% if bill.lead.paying_authority %}
<div class="lead">{{ bill.lead.paying_authority.billing_name|default:bill.lead.paying_authority.company }}</div>
{{ bill.lead.paying_authority.company.billing_address|linebreaksbr }}
<div class="lead">
{{ bill.lead.paying_authority.billing_name|default:bill.lead.paying_authority.company }}<br>
{{ bill.lead.paying_authority.company.billing_address|linebreaksbr }}<br>
{% if bill.lead.paying_authority.company.vat_id %}
{% trans "VAT id:" %} {{ bill.lead.paying_authority.company.vat_id }}<br>
{% endif %}
</div>
{% else %}
<div class="lead">
{{ bill.lead.client.billing_name|default:bill.lead.client.organisation }}
{{ bill.lead.client.billing_contact.contact }}<br>
{{ bill.lead.client.billing_address|linebreaksbr }}
{{ bill.lead.client.billing_address|linebreaksbr }}<br>
{% if bill.lead.client.vat_id or bill.lead.client.organisation.company.vat_id %}
{% trans "VAT id:" %} {{ bill.lead.client.vat_id|default:bill.lead.client.organisation.company.vat_id }}<br>
{% endif %}
</div>
{% endif %}
</div>
Expand Down

0 comments on commit e0a44c4

Please sign in to comment.