Fabs 11 years ago
parent
commit
a995fae5bf
1 changed files with 21 additions and 20 deletions
  1. 21 20
      coin/billing/models.py

+ 21 - 20
coin/billing/models.py

@@ -1,36 +1,37 @@
 from django.db import models
 
-# Create your models here.
 
-    
 class InvoceDetail(models.Model):
 
-    label= models.CharField(max_length=100)
-    amount = models.DecimalField( max_digits=5, decimal_places=2)
+    label = models.CharField(max_length=100)
+    amount = models.DecimalField(max_digits=5, decimal_places=2)
     quantity = models.IntegerField(null=True)
-    tax = models.IntegerField( null=True)
+    tax = models.IntegerField(null=True)
+
     def __unicode__(self):
         return self.label
 
+
 class Invoce(models.Model):
 
     INVOICES_STATUS_CHOICES = (
         ('open', 'A payer'),
-        ('Closed', 'regler'),
-        ('trouble', "litige"),
+        ('Closed', 'Reglée'),
+        ('trouble', 'Litige')
     )
-    status= models.CharField(max_length=50, choices=INVOICES_STATUS_CHOICES,default='open')
+
+    status = models.CharField(max_length=50, choices=INVOICES_STATUS_CHOICES,
+                              default='open')
     detail = models.ForeignKey(Invoces_Detail)
-    amount = models.DecimalField( max_digits=5, decimal_places=2)
-    date = models.DateField (auto_now_add=True, null=True)
-    period_from=models.DateField (auto_now_add=False, null=True)
-    period_to=models.DateField (auto_now_add=False, null=True)
-    date_due=models.DateField (auto_now_add=False, null=True)
-
-    
-        
+    amount = models.DecimalField(max_digits=5, decimal_places=2)
+    date = models.DateField(auto_now_add=True, null=True)
+    period_from = models.DateField(auto_now_add=False, null=True)
+    period_to = models.DateField(auto_now_add=False, null=True)
+    date_due = models.DateField(auto_now_add=False, null=True)
+
+
 class Payment(models.Model):
-    payment_means =models.CharField(max_length=100, null=True)
-    amount=  models.DecimalField( max_digits=7, decimal_places=2, null=True)
-    date=models.DateField(auto_now_add=True)
-    invoce =models.ForeignKey(Invoces)
+    payment_means = models.CharField(max_length=100, null=True)
+    amount = models.DecimalField(max_digits=7, decimal_places=2, null=True)
+    date = models.DateField(auto_now_add=True)
+    invoce = models.ForeignKey(Invoces)