[go: up one dir, main page]

Menu

[r33]: / admin / nueva_factura.php  Maximize  Restore  History

Download this file

174 lines (162 with data), 5.7 kB

  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
<?php
/*
* ABC ERP - Sistema ERP para PYMEs
* Copyright (C) 2013 Santiago Faci <santi@arkabytes.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<!-- Campos fecha -->
<script type="text/javascript">
$(function() {
$("#fecha").datepicker({dateFormat: 'dd-mm-yy'});
$("#fecha_vencimiento").datepicker({dateFormat: 'dd-mm-yy'});
});
</script>
<!-- Combo autorellenable -->
<script type="text/javascript">
$(function() {
$("#cliente").autocomplete({
source: "run/_buscar_cliente.php",
minLength: 2,
select: function(event, ui) {
}
});
});
</script>
<script type="text/javascript">
jQuery(function() {
$(document).ready(function() {
$('#cliente').focus();
});
});
$(function() {
$("#crear_cliente").button();
$("#crear_cliente").click(function() {
$("#dialogo_cliente").dialog("open");
});
});
$(function() {
$("#crear_articulo").button();
$("#crear_articulo").click(function() {
$("#dialogo_articulo").dialog("open");
});
});
$(function() {
$("#forma_pago").combobox();
});
</script>
<!-- Diálogos para ventanas emergentes -->
<?php
include ("../include/arkabytes/dialogo_cliente.php");
include ("../include/arkabytes/dialogo_articulo.php");
?>
<span class="titulocelda">Nueva Factura</span>
<form id="formulario" method="post" action="run/_nueva_factura.php">
<fieldset>
<span class="error">En esta versión, para crear facturas se debe crear primero un pedido, y generar la factura a partir de él</span>
<legend>Datos de Factura</legend>
<ol>
<li>
<label for="cliente"><strong>Cliente</strong></label>
<input type="text" name="cliente" id="cliente" class="required" size="30"/> <a href="#" id="crear_cliente" title="Dar de alta un Cliente">+</a>
</li>
<li>
<label>Número</label>
<input type="text" name="numero" id="numero" size="5"/>
</li>
<li>
<label><strong>Fecha</strong></label>
<input type="text" name="fecha" id="fecha" size="10" class="required"/> (dd-mm-aaaa)
<li>
<label>Fecha Vencimiento</label>
<input type="text" name="fecha_vencimiento" id="fecha_vencimiento" size="10"/> (dd-mm-aaaa)
</li>
<li>
<label for="estado">Estado</label>
<select name="estado" id="estado">
<option value="pendiente">Sin Pagar</option>
<option value="entregado">Pagada</option>
<option value="cancelado">Anulada</option>
</select>
</li>
<li>
<label>Comentario</label>
<textarea name="comentario" cols="30" rows="5"></textarea>
</li>
<li>
<label>Observaciones</label>
<textarea name="observaciones" cols="30" rows="5"></textarea>
</li>
<li>
<label>Importe</label>
<input type="text" name="importe" id="importe"/>
</li>
<li>
<label>Base Imponible</label>
<input type="text" name="base_imponible" id="base_imponible"/>
</li>
<li>
<label>IVA</label>
<input type="text" name="iva" id="iva"/>
</li>
<li>
<label>Forma Pago</label>
<select name="forma_pago" id="forma_pago">
<?php
require_once("../config/abc-config.php");
$bbdd = new BBDD();
$resultado = $bbdd->ejecuta_consulta("SELECT id, nombre FROM formas_pago");
if ($resultado->num_rows == 0) {
echo "<option>No hay Formas de Pago</option>";
}
else {
while ($fila = $resultado->fetch_array()) {
echo "<option value='" . $fila["nombre"] ."'>" . $fila["nombre"] . "</option>";
}
}
$resultado->close();
?>
</select>
</li>
</ol>
</fieldset>
<fieldset class="submit">
<input type="submit" value="Enviar"/>
</fieldset>
</form>
<div id="mensaje"></div>
<div id="resultado"></div>
<br/>
<form id="formulario" method="post" action="run/_nuevo_detalle_factura.php">
<fieldset>
<legend>Artículos</legend>
<ol>
<li>
<label>Artículo</label>
<input type="text" name="articulo" size="30"/> <a href="#" id="crear_articulo" title="Dar de alta un Artículo">+</a>
</li>
<li>
<label>Cantidad</label>
<input type="text" name="cantidad" size="4"/>
<input type="hidden" name="id_pedido" value="<?php echo $id_pedido; ?>"/>
<input style="float: right" type="image" src="icons/anadir32.png" value="Añadir"/>
</li>
</ol>
</fieldset>
</form>
<form id="formulario" method="post" action="run/_terminar_factura.php">
<input style="float: right" type="submit" value="Terminar Factura"/>
</form>