Timbres mes correct

This commit is contained in:
fjrodriguez
2022-12-02 08:30:09 -06:00
parent b3d4aab201
commit 4a1531d2c3
2 changed files with 8 additions and 7 deletions

View File

@@ -41,9 +41,11 @@ class Clientes(models.Model):
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()
def timbres_mes_count(self):
today = datetime.date.today()
month = today.month
year = today.year
return Timbres.objects.filter(rfcc=self.RFC, created_at__year=str(year),created_at__month=str(month)).count()
class Meta:
ordering = ('RFC',)