Skip to content

Commit

Permalink
Making invoices fields optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sarias-eb committed Jul 24, 2020
1 parent ed6e0d5 commit ce3966b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions invoices_app/migrations/0008_auto_20200724_1318.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2020-07-24 13:18
from __future__ import unicode_literals

from decimal import Decimal
import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('invoices_app', '0007_auto_20200616_1803'),
]

operations = [
migrations.AlterField(
model_name='historicalinvoice',
name='net_amount',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='Net amount'),
),
migrations.AlterField(
model_name='historicalinvoice',
name='vat',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))], verbose_name='Tax Liens'),
),
migrations.AlterField(
model_name='invoice',
name='net_amount',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='Net amount'),
),
migrations.AlterField(
model_name='invoice',
name='vat',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=20, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))], verbose_name='Tax Liens'),
),
]
4 changes: 4 additions & 0 deletions invoices_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ class Meta:
max_digits=20,
decimal_places=2,
validators=[MinValueValidator(Decimal('0.01'))],
blank=True,
null=True,
)
vat = models.DecimalField(
max_digits=20,
decimal_places=2,
validators=[MinValueValidator(Decimal('0.00'))],
verbose_name=_('Tax Liens'),
blank=True,
null=True,
)
total_amount = models.DecimalField(
max_digits=20,
Expand Down

0 comments on commit ce3966b

Please sign in to comment.