From 4743b2a351dbb416e90ae16ed51c8aa20655c174 Mon Sep 17 00:00:00 2001 From: Kev1nByte Date: Wed, 19 Jul 2023 19:53:19 -0500 Subject: [PATCH] Sales report - Pt2 --- views/modulos/grafico-ventas.php | 0 views/modulos/reportes/grafico-ventas.php | 60 +++++++++++++++++------ 2 files changed, 45 insertions(+), 15 deletions(-) delete mode 100644 views/modulos/grafico-ventas.php diff --git a/views/modulos/grafico-ventas.php b/views/modulos/grafico-ventas.php deleted file mode 100644 index e69de29b..00000000 diff --git a/views/modulos/reportes/grafico-ventas.php b/views/modulos/reportes/grafico-ventas.php index 53ea89a3..46bce1d2 100644 --- a/views/modulos/reportes/grafico-ventas.php +++ b/views/modulos/reportes/grafico-ventas.php @@ -22,13 +22,29 @@ foreach ($respuesta as $key => $value) { + #Capturamos sólo el año y el mes + $fecha = substr($value["fecha"],0,7); + + #Introducir las fechas en arrayFechas + array_push($arrayFechas, $fecha); + + #Capturamos las ventas + $arrayVentas = array($fecha => $value["total"]); + + #Sumamos los pagos que ocurrieron el mismo mes + foreach ($arrayVentas as $key => $value) { + + $sumaPagosMes[$key] += $value; + + } } + $noRepetirFechas = array_unique($arrayFechas); -?> +?>
@@ -45,30 +61,42 @@
-
+ \ No newline at end of file