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 @@
Referencia | +Descripción | +Cantidad | ++ | Precio | +Dto. % | +Neto | +{#FS_IVA#} | +RE % | +{#FS_IRPF#} % | +Total | +
---|---|---|---|---|---|---|---|---|---|---|
+ + | ++ + + + | +
+ Totales
+ |
+
+ {$fsc->show_numero(0)}
+ |
+
+ {$fsc->show_numero(0)}
+ |
+
+ {$fsc->show_numero(0)}
+ |
+
+ {$fsc->show_numero(0)}
+ |
+ + + | +