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

Remove the field is not in use #394

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions invoices_app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
'Due Date': 'invoice_due_date',
'Date Received': 'invoice_date_received',
'Currency': 'currency',
'Net Amount': 'net_amount',
'VAT': 'vat',
'Total Amount': 'total_amount',
'Workday ID': 'workday_id',
'PO Number': 'po_number'
Expand Down
2 changes: 0 additions & 2 deletions invoices_app/factory_boy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class InvoiceFactory(factory.django.DjangoModelFactory):
invoice_file = file_mock
currency = 'ARS'
invoice_number = '1234'
net_amount = '4000'
vat = '1200'
total_amount = '5200'
invoice_eb_entity = factory.SubFactory(EBEntityFactory)

Expand Down
19 changes: 0 additions & 19 deletions invoices_app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,20 @@ class Meta:
'invoice_number',
'po_number',
'currency',
'net_amount',
'vat',
'total_amount',
'invoice_file',
'workday_id',
)
widgets = {
'currency': forms.Select(attrs={'class': 'custom-select'}),
'po_number': forms.TextInput(attrs={'class': 'form-control', 'placeholder': _('e.g. 124246346')}),
'vat': forms.NumberInput(
attrs={
'id': 'vat',
'class': 'form-control',
'placeholder': '0',
'onChange': 'calculate_total_amount()',
}
),
'total_amount': forms.NumberInput(
attrs={
'id': 'total',
'class': 'form-control',
'placeholder': '0'
}
),
'net_amount': forms.NumberInput(
attrs={
'id': 'net_amount',
'class': 'form-control',
'placeholder': '0',
'label': _('Net Amount'),
'onChange': 'calculate_total_amount()',
}
),
'invoice_number': forms.TextInput(
attrs={
'class': 'form-control',
Expand Down
31 changes: 31 additions & 0 deletions invoices_app/migrations/0008_auto_20200723_1935.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2020-07-23 19:35
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

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

operations = [
migrations.RemoveField(
model_name='historicalinvoice',
name='net_amount',
),
migrations.RemoveField(
model_name='historicalinvoice',
name='vat',
),
migrations.RemoveField(
model_name='invoice',
name='net_amount',
),
migrations.RemoveField(
model_name='invoice',
name='vat',
),
]
13 changes: 1 addition & 12 deletions invoices_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,7 @@ class Meta:
invoice_due_date = models.DateField(verbose_name=_('Due Date'))
invoice_date_received = models.DateTimeField(auto_now_add=True, verbose_name=_('Date Received'))
invoice_number = models.CharField(max_length=20, verbose_name=_('Invoice Number'))
net_amount = models.DecimalField(
verbose_name=_('Net amount'),
max_digits=20,
decimal_places=2,
validators=[MinValueValidator(Decimal('0.01'))],
)
vat = models.DecimalField(
max_digits=20,
decimal_places=2,
validators=[MinValueValidator(Decimal('0.00'))],
verbose_name=_('Tax Liens'),
)

total_amount = models.DecimalField(
max_digits=20,
decimal_places=2,
Expand Down
2 changes: 0 additions & 2 deletions invoices_app/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ def setUp(self):
'invoice_number': '987654321',
'invoice_type': 'A',
'eb_entity': self.eb_entity_example.id,
'net_amount': '4000',
'po_number': '98876',
'taxpayer': self.taxpayer.id,
'total_amount': '5200',
'vat': '1200',
'user': self.user.id,
}

Expand Down
1 change: 1 addition & 0 deletions supplier_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class InvitingBuyer(models.Model):
)
creation_date = models.DateTimeField(auto_now_add=True)


class CompanyUserPermission(models.Model):
company = models.ForeignKey(Company, on_delete=models.CASCADE)
user = models.ForeignKey(
Expand Down