From 38bb593949bab578fa6c7a6877ace7d4ba1428ad Mon Sep 17 00:00:00 2001 From: NeoRazorX Date: Tue, 12 Sep 2017 17:28:27 +0200 Subject: [PATCH] =?UTF-8?q?-=20Solucionado=20bug=20en=20nueva=5Fcompra.=20?= =?UTF-8?q?Estaba=20mostrando=20los=20descuentos=20extra=20de=20ventas.=20?= =?UTF-8?q?-=20A=C3=B1adida=20optimizaci=C3=B3n=20de=20la=20consulta=20de?= =?UTF-8?q?=20art=C3=ADculos=20sin=20vender=20en=20el=20informe=20de=20art?= =?UTF-8?q?=C3=ADculos.=20-=20Actualizada=20la=20versi=C3=B3n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/informe_articulos.php | 18 ++++--- facturascripts.ini | 2 +- view/block/nueva_compra.html | 2 +- view/block/nueva_venta.html | 2 +- view/block/table_lineas_nueva_compra.html | 50 +++++++++++++++++++ ...doc.html => table_lineas_nueva_venta.html} | 29 +++++------ view/{ => block}/ventas_albaran_lineas.html | 0 view/{ => block}/ventas_factura_lineas.html | 0 view/ventas_albaran.html | 2 +- view/ventas_factura.html | 2 +- 10 files changed, 80 insertions(+), 27 deletions(-) create mode 100644 view/block/table_lineas_nueva_compra.html rename view/block/{table_lineas_nuevodoc.html => table_lineas_nueva_venta.html} (88%) rename view/{ => block}/ventas_albaran_lineas.html (100%) rename view/{ => block}/ventas_factura_lineas.html (100%) diff --git a/controller/informe_articulos.php b/controller/informe_articulos.php index 1a4a056..53f327e 100644 --- a/controller/informe_articulos.php +++ b/controller/informe_articulos.php @@ -338,12 +338,18 @@ private function sin_vender() $toplist = $this->cache->get_array('top_articulos_sin_vender'); if (!$toplist) { $articulo = new articulo(); - $sql = "SELECT * FROM articulos WHERE sevende = true" - . " AND bloqueado = false AND stockfis > 0 AND referencia NOT IN " - . "(SELECT DISTINCT(referencia) FROM lineasfacturascli WHERE referencia IS NOT NULL" - . " AND idfactura IN (SELECT idfactura FROM facturascli" - . " WHERE fecha >= " . $articulo->var2str(Date('1-1-Y')) . "))" - . " ORDER BY stockfis DESC"; + $sql = "select * from (select a.*" + . " from " + . " articulos a " + . " left join (select lf.referencia" + . " from lineasfacturascli lf, facturascli f" + . " where" + . " lf.idfactura=f.idfactura and" + . " lf.referencia is not null and" + . " f.fecha >= " . $articulo->var2str(Date('1-1-Y')) + . " group by lf.referencia) as f1 on a.referencia=f1.referencia" + . " where" + . " f1.referencia is null order by a.stockfis desc) a"; $lineas = $this->db->select_limit($sql, FS_ITEM_LIMIT, 0); if ($lineas) { diff --git a/facturascripts.ini b/facturascripts.ini index 359a794..501a472 100644 --- a/facturascripts.ini +++ b/facturascripts.ini @@ -1,4 +1,4 @@ -version = 128 +version = 129 version_url = 'https://raw.githubusercontent.com/NeoRazorX/facturacion_base/master/facturascripts.ini' update_url = 'https://github.com/NeoRazorX/facturacion_base/archive/master.zip' wizard = 'base_wizard' diff --git a/view/block/nueva_compra.html b/view/block/nueva_compra.html index a9c4133..c78978c 100644 --- a/view/block/nueva_compra.html +++ b/view/block/nueva_compra.html @@ -130,7 +130,7 @@

- {include="block/table_lineas_nuevodoc"} + {include="block/table_lineas_nueva_compra"}
diff --git a/view/block/nueva_venta.html b/view/block/nueva_venta.html index 802eb6b..fd64958 100644 --- a/view/block/nueva_venta.html +++ b/view/block/nueva_venta.html @@ -145,7 +145,7 @@

- {include="block/table_lineas_nuevodoc"} + {include="block/table_lineas_nueva_venta"}
diff --git a/view/block/table_lineas_nueva_compra.html b/view/block/table_lineas_nueva_compra.html new file mode 100644 index 0000000..d203a9c --- /dev/null +++ b/view/block/table_lineas_nueva_compra.html @@ -0,0 +1,50 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ReferenciaDescripciónCantidadPrecioDto. %Neto{#FS_IVA#}RE %{#FS_IRPF#} %Total
+ + + + + + +
Totales
+
+
{$fsc->show_numero(0)}
+
+
{$fsc->show_numero(0)}
+
+
{$fsc->show_numero(0)}
+
+
{$fsc->show_numero(0)}
+
+ +
+
\ No newline at end of file diff --git a/view/block/table_lineas_nuevodoc.html b/view/block/table_lineas_nueva_venta.html similarity index 88% rename from view/block/table_lineas_nuevodoc.html rename to view/block/table_lineas_nueva_venta.html index 223ebd0..1873e82 100644 --- a/view/block/table_lineas_nuevodoc.html +++ b/view/block/table_lineas_nueva_venta.html @@ -29,10 +29,8 @@ - - - - + + @@ -53,38 +51,37 @@ -
{$fsc->show_numero(0)}
+
{$fsc->show_numero(0)}
- + - + - + - + - + -
{$fsc->show_numero(0)}
+
{$fsc->show_numero(0)}
-
{$fsc->show_numero(0)}
+
{$fsc->show_numero(0)}
-
{$fsc->show_numero(0)}
+
{$fsc->show_numero(0)}
-
{$fsc->show_numero(0)}
+
{$fsc->show_numero(0)}
- + diff --git a/view/ventas_albaran_lineas.html b/view/block/ventas_albaran_lineas.html similarity index 100% rename from view/ventas_albaran_lineas.html rename to view/block/ventas_albaran_lineas.html diff --git a/view/ventas_factura_lineas.html b/view/block/ventas_factura_lineas.html similarity index 100% rename from view/ventas_factura_lineas.html rename to view/block/ventas_factura_lineas.html diff --git a/view/ventas_albaran.html b/view/ventas_albaran.html index 366921d..169ef11 100644 --- a/view/ventas_albaran.html +++ b/view/ventas_albaran.html @@ -327,7 +327,7 @@
- {include="ventas_albaran_lineas"} + {include="block/ventas_albaran_lineas"}
diff --git a/view/ventas_factura.html b/view/ventas_factura.html index 34e90d1..01fb08e 100644 --- a/view/ventas_factura.html +++ b/view/ventas_factura.html @@ -300,7 +300,7 @@
- {include="ventas_factura_lineas"} + {include="block/ventas_factura_lineas"}