Commit 0a9bc7e3bb868a7ddf935c77a5cb5db10b1336b8
Exists in
master
Merge branch 'master' of https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido
Showing
2 changed files
Show diff stats
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const clean = require('gulp-clean'); | 2 | const clean = require('gulp-clean'); |
3 | const concat = require('gulp-concat'); | 3 | const concat = require('gulp-concat'); |
4 | const htmlmin = require('gulp-htmlmin'); | 4 | const htmlmin = require('gulp-htmlmin'); |
5 | const rename = require('gulp-rename'); | 5 | const rename = require('gulp-rename'); |
6 | const uglify = require('gulp-uglify'); | 6 | const uglify = require('gulp-uglify'); |
7 | const gulp = require('gulp'); | 7 | const gulp = require('gulp'); |
8 | const pump = require('pump'); | 8 | const pump = require('pump'); |
9 | const jshint = require('gulp-jshint'); | 9 | const jshint = require('gulp-jshint'); |
10 | const replace = require('gulp-replace'); | 10 | const replace = require('gulp-replace'); |
11 | const connect = require('gulp-connect'); | 11 | const connect = require('gulp-connect'); |
12 | 12 | ||
13 | var paths = { | 13 | var paths = { |
14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
17 | dist: 'dist/' | 17 | dist: 'dist/' |
18 | }; | 18 | }; |
19 | 19 | ||
20 | gulp.task('templates', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], function() { |
21 | return pump( | 21 | return pump( |
22 | [ | 22 | [ |
23 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
24 | htmlmin(), | 24 | htmlmin(), |
25 | templateCache('views.js', { | 25 | templateCache('views.js', { |
26 | module: 'focaCrearNotaPedido', | 26 | module: 'focaCrearNotaPedido', |
27 | root: '' | 27 | root: '' |
28 | }), | 28 | }), |
29 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
30 | ] | 30 | ] |
31 | ); | 31 | ); |
32 | }); | 32 | }); |
33 | 33 | ||
34 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
35 | return pump( | 35 | return pump( |
36 | [ | 36 | [ |
37 | gulp.src([ | 37 | gulp.src([ |
38 | paths.srcJS, | 38 | paths.srcJS, |
39 | 'tmp/views.js' | 39 | 'tmp/views.js' |
40 | ]), | 40 | ]), |
41 | concat('foca-crear-nota-pedido.js'), | 41 | concat('foca-crear-nota-pedido.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
44 | rename('foca-crear-nota-pedido.min.js'), | 44 | rename('foca-crear-nota-pedido.min.js'), |
45 | uglify(), | 45 | uglify(), |
46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ | 47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ | 48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ |
49 | '"angular-ladda"', ''), | 49 | '"angular-ladda"', ''), |
50 | gulp.dest(paths.dist) | 50 | gulp.dest(paths.dist) |
51 | ] | 51 | ] |
52 | ); | 52 | ); |
53 | }); | 53 | }); |
54 | 54 | ||
55 | gulp.task('clean', function(){ | 55 | gulp.task('clean', function(){ |
56 | return gulp.src(['tmp', 'dist'], {read: false}) | 56 | return gulp.src(['tmp', 'dist'], {read: false}) |
57 | .pipe(clean()); | 57 | .pipe(clean()); |
58 | }); | 58 | }); |
59 | 59 | ||
60 | gulp.task('pre-commit', function() { | 60 | gulp.task('pre-commit', function() { |
61 | return pump( | 61 | return pump( |
62 | [ | 62 | [ |
63 | gulp.src(paths.srcJS), | 63 | gulp.src(paths.srcJS), |
64 | jshint('.jshintrc'), | 64 | jshint('.jshintrc'), |
65 | jshint.reporter('default'), | 65 | jshint.reporter('default'), |
66 | jshint.reporter('fail') | 66 | jshint.reporter('fail') |
67 | ] | 67 | ] |
68 | ); | 68 | ); |
69 | 69 | ||
70 | gulp.start('uglify'); | 70 | gulp.start('uglify'); |
71 | }); | 71 | }); |
72 | 72 | ||
73 | gulp.task('webserver', function() { | 73 | gulp.task('webserver', function() { |
74 | pump [ | 74 | pump [ |
75 | connect.server({port: 3000}) | 75 | connect.server({port: 3300, host: '0.0.0.0'}) |
76 | ] | 76 | ] |
77 | }); | 77 | }); |
78 | 78 | ||
79 | gulp.task('clean-post-install', function() { | 79 | gulp.task('clean-post-install', function() { |
80 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 80 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
81 | 'index.html'], {read: false}) | 81 | 'index.html'], {read: false}) |
82 | .pipe(clean()); | 82 | .pipe(clean()); |
83 | }); | 83 | }); |
84 | 84 | ||
85 | gulp.task('default', ['webserver']); | 85 | gulp.task('default', ['webserver']); |
86 | 86 | ||
87 | gulp.task('watch', function() { | 87 | gulp.task('watch', function() { |
88 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 88 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
89 | }); | 89 | }); |
90 | 90 |
src/views/nota-pedido.html
1 | <div class="crear-nota-pedido"> | 1 | <div class="crear-nota-pedido"> |
2 | <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> | 2 | <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> |
3 | <div class="row"> | 3 | <div class="row"> |
4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> | 4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> |
5 | <div class="row p-1 panel-informativo"> | 5 | <div class="row p-1 panel-informativo"> |
6 | <div class="col-12"> | 6 | <div class="col-12"> |
7 | <div class="row"> | 7 | <div class="row"> |
8 | <div class="col-12 col-sm-4 nota-pedido"> | 8 | <div class="col-12 col-sm-4 nota-pedido"> |
9 | <h5>NOTA DE PEDIDO</h5> | 9 | <h5>NOTA DE PEDIDO</h5> |
10 | </div> | 10 | </div> |
11 | <div class="col-6 col-sm-4 numero-pedido">Nº {{puntoVenta}}-{{comprobante}}</div> | 11 | <div class="col-5 col-sm-4 numero-pedido" |
12 | <div class="col-6 col-sm-4 text-right crear-nota-pedido-fecha"> | 12 | >Nº {{puntoVenta}}-{{comprobante}} |
13 | </div> | ||
14 | <div class="col-7 col-sm-4 text-right"> | ||
13 | Fecha: | 15 | Fecha: |
14 | <span | 16 | <span |
15 | ng-show="!datepickerAbierto" | 17 | ng-show="!datepickerAbierto" |
16 | ng-bind="now | date:'dd/MM/yyyy HH:mm'" | 18 | ng-bind="now | date:'dd/MM/yyyy HH:mm'" |
17 | ng-click="datepickerAbierto = true" | 19 | ng-click="datepickerAbierto = true" |
18 | > | 20 | > |
19 | </span> | 21 | </span> |
20 | <input | 22 | <input |
21 | ng-show="datepickerAbierto" | 23 | ng-show="datepickerAbierto" |
22 | type="date" | 24 | type="date" |
23 | ng-model="now" | 25 | ng-model="now" |
24 | ng-change="datepickerAbierto = false" | 26 | ng-change="datepickerAbierto = false" |
25 | ng-blur="datepickerAbierto = false" | 27 | ng-blur="datepickerAbierto = false" |
26 | class="form-control form-control-sm col-8 float-right" | 28 | class="form-control form-control-sm col-8 float-right" |
27 | foca-focus="datepickerAbierto" | 29 | foca-focus="datepickerAbierto" |
28 | hasta-hoy | 30 | hasta-hoy |
29 | /> | 31 | /> |
30 | </div> | 32 | </div> |
31 | </div> | 33 | </div> |
32 | <div class="row"> | 34 | <div class="row"> |
33 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> | 35 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> |
34 | <span class="label" ng-bind="cab.label"></span> | 36 | <span class="label" ng-bind="cab.label"></span> |
35 | <span class="valor" ng-bind="cab.valor"></span> | 37 | <span class="valor" ng-bind="cab.valor"></span> |
36 | </div> | 38 | </div> |
37 | <a | 39 | <a |
38 | class="btn col-12 btn-secondary d-sm-none" | 40 | class="btn col-12 btn-secondary d-sm-none" |
39 | ng-show="cabecera.length > 0" | 41 | ng-show="cabecera.length > 0" |
40 | ng-click="showCabecera = !showCabecera" | 42 | ng-click="showCabecera = !showCabecera" |
41 | > | 43 | > |
42 | <i | 44 | <i |
43 | class="fa fa-chevron-down" | 45 | class="fa fa-chevron-down" |
44 | ng-hide="showCabecera" | 46 | ng-hide="showCabecera" |
45 | aria-hidden="true" | 47 | aria-hidden="true" |
46 | > | 48 | > |
47 | </i> | 49 | </i> |
48 | <i | 50 | <i |
49 | class="fa fa-chevron-up" | 51 | class="fa fa-chevron-up" |
50 | ng-show="showCabecera" | 52 | ng-show="showCabecera" |
51 | aria-hidden="true"> | 53 | aria-hidden="true"> |
52 | </i> | 54 | </i> |
53 | </a> | 55 | </a> |
54 | </div> | 56 | </div> |
55 | </div> | 57 | </div> |
56 | </div> | 58 | </div> |
57 | <div class="row p-1 botonera-secundaria"> | 59 | <div class="row p-1 botonera-secundaria"> |
58 | <div class="col-12"> | 60 | <div class="col-12"> |
59 | <div class="row"> | 61 | <div class="row"> |
60 | <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera"> | 62 | <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera"> |
61 | <button | 63 | <button |
62 | type="button" | 64 | type="button" |
63 | class="btn btn-default btn-block btn-xs text-left py-2" | 65 | class="btn btn-default btn-block btn-xs text-left py-2" |
64 | ng-click="boton.accion()" | 66 | ng-click="boton.accion()" |
65 | ng-class="{'d-none d-sm-block': boton.texto == ''}" | 67 | ng-class="{'d-none d-sm-block': boton.texto == ''}" |
66 | > | 68 | > |
67 | <i | 69 | <i |
68 | class="fa fa-arrow-circle-right" | 70 | class="fa fa-arrow-circle-right" |
69 | ng-show="boton.texto != ''" | 71 | ng-show="boton.texto != ''" |
70 | ></i> | 72 | ></i> |
71 | | 73 | |
72 | {{boton.texto}} | 74 | {{boton.texto}} |
73 | </button> | 75 | </button> |
74 | </div> | 76 | </div> |
75 | </div> | 77 | </div> |
76 | </div> | 78 | </div> |
77 | </div> | 79 | </div> |
78 | </div> | 80 | </div> |
79 | </div> | 81 | </div> |
80 | </form> | 82 | </form> |
81 | <div class="row"> | 83 | <div class="row"> |
82 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 84 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
83 | <!-- PC --> | 85 | <!-- PC --> |
84 | <div class="row grilla-articulo align-items-end"> | 86 | <div class="row grilla-articulo align-items-end d-none d-sm-flex"> |
85 | <table class="table tabla-articulo table-striped table-sm table-dark mb-0"> | 87 | <table class="table tabla-articulo table-striped table-sm table-dark"> |
86 | <thead> | 88 | <thead> |
87 | <tr class="d-flex"> | 89 | <tr class="d-flex"> |
88 | <th class="">#</th> | 90 | <th class="">#</th> |
89 | <th class="col">Código</th> | 91 | <th class="col">Código</th> |
90 | <th class="col-4">Descripción</th> | 92 | <th class="col-4">Descripción</th> |
91 | <th class="col text-right">Cantidad</th> | 93 | <th class="col text-right">Cantidad</th> |
92 | <th class="col text-right">Precio Unitario</th> | 94 | <th class="col text-right">Precio Unitario</th> |
93 | <th class="col text-right">SubTotal</th> | 95 | <th class="col text-right">SubTotal</th> |
94 | <th class="text-right"> | 96 | <th class="text-right"> |
95 | <button | 97 | <button |
96 | class="btn btn-outline-secondary selectable" | 98 | class="btn btn-outline-secondary selectable" |
97 | ng-click="show = !show; masMenos()" | 99 | ng-click="show = !show; masMenos()" |
98 | > | 100 | > |
99 | <i | 101 | <i |
100 | class="fa fa-chevron-down" | 102 | class="fa fa-chevron-down" |
101 | ng-show="show" | 103 | ng-show="show" |
102 | aria-hidden="true" | 104 | aria-hidden="true" |
103 | > | 105 | > |
104 | </i> | 106 | </i> |
105 | <i | 107 | <i |
106 | class="fa fa-chevron-up" | 108 | class="fa fa-chevron-up" |
107 | ng-hide="show" | 109 | ng-hide="show" |
108 | aria-hidden="true"> | 110 | aria-hidden="true"> |
109 | </i> | 111 | </i> |
110 | </button> | 112 | </button> |
111 | </th> | 113 | </th> |
112 | </tr> | 114 | </tr> |
113 | </thead> | 115 | </thead> |
114 | <tbody class="tabla-articulo-body"> | 116 | <tbody class="tabla-articulo-body"> |
115 | <tr | 117 | <tr |
116 | ng-repeat="(key, articulo) in articulosTabla" | 118 | ng-repeat="(key, articulo) in articulosTabla" |
117 | ng-show="show || key == (articulosTabla.length - 1)" | 119 | ng-show="show || key == (articulosTabla.length - 1)" |
118 | class="d-flex" | 120 | class="d-flex" |
119 | > | 121 | > |
120 | <td ng-bind="key + 1"></td> | 122 | <td ng-bind="key + 1"></td> |
121 | <td | 123 | <td |
122 | class="col" | 124 | class="col" |
123 | ng-bind="articulo.sector + '-' + articulo.codigo" | 125 | ng-bind="articulo.sector + '-' + articulo.codigo" |
124 | ></td> | 126 | ></td> |
125 | <td | 127 | <td |
126 | class="col-4" | 128 | class="col-4" |
127 | ng-bind="articulo.descripcion" | 129 | ng-bind="articulo.descripcion" |
128 | ></td> | 130 | ></td> |
129 | <td class="col text-right"> | 131 | <td class="col text-right"> |
130 | <input | 132 | <input |
131 | ng-show="articulo.editCantidad" | 133 | ng-show="articulo.editCantidad" |
132 | ng-model="articulo.cantidad" | 134 | ng-model="articulo.cantidad" |
133 | class="form-control" | 135 | class="form-control" |
134 | type="number" | 136 | type="number" |
135 | min="1" | 137 | min="1" |
136 | foca-focus="articulo.editCantidad" | 138 | foca-focus="articulo.editCantidad" |
137 | ng-keypress="editarArticulo($event.keyCode, articulo)" | 139 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
138 | ng-focus="selectFocus($event)" | 140 | ng-focus="selectFocus($event)" |
139 | > | 141 | > |
140 | <i | 142 | <i |
141 | class="selectable" | 143 | class="selectable" |
142 | ng-click="cambioEdit(articulo, 'cantidad')" | 144 | ng-click="cambioEdit(articulo, 'cantidad')" |
143 | ng-hide="articulo.editCantidad" | 145 | ng-hide="articulo.editCantidad" |
144 | ng-bind="articulo.cantidad"> | 146 | ng-bind="articulo.cantidad"> |
145 | </i> | 147 | </i> |
146 | </td> | 148 | </td> |
147 | <td class="col text-right"> | 149 | <td class="col text-right"> |
148 | <input | 150 | <input |
149 | ng-show="articulo.editPrecio" | 151 | ng-show="articulo.editPrecio" |
150 | ng-model="articulo.precio" | 152 | ng-model="articulo.precio" |
151 | class="form-control" | 153 | class="form-control" |
152 | type="number" | 154 | type="number" |
153 | min="1" | 155 | min="1" |
154 | step="0.01" | 156 | step="0.01" |
155 | foca-focus="articulo.editPrecio" | 157 | foca-focus="articulo.editPrecio" |
156 | ng-keypress="editarArticulo($event.keyCode, articulo)" | 158 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
157 | ng-focus="selectFocus($event)" | 159 | ng-focus="selectFocus($event)" |
158 | > | 160 | > |
159 | <i | 161 | <i |
160 | class="selectable" | 162 | class="selectable" |
161 | ng-click="idLista == -1 && cambioEdit(articulo, 'precio')" | 163 | ng-click="idLista == -1 && cambioEdit(articulo, 'precio')" |
162 | ng-hide="articulo.editPrecio" | 164 | ng-hide="articulo.editPrecio" |
163 | ng-bind="articulo.precio"> | 165 | ng-bind="articulo.precio"> |
164 | </i> | 166 | </i> |
165 | </td> | 167 | </td> |
166 | <td | 168 | <td |
167 | class="col text-right" | 169 | class="col text-right" |
168 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> | 170 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> |
169 | </td> | 171 | </td> |
170 | <td class="text-center"> | 172 | <td class="text-center"> |
171 | <button | 173 | <button |
172 | class="btn btn-outline-secondary" | 174 | class="btn btn-outline-secondary" |
173 | ng-click="quitarArticulo(key)" | 175 | ng-click="quitarArticulo(key)" |
174 | > | 176 | > |
175 | <i class="fa fa-trash"></i> | 177 | <i class="fa fa-trash"></i> |
176 | </button> | 178 | </button> |
177 | </td> | 179 | </td> |
178 | </tr> | 180 | </tr> |
179 | </tbody> | 181 | </tbody> |
180 | <tfoot> | 182 | <tfoot> |
181 | <tr ng-show="!cargando" class="d-flex"> | 183 | <tr ng-show="!cargando" class="d-flex"> |
182 | <td | 184 | <td |
183 | class="align-middle" | 185 | class="align-middle" |
184 | ng-bind="articulosTabla.length + 1" | 186 | ng-bind="articulosTabla.length + 1" |
185 | ></td> | 187 | ></td> |
186 | <td class="col"> | 188 | <td class="col"> |
187 | <input | 189 | <input |
188 | class="form-control" | 190 | class="form-control" |
189 | ng-model="articuloACargar.sectorCodigo" | 191 | ng-model="articuloACargar.sectorCodigo" |
190 | readonly | 192 | readonly |
191 | > | 193 | > |
192 | </td> | 194 | </td> |
193 | <td class="col-4 tabla-articulo-descripcion"> | 195 | <td class="col-4 tabla-articulo-descripcion"> |
194 | <input | 196 | <input |
195 | class="form-control" | 197 | class="form-control" |
196 | ng-model="articuloACargar.descripcion" | 198 | ng-model="articuloACargar.descripcion" |
197 | readonly | 199 | readonly |
198 | > | 200 | > |
199 | </td> | 201 | </td> |
200 | <td class="col text-right"> | 202 | <td class="col text-right"> |
201 | <input | 203 | <input |
202 | class="form-control" | 204 | class="form-control" |
203 | type="number" | 205 | type="number" |
204 | min="1" | 206 | min="1" |
205 | ng-model="articuloACargar.cantidad" | 207 | ng-model="articuloACargar.cantidad" |
206 | foca-focus="!cargando" | 208 | foca-focus="!cargando" |
207 | esc-key="resetFilter()" | 209 | esc-key="resetFilter()" |
208 | ng-keypress="agregarATabla($event.keyCode)" | 210 | ng-keypress="agregarATabla($event.keyCode)" |
209 | > | 211 | > |
210 | </td> | 212 | </td> |
211 | <td class="col text-right"> | 213 | <td class="col text-right"> |
212 | <input | 214 | <input |
213 | class="form-control" | 215 | class="form-control" |
214 | ng-value="articuloACargar.precio | currency: '$'" | 216 | ng-value="articuloACargar.precio | currency: '$'" |
215 | ng-show="idLista != -1" | 217 | ng-show="idLista != -1" |
216 | readonly | 218 | readonly |
217 | > | 219 | > |
218 | <input | 220 | <input |
219 | class="form-control" | 221 | class="form-control" |
220 | type="number" | 222 | type="number" |
221 | step="0.01" | 223 | step="0.01" |
222 | ng-model="articuloACargar.precio" | 224 | ng-model="articuloACargar.precio" |
223 | esc-key="resetFilter()" | 225 | esc-key="resetFilter()" |
224 | ng-keypress="agregarATabla($event.keyCode)" | 226 | ng-keypress="agregarATabla($event.keyCode)" |
225 | ng-show="idLista == -1" | 227 | ng-show="idLista == -1" |
226 | > | 228 | > |
227 | </td> | 229 | </td> |
228 | <td class="col text-right"> | 230 | <td class="col text-right"> |
229 | <input | 231 | <input |
230 | class="form-control" | 232 | class="form-control" |
231 | ng-value="getSubTotal() | currency: '$'" | 233 | ng-value="getSubTotal() | currency: '$'" |
232 | readonly | 234 | readonly |
233 | ></td> | 235 | ></td> |
234 | <td class="text-center align-middle"> | 236 | <td class="text-center align-middle"> |
235 | <button | 237 | <button |
236 | class="btn btn-outline-secondary" | 238 | class="btn btn-outline-secondary" |
237 | ng-click="agregarATabla(13)" | 239 | ng-click="agregarATabla(13)" |
238 | > | 240 | > |
239 | <i class="fa fa-save"></i> | 241 | <i class="fa fa-save"></i> |
240 | </button> | 242 | </button> |
241 | </td> | 243 | </td> |
242 | </tr> | 244 | </tr> |
243 | <tr ng-show="cargando" class="d-flex"> | 245 | <tr ng-show="cargando" class="d-flex"> |
244 | <td colspan="7" class="col-12"> | 246 | <td colspan="7" class="col-12"> |
245 | <input | 247 | <input |
246 | placeholder="Seleccione Articulo" | 248 | placeholder="Seleccione Articulo" |
247 | class="form-control form-control-sm" | 249 | class="form-control form-control-sm" |
248 | readonly | 250 | readonly |
249 | ng-click="seleccionarArticulo()" | 251 | ng-click="seleccionarArticulo()" |
250 | /> | 252 | /> |
251 | </td> | 253 | </td> |
252 | </tr> | 254 | </tr> |
253 | <tr class="d-flex"> | 255 | <tr class="d-flex"> |
254 | <td colspan="4"> | 256 | <td colspan="4" class="no-border-top"> |
255 | <strong>Cantidad Items:</strong> | 257 | <strong>Cantidad Items:</strong> |
256 | <a ng-bind="articulosTabla.length"></a> | 258 | <a ng-bind="articulosTabla.length"></a> |
257 | </td> | 259 | </td> |
258 | <td class="text-right ml-auto table-celda-total"><h3>Total:</h3></td> | 260 | <td class="text-right ml-auto table-celda-total no-border-top"> |
259 | <td class="table-celda-total text-right" colspan="1"> | 261 | <h3>Total:</h3> |
262 | </td> | ||
263 | <td class="table-celda-total text-right no-border-top" colspan="1"> | ||
260 | <h3>{{getTotal() | currency: '$'}}</h3> | 264 | <h3>{{getTotal() | currency: '$'}}</h3> |
261 | </td> | 265 | </td> |
262 | <td class="text-right"> | 266 | <td class="text-right no-border-top"> |
263 | <button | 267 | <button |
264 | type="button" | 268 | type="button" |
265 | class="btn btn-default btn-sm" | 269 | class="btn btn-default btn-sm" |
266 | > | 270 | > |
267 | Totales | 271 | Totales |
268 | </button> | 272 | </button> |
269 | </td> | 273 | </td> |
270 | </tr> | 274 | </tr> |
271 | </tfoot> | 275 | </tfoot> |
272 | </table> | 276 | </table> |
273 | </div> | 277 | </div> |
278 | |||
279 | <!-- MOBILE --> | ||
280 | <div class="row d-sm-none"> | ||
281 | <table class="table table-sm table-striped table-dark margin-bottom-mobile"> | ||
282 | <thead> | ||
283 | <tr class="d-flex"> | ||
284 | <th class="">#</th> | ||
285 | <th class="col px-0"> | ||
286 | <div class="d-flex"> | ||
287 | <div class="col-4 px-1">Código</div> | ||
288 | <div class="col-8 px-1">Descripción</div> | ||
289 | </div> | ||
290 | <div class="d-flex"> | ||
291 | <div class="col-3 px-1">Cantidad</div> | ||
292 | <div class="col px-1 text-right">P. Uni.</div> | ||
293 | <div class="col px-1 text-right">Subtotal</div> | ||
294 | </div> | ||
295 | </th> | ||
296 | <th class="text-center tamaño-boton"> | ||
297 | | ||
298 | </th> | ||
299 | </tr> | ||
300 | </thead> | ||
301 | <tbody> | ||
302 | <tr | ||
303 | ng-repeat="(key, articulo) in articulosTabla" | ||
304 | ng-show="show || key == articulosTabla.length - 1" | ||
305 | > | ||
306 | <td class="w-100 align-middle d-flex p-0"> | ||
307 | <div class="align-middle p-1"> | ||
308 | <span ng-bind="key+1" class="align-middle"></span> | ||
309 | </div> | ||
310 | <div class="col px-0"> | ||
311 | <div class="d-flex"> | ||
312 | <div class="col-4 px-1"> | ||
313 | <span | ||
314 | ng-bind="articulo.sector + '-' + articulo.codigo" | ||
315 | ></span> | ||
316 | </div> | ||
317 | <div class="col-8 px-1"> | ||
318 | <span ng-bind="articulo.descripcion"></span> | ||
319 | </div> | ||
320 | </div> | ||
321 | <div class="d-flex"> | ||
322 | <div class="col-3 px-1"> | ||
323 | <span ng-bind="'x' + articulo.cantidad"></span> | ||
324 | </div> | ||
325 | <div class="col-3 px-1 text-right"> | ||
326 | <span ng-bind="articulo.precio | currency: '$'"></span> | ||
327 | </div> | ||
328 | <div class="col px-1 text-right"> | ||
329 | <span | ||
330 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'" | ||
331 | > | ||
332 | </span> | ||
333 | </div> | ||
334 | </div> | ||
335 | </div> | ||
336 | <div class="align-middle p-1"> | ||
337 | <button | ||
338 | class="btn btn-outline-secondary" | ||
339 | ng-click="quitarArticulo(key)" | ||
340 | > | ||
341 | <i class="fa fa-trash"></i> | ||
342 | </button> | ||
343 | </div> | ||
344 | </td> | ||
345 | </tr> | ||
346 | </tbody> | ||
347 | <tfoot> | ||
348 | <!-- CARGANDO ITEM --> | ||
349 | <tr ng-show="!cargando" class="d-flex"> | ||
350 | <td | ||
351 | class="align-middle p-1" | ||
352 | ng-bind="articulosTabla.length + 1" | ||
353 | ></td> | ||
354 | <td class="col p-0"> | ||
355 | <div class="d-flex"> | ||
356 | <div class="col-4 px-1"> | ||
357 | <span | ||
358 | ng-bind="articuloACargar.sectorCodigo" | ||
359 | ></span> | ||
360 | </div> | ||
361 | <div class="col-8 px-1"> | ||
362 | <span ng-bind="articuloACargar.descripcion"></span> | ||
363 | </div> | ||
364 | </div> | ||
365 | <div class="d-flex"> | ||
366 | <div class="col-3 px-1 m-1"> | ||
367 | <input | ||
368 | class="form-control p-1" | ||
369 | type="number" | ||
370 | min="1" | ||
371 | ng-model="articuloACargar.cantidad" | ||
372 | foca-focus="!cargando" | ||
373 | ng-keypress="agregarATabla($event.keyCode)" | ||
374 | style="height: auto; line-height: 1.1em" | ||
375 | > | ||
376 | </div> | ||
377 | <div class="col-3 px-1 text-right"> | ||
378 | <span ng-bind="articuloACargar.precio | currency: '$'"></span> | ||
379 | </div> | ||
380 | <div class="col px-1 text-right"> | ||
381 | <span | ||
382 | ng-bind="getSubTotal() | currency: '$'" | ||
383 | > | ||
384 | </span> | ||
385 | </div> | ||
386 | </div> | ||
387 | </td> | ||
388 | <td class="text-center align-middle"> | ||
389 | <button | ||
390 | class="btn btn-outline-secondary" | ||
391 | ng-click="agregarATabla(13)" | ||
392 | > | ||
393 | <i class="fa fa-save"></i> | ||
394 | </button> | ||
395 | </td> | ||
396 | </tr> | ||
397 | <!-- SELECCIONAR PRODUCTO --> | ||
398 | <tr ng-show="cargando" class="d-flex"> | ||
399 | <td class="col-12"> | ||
400 | <input | ||
401 | placeholder="Seleccione Articulo" | ||
402 | class="form-control form-control-sm" | ||
403 | readonly | ||
404 | ng-click="seleccionarArticulo()" | ||
405 | /> | ||
406 | </td> | ||
407 | </tr> | ||
408 | <!-- TOOGLE EXPANDIR --> | ||
409 | <tr> | ||
410 | <td class="col"> | ||
411 | <button | ||
412 | class="btn btn-outline-secondary selectable w-100" | ||
413 | ng-click="show = !show; masMenos()" | ||
414 | ng-show="articulosTabla.length > 0" | ||
415 | > | ||
416 | <i | ||
417 | class="fa fa-chevron-down" | ||
418 | ng-hide="show" | ||
419 | aria-hidden="true" | ||
420 | > | ||
421 | </i> | ||
422 | <i | ||
423 | class="fa fa-chevron-up" | ||
424 | ng-show="show" | ||
425 | aria-hidden="true"> | ||
426 | </i> | ||
427 | </button> | ||
428 | </td> | ||
429 | </tr> | ||
430 | <!-- FOOTER --> | ||
431 | <tr class="d-flex"> | ||
432 | <td class="align-middle no-border-top" colspan="2"> | ||
433 | <strong>Cantidad Items:</strong> | ||
434 | <a ng-bind="articulosTabla.length"></a> | ||
435 | </td> | ||
436 | <td class="text-right ml-auto table-celda-total no-border-top"> | ||
437 | <h3>Total:</h3> | ||
438 | </td> | ||
439 | <td class="table-celda-total text-right no-border-top"> | ||
440 | <h3>{{getTotal() | currency: '$'}}</h3> | ||
441 | </td> | ||
442 | </tr> | ||
443 | </tfoot> | ||
444 | </table> | ||
445 | </div> | ||
274 | </div> | 446 | </div> |
275 | <div class="col-auto my-2 col-lg-2 botonera-lateral"> | 447 | <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> |
276 | <div class="row align-items-end"> | 448 | <div class="row align-items-end"> |
277 | <div class="col-12"> | 449 | <div class="col-12"> |
278 | <button | 450 | <button |
279 | ng-click="crearNotaPedido()" | 451 | ng-click="crearNotaPedido()" |
280 | type="submit" | 452 | type="submit" |
281 | title="Crear nota pedido" | 453 | title="Crear nota pedido" |
282 | class="btn btn-default btn-block mb-2"> | 454 | class="btn btn-default btn-block mb-2"> |
283 | Guardar | 455 | Guardar |
284 | </button> | 456 | </button> |
285 | <button | 457 | <button |
286 | ng-click="salir()" | 458 | ng-click="salir()" |
287 | type="button" | 459 | type="button" |
288 | title="Salir" | 460 | title="Salir" |
289 | class="btn btn-default btn-block"> | 461 | class="btn btn-default btn-block"> |
290 | Salir | 462 | Salir |
291 | </button> | 463 | </button> |
292 | </div> | 464 | </div> |
293 | </div> | 465 | </div> |
294 | </div> | 466 | </div> |
295 | </div> | 467 | </div> |
468 | <div class="row d-md-none fixed-bottom"> | ||
469 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> | ||
470 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> | ||
471 | <span class="mr-3 ml-auto" ng-click="crearNotaPedido()">Guardar</span> | ||
472 | </div> | ||
473 | </div> | ||
296 | </div> | 474 | </div> |
297 | 475 |