/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Autores: Pedro Obregón Mejías
Rubén D. Mancera Morán
Versión: 1.0
Fecha Liberación del código: 13/07/2004
Galopín para gnuLinEx 2004 -- Extremadura
*/
?>
Galopin v1.0
include ("conectar.php");
include ("convertirfechas.php");
include ("convertirfechas2.php");?>
if ($ini==1) {
if (!empty($codigo)) { ?>
FACTURAS
Cliente
Cód Factura
Cantidad de artículos
if (empty($fecha1)) { $fecha1="01/01/1970"; }
if (empty($fecha2)) { $fecha2=date("d/m/Y"); }
$fecha1=conversion($fecha1);
$fecha2=conversion($fecha2);
$familia = substr($codigo,0,2);
$subfamilia = substr($codigo,2,2);
$codigoarticulo = substr($codigo,4,2);
$consulta2 = "select * from articulos where codfamilia='$familia' and codsubfamilia='$subfamilia' and codigo='$codigoarticulo'";
$resultado2 = mysql_query($consulta2, $conexion);
$filas2=mysql_num_rows($resultado2);
if ($filas2>0) {
$consulta = "Select clientes.nombre,facturas.codfactura,factulinea.cantidad from clientes,facturas,factulinea where
clientes.codcliente=facturas.codcliente and facturas.codfactura=factulinea.codfactura and factulinea.codfamilia='$familia' and
factulinea.codsubfamilia='$subfamilia' and factulinea.codigo='$codigoarticulo' and fecha >= '$fecha1' and fecha <= '$fecha2'";
$resultado = mysql_query($consulta, $conexion);
while ($lafila=mysql_fetch_array($resultado)) { ?>
if ($filas2>0) {
$consulta = "Select clientes.nombre,albaranes.codalbaran,albalinea.cantidad from clientes,albaranes,albalinea where
albaranes.codfactura=0 and clientes.codcliente=albaranes.codcliente and albaranes.codalbaran=albalinea.codalbaran and albalinea.codfamilia='$familia' and
albalinea.codsubfamilia='$subfamilia' and albalinea.codigo='$codigoarticulo' and fecha >= '$fecha1' and fecha <= '$fecha2'";
$resultado = mysql_query($consulta, $conexion);
while ($lafila=mysql_fetch_array($resultado)) { ?>
if ($filas2>0) {
$consulta = "Select clientes.nombre,partes.codparte,partelinea.cantidad from clientes,partes,partelinea where
partes.codalbaran=0 and clientes.codcliente=partes.codcliente and partes.codparte=partelinea.codparte and partelinea.codfamilia='$familia' and
partelinea.codsubfamilia='$subfamilia' and partelinea.codigo='$codigoarticulo' and fecha >= '$fecha1' and fecha <= '$fecha2'";
$resultado = mysql_query($consulta, $conexion);
while ($lafila=mysql_fetch_array($resultado)) { ?>