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"}