chore: Delete numerous application modules, templates, static assets, documentation, and build files.

This commit is contained in:
2026-02-25 17:09:27 -03:00
parent 7ddaa2d1f9
commit 2fc4fafed7
562 changed files with 17 additions and 6810 deletions

23
clients/serializers.py Normal file
View File

@@ -0,0 +1,23 @@
from rest_framework import serializers
from .models import Client
from comandas.models import Comanda, ProductComanda
from payments.models import Payments, somar
from decimal import Decimal
class ClientSerializer(serializers.ModelSerializer):
debt = serializers.SerializerMethodField()
class Meta:
model = Client
fields = ['id', 'name', 'created_at', 'active', 'contact', 'debt']
def get_debt(self, obj):
comandas = Comanda.objects.filter(client=obj, status='FIADO')
total_debt = Decimal(0)
for comanda in comandas:
consumo = ProductComanda.objects.filter(comanda=comanda)
valores = somar(consumo, comanda)
total_debt += valores['totalSemTaxa']
return total_debt