|
@@ -25,6 +25,8 @@ class _VentaScreenState extends State<VentaScreen> {
|
|
|
double totalEfectivoDelDia = 0.0;
|
|
|
double totalTarjetaDelDia = 0.0;
|
|
|
double totalTransferenciaDelDia = 0.0;
|
|
|
+ double cambio = 0.0;
|
|
|
+ double totalSinCambio = 0.0;
|
|
|
|
|
|
String formatCurrency(double amount) {
|
|
|
final format = NumberFormat("#,##0.00", "es_MX");
|
|
@@ -200,33 +202,46 @@ class _VentaScreenState extends State<VentaScreen> {
|
|
|
fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
),
|
|
|
),
|
|
|
- if (totalEfectivoDelDia > 0)
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.all(16.0),
|
|
|
- child: Text(
|
|
|
- "Total en Efectivo: \$${formatCurrency(totalEfectivoDelDia)}",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- ),
|
|
|
- if (totalTarjetaDelDia > 0)
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.all(16.0),
|
|
|
- child: Text(
|
|
|
- "Total en Tarjeta: \$${formatCurrency(totalTarjetaDelDia)}",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- ),
|
|
|
- if (totalTransferenciaDelDia > 0)
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.all(16.0),
|
|
|
- child: Text(
|
|
|
- "Total en Transferencia: \$${formatCurrency(totalTransferenciaDelDia)}",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ if (totalTarjetaDelDia > 0)
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.all(16.0),
|
|
|
+ child: Text(
|
|
|
+ "Total en Tarjeta: \$${formatCurrency(totalTarjetaDelDia)}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ if (totalTransferenciaDelDia > 0)
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.all(16.0),
|
|
|
+ child: Text(
|
|
|
+ "Total en Transferencia: \$${formatCurrency(totalTransferenciaDelDia)}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ if (totalEfectivoDelDia > 0)
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.all(16.0),
|
|
|
+ child: Text(
|
|
|
+ "Total en Efectivo: \$${formatCurrency(totalEfectivoDelDia)}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ if (cambio > 0)
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.all(16.0),
|
|
|
+ child: Text(
|
|
|
+ "Cambio Entregado: \$${formatCurrency(cambio)}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 20, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
if (totalCancelados > 0)
|
|
|
Padding(
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
@@ -276,14 +291,23 @@ class _VentaScreenState extends State<VentaScreen> {
|
|
|
totalEfectivoDelDia = 0.0;
|
|
|
totalTarjetaDelDia = 0.0;
|
|
|
totalTransferenciaDelDia = 0.0;
|
|
|
+ cambio = 0.0;
|
|
|
+ totalSinCambio = 0.0;
|
|
|
|
|
|
for (var pedido in pedidosNoCancelados) {
|
|
|
totalDelDia += pedido.totalPedido ?? 0.0;
|
|
|
totalEfectivoDelDia += pedido.cantEfectivo ?? 0.0;
|
|
|
totalTarjetaDelDia += pedido.cantTarjeta ?? 0.0;
|
|
|
totalTransferenciaDelDia += pedido.cantTransferencia ?? 0.0;
|
|
|
+ totalSinCambio =
|
|
|
+ totalEfectivoDelDia + totalTarjetaDelDia + totalTransferenciaDelDia;
|
|
|
+
|
|
|
+ cambio = totalSinCambio - totalDelDia;
|
|
|
}
|
|
|
|
|
|
+ print("Total del dia sin cambios $totalSinCambio");
|
|
|
+ print("Cambio $cambio");
|
|
|
+
|
|
|
totalCancelados = pedidosCancelados.fold(
|
|
|
0.0, (sum, current) => sum + (current.totalPedido ?? 0.0));
|
|
|
|