hoja-ruta.html
18.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
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<div class="crear-hoja-ruta foca-crear one-row row">
    <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0 col-lg-12">
        <div class="row">
            <div class="col-md-10 col-lg-12">
                <div class="row panel-informativo">
                    <div class="col-12">
                        <div class="row titulares">
                            <div class="col-12 col-sm-3 nota-pedido border border-left-0 border-white align-middle">
                                <h5 class="mb-0">HOJA DE RUTA</h5>
                            </div>
                            <div class="col-12 col-sm-3 numero-pedido text-center text-md-left border border-white align-middle"
                                >Nº {{puntoVenta}}-{{comprobante}}
                            </div>
                            <div class="col-7 col-sm-3 border border-white align-middle">
                                Fecha:
                                <span
                                    ng-show="!datepickerAbierto"
                                    ng-bind="now | date:'dd/MM/yyyy'"
                                    ng-click="datepickerAbierto = true"
                                >
                                </span>
                                <input
                                    ng-show="datepickerAbierto"
                                    type="date"
                                    ng-model="now"
                                    ng-change="datepickerAbierto = false"
                                    ng-blur="datepickerAbierto = false"
                                    class="form-control form-control-sm col-8 float-right"
                                    foca-focus="datepickerAbierto"
                                    hasta-hoy
                                />
                            </div>
                            <div class="col-5 col-sm-3 border border-white border-right-0 align-middle">
                                Hora:
                                <span
                                    ng-show="!datepickerAbierto"
                                    ng-bind="now | date:'HH:mm'"
                                    ng-click="datepickerAbierto = true"
                                >
                                </span>
                            </div>
                        </div>
                        <div class="row py-2">
                            <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera">
                                <span class="label" ng-bind="cab.label"></span>
                                <span class="valor" ng-bind="cab.valor"></span>
                            </div>
                            <a 
                                class="btn col-12 btn-secondary d-sm-none" 
                                ng-show="cabecera.length > 0"
                                ng-click="showCabecera = !showCabecera"
                            >
                                <i
                                    class="fa fa-chevron-down"
                                    ng-hide="showCabecera"
                                    aria-hidden="true"
                                >
                                </i>
                                <i
                                    class="fa fa-chevron-up"
                                    ng-show="showCabecera"
                                    aria-hidden="true">
                                </i>
                            </a>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
    </form>
    <div class="col-lg-12">
        <div class="row mt-4">
            <div class="col-12 col-md-10 border border-light rounded">
                <div class="row px-5 py-2 botonera-secundaria">
                    <div class="col-12">
                        <foca-botonera-facturador botones="botonera" extra="1" class="row"></foca-botonera-facturador>
                    </div>
                </div>
                <!-- PC -->
                <div class="row grilla-articulo align-items-end d-none d-sm-flex">
                    <table class="table tabla-articulo table-striped table-sm mb-0 rounded-bottom">
                        <thead>
                            <tr class="d-flex">
                                <th class="col-auto">#</th>
                                <th class="col-2">Remito</th>
                                <th class="col">Cliente</th>
                                <th class="col">Dirección</th>
                                <th class="text-right" style="width: 80px">Cantidad</th>
                                <th class="col-auto">
                                    <button
                                        class="btn btn-outline-light selectable"
                                        ng-click="show = !show; masMenos()"
                                    >
                                        <i
                                            class="fa fa-chevron-down"
                                            ng-show="show"
                                            aria-hidden="true"
                                        >
                                        </i>
                                        <i
                                            class="fa fa-chevron-up"
                                            ng-hide="show"
                                            aria-hidden="true">
                                        </i>
                                    </button>
                                </th>
                                </th>
                            </tr>
                        </thead>
                        <tbody class="tabla-articulo-body">
                            <tr
                                ng-repeat="(key, remito) in remitosTabla"
                                class="d-flex"
                                ng-show="show || key == remitosTabla.length - 1"
                            >
                                <td ng-bind="key + 1" class="col-auto"></td>
                                <td
                                    class="col-2" 
                                    ng-bind="rellenar(remito.sucursal, 4) + '-' + rellenar(remito.numeroRemito, 8)"
                                ></td>
                                <th class="col" ng-bind="remito.cliente[0].NOM"></th>
                                <th class="col" ng-bind="remito.domicilioStamp"></th>
                                <th class="text-right" ng-bind="remito.litros" style="width: 80px"></th>
                                <td class="text-center col-auto">
                                    <button
                                        class="btn btn-outline-light"
                                        ng-click="quitarArticulo(key)"
                                    >
                                        <i class="fa fa-trash"></i>
                                    </button>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr class="d-flex">
                                <td class="col-auto px-1">
                                    <strong>Remitos:</strong>
                                    <a ng-bind="remitosTabla.length"></a>
                                </td>
                                <td class="col"></td>
                                <td class="col-auto px-1">
                                    <strong>Cantidad:</strong>
                                    <a ng-bind="hojaRuta.litros"></a>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
    
                <!-- MOBILE -->
                <div class="row d-sm-none">
                    <table class="table table-sm table-striped tabla-articulo margin-bottom-mobile">
                        <thead>
                            <tr class="d-flex">
                                <th class="">#</th>
                                <th class="col px-0">
                                    <div class="d-flex">
                                        <div class="col-4 px-1">Código</div>
                                        <div class="col-8 px-1">Descripción</div>
                                    </div>
                                    <div class="d-flex">
                                        <div class="col-3 px-1">Cantidad</div>
                                        <div class="col px-1 text-right">P. Uni.</div>
                                        <div class="col px-1 text-right">Subtotal</div>
                                    </div>
                                </th>
                                <th class="text-center tamaño-boton">
                                     
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr 
                                ng-repeat="(key, articulo) in remitosTabla"
                                ng-show="show || key == remitosTabla.length - 1"
                            >
                                <td class="w-100 align-middle d-flex p-0">
                                    <div class="align-middle p-1">
                                        <span ng-bind="key+1" class="align-middle"></span>
                                    </div>
                                    <div class="col px-0">
                                        <div class="d-flex">
                                            <div class="col-4 px-1">
                                                <span 
                                                    ng-bind="articulo.sector + '-' + articulo.codigo"
                                                ></span>
                                            </div>
                                            <div class="col-8 px-1">
                                                <span ng-bind="articulo.descripcion"></span>
                                            </div>
                                        </div>
                                        <div class="d-flex">
                                            <div class="col-3 px-1">
                                                <span ng-bind="'x' + articulo.cantidad"></span>
                                            </div>
                                            <div class="col-3 px-1 text-right">
                                                <span ng-bind="articulo.precio | currency: hojaRuta.moneda.simbolo : 4"></span>
                                            </div>
                                            <div class="col px-1 text-right">
                                                <span 
                                                    ng-bind="(articulo.precio * articulo.cantidad) | currency: hojaRuta.moneda.simbolo"
                                                >
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="align-middle p-1">
                                        <button
                                            class="btn btn-outline-light"
                                            ng-click="quitarArticulo(key)"
                                        >
                                            <i class="fa fa-trash"></i>
                                        </button>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <!-- CARGANDO ITEM -->
                            <tr ng-show="!cargando" class="d-flex">
                                <td 
                                    class="align-middle p-1" 
                                    ng-bind="remitosTabla.length + 1"
                                ></td>
                                <td class="col p-0">
                                    <div class="d-flex">
                                        <div class="col-4 px-1">
                                            <span 
                                                ng-bind="articuloACargar.sectorCodigo"
                                            ></span>
                                        </div>
                                        <div class="col-8 px-1">
                                            <span ng-bind="articuloACargar.descripcion"></span>
                                        </div>
                                    </div>
                                    <div class="d-flex">
                                        <div class="col-3 px-1 m-1">
                                            <input
                                                class="form-control p-1"
                                                type="number"
                                                min="1"
                                                ng-model="articuloACargar.cantidad"
                                                foca-focus="!cargando"
                                                ng-keypress="agregarATabla($event.keyCode)"
                                                style="height: auto; line-height: 1.1em"
                                            >
                                        </div>
                                        <div class="col-3 px-1 text-right">
                                            <span ng-bind="articuloACargar.precio | currency: hojaRuta.moneda.simbolo : 4"></span>
                                        </div>
                                        <div class="col px-1 text-right">
                                            <span 
                                                ng-bind="getSubTotal() | currency: hojaRuta.moneda.simbolo"
                                            >
                                            </span>
                                        </div>
                                    </div>
                                </td>
                                <td class="text-center align-middle">
                                    <button
                                        class="btn btn-outline-light"
                                        ng-click="agregarATabla(13)"
                                    >
                                        <i class="fa fa-save"></i>
                                    </button>
                                </td>
                            </tr>
                            <!-- SELECCIONAR PRODUCTO -->
                            <tr ng-show="cargando" class="d-flex">
                                <td class="col-12">
                                    <input
                                        placeholder="Seleccione Articulo"
                                        class="form-control form-control-sm"
                                        readonly
                                        ng-click="seleccionarArticulo()"
                                    />
                                </td>
                            </tr>
                            <!-- TOOGLE EXPANDIR -->
                            <tr>
                                <td class="col">
                                    <button
                                        class="btn btn-outline-light selectable w-100"
                                        ng-click="show = !show; masMenos()"
                                        ng-show="remitosTabla.length > 0"
                                    >
                                        <i
                                            class="fa fa-chevron-down"
                                            ng-hide="show"
                                            aria-hidden="true"
                                        >
                                        </i>
                                        <i
                                            class="fa fa-chevron-up"
                                            ng-show="show"
                                            aria-hidden="true">
                                        </i>
                                    </button>
                                </td>
                            </tr>
                            <!-- FOOTER -->
                            <tr class="d-flex">
                                <td class="align-middle no-border-top" colspan="2">
                                    <strong>Cantidad Items:</strong>
                                    <a ng-bind="remitosTabla.length"></a>
                                </td>
                                <td class="text-right ml-auto table-celda-total no-border-top">
                                    <h3>Total:</h3>
                                </td>
                                <td class="table-celda-total text-right no-border-top">
                                    <h3>{{getTotal() | currency: hojaRuta.moneda.simbolo}}</h3>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
            <div class="col-auto my-2 col-lg-2 botonera-lateral d-none">
                <div class="col-12 mt-auto">
                    <button
                        ng-click="crearHojaRuta()"
                        type="submit"
                        title="Crear nota pedido"
                        class="btn btn-default btn-block mb-2 border border-dark">
                        <strong>GUARDAR</strong>
                    </button>
                    <button
                        type="submit"
                        title="Crear nota pedido"
                        class="btn btn-default btn-block mb-2 border border-dark">
                        <strong>PAUSAR</strong>
                    </button>
                    <button
                        ng-click="salir()"
                        type="button"
                        title="Salir"
                        class="btn btn-default btn-block border border-dark">
                        <strong>SALIR</strong>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div class="row d-md-none fixed-bottom">
        <div class="w-100 bg-dark d-flex px-3 acciones-mobile">
            <span class="ml-3 text-muted" ng-click="salir()">Salir</span>
            <span class="mr-3 ml-auto" ng-click="crearHojaRuta()">Guardar</span>
        </div>
    </div>
</div>