mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: taxa de serviço conticionado a configuração (que ainda não existe rs)
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load custom_filter_tag %}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +36,7 @@ Clientes
|
||||
|
||||
<tr>
|
||||
<td ><a id="name-{{client.id}}" href="{% url 'viewClient' client.id %}">{{client.name}}</a></td>
|
||||
<td id="debt-{{client.id}}" >R$ {{client.debt}}</td>
|
||||
<td id="debt-{{client.id}}" >R$ {{client.id | totalFiado}}</td>
|
||||
<td class="hide-on-mobile" id="contact-{{client.id}}" >{{client.contact}}</td>
|
||||
<td hidden id="active-{{client.id}}" >{{client.active}}</td>
|
||||
<td>
|
||||
|
||||
@@ -16,7 +16,7 @@ Comandas
|
||||
<body>
|
||||
<div style="justify-self: center;">
|
||||
<h4>{{client.name}}</h4>
|
||||
<h4>R$ {{total}}</h4>
|
||||
<h4>R$ {{client.id | totalFiado}}</h4>
|
||||
</div>
|
||||
|
||||
<div class=" ">
|
||||
|
||||
@@ -15,21 +15,24 @@ def clients(request):
|
||||
return render(request, 'clients.html', {'clients': clients})
|
||||
|
||||
def viewClient(request,clientId):
|
||||
# config = {
|
||||
# 'taxa': False
|
||||
# }
|
||||
client = Client.objects.get(id=int(clientId))
|
||||
comandas = Comanda.objects.filter(client = client).filter(status = 'FIADO')
|
||||
total = Decimal(0)
|
||||
for comanda in comandas:
|
||||
totalConsumo = 0
|
||||
totalParcial = 0
|
||||
consumo = ProductComanda.objects.filter(comanda=comanda)
|
||||
parcial = Payments.objects.filter(comanda=comanda)
|
||||
for p in parcial:
|
||||
totalParcial += p.value
|
||||
for produto in consumo:
|
||||
totalConsumo += produto.product.price
|
||||
total+= (totalConsumo - totalParcial)
|
||||
total+= round(total * Decimal(0.1), 2)
|
||||
return render(request, 'viewclient.html', {'total': total, 'client': client, 'comandas': comandas})
|
||||
# for comanda in comandas:
|
||||
# totalConsumo = 0
|
||||
# totalParcial = 0
|
||||
# consumo = ProductComanda.objects.filter(comanda=comanda)
|
||||
# parcial = Payments.objects.filter(comanda=comanda)
|
||||
# for p in parcial:
|
||||
# totalParcial += p.value
|
||||
# for produto in consumo:
|
||||
# totalConsumo += produto.product.price
|
||||
# total+= (totalConsumo - totalParcial)
|
||||
# total = total + round(total * Decimal(0.1), 2) if config['taxa'] else total
|
||||
return render(request, 'viewclient.html', {'client': client, 'comandas': comandas})
|
||||
|
||||
|
||||
@group_required(groupName='Gerente')
|
||||
|
||||
Reference in New Issue
Block a user