Skip to content

Commit

Permalink
update LegalEntity model
Browse files Browse the repository at this point in the history
  • Loading branch information
phedoreanu committed Mar 23, 2024
1 parent 0eec75f commit c09e51e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.11 on 2024-03-23 19:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('oscar_invoices', '0004_date_banking_details'),
]

operations = [
migrations.AddField(
model_name='legalentity',
name='company_number',
field=models.CharField(blank=True, max_length=20, null=True, verbose_name='Company identification number'),
),
migrations.AlterField(
model_name='legalentity',
name='vat_number',
field=models.CharField(blank=True, max_length=20, null=True, verbose_name='VAT identification number'),
),
]
7 changes: 6 additions & 1 deletion oscar_invoices/templates/oscar_invoices/invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ <h1>{% trans "Original invoice" %} #{{ invoice.number }}</h1><br>
</td>
<td>
{{ legal_entity.business_name }}<br>
{% trans "VAT ID" %}: {{ legal_entity.vat_number }}<br>
{% if legal_entity.vat_number %}
{% trans "VAT ID" %}: {{ legal_entity.vat_number }}<br>
{% endif %}
{% if legal_entity.company_number %}
{% trans "Company ID" %}: {{ legal_entity.company_number }}<br>
{% endif %}
<address>
{{ legal_entity_address.summary }}<br/>
{% if legal_entity_address.phone_number %}
Expand Down
2 changes: 1 addition & 1 deletion tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class LegalEntityFactory(factory.django.DjangoModelFactory):
business_name = 'Test Company'
vat_number = 'test-vat-number'
company_number = 'test-company-number'

class Meta:
model = get_model('oscar_invoices', 'LegalEntity')
Expand Down

0 comments on commit c09e51e

Please sign in to comment.