1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
<?
/*
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
*/
?>
<html>
<head>
<title>Galopin v1.0</title>
<link href="estilo.css" rel="stylesheet" type="text/css">
<script>
var miPopup
function abreVentana(){
miPopup = window.open("buscarproveedor.php","miwin","width=600,height=400,scrollbars=yes")
miPopup.focus()
}
</script>
</head>
<? include ("conectar.php");
include ("convertirfechas2.php");?>
<body>
<img src="images/nuevas/detallesalbaranesprov.jpg" alt="Detalles de Albaranes de Proveedor"><br>
<br>
<form name="form1" method="post" action="detalleproveedores.php">
<? if ($ini==1) {
$error=0;
include ("controlfecha1.php"); }
if ($error==1) {
print $errores; } ?>
<table align="center">
<tr>
<td width="33%" class="primeralineaizquierda"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Código
de proveedor:</font></td>
<td width="67%">
<? if ($ini==0) { ?>
<input name="codigo" type="text" id="codigo" size="10" maxlength="10">
<? } else { ?>
<input name="codigo" type="text" id="nombre" size="10" maxlength="10" value="<? echo $codigo; ?>">
<? } ?>
<a href="#"><img src="images/lupa.jpg" alt="Buscar Proveedor" width="17" height="17" border="0" onclick="abreVentana()"></a></td>
</td>
</tr>
<tr>
<td class="primeralineaizquierda"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Código
de albarán:</font></td>
<td>
<? if ($ini==0) { ?>
<input name="albaran" type="text" id="albaran" size="12" maxlength="12">
<? } else { ?>
<input name="albaran" type="text" id="albaran" size="12" maxlength="12" value="<? echo $albaran; ?>">
<? } ?>
</td></tr>
<tr>
<td class="primeralineaizquierda"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Fecha del
albarán:</font></td>
<td>Desde
<? if ($ini==0) { ?>
<input name="fecha1" type="text" id="fecha1" size="10" maxlength="10">
<? } else { ?>
<input name="fecha1" type="text" id="fecha1" size="10" maxlength="10" value="<? echo $fecha1; ?>">
<? } ?>
hasta
<? if ($ini==0) { ?>
<input name="fecha2" type="text" id="fecha2" size="10" maxlength="10">
<? } else { ?>
<input name="fecha2" type="text" id="fecha2" size="10" maxlength="10" value="<? echo $fecha2; ?>">
<? } ?>
</td></tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Buscar proveedores">
<input type="hidden" name="ini" value="1">
</div></td>
</tr>
</table>
</form>
<p>
<? if ($ini==1) {
$totales1=0;
$totales2=0;
$totales3=0;
$consulta = "Select * from albaranesp";
$consulta2 = "where codfactura='0'";
include ("cascadaalbaranesp.php");
$consulta = $consulta . " " . "order by fecha desc";
$resultado = mysql_query($consulta, $conexion);
$filas=mysql_num_rows($resultado);
print "<center><font size=2 face='Verdana, Arial, Helvetica, sans-serif'>Número de albaranes " . $filas . "</font></center>";
$resultado = mysql_query($consulta, $conexion);
?>
</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr bgcolor="#cddfed">
<td width="6%" align="center" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Cod.
Albarán</font></td>
<td width="20%" align="center" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Proveedor</font></td>
<td width="7%" align="center" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Importe</font></td>
<td width="7%" align="center" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">IVA</font></td>
<td width="7%" align="center" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Total</font></td>
<td width="7%" align="center" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Fecha</font></td>
</tr>
<? while ($lafila=mysql_fetch_array($resultado)) { ?>
<tr>
<?
$fech=$lafila["fecha"];
$fech=reconversion($fech);
$codcli=$lafila["codproveedor"];
$alba=$lafila["codalbaran"];
$ivaa=$lafila["iva"];
$ivaa=$ivaa/100;
$importea=0;
$importeivaa=0;
$totala=0;
$consulta0="select * from albalineap where codproveedor='$codcli' and codalbaran='$alba'";
$resultado0=mysql_query($consulta0,$conexion);
while ($lafila0=mysql_fetch_array($resultado0)) {
$importea=$importea + $lafila0["importe"];
$plus=$lafila0["importe"] * $ivaa;
$importeivaa=$importeivaa + $plus;
}
$totala=$importea + $importeivaa;
$totales1=$totales1 + $importea;
$totales2=$totales2 + $importeivaa;
$totales3=$totales3 + $totala;
$consulta1 = "select nombre from proveedores where codproveedor = '$codcli'";
$resultado1 = mysql_query($consulta1, $conexion);
$lafila1=mysql_fetch_array($resultado1); ?>
<td height="22" class="segundalinea"><font color="#FF0000"><b><? echo $lafila["codalbaran"]; ?></font></td>
<td class="segundalineaizquierda"><? echo $lafila1["nombre"]; ?></td>
<td class="segundalineaderecha"><? $importea= number_format($importea,2,",","."); echo $importea; ?></td>
<td class="segundalineaderecha"><? $importeivaa= number_format($importeivaa,2,",",".");echo $importeivaa; ?></td>
<td class="segundalineaderecha"><? $totala= number_format($totala,2,",",".");echo $totala; ?></td>
<td class="segundalinea"><? echo $fech; ?></td>
</tr>
<?
} ?>
</table>
<? }
$totales1= number_format($totales1,2,",",".");
$totales2= number_format($totales2,2,",",".");
$totales3= number_format($totales3,2,",",".");
?>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr bgcolor="#cddfed">
<td width="33%" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Total importe</font></td>
<td width="33%" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Total acumulado IVA</font></td>
<td width="33%" class="primeralinea"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Total Final</font></td>
</tr>
<tr bgcolor="#cddfed">
<td width="33%" class="segundalineaderecha"><font size="1" color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo $totales1; ?></b></font></td>
<td width="33%" class="segundalineaderecha"><font size="1" color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo $totales2; ?></b></font></td>
<td width="33%" class="segundalineaderecha"><font size="1" color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><b><? echo $totales3; ?></b></font></td>
</tr>
</table>
<? @mysql_free_result($resultado);
@mysql_free_result($resultado0);
@mysql_free_result($resultado1); ?>
</body>
</html>
|