coding utf-8 from django db import models class Payer models Model inn

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
from django.db import models
class Payer(models.Model):
inn = models.CharField(max_length = 12, verbose_name='ИНН')
name = models.CharField(max_length = 400, verbose_name='наименование плательщика')
def __unicode__(self):
return self.inn + ' - ' + self.name
class Meta:
verbose_name = 'плательщик'
verbose_name_plural = 'плательщики'
class Payment(models.Model):
date = models.DateField(verbose_name='дата')
payer = models.ForeignKey('Payer', verbose_name='плательщик')
tax = models.ForeignKey('Tax', verbose_name='по БК')
desc = models.CharField(max_length =400, verbose_name='назначение платежа')
amount = models.CharField(max_length = 40, verbose_name='зачислено')
class Meta:
verbose_name = 'платеж'
verbose_name_plural = 'платежи'
class Register(models.Model):
tax = models.ForeignKey('Tax', verbose_name='по БК')
payer = models.ForeignKey('Payer', verbose_name='плательщик')
date_1 = models.DateField(verbose_name='дата 1')
payment_1 = models.CharField(max_length = 40, verbose_name='платеж 1')
date_2 = models.DateField(verbose_name='дата 2')
payment_2 = models.CharField(max_length = 40, verbose_name='платеж 2')
reason = models.CharField(max_length = 400, verbose_name='причины отклонений')
class Meta:
verbose_name = 'реестр'
verbose_name_plural = 'реестры'
class TaxCategory(models.Model):
name = models.CharField(max_length = 70, verbose_name='наименование категории')
def __unicode__(self):
return self.name
class Meta:
verbose_name = 'справочник категорий КБК'
verbose_name_plural = 'справочник категорий КБК'
class Tax(models.Model):
category = models.ForeignKey('TaxCategory', verbose_name='наименование категории')
code = models.CharField(max_length = 25, verbose_name='код классификации')
desc = models.CharField(max_length = 400, verbose_name='описание')
def __unicode__(self):
return self.code
class Meta:
verbose_name = 'справочник КБК'
verbose_name_plural = 'справочник КБК'