diff --git a/accounting/migrations/0004_auto_20160824_2145.py b/accounting/migrations/0004_auto_20160824_2145.py new file mode 100644 index 00000000..0636463b --- /dev/null +++ b/accounting/migrations/0004_auto_20160824_2145.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting', '0003_auto_20160824_1732'), + ] + + operations = [ + migrations.AlterModelOptions( + name='accountingtype', + options={'ordering': ['movement_type', 'code'], 'verbose_name': 'accounting type'}, + ), + migrations.AlterModelOptions( + name='bankaccount', + options={'ordering': ['club', 'name'], 'verbose_name': 'Bank account'}, + ), + migrations.AlterModelOptions( + name='clubaccount', + options={'ordering': ['bank_account', 'name'], 'verbose_name': 'Club account'}, + ), + migrations.AlterModelOptions( + name='generaljournal', + options={'ordering': ['-start_date'], 'verbose_name': 'General journal'}, + ), + migrations.AlterModelOptions( + name='simplifiedaccountingtype', + options={'ordering': ['accounting_type__movement_type', 'accounting_type__code'], 'verbose_name': 'simplified type'}, + ), + ] diff --git a/accounting/models.py b/accounting/models.py index 44508a4d..c4ee8614 100644 --- a/accounting/models.py +++ b/accounting/models.py @@ -48,6 +48,10 @@ class BankAccount(models.Model): number = models.CharField(_('account number'), max_length=255, blank=True) club = models.ForeignKey(Club, related_name="bank_accounts", verbose_name=_("club")) + class Meta: + verbose_name = _("Bank account") + ordering = ['club', 'name'] + def is_owned_by(self, user): """ Method to see if that object can be edited by the given user @@ -70,6 +74,10 @@ class ClubAccount(models.Model): club = models.ForeignKey(Club, related_name="club_account", verbose_name=_("club")) bank_account = models.ForeignKey(BankAccount, related_name="club_accounts", verbose_name=_("bank account")) + class Meta: + verbose_name = _("Club account") + ordering = ['bank_account', 'name'] + def is_owned_by(self, user): """ Method to see if that object can be edited by the given user @@ -118,6 +126,10 @@ class GeneralJournal(models.Model): amount = CurrencyField(_('amount'), default=0) effective_amount = CurrencyField(_('effective_amount'), default=0) + class Meta: + verbose_name = _("General journal") + ordering = ['-start_date'] + def is_owned_by(self, user): """ Method to see if that object can be edited by the given user @@ -259,10 +271,12 @@ class AccountingType(models.Model): ], ) label = models.CharField(_('label'), max_length=128) - movement_type = models.CharField(_('movement type'), choices=[('CREDIT', 'Credit'), ('DEBIT', 'Debit'), ('NEUTRAL', 'Neutral')], max_length=12) + movement_type = models.CharField(_('movement type'), choices=[('CREDIT', _('Credit')), ('DEBIT', _('Debit')), + ('NEUTRAL', _('Neutral'))], max_length=12) class Meta: verbose_name = _("accounting type") + ordering = ['movement_type', 'code'] def is_owned_by(self, user): """ @@ -276,7 +290,7 @@ class AccountingType(models.Model): return reverse('accounting:type_list') def __str__(self): - return self.code+" - "+self.movement_type+" - "+self.label + return self.code+" - "+self.get_movement_type_display()+" - "+self.label class SimplifiedAccountingType(models.Model): """ @@ -288,6 +302,7 @@ class SimplifiedAccountingType(models.Model): class Meta: verbose_name = _("simplified type") + ordering = ['accounting_type__movement_type', 'accounting_type__code'] @property def movement_type(self): @@ -300,5 +315,5 @@ class SimplifiedAccountingType(models.Model): return reverse('accounting:simple_type_list') def __str__(self): - return self.label+" - "+self.accounting_type.code+" - "+self.get_movement_type_display() + return self.get_movement_type_display()+" - "+self.accounting_type.code+" - "+self.label diff --git a/accounting/templates/accounting/bank_account_details.jinja b/accounting/templates/accounting/bank_account_details.jinja index 19a121ef..076d2753 100644 --- a/accounting/templates/accounting/bank_account_details.jinja +++ b/accounting/templates/accounting/bank_account_details.jinja @@ -11,6 +11,9 @@
{% trans %}New journal{% endtrans %}
{% else %} diff --git a/accounting/templates/accounting/operation_edit.jinja b/accounting/templates/accounting/operation_edit.jinja index 77cdc0cb..9866892d 100644 --- a/accounting/templates/accounting/operation_edit.jinja +++ b/accounting/templates/accounting/operation_edit.jinja @@ -5,6 +5,14 @@ {% endblock %} {% block content %} ++{% trans %}Accounting{% endtrans %} > +{{object.club_account.bank_account }} > +{{ object.club_account }} > +{{ object.name }} > +{% trans %}Edit operation{% endtrans %} +
+