New functionality
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from django.db import models
|
||||
import datetime
|
||||
|
||||
|
||||
class saldoModel(models.Model):
|
||||
@@ -11,10 +12,11 @@ class Timbres(models.Model):
|
||||
rfcp = models.CharField(max_length=13)
|
||||
fecha = models.CharField(max_length=55)
|
||||
folio = models.CharField(max_length=55)
|
||||
serie = models.CharField(max_length=10)
|
||||
serie = models.CharField(max_length=10,blank=True)
|
||||
tipo = models.CharField(max_length=35)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ('-created_at',)
|
||||
|
||||
@@ -28,7 +30,7 @@ class ErroresTimbres(models.Model):
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
class Meta:
|
||||
ordering = ('uuid',)
|
||||
abstract = True
|
||||
|
||||
|
||||
class Clientes(models.Model):
|
||||
RFC = models.CharField(max_length=13, unique=True)
|
||||
@@ -36,9 +38,13 @@ class Clientes(models.Model):
|
||||
|
||||
|
||||
Activo = models.BooleanField(default=True)
|
||||
fecha_baja = models.DateField(blank=True)
|
||||
|
||||
fecha_baja = models.DateField(blank=True,null=True)
|
||||
|
||||
@property
|
||||
def timbres_mes_count(self):
|
||||
print('date',datetime.date.today())
|
||||
return Timbres.objects.filter(rfcc=self.RFC, created_at__gte=datetime.date.today()).count()
|
||||
class Meta:
|
||||
ordering = ('RFC',)
|
||||
abstract =True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user