-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathventas.html
executable file
·216 lines (214 loc) · 10.2 KB
/
ventas.html
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<div class="row" ng-init="initVentas()">
<div class="col s12 m12 l12 xl12">
<div class="card">
<div class="card-content">
<span class="card-title">Ventas activas</span>
<table id="data-table-ventas" class="striped bordered" cellspacing="0">
<thead>
<tr>
<th>Folio Venta</th>
<th>Clave Cliente</th>
<th>Nombre</th>
<th>Total</th>
<th>Fecha</th>
<th>Estatus</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="venta in ventas">
<td>{{venta.folio}}</td>
<td>{{venta.claveCliente}}</td>
<td>{{venta.nombreCliente}}</td>
<td>{{venta.total | currency : $ : 2}}</td>
<td>{{venta.fecha | date : 'dd/MM/yyyy HH:mm:ss'}}</td>
<td>{{venta.estatus === 1 ? 'Pendiente' : 'Pagada'}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="fixed-action-btn">
<a class="btn-floating btn-large blue">
<i class="large material-icons">add</i>
</a>
<ul>
<li>
<a class="btn-floating green" ng-click="modalNuevaVenta()">
<i class="large material-icons">add_shopping_cart</i>
</a>
</li>
</ul>
</div>
<div id="modalNuevaVenta" class="modal modal-fixed-footer">
<div class="modal-content">
<div ng-if="proceso === 'paso1'"> <!-- Paso 1 -->
<h4>Registro de ventas</h4>
<div class="row">
<div class="col s5 offset-s7 m3 offset-m9">
<b>Folio Venta: {{folioVenta}}</b>
</div>
</div>
<div class="row">
<div class="col s12 m7">
<div class="input-field col s12">
<i class="material-icons prefix">person</i>
<input autocomplete="off" type="text" id="autocomplete-input-cliente" class="autocomplete" placeholder="Buscar Cliente" ng-keyup="buscarCliente()">
<label for="autocomplete-input-cliente" class="active">Cliente</label>
</div>
</div>
<div class="col s12 m5" ng-show="clienteSeleccionado !== undefined">
<div class="input-field col s12">
<input id="rfc" type="text" class="validate" ng-model="clienteSeleccionado.rfc" disabled>
<label for="rfc" class="active">RFC</label>
</div>
</div>
</div>
<div class="row">
<div class="s12">
<div class="divider"></div>
</div>
</div>
<div class="row espacio-arriba-fila">
<div class="col s8 m7">
<div class="input-field col s12">
<i class="material-icons prefix">person</i>
<input autocomplete="off" type="text" id="autocomplete-input-articulo" class="autocomplete" placeholder="Buscar Artículo" ng-keyup="buscarArticulo()">
<label for="autocomplete-input-articulo" class="active">Artículo</label>
</div>
</div>
<div class="col s4 m5 espacio-arriba-boton" ng-show="articuloSeleccionado !== undefined">
<button class="btn waves-effect waves-light green white-text" ng-click="agregarArticulo()">
<i class="material-icons">add</i>
</button>
</div>
</div>
<div class="row">
<div class="s12">
<div class="divider"></div>
</div>
</div>
<div class="row">
<div class="col s12">
<table class="striped" cellspacing="0">
<thead>
<tr>
<th>Descripción Artículo</th>
<th>Modelo</th>
<th>Cantidad</th>
<th>Precio</th>
<th>Importe</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="articulo in detalleVenta">
<td>{{articulo.descripcion}}</td>
<td>{{articulo.modelo}}</td>
<td>
<div class="input-field ancho-cantidad">
<input focus-me="articulo.focus" type="number" ng-model="articulo.cantidad" class="center-align" min="1" minlength="1" ng-change="cambiarCantidad(articulo.id)">
</div>
</td>
<td>{{articulo.precio | number: 2}}</td>
<td>{{articulo.importe | number: 2}}</td>
<th><button class="btn-floating waves-effect waves-light red white-text" ng-click="eliminarArticulo(articulo)"><i class="material-icons">close</i></button></th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="s12">
<div class="divider"></div>
</div>
</div>
<div ng-if="detalleVenta !== undefined && detalleVenta.length > 0">
<div class="row espacio-arriba-fila-totales">
<div class="col s3 offset-s7 espacio-arriba-label right-align">
Enganche:
</div>
<div class="col s2">
<div class="ancho-cantidad">
<input type="text" ng-value="enganche | currency : $ : 2" class="right-align input-totales">
</div>
</div>
</div>
<div class="row">
<div class="col s3 offset-s7 espacio-arriba-label right-align">
Bonificación Enganche:
</div>
<div class="col s2">
<div class="ancho-cantidad">
<input type="text" ng-value="bonificacionEnganche | currency : $ : 2" class="right-align input-totales">
</div>
</div>
</div>
<div class="row">
<div class="col s3 offset-s7 espacio-arriba-label right-align">
Total:
</div>
<div class="col s2">
<div class="ancho-cantidad">
<input type="text" ng-value="totalAdeudo | currency : $ : 2" class="right-align input-totales">
</div>
</div>
</div>
</div>
</div>
<div ng-if="proceso === 'paso2'"> <!-- Paso 2 -->
<h4>Abonos Mensuales</h4>
<table class="responsive-table display bordered striped highlight" cellspacing="0">
<tbody>
<tr ng-repeat="plazo in plazos" ng-if="plazo.plazo <= plazoMaximo">
<td>{{plazo.plazo}} ABONOS DE</td>
<td>{{plazo.importeAbono | currency : $ : 2}}</td>
<td>TOTAL A PAGAR {{plazo.totalPagar | currency : $ : 2}}</td>
<td>SE AHORRA {{plazo.importeAhorra | currency : $ : 2}}</td>
<td>
<input class="with-gap" name="plazos" type="radio" value="{{plazo.plazo}}" ng-model="$parent.plazoSeleccionado" id="plazo-{{plazo.plazo}}" />
<label for="plazo-{{plazo.plazo}}"></label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<div class="input-field col s12 right-align" >
<button class="btn cyan darken-1 waves-effect waves-light" type="button" ng-click="cerrarModalVenta()" ng-if="proceso === 'paso1'">
<i class="material-icons left">close</i> Cancelar
</button>
<button class="btn green darken-1 waves-effect waves-light" type="button" ng-click="crearPlazos()" ng-if="proceso === 'paso1' && detalleVenta !== undefined && detalleVenta.length > 0">
<i class="material-icons right">arrow_forward</i> Siguiente
</button>
<button class="btn cyan darken-1 waves-effect waves-light" type="button" ng-click="atrasModalVenta()" ng-if="proceso === 'paso2'" ng-show="!cargando">
<i class="material-icons left">arrow_back</i> Atras
</button>
<button
class="btn green darken-1 waves-effect waves-light"
type="button"
ng-click="guardarVenta()"
ng-show="!cargando"
ng-if="proceso === 'paso2'">
<i class="material-icons right">save</i> Guardar
</button>
</div>
<div class="input-field col s12 right-align" ng-show="cargando">
<div class="preloader-wrapper small active">
<div class="spinner-layer spinner-green-only">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</div>
</div>
</div>