51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
from django.db import models
|
|
import datetime
|
|
|
|
|
|
class saldoModel(models.Model):
|
|
saldo = models.IntegerField()
|
|
|
|
|
|
class Timbres(models.Model):
|
|
uuid = models.CharField(max_length=36, unique=True)
|
|
rfcc = models.CharField(max_length=13)
|
|
rfcp = models.CharField(max_length=13)
|
|
fecha = models.CharField(max_length=55)
|
|
folio = models.CharField(max_length=55)
|
|
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',)
|
|
|
|
|
|
class ErroresTimbres(models.Model):
|
|
uuid = models.CharField(max_length=36)
|
|
description = models.TextField()
|
|
rfcc = models.CharField(max_length=13)
|
|
folio = models.CharField(max_length=55)
|
|
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
class Meta:
|
|
ordering = ('uuid',)
|
|
|
|
|
|
class Clientes(models.Model):
|
|
RFC = models.CharField(max_length=13, unique=True)
|
|
Nombre = models.CharField(max_length=100)
|
|
|
|
|
|
Activo = models.BooleanField(default=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',)
|
|
|
|
|