Commit cc525788315fb9e0837206b7bf6ae065554e5da9

Authored by Pablo Marco del Pont
Exists in master

Merge branch 'master' into 'master'

Master

See merge request modulos-npm/foca-crear-nota-pedido!69
src/js/controller.js
1 angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', 1 angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
2 [ 2 [
3 '$scope', '$uibModal', '$location', '$filter', 'crearNotaPedidoService', 3 '$scope', '$uibModal', '$location', '$filter', 'crearNotaPedidoService',
4 'focaModalService', 'focaSeguimientoService', 'notaPedidoBusinessService', 4 'focaModalService', 'focaSeguimientoService', 'notaPedidoBusinessService', '$rootScope',
5 function( 5 function(
6 $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService, 6 $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService,
7 focaSeguimientoService, notaPedidoBusinessService 7 focaSeguimientoService, notaPedidoBusinessService, $rootScope
8 ) { 8 ) {
9 $scope.botonera = [ 9 $scope.botonera = [
10 {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, 10 {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}},
11 {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, 11 {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}},
12 {texto: 'Proveedor', accion: function() {$scope.seleccionarProveedor();}}, 12 {texto: 'Proveedor', accion: function() {$scope.seleccionarProveedor();}},
13 {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, 13 {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}},
14 { 14 {
15 texto: 'Precios y condiciones', 15 texto: 'Precios y condiciones',
16 accion: function() {$scope.abrirModalListaPrecio();}}, 16 accion: function() {$scope.abrirModalListaPrecio();}},
17 {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, 17 {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}},
18 {texto: '', accion: function() {}}, 18 {texto: '', accion: function() {}},
19 {texto: '', accion: function() {}} 19 {texto: '', accion: function() {}}
20 ]; 20 ];
21 $scope.datepickerAbierto = false; 21 $scope.datepickerAbierto = false;
22 22
23 $scope.show = false; 23 $scope.show = false;
24 $scope.cargando = true; 24 $scope.cargando = true;
25 $scope.dateOptions = { 25 $scope.dateOptions = {
26 maxDate: new Date(), 26 maxDate: new Date(),
27 minDate: new Date(2010, 0, 1) 27 minDate: new Date(2010, 0, 1)
28 }; 28 };
29 29
30 $scope.notaPedido = { 30 $scope.notaPedido = {
31 vendedor: {}, 31 vendedor: {},
32 cliente: {}, 32 cliente: {},
33 proveedor: {}, 33 proveedor: {},
34 domicilio: {dom: ''}, 34 domicilio: {dom: ''},
35 moneda: {}, 35 moneda: {},
36 cotizacion: {} 36 cotizacion: {}
37 }; 37 };
38 var monedaPorDefecto; 38 var monedaPorDefecto;
39 //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' 39 //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]'
40 crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) { 40 crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) {
41 monedaPorDefecto = { 41 monedaPorDefecto = {
42 id: res.data[0].ID, 42 id: res.data[0].ID,
43 detalle: res.data[0].DETALLE, 43 detalle: res.data[0].DETALLE,
44 simbolo: res.data[0].SIMBOLO, 44 simbolo: res.data[0].SIMBOLO,
45 cotizaciones: res.data[0].cotizaciones 45 cotizaciones: res.data[0].cotizaciones
46 }; 46 };
47 addCabecera('Moneda:', monedaPorDefecto.detalle); 47 addCabecera('Moneda:', monedaPorDefecto.detalle);
48 addCabecera('Fecha cotizacion:', 48 addCabecera('Fecha cotizacion:',
49 new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); 49 new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString());
50 addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].COTIZACION); 50 addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].COTIZACION);
51 $scope.notaPedido.moneda = monedaPorDefecto; 51 $scope.notaPedido.moneda = monedaPorDefecto;
52 $scope.notaPedido.cotizacion = monedaPorDefecto.cotizaciones[0]; 52 $scope.notaPedido.cotizacion = monedaPorDefecto.cotizaciones[0];
53 }); 53 });
54 54
55 $scope.cabecera = []; 55 $scope.cabecera = [];
56 $scope.showCabecera = true; 56 $scope.showCabecera = true;
57 57
58 $scope.now = new Date(); 58 $scope.now = new Date();
59 $scope.puntoVenta = '0000'; 59 $scope.puntoVenta = '0000';
60 $scope.comprobante = '00000000'; 60 $scope.comprobante = '00000000';
61 $scope.articulosTabla = []; 61 $scope.articulosTabla = [];
62 $scope.idLista = undefined; 62 $scope.idLista = undefined;
63 //La pantalla solo se usa para cargar pedidos 63 //La pantalla solo se usa para cargar pedidos
64 //var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); 64 //var notaPedidoTemp = crearNotaPedidoService.getNotaPedido();
65 65
66 crearNotaPedidoService.getPrecioCondicion().then( 66 crearNotaPedidoService.getPrecioCondicion().then(
67 function(res) { 67 function(res) {
68 $scope.precioCondiciones = res.data; 68 $scope.precioCondiciones = res.data;
69 } 69 }
70 ); 70 );
71 71
72 crearNotaPedidoService.getNumeroNotaPedido().then( 72 crearNotaPedidoService.getNumeroNotaPedido().then(
73 function(res) { 73 function(res) {
74 $scope.puntoVenta = rellenar(res.data.sucursal, 4); 74 $scope.puntoVenta = rellenar(res.data.sucursal, 4);
75 $scope.comprobante = rellenar(res.data.numeroNotaPedido, 8); 75 $scope.comprobante = rellenar(res.data.numeroNotaPedido, 8);
76 }, 76 },
77 function(err) { 77 function(err) {
78 focaModalService.alert('La terminal no esta configurada correctamente'); 78 focaModalService.alert('La terminal no esta configurada correctamente');
79 console.info(err); 79 console.info(err);
80 } 80 }
81 ); 81 );
82 //La pantalla solo se usa para cargar pedidos 82 //La pantalla solo se usa para cargar pedidos
83 // if (notaPedidoTemp !== undefined) { 83 // if (notaPedidoTemp !== undefined) {
84 // notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); 84 // notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga);
85 // $scope.notaPedido = notaPedidoTemp; 85 // $scope.notaPedido = notaPedidoTemp;
86 // $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); 86 // $scope.notaPedido.flete = ($scope.notaPedido.flete).toString();
87 // $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); 87 // $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString();
88 // $scope.idLista = $scope.notaPedido.precioCondicion; 88 // $scope.idLista = $scope.notaPedido.precioCondicion;
89 // crearNotaPedidoService 89 // crearNotaPedidoService
90 // .getArticulosByIdNotaPedido($scope.notaPedido.id).then( 90 // .getArticulosByIdNotaPedido($scope.notaPedido.id).then(
91 // function(res) { 91 // function(res) {
92 // $scope.articulosTabla = res.data; 92 // $scope.articulosTabla = res.data;
93 // } 93 // }
94 // ); 94 // );
95 //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO 95 //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO
96 //(NO REQUERIDO EN ESTA VERSION) 96 //(NO REQUERIDO EN ESTA VERSION)
97 // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( 97 // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then(
98 // function(res) { 98 // function(res) {
99 // $scope.notaPedido.domicilio = res.data; 99 // $scope.notaPedido.domicilio = res.data;
100 // } 100 // }
101 // ); 101 // );
102 // } else { 102 // } else {
103 // $scope.notaPedido.fechaCarga = new Date(); 103 // $scope.notaPedido.fechaCarga = new Date();
104 // $scope.notaPedido.bomba = '0'; 104 // $scope.notaPedido.bomba = '0';
105 // $scope.notaPedido.flete = '0'; 105 // $scope.notaPedido.flete = '0';
106 // $scope.idLista = undefined; 106 // $scope.idLista = undefined;
107 // } 107 // }
108 //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO 108 //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO
109 // $scope.addNewDom = function() { 109 // $scope.addNewDom = function() {
110 // $scope.notaPedido.domicilio.push({ 'id': 0 }); 110 // $scope.notaPedido.domicilio.push({ 'id': 0 });
111 // }; 111 // };
112 // $scope.removeNewChoice = function(choice) { 112 // $scope.removeNewChoice = function(choice) {
113 // if ($scope.notaPedido.domicilio.length > 1) { 113 // if ($scope.notaPedido.domicilio.length > 1) {
114 // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( 114 // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(
115 // function(c) { 115 // function(c) {
116 // return c.$$hashKey === choice.$$hashKey; 116 // return c.$$hashKey === choice.$$hashKey;
117 // } 117 // }
118 // ), 1); 118 // ), 1);
119 // } 119 // }
120 // }; 120 // };
121 121
122 $scope.crearNotaPedido = function() { 122 $scope.crearNotaPedido = function() {
123 if(!$scope.notaPedido.vendedor.codigo) { 123 if(!$scope.notaPedido.vendedor.codigo) {
124 focaModalService.alert('Ingrese Vendedor'); 124 focaModalService.alert('Ingrese Vendedor');
125 return; 125 return;
126 } else if(!$scope.notaPedido.cliente.cod) { 126 } else if(!$scope.notaPedido.cliente.cod) {
127 focaModalService.alert('Ingrese Cliente'); 127 focaModalService.alert('Ingrese Cliente');
128 return; 128 return;
129 } else if(!$scope.notaPedido.proveedor.codigo) { 129 } else if(!$scope.notaPedido.proveedor.codigo) {
130 focaModalService.alert('Ingrese Proveedor'); 130 focaModalService.alert('Ingrese Proveedor');
131 return; 131 return;
132 } else if(!$scope.notaPedido.moneda.id) { 132 } else if(!$scope.notaPedido.moneda.id) {
133 focaModalService.alert('Ingrese Moneda'); 133 focaModalService.alert('Ingrese Moneda');
134 return; 134 return;
135 } else if(!$scope.notaPedido.cotizacion.ID) { 135 } else if(!$scope.notaPedido.cotizacion.ID) {
136 focaModalService.alert('Ingrese Cotización'); 136 focaModalService.alert('Ingrese Cotización');
137 return; 137 return;
138 } else if(!$scope.plazosPagos) { 138 } else if(!$scope.plazosPagos) {
139 focaModalService.alert('Ingrese Precios y Condiciones'); 139 focaModalService.alert('Ingrese Precios y Condiciones');
140 return; 140 return;
141 } else if( 141 } else if(
142 $scope.notaPedido.flete === undefined || $scope.notaPedido.flete === null) 142 $scope.notaPedido.flete === undefined || $scope.notaPedido.flete === null)
143 { 143 {
144 focaModalService.alert('Ingrese Flete'); 144 focaModalService.alert('Ingrese Flete');
145 return; 145 return;
146 } else if(!$scope.notaPedido.domicilio.id) { 146 } else if(!$scope.notaPedido.domicilio.id) {
147 focaModalService.alert('Ingrese Domicilio'); 147 focaModalService.alert('Ingrese Domicilio');
148 return; 148 return;
149 } else if($scope.articulosTabla.length === 0) { 149 } else if($scope.articulosTabla.length === 0) {
150 focaModalService.alert('Debe cargar al menos un articulo'); 150 focaModalService.alert('Debe cargar al menos un articulo');
151 return; 151 return;
152 } 152 }
153 var date = new Date(); 153 var date = new Date();
154 var notaPedido = { 154 var notaPedido = {
155 id: 0, 155 id: 0,
156 fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) 156 fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000))
157 .toISOString().slice(0, 19).replace('T', ' '), 157 .toISOString().slice(0, 19).replace('T', ' '),
158 idVendedor: $scope.notaPedido.vendedor.codigo, 158 idVendedor: $scope.notaPedido.vendedor.codigo,
159 idCliente: $scope.notaPedido.cliente.cod, 159 idCliente: $scope.notaPedido.cliente.cod,
160 nombreCliente: $scope.notaPedido.cliente.nom, 160 nombreCliente: $scope.notaPedido.cliente.nom,
161 cuitCliente: $scope.notaPedido.cliente.cuit, 161 cuitCliente: $scope.notaPedido.cliente.cuit,
162 idProveedor: $scope.notaPedido.proveedor.codigo, 162 idProveedor: $scope.notaPedido.proveedor.codigo,
163 idDomicilio: $scope.notaPedido.domicilio.id, 163 idDomicilio: $scope.notaPedido.domicilio.id,
164 idCotizacion: $scope.notaPedido.cotizacion.ID, 164 idCotizacion: $scope.notaPedido.cotizacion.ID,
165 cotizacion: $scope.notaPedido.cotizacion.COTIZACION, 165 cotizacion: $scope.notaPedido.cotizacion.COTIZACION,
166 flete: $scope.notaPedido.flete, 166 flete: $scope.notaPedido.flete,
167 fob: $scope.notaPedido.fob, 167 fob: $scope.notaPedido.fob,
168 bomba: $scope.notaPedido.bomba, 168 bomba: $scope.notaPedido.bomba,
169 kilometros: $scope.notaPedido.kilometros, 169 kilometros: $scope.notaPedido.kilometros,
170 estado: 0, 170 estado: 0,
171 total: $scope.getTotal() 171 total: $scope.getTotal()
172 }; 172 };
173 crearNotaPedidoService.crearNotaPedido(notaPedido).then( 173 crearNotaPedidoService.crearNotaPedido(notaPedido).then(
174 function(data) { 174 function(data) {
175 notaPedidoBusinessService.addArticulos($scope.articulosTabla, 175 notaPedidoBusinessService.addArticulos($scope.articulosTabla,
176 data.data.id, $scope.notaPedido.cotizacion.COTIZACION); 176 data.data.id, $scope.notaPedido.cotizacion.COTIZACION);
177 focaSeguimientoService.guardarPosicion('crear nota pedido', ''); 177 focaSeguimientoService.guardarPosicion('crear nota pedido', '');
178 var plazos = $scope.plazosPagos; 178 var plazos = $scope.plazosPagos;
179 179
180 for(var j = 0; j < plazos.length; j++) { 180 for(var j = 0; j < plazos.length; j++) {
181 var json = { 181 var json = {
182 idPedido: data.data.id, 182 idPedido: data.data.id,
183 dias: plazos[j].dias 183 dias: plazos[j].dias
184 }; 184 };
185 crearNotaPedidoService.crearPlazosParaNotaPedido(json); 185 crearNotaPedidoService.crearPlazosParaNotaPedido(json);
186 } 186 }
187 notaPedidoBusinessService.addEstado(data.data.id, 187 notaPedidoBusinessService.addEstado(data.data.id,
188 $scope.notaPedido.vendedor.codigo); 188 $scope.notaPedido.vendedor.codigo);
189 189
190 focaModalService.alert('Nota pedido creada'); 190 focaModalService.alert('Nota pedido creada');
191 $scope.cabecera = []; 191 $scope.cabecera = [];
192 addCabecera('Moneda:', $scope.notaPedido.moneda.detalle); 192 addCabecera('Moneda:', $scope.notaPedido.moneda.detalle);
193 addCabecera( 193 addCabecera(
194 'Fecha cotizacion:', 194 'Fecha cotizacion:',
195 $filter('date')($scope.notaPedido.cotizacion.FECHA, 'dd/MM/yyyy') 195 $filter('date')($scope.notaPedido.cotizacion.FECHA, 'dd/MM/yyyy')
196 ); 196 );
197 addCabecera('Cotizacion:', $scope.notaPedido.cotizacion.COTIZACION); 197 addCabecera('Cotizacion:', $scope.notaPedido.cotizacion.COTIZACION);
198 $scope.notaPedido.vendedor = {}; 198 $scope.notaPedido.vendedor = {};
199 $scope.notaPedido.cliente = {}; 199 $scope.notaPedido.cliente = {};
200 $scope.notaPedido.proveedor = {}; 200 $scope.notaPedido.proveedor = {};
201 $scope.notaPedido.domicilio = {}; 201 $scope.notaPedido.domicilio = {};
202 $scope.notaPedido.flete = null; 202 $scope.notaPedido.flete = null;
203 $scope.notaPedido.fob = null; 203 $scope.notaPedido.fob = null;
204 $scope.notaPedido.bomba = null; 204 $scope.notaPedido.bomba = null;
205 $scope.notaPedido.kilometros = null; 205 $scope.notaPedido.kilometros = null;
206 $scope.articulosTabla = []; 206 $scope.articulosTabla = [];
207 }, 207 },
208 function(error) { 208 function(error) {
209 focaModalService.alert('Hubo un error al crear la nota de pedido'); 209 focaModalService.alert('Hubo un error al crear la nota de pedido');
210 console.info(error); 210 console.info(error);
211 } 211 }
212 ); 212 );
213 }; 213 };
214 214
215 $scope.seleccionarArticulo = function() { 215 $scope.seleccionarArticulo = function() {
216 if ($scope.idLista === undefined) { 216 if ($scope.idLista === undefined) {
217 focaModalService.alert( 217 focaModalService.alert(
218 'Primero seleccione una lista de precio y condicion'); 218 'Primero seleccione una lista de precio y condicion');
219 return; 219 return;
220 } 220 }
221 var modalInstance = $uibModal.open( 221 var modalInstance = $uibModal.open(
222 { 222 {
223 ariaLabelledBy: 'Busqueda de Productos', 223 ariaLabelledBy: 'Busqueda de Productos',
224 templateUrl: 'modal-busqueda-productos.html', 224 templateUrl: 'modal-busqueda-productos.html',
225 controller: 'modalBusquedaProductosCtrl', 225 controller: 'modalBusquedaProductosCtrl',
226 resolve: { 226 resolve: {
227 parametroProducto: { 227 parametroProducto: {
228 idLista: $scope.idLista, 228 idLista: $scope.idLista,
229 cotizacion: $scope.notaPedido.cotizacion.COTIZACION, 229 cotizacion: $scope.notaPedido.cotizacion.COTIZACION,
230 simbolo: $scope.notaPedido.moneda.simbolo 230 simbolo: $scope.notaPedido.moneda.simbolo
231 } 231 }
232 }, 232 },
233 size: 'lg' 233 size: 'lg'
234 } 234 }
235 ); 235 );
236 modalInstance.result.then( 236 modalInstance.result.then(
237 function(producto) { 237 function(producto) {
238 var newArt = 238 var newArt =
239 { 239 {
240 id: 0, 240 id: 0,
241 codigo: producto.codigo, 241 codigo: producto.codigo,
242 sector: producto.sector, 242 sector: producto.sector,
243 sectorCodigo: producto.sector + '-' + producto.codigo, 243 sectorCodigo: producto.sector + '-' + producto.codigo,
244 descripcion: producto.descripcion, 244 descripcion: producto.descripcion,
245 item: $scope.articulosTabla.length + 1, 245 item: $scope.articulosTabla.length + 1,
246 nombre: producto.descripcion, 246 nombre: producto.descripcion,
247 precio: parseFloat(producto.precio.toFixed(4)), 247 precio: parseFloat(producto.precio.toFixed(4)),
248 costoUnitario: producto.costo, 248 costoUnitario: producto.costo,
249 editCantidad: false, 249 editCantidad: false,
250 editPrecio: false 250 editPrecio: false
251 }; 251 };
252 $scope.articuloACargar = newArt; 252 $scope.articuloACargar = newArt;
253 $scope.cargando = false; 253 $scope.cargando = false;
254 }, function() { 254 }, function() {
255 // funcion ejecutada cuando se cancela el modal 255 // funcion ejecutada cuando se cancela el modal
256 } 256 }
257 ); 257 );
258 }; 258 };
259 259
260 $scope.seleccionarVendedor = function() { 260 $scope.seleccionarVendedor = function() {
261 var modalInstance = $uibModal.open( 261 var modalInstance = $uibModal.open(
262 { 262 {
263 ariaLabelledBy: 'Busqueda de Vendedores', 263 ariaLabelledBy: 'Busqueda de Vendedores',
264 templateUrl: 'modal-vendedores.html', 264 templateUrl: 'modal-vendedores.html',
265 controller: 'modalVendedoresCtrl', 265 controller: 'modalVendedoresCtrl',
266 size: 'lg' 266 size: 'lg'
267 } 267 }
268 ); 268 );
269 modalInstance.result.then( 269 modalInstance.result.then(
270 function(vendedor) { 270 function(vendedor) {
271 addCabecera('Vendedor:', vendedor.NomVen); 271 addCabecera('Vendedor:', vendedor.NomVen);
272 $scope.notaPedido.vendedor.codigo = vendedor.CodVen; 272 $scope.notaPedido.vendedor.codigo = vendedor.CodVen;
273 }, function() { 273 }, function() {
274 274
275 } 275 }
276 ); 276 );
277 }; 277 };
278 278
279 $scope.seleccionarProveedor = function() { 279 $scope.seleccionarProveedor = function() {
280 var modalInstance = $uibModal.open( 280 var modalInstance = $uibModal.open(
281 { 281 {
282 ariaLabelledBy: 'Busqueda de Proveedor', 282 ariaLabelledBy: 'Busqueda de Proveedor',
283 templateUrl: 'modal-proveedor.html', 283 templateUrl: 'modal-proveedor.html',
284 controller: 'focaModalProveedorCtrl', 284 controller: 'focaModalProveedorCtrl',
285 size: 'lg' 285 size: 'lg'
286 } 286 }
287 ); 287 );
288 modalInstance.result.then( 288 modalInstance.result.then(
289 function(proveedor) { 289 function(proveedor) {
290 $scope.notaPedido.proveedor.codigo = proveedor.COD; 290 $scope.notaPedido.proveedor.codigo = proveedor.COD;
291 addCabecera('Proveedor:', proveedor.NOM); 291 addCabecera('Proveedor:', proveedor.NOM);
292 }, function() { 292 }, function() {
293 293
294 } 294 }
295 ); 295 );
296 }; 296 };
297 297
298 $scope.seleccionarCliente = function() { 298 $scope.seleccionarCliente = function() {
299 299
300 var modalInstance = $uibModal.open( 300 var modalInstance = $uibModal.open(
301 { 301 {
302 ariaLabelledBy: 'Busqueda de Cliente', 302 ariaLabelledBy: 'Busqueda de Cliente',
303 templateUrl: 'foca-busqueda-cliente-modal.html', 303 templateUrl: 'foca-busqueda-cliente-modal.html',
304 controller: 'focaBusquedaClienteModalController', 304 controller: 'focaBusquedaClienteModalController',
305 size: 'lg' 305 size: 'lg'
306 } 306 }
307 ); 307 );
308 modalInstance.result.then( 308 modalInstance.result.then(
309 function(cliente) { 309 function(cliente) {
310 $scope.abrirModalDomicilios(cliente); 310 $scope.abrirModalDomicilios(cliente);
311 }, function() { 311 }, function() {
312 312
313 } 313 }
314 ); 314 );
315 }; 315 };
316 316
317 $scope.abrirModalDomicilios = function(cliente) { 317 $scope.abrirModalDomicilios = function(cliente) {
318 var modalInstanceDomicilio = $uibModal.open( 318 var modalInstanceDomicilio = $uibModal.open(
319 { 319 {
320 ariaLabelledBy: 'Busqueda de Domicilios', 320 ariaLabelledBy: 'Busqueda de Domicilios',
321 templateUrl: 'modal-domicilio.html', 321 templateUrl: 'modal-domicilio.html',
322 controller: 'focaModalDomicilioController', 322 controller: 'focaModalDomicilioController',
323 resolve: { idCliente: function() { return cliente.cod; }}, 323 resolve: { idCliente: function() { return cliente.cod; }},
324 size: 'lg', 324 size: 'lg',
325 } 325 }
326 ); 326 );
327 modalInstanceDomicilio.result.then( 327 modalInstanceDomicilio.result.then(
328 function(domicilio) { 328 function(domicilio) {
329 $scope.notaPedido.domicilio.id = domicilio.nivel2; 329 $scope.notaPedido.domicilio.id = domicilio.nivel2;
330 $scope.notaPedido.cliente = cliente; 330 $scope.notaPedido.cliente = cliente;
331 331
332 addCabecera('Cliente:', cliente.nom); 332 addCabecera('Cliente:', cliente.nom);
333 addCabecera('Domicilio:', domicilio.Calle + ' ' + domicilio.Numero); 333 addCabecera('Domicilio:', domicilio.Calle + ' ' + domicilio.Numero);
334 }, function() { 334 }, function() {
335 $scope.seleccionarCliente(); 335 $scope.seleccionarCliente();
336 return; 336 return;
337 } 337 }
338 ); 338 );
339 }; 339 };
340 340
341 $scope.mostrarFichaCliente = function() { 341 $scope.mostrarFichaCliente = function() {
342 $uibModal.open( 342 $uibModal.open(
343 { 343 {
344 ariaLabelledBy: 'Datos del Cliente', 344 ariaLabelledBy: 'Datos del Cliente',
345 templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', 345 templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html',
346 controller: 'focaCrearNotaPedidoFichaClienteController', 346 controller: 'focaCrearNotaPedidoFichaClienteController',
347 size: 'lg' 347 size: 'lg'
348 } 348 }
349 ); 349 );
350 }; 350 };
351 351
352 $scope.getTotal = function() { 352 $scope.getTotal = function() {
353 var total = 0; 353 var total = 0;
354 var arrayTempArticulos = $scope.articulosTabla; 354 var arrayTempArticulos = $scope.articulosTabla;
355 for (var i = 0; i < arrayTempArticulos.length; i++) { 355 for (var i = 0; i < arrayTempArticulos.length; i++) {
356 total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad; 356 total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad;
357 } 357 }
358 return parseFloat(total.toFixed(2)); 358 return parseFloat(total.toFixed(2));
359 }; 359 };
360 360
361 $scope.getSubTotal = function() { 361 $scope.getSubTotal = function() {
362 if($scope.articuloACargar) { 362 if($scope.articuloACargar) {
363 return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; 363 return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad;
364 } 364 }
365 }; 365 };
366 366
367 $scope.abrirModalListaPrecio = function() { 367 $scope.abrirModalListaPrecio = function() {
368 var modalInstance = $uibModal.open( 368 var modalInstance = $uibModal.open(
369 { 369 {
370 ariaLabelledBy: 'Busqueda de Precio Condición', 370 ariaLabelledBy: 'Busqueda de Precio Condición',
371 templateUrl: 'modal-precio-condicion.html', 371 templateUrl: 'modal-precio-condicion.html',
372 controller: 'focaModalPrecioCondicionController', 372 controller: 'focaModalPrecioCondicionController',
373 size: 'lg' 373 size: 'lg'
374 } 374 }
375 ); 375 );
376 modalInstance.result.then( 376 modalInstance.result.then(
377 function(precioCondicion) { 377 function(precioCondicion) {
378 var cabecera = ''; 378 var cabecera = '';
379 var plazosConcat = ''; 379 var plazosConcat = '';
380 if(!Array.isArray(precioCondicion)) { 380 if(!Array.isArray(precioCondicion)) {
381 $scope.plazosPagos = precioCondicion.plazoPago; 381 $scope.plazosPagos = precioCondicion.plazoPago;
382 $scope.idLista = precioCondicion.idListaPrecio; 382 $scope.idLista = precioCondicion.idListaPrecio;
383 for(var i = 0; i < precioCondicion.plazoPago.length; i++) { 383 for(var i = 0; i < precioCondicion.plazoPago.length; i++) {
384 plazosConcat += precioCondicion.plazoPago[i].dias + ' '; 384 plazosConcat += precioCondicion.plazoPago[i].dias + ' ';
385 } 385 }
386 cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); 386 cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim();
387 } else { //Cuando se ingresan los plazos manualmente 387 } else { //Cuando se ingresan los plazos manualmente
388 $scope.idLista = -1; //-1, el modal productos busca todos los productos 388 $scope.idLista = -1; //-1, el modal productos busca todos los productos
389 $scope.plazosPagos = precioCondicion; 389 $scope.plazosPagos = precioCondicion;
390 for(var j = 0; j < precioCondicion.length; j++) { 390 for(var j = 0; j < precioCondicion.length; j++) {
391 plazosConcat += precioCondicion[j].dias + ' '; 391 plazosConcat += precioCondicion[j].dias + ' ';
392 } 392 }
393 cabecera = 'Ingreso manual ' + plazosConcat.trim(); 393 cabecera = 'Ingreso manual ' + plazosConcat.trim();
394 } 394 }
395 $scope.articulosTabla = []; 395 $scope.articulosTabla = [];
396 addCabecera('Precios y condiciones:', cabecera); 396 addCabecera('Precios y condiciones:', cabecera);
397 }, function() { 397 }, function() {
398 398
399 } 399 }
400 ); 400 );
401 }; 401 };
402 402
403 $scope.abrirModalFlete = function() { 403 $scope.abrirModalFlete = function() {
404 var modalInstance = $uibModal.open( 404 var modalInstance = $uibModal.open(
405 { 405 {
406 ariaLabelledBy: 'Busqueda de Flete', 406 ariaLabelledBy: 'Busqueda de Flete',
407 templateUrl: 'modal-flete.html', 407 templateUrl: 'modal-flete.html',
408 controller: 'focaModalFleteController', 408 controller: 'focaModalFleteController',
409 size: 'lg', 409 size: 'lg',
410 resolve: { 410 resolve: {
411 parametrosFlete: 411 parametrosFlete:
412 function() { 412 function() {
413 return { 413 return {
414 flete: $scope.notaPedido.flete ? '1' : 414 flete: $scope.notaPedido.flete ? '1' :
415 ($scope.notaPedido.fob ? 'FOB' : 415 ($scope.notaPedido.fob ? 'FOB' :
416 ($scope.notaPedido.flete === undefined ? null : '0')), 416 ($scope.notaPedido.flete === undefined ? null : '0')),
417 bomba: $scope.notaPedido.bomba ? '1' : 417 bomba: $scope.notaPedido.bomba ? '1' :
418 ($scope.notaPedido.bomba === undefined ? null : '0'), 418 ($scope.notaPedido.bomba === undefined ? null : '0'),
419 kilometros: $scope.notaPedido.kilometros 419 kilometros: $scope.notaPedido.kilometros
420 }; 420 };
421 } 421 }
422 } 422 }
423 } 423 }
424 ); 424 );
425 modalInstance.result.then( 425 modalInstance.result.then(
426 function(datos) { 426 function(datos) {
427 $scope.notaPedido.flete = datos.flete; 427 $scope.notaPedido.flete = datos.flete;
428 $scope.notaPedido.fob = datos.FOB; 428 $scope.notaPedido.fob = datos.FOB;
429 $scope.notaPedido.bomba = datos.bomba; 429 $scope.notaPedido.bomba = datos.bomba;
430 $scope.notaPedido.kilometros = datos.kilometros; 430 $scope.notaPedido.kilometros = datos.kilometros;
431 431
432 addCabecera('Flete:', datos.flete ? 'Si' : 432 addCabecera('Flete:', datos.flete ? 'Si' :
433 ($scope.notaPedido.fob ? 'FOB' : 'No')); 433 ($scope.notaPedido.fob ? 'FOB' : 'No'));
434 if(datos.flete) { 434 if(datos.flete) {
435 addCabecera('Bomba:', datos.bomba ? 'Si' : 'No'); 435 addCabecera('Bomba:', datos.bomba ? 'Si' : 'No');
436 addCabecera('Kilometros:', datos.kilometros); 436 addCabecera('Kilometros:', datos.kilometros);
437 } else { 437 } else {
438 removeCabecera('Bomba:'); 438 removeCabecera('Bomba:');
439 removeCabecera('Kilometros:'); 439 removeCabecera('Kilometros:');
440 $scope.notaPedido.fob = false; 440 $scope.notaPedido.fob = false;
441 $scope.notaPedido.bomba = false; 441 $scope.notaPedido.bomba = false;
442 $scope.notaPedido.kilometros = null; 442 $scope.notaPedido.kilometros = null;
443 } 443 }
444 }, function() { 444 }, function() {
445 445
446 } 446 }
447 ); 447 );
448 }; 448 };
449 449
450 $scope.abrirModalMoneda = function() { 450 $scope.abrirModalMoneda = function() {
451 var modalInstance = $uibModal.open( 451 var modalInstance = $uibModal.open(
452 { 452 {
453 ariaLabelledBy: 'Busqueda de Moneda', 453 ariaLabelledBy: 'Busqueda de Moneda',
454 templateUrl: 'modal-moneda.html', 454 templateUrl: 'modal-moneda.html',
455 controller: 'focaModalMonedaController', 455 controller: 'focaModalMonedaController',
456 size: 'lg' 456 size: 'lg'
457 } 457 }
458 ); 458 );
459 modalInstance.result.then( 459 modalInstance.result.then(
460 function(moneda) { 460 function(moneda) {
461 $scope.abrirModalCotizacion(moneda); 461 $scope.abrirModalCotizacion(moneda);
462 }, function() { 462 }, function() {
463 463
464 } 464 }
465 ); 465 );
466 }; 466 };
467 467
468 $scope.abrirModalCotizacion = function(moneda) { 468 $scope.abrirModalCotizacion = function(moneda) {
469 var modalInstance = $uibModal.open( 469 var modalInstance = $uibModal.open(
470 { 470 {
471 ariaLabelledBy: 'Busqueda de Cotización', 471 ariaLabelledBy: 'Busqueda de Cotización',
472 templateUrl: 'modal-cotizacion.html', 472 templateUrl: 'modal-cotizacion.html',
473 controller: 'focaModalCotizacionController', 473 controller: 'focaModalCotizacionController',
474 size: 'lg', 474 size: 'lg',
475 resolve: {idMoneda: function() {return moneda.ID;}} 475 resolve: {idMoneda: function() {return moneda.ID;}}
476 } 476 }
477 ); 477 );
478 modalInstance.result.then( 478 modalInstance.result.then(
479 function(cotizacion) { 479 function(cotizacion) {
480 var articulosTablaTemp = $scope.articulosTabla; 480 var articulosTablaTemp = $scope.articulosTabla;
481 for(var i = 0; i < articulosTablaTemp.length; i++) { 481 for(var i = 0; i < articulosTablaTemp.length; i++) {
482 articulosTablaTemp[i].precio = articulosTablaTemp[i].precio * 482 articulosTablaTemp[i].precio = articulosTablaTemp[i].precio *
483 $scope.notaPedido.cotizacion.COTIZACION; 483 $scope.notaPedido.cotizacion.COTIZACION;
484 articulosTablaTemp[i].precio = articulosTablaTemp[i].precio / 484 articulosTablaTemp[i].precio = articulosTablaTemp[i].precio /
485 cotizacion.COTIZACION; 485 cotizacion.COTIZACION;
486 } 486 }
487 $scope.articulosTabla = articulosTablaTemp; 487 $scope.articulosTabla = articulosTablaTemp;
488 $scope.notaPedido.moneda = { 488 $scope.notaPedido.moneda = {
489 id: moneda.ID, 489 id: moneda.ID,
490 detalle: moneda.DETALLE, 490 detalle: moneda.DETALLE,
491 simbolo: moneda.SIMBOLO 491 simbolo: moneda.SIMBOLO
492 }; 492 };
493 $scope.notaPedido.cotizacion = { 493 $scope.notaPedido.cotizacion = {
494 ID: cotizacion.ID, 494 ID: cotizacion.ID,
495 COTIZACION: cotizacion.COTIZACION, 495 COTIZACION: cotizacion.COTIZACION,
496 FECHA: cotizacion.FECHA 496 FECHA: cotizacion.FECHA
497 }; 497 };
498 addCabecera('Moneda:', moneda.DETALLE); 498 addCabecera('Moneda:', moneda.DETALLE);
499 addCabecera( 499 addCabecera(
500 'Fecha cotizacion:', 500 'Fecha cotizacion:',
501 $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') 501 $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy')
502 ); 502 );
503 addCabecera('Cotizacion:', cotizacion.COTIZACION); 503 addCabecera('Cotizacion:', cotizacion.COTIZACION);
504 }, function() { 504 }, function() {
505 505
506 } 506 }
507 ); 507 );
508 }; 508 };
509 509
510 $scope.agregarATabla = function(key) { 510 $scope.agregarATabla = function(key) {
511 if(key === 13) { 511 if(key === 13) {
512 if($scope.articuloACargar.cantidad === undefined || 512 if($scope.articuloACargar.cantidad === undefined ||
513 $scope.articuloACargar.cantidad === 0 || 513 $scope.articuloACargar.cantidad === 0 ||
514 $scope.articuloACargar.cantidad === null ){ 514 $scope.articuloACargar.cantidad === null ){
515 focaModalService.alert('El valor debe ser al menos 1'); 515 focaModalService.alert('El valor debe ser al menos 1');
516 return; 516 return;
517 } 517 }
518 delete $scope.articuloACargar.sectorCodigo; 518 delete $scope.articuloACargar.sectorCodigo;
519 $scope.articulosTabla.push($scope.articuloACargar); 519 $scope.articulosTabla.push($scope.articuloACargar);
520 $scope.cargando = true; 520 $scope.cargando = true;
521 } 521 }
522 }; 522 };
523 523
524 $scope.quitarArticulo = function(key) { 524 $scope.quitarArticulo = function(key) {
525 $scope.articulosTabla.splice(key, 1); 525 $scope.articulosTabla.splice(key, 1);
526 }; 526 };
527 527
528 $scope.editarArticulo = function(key, articulo) { 528 $scope.editarArticulo = function(key, articulo) {
529 if(key === 13) { 529 if(key === 13) {
530 if(articulo.cantidad === null || articulo.cantidad === 0 || 530 if(articulo.cantidad === null || articulo.cantidad === 0 ||
531 articulo.cantidad === undefined){ 531 articulo.cantidad === undefined){
532 focaModalService.alert('El valor debe ser al menos 1'); 532 focaModalService.alert('El valor debe ser al menos 1');
533 return; 533 return;
534 } 534 }
535 articulo.editCantidad = false; 535 articulo.editCantidad = false;
536 articulo.editPrecio = false; 536 articulo.editPrecio = false;
537 } 537 }
538 }; 538 };
539 539
540 $scope.cambioEdit = function(articulo, propiedad) { 540 $scope.cambioEdit = function(articulo, propiedad) {
541 if(propiedad === 'cantidad') { 541 if(propiedad === 'cantidad') {
542 articulo.editCantidad = true; 542 articulo.editCantidad = true;
543 } else if(propiedad === 'precio') { 543 } else if(propiedad === 'precio') {
544 articulo.editPrecio = true; 544 articulo.editPrecio = true;
545 } 545 }
546 }; 546 };
547 547
548 $scope.limpiarFlete = function() { 548 $scope.limpiarFlete = function() {
549 $scope.notaPedido.fleteNombre = ''; 549 $scope.notaPedido.fleteNombre = '';
550 $scope.notaPedido.chofer = ''; 550 $scope.notaPedido.chofer = '';
551 $scope.notaPedido.vehiculo = ''; 551 $scope.notaPedido.vehiculo = '';
552 $scope.notaPedido.kilometros = ''; 552 $scope.notaPedido.kilometros = '';
553 $scope.notaPedido.costoUnitarioKmFlete = ''; 553 $scope.notaPedido.costoUnitarioKmFlete = '';
554 $scope.choferes = ''; 554 $scope.choferes = '';
555 $scope.vehiculos = ''; 555 $scope.vehiculos = '';
556 }; 556 };
557 557
558 $scope.limpiarPantalla = function() { 558 $scope.limpiarPantalla = function() {
559 $scope.limpiarFlete(); 559 $scope.limpiarFlete();
560 $scope.notaPedido.flete = '0'; 560 $scope.notaPedido.flete = '0';
561 $scope.notaPedido.bomba = '0'; 561 $scope.notaPedido.bomba = '0';
562 $scope.notaPedido.precioCondicion = ''; 562 $scope.notaPedido.precioCondicion = '';
563 $scope.articulosTabla = []; 563 $scope.articulosTabla = [];
564 $scope.notaPedido.vendedor.nombre = ''; 564 $scope.notaPedido.vendedor.nombre = '';
565 $scope.notaPedido.cliente = {nombre: ''}; 565 $scope.notaPedido.cliente = {nombre: ''};
566 $scope.notaPedido.domicilio = {dom: ''}; 566 $scope.notaPedido.domicilio = {dom: ''};
567 $scope.domiciliosCliente = []; 567 $scope.domiciliosCliente = [];
568 }; 568 };
569 569
570 $scope.resetFilter = function() { 570 $scope.resetFilter = function() {
571 $scope.articuloACargar = {}; 571 $scope.articuloACargar = {};
572 $scope.cargando = true; 572 $scope.cargando = true;
573 }; 573 };
574 574 //Recibe aviso si el teclado está en uso
575 // $rootScope.$on('usarTeclado', function(event, data) {
576 // if(data) {
577 // $scope.mostrarTeclado = true;
578 // return;
579 // }
580 // $scope.mostrarTeclado = false;
581 // })
575 $scope.selectFocus = function($event) { 582 $scope.selectFocus = function($event) {
583 //Si el teclado esta en uso no selecciona el valor
584 // if($scope.mostrarTeclado) {
585 // return;
586 // }
576 $event.target.select(); 587 $event.target.select();
577 }; 588 };
578 589
579 $scope.salir = function() { 590 $scope.salir = function() {
580 $location.path('/'); 591 $location.path('/');
581 }; 592 };
582 593
583 $scope.parsearATexto = function(articulo) { 594 $scope.parsearATexto = function(articulo) {
584 articulo.cantidad = parseFloat(articulo.cantidad); 595 articulo.cantidad = parseFloat(articulo.cantidad);
585 articulo.precio = parseFloat(articulo.precio); 596 articulo.precio = parseFloat(articulo.precio);
586 }; 597 };
587 598
588 function addCabecera(label, valor) { 599 function addCabecera(label, valor) {
589 var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); 600 var propiedad = $filter('filter')($scope.cabecera, {label: label}, true);
590 if(propiedad.length === 1) { 601 if(propiedad.length === 1) {
591 propiedad[0].valor = valor; 602 propiedad[0].valor = valor;
592 } else { 603 } else {
593 $scope.cabecera.push({label: label, valor: valor}); 604 $scope.cabecera.push({label: label, valor: valor});
594 } 605 }
595 } 606 }
596 607
597 function removeCabecera(label) { 608 function removeCabecera(label) {
598 var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); 609 var propiedad = $filter('filter')($scope.cabecera, {label: label}, true);
599 if(propiedad.length === 1){ 610 if(propiedad.length === 1){
600 $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); 611 $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1);
601 } 612 }
602 } 613 }
603 614
604 function rellenar(relleno, longitud) { 615 function rellenar(relleno, longitud) {
605 relleno = '' + relleno; 616 relleno = '' + relleno;
606 while (relleno.length < longitud) { 617 while (relleno.length < longitud) {
607 relleno = '0' + relleno; 618 relleno = '0' + relleno;
608 } 619 }
609 620
610 return relleno; 621 return relleno;
611 } 622 }
612 } 623 }
613 ] 624 ]
614 ) 625 )
615 .controller('notaPedidoListaCtrl', [ 626 .controller('notaPedidoListaCtrl', [
616 '$scope', 627 '$scope',
617 'crearNotaPedidoService', 628 'crearNotaPedidoService',
618 '$location', 629 '$location',
619 function($scope, crearNotaPedidoService, $location) { 630 function($scope, crearNotaPedidoService, $location) {
620 crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { 631 crearNotaPedidoService.obtenerNotaPedido().then(function(datos) {
621 $scope.notaPedidos = datos.data; 632 $scope.notaPedidos = datos.data;
622 }); 633 });
623 $scope.editar = function(notaPedido) { 634 $scope.editar = function(notaPedido) {
624 crearNotaPedidoService.setNotaPedido(notaPedido); 635 crearNotaPedidoService.setNotaPedido(notaPedido);
625 $location.path('/venta-nota-pedido/abm/'); 636 $location.path('/venta-nota-pedido/abm/');
626 }; 637 };
627 $scope.crearPedido = function() { 638 $scope.crearPedido = function() {
628 crearNotaPedidoService.clearNotaPedido(); 639 crearNotaPedidoService.clearNotaPedido();
629 $location.path('/venta-nota-pedido/abm/'); 640 $location.path('/venta-nota-pedido/abm/');
630 }; 641 };
631 } 642 }
632 ]) 643 ])
633 .controller('focaCrearNotaPedidoFichaClienteController', [ 644 .controller('focaCrearNotaPedidoFichaClienteController', [
634 '$scope', 645 '$scope',
635 'crearNotaPedidoService', 646 'crearNotaPedidoService',
636 '$location', 647 '$location',
637 function($scope, crearNotaPedidoService, $location) { 648 function($scope, crearNotaPedidoService, $location) {
638 crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { 649 crearNotaPedidoService.obtenerNotaPedido().then(function(datos) {
639 $scope.notaPedidos = datos.data; 650 $scope.notaPedidos = datos.data;
640 }); 651 });
641 $scope.editar = function(notaPedido) { 652 $scope.editar = function(notaPedido) {
642 crearNotaPedidoService.setNotaPedido(notaPedido); 653 crearNotaPedidoService.setNotaPedido(notaPedido);
643 $location.path('/venta-nota-pedido/abm/'); 654 $location.path('/venta-nota-pedido/abm/');
644 }; 655 };
645 $scope.crearPedido = function() { 656 $scope.crearPedido = function() {
646 crearNotaPedidoService.clearNotaPedido(); 657 crearNotaPedidoService.clearNotaPedido();
647 $location.path('/venta-nota-pedido/abm/'); 658 $location.path('/venta-nota-pedido/abm/');
648 }; 659 };
649 } 660 }
650 ]); 661 ]);
651 662
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-5 col-sm-4 numero-pedido" 11 <div class="col-5 col-sm-4 numero-pedido"
12 >Nº {{puntoVenta}}-{{comprobante}} 12 >Nº {{puntoVenta}}-{{comprobante}}
13 </div> 13 </div>
14 <div class="col-7 col-sm-4 text-right"> 14 <div class="col-7 col-sm-4 text-right">
15 Fecha: 15 Fecha:
16 <span 16 <span
17 ng-show="!datepickerAbierto" 17 ng-show="!datepickerAbierto"
18 ng-bind="now | date:'dd/MM/yyyy HH:mm'" 18 ng-bind="now | date:'dd/MM/yyyy HH:mm'"
19 ng-click="datepickerAbierto = true" 19 ng-click="datepickerAbierto = true"
20 > 20 >
21 </span> 21 </span>
22 <input 22 <input
23 ng-show="datepickerAbierto" 23 ng-show="datepickerAbierto"
24 type="date" 24 type="date"
25 ng-model="now" 25 ng-model="now"
26 ng-change="datepickerAbierto = false" 26 ng-change="datepickerAbierto = false"
27 ng-blur="datepickerAbierto = false" 27 ng-blur="datepickerAbierto = false"
28 class="form-control form-control-sm col-8 float-right" 28 class="form-control form-control-sm col-8 float-right"
29 foca-focus="datepickerAbierto" 29 foca-focus="datepickerAbierto"
30 hasta-hoy 30 hasta-hoy
31 /> 31 />
32 </div> 32 </div>
33 </div> 33 </div>
34 <div class="row"> 34 <div class="row">
35 <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">
36 <span class="label" ng-bind="cab.label"></span> 36 <span class="label" ng-bind="cab.label"></span>
37 <span class="valor" ng-bind="cab.valor"></span> 37 <span class="valor" ng-bind="cab.valor"></span>
38 </div> 38 </div>
39 <a 39 <a
40 class="btn col-12 btn-secondary d-sm-none" 40 class="btn col-12 btn-secondary d-sm-none"
41 ng-show="cabecera.length > 0" 41 ng-show="cabecera.length > 0"
42 ng-click="showCabecera = !showCabecera" 42 ng-click="showCabecera = !showCabecera"
43 > 43 >
44 <i 44 <i
45 class="fa fa-chevron-down" 45 class="fa fa-chevron-down"
46 ng-hide="showCabecera" 46 ng-hide="showCabecera"
47 aria-hidden="true" 47 aria-hidden="true"
48 > 48 >
49 </i> 49 </i>
50 <i 50 <i
51 class="fa fa-chevron-up" 51 class="fa fa-chevron-up"
52 ng-show="showCabecera" 52 ng-show="showCabecera"
53 aria-hidden="true"> 53 aria-hidden="true">
54 </i> 54 </i>
55 </a> 55 </a>
56 </div> 56 </div>
57 </div> 57 </div>
58 </div> 58 </div>
59 <div class="row p-1 botonera-secundaria"> 59 <div class="row p-1 botonera-secundaria">
60 <div class="col-12"> 60 <div class="col-12">
61 <div class="row"> 61 <div class="row">
62 <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">
63 <button 63 <button
64 type="button" 64 type="button"
65 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"
66 ng-click="boton.accion()" 66 ng-click="boton.accion()"
67 ng-class="{'d-none d-sm-block': boton.texto == ''}" 67 ng-class="{'d-none d-sm-block': boton.texto == ''}"
68 > 68 >
69 <i 69 <i
70 class="fa fa-arrow-circle-right" 70 class="fa fa-arrow-circle-right"
71 ng-show="boton.texto != ''" 71 ng-show="boton.texto != ''"
72 ></i> 72 ></i>
73 &nbsp; 73 &nbsp;
74 {{boton.texto}} 74 {{boton.texto}}
75 </button> 75 </button>
76 </div> 76 </div>
77 </div> 77 </div>
78 </div> 78 </div>
79 </div> 79 </div>
80 </div> 80 </div>
81 </div> 81 </div>
82 </form> 82 </form>
83 <div class="row"> 83 <div class="row">
84 <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">
85 <!-- PC --> 85 <!-- PC -->
86 <div class="row grilla-articulo align-items-end d-none d-sm-flex"> 86 <div class="row grilla-articulo align-items-end d-none d-sm-flex">
87 <table class="table tabla-articulo table-striped table-sm table-dark"> 87 <table class="table tabla-articulo table-striped table-sm table-dark">
88 <thead> 88 <thead>
89 <tr class="d-flex"> 89 <tr class="d-flex">
90 <th class="">#</th> 90 <th class="">#</th>
91 <th class="col">Código</th> 91 <th class="col">Código</th>
92 <th class="col-4">Descripción</th> 92 <th class="col-4">Descripción</th>
93 <th class="col text-right">Cantidad</th> 93 <th class="col text-right">Cantidad</th>
94 <th class="col text-right">Precio Unitario</th> 94 <th class="col text-right">Precio Unitario</th>
95 <th class="col text-right">SubTotal</th> 95 <th class="col text-right">SubTotal</th>
96 <th class="text-right"> 96 <th class="text-right">
97 <button 97 <button
98 class="btn btn-outline-secondary selectable" 98 class="btn btn-outline-secondary selectable"
99 ng-click="show = !show; masMenos()" 99 ng-click="show = !show; masMenos()"
100 > 100 >
101 <i 101 <i
102 class="fa fa-chevron-down" 102 class="fa fa-chevron-down"
103 ng-show="show" 103 ng-show="show"
104 aria-hidden="true" 104 aria-hidden="true"
105 > 105 >
106 </i> 106 </i>
107 <i 107 <i
108 class="fa fa-chevron-up" 108 class="fa fa-chevron-up"
109 ng-hide="show" 109 ng-hide="show"
110 aria-hidden="true"> 110 aria-hidden="true">
111 </i> 111 </i>
112 </button> 112 </button>
113 </th> 113 </th>
114 </tr> 114 </tr>
115 </thead> 115 </thead>
116 <tbody class="tabla-articulo-body"> 116 <tbody class="tabla-articulo-body">
117 <tr 117 <tr
118 ng-repeat="(key, articulo) in articulosTabla" 118 ng-repeat="(key, articulo) in articulosTabla"
119 ng-show="show || key == (articulosTabla.length - 1)" 119 ng-show="show || key == (articulosTabla.length - 1)"
120 class="d-flex" 120 class="d-flex"
121 > 121 >
122 <td ng-bind="key + 1"></td> 122 <td ng-bind="key + 1"></td>
123 <td 123 <td
124 class="col" 124 class="col"
125 ng-bind="articulo.sector + '-' + articulo.codigo" 125 ng-bind="articulo.sector + '-' + articulo.codigo"
126 ></td> 126 ></td>
127 <td 127 <td
128 class="col-4" 128 class="col-4"
129 ng-bind="articulo.descripcion" 129 ng-bind="articulo.descripcion"
130 ></td> 130 ></td>
131 <td class="col text-right"> 131 <td class="col text-right">
132 <input 132 <input
133 ng-show="articulo.editCantidad" 133 ng-show="articulo.editCantidad"
134 ng-model="articulo.cantidad" 134 ng-model="articulo.cantidad"
135 class="form-control" 135 class="form-control"
136 type="text" 136 type="number"
137 min="1"
137 foca-focus="articulo.editCantidad" 138 foca-focus="articulo.editCantidad"
138 ng-keypress="editarArticulo($event.keyCode, articulo)" 139 ng-keypress="editarArticulo($event.keyCode, articulo)"
139 ng-focus="selectFocus($event)" 140 ng-focus="selectFocus($event)"
140 ng-blur="parsearATexto(articulo)"
141 teclado-virtual 141 teclado-virtual
142 > 142 >
143 <i 143 <i
144 class="selectable" 144 class="selectable"
145 ng-click="cambioEdit(articulo, 'cantidad')" 145 ng-click="cambioEdit(articulo, 'cantidad')"
146 ng-hide="articulo.editCantidad" 146 ng-hide="articulo.editCantidad"
147 ng-bind="articulo.cantidad"> 147 ng-bind="articulo.cantidad">
148 </i> 148 </i>
149 </td> 149 </td>
150 <td class="col text-right"> 150 <td class="col text-right">
151 <input 151 <input
152 ng-show="articulo.editPrecio" 152 ng-show="articulo.editPrecio"
153 ng-model="articulo.precio" 153 ng-model="articulo.precio"
154 class="form-control" 154 class="form-control"
155 type="text" 155 type="number"
156 min="0"
157 step="0.0001"
156 foca-focus="articulo.editPrecio" 158 foca-focus="articulo.editPrecio"
157 ng-keypress="editarArticulo($event.keyCode, articulo)" 159 ng-keypress="editarArticulo($event.keyCode, articulo)"
158 ng-focus="selectFocus($event)" 160 ng-focus="selectFocus($event)"
159 ng-blur="parsearATexto(articulo)"
160 teclado-virtual 161 teclado-virtual
161 > 162 >
162 <i 163 <i
163 class="selectable" 164 class="selectable"
164 ng-click="idLista == -1 && cambioEdit(articulo, 'precio')" 165 ng-click="idLista == -1 && cambioEdit(articulo, 'precio')"
165 ng-hide="articulo.editPrecio" 166 ng-hide="articulo.editPrecio"
166 ng-bind="articulo.precio | currency: notaPedido.moneda.simbolo : 4"> 167 ng-bind="articulo.precio | currency: notaPedido.moneda.simbolo : 4">
167 </i> 168 </i>
168 </td> 169 </td>
169 <td 170 <td
170 class="col text-right" 171 class="col text-right"
171 ng-bind="(articulo.precio * articulo.cantidad) | currency: notaPedido.moneda.simbolo"> 172 ng-bind="(articulo.precio * articulo.cantidad) | currency: notaPedido.moneda.simbolo">
172 </td> 173 </td>
173 <td class="text-center"> 174 <td class="text-center">
174 <button 175 <button
175 class="btn btn-outline-secondary" 176 class="btn btn-outline-secondary"
176 ng-click="quitarArticulo(key)" 177 ng-click="quitarArticulo(key)"
177 > 178 >
178 <i class="fa fa-trash"></i> 179 <i class="fa fa-trash"></i>
179 </button> 180 </button>
180 </td> 181 </td>
181 </tr> 182 </tr>
182 </tbody> 183 </tbody>
183 <tfoot> 184 <tfoot>
184 <tr ng-show="!cargando" class="d-flex"> 185 <tr ng-show="!cargando" class="d-flex">
185 <td 186 <td
186 class="align-middle" 187 class="align-middle"
187 ng-bind="articulosTabla.length + 1" 188 ng-bind="articulosTabla.length + 1"
188 ></td> 189 ></td>
189 <td class="col"> 190 <td class="col">
190 <input 191 <input
191 class="form-control" 192 class="form-control"
192 ng-model="articuloACargar.sectorCodigo" 193 ng-model="articuloACargar.sectorCodigo"
193 readonly 194 readonly
194 > 195 >
195 </td> 196 </td>
196 <td class="col-4 tabla-articulo-descripcion"> 197 <td class="col-4 tabla-articulo-descripcion">
197 <input 198 <input
198 class="form-control" 199 class="form-control"
199 ng-model="articuloACargar.descripcion" 200 ng-model="articuloACargar.descripcion"
200 readonly 201 readonly
201 > 202 >
202 </td> 203 </td>
203 <td class="col text-right"> 204 <td class="col text-right">
204 <input 205 <input
205 class="form-control" 206 class="form-control"
206 type="text" 207 type="number"
208 min="1"
207 ng-model="articuloACargar.cantidad" 209 ng-model="articuloACargar.cantidad"
208 foca-focus="!cargando" 210 foca-focus="!cargando"
209 esc-key="resetFilter()" 211 esc-key="resetFilter()"
210 ng-keypress="agregarATabla($event.keyCode)" 212 ng-keypress="agregarATabla($event.keyCode)"
211 ng-blur="parsearATexto(articuloACargar)" 213 ng-blur="parsearATexto(articuloACargar)"
212 teclado-virtual 214 teclado-virtual
213 > 215 >
214 </td> 216 </td>
215 <td class="col text-right"> 217 <td class="col text-right">
216 <input 218 <input
217 class="form-control" 219 class="form-control"
218 ng-value="articuloACargar.precio | currency: notaPedido.moneda.simbolo : 4" 220 ng-value="articuloACargar.precio | currency: notaPedido.moneda.simbolo : 4"
219 ng-show="idLista != -1" 221 ng-show="idLista != -1"
220 readonly 222 readonly
221 > 223 >
222 <input 224 <input
223 class="form-control" 225 class="form-control"
224 type="text" 226 type="number"
227 min="0"
228 step="0.0001"
225 ng-model="articuloACargar.precio" 229 ng-model="articuloACargar.precio"
226 esc-key="resetFilter()" 230 esc-key="resetFilter()"
227 ng-keypress="agregarATabla($event.keyCode)" 231 ng-keypress="agregarATabla($event.keyCode)"
228 ng-show="idLista == -1" 232 ng-show="idLista == -1"
229 ng-blur="parsearATexto(articuloACargar)"
230 teclado-virtual 233 teclado-virtual
231 > 234 >
232 </td> 235 </td>
233 <td class="col text-right"> 236 <td class="col text-right">
234 <input 237 <input
235 class="form-control" 238 class="form-control"
236 ng-value="getSubTotal() | currency: notaPedido.moneda.simbolo" 239 ng-value="getSubTotal() | currency: notaPedido.moneda.simbolo"
237 readonly 240 readonly
238 ></td> 241 ></td>
239 <td class="text-center align-middle"> 242 <td class="text-center align-middle">
240 <button 243 <button
241 class="btn btn-outline-secondary" 244 class="btn btn-outline-secondary"
242 ng-click="agregarATabla(13)" 245 ng-click="agregarATabla(13)"
243 > 246 >
244 <i class="fa fa-save"></i> 247 <i class="fa fa-save"></i>
245 </button> 248 </button>
246 </td> 249 </td>
247 </tr> 250 </tr>
248 <tr ng-show="cargando" class="d-flex"> 251 <tr ng-show="cargando" class="d-flex">
249 <td colspan="7" class="col-12"> 252 <td colspan="7" class="col-12">
250 <input 253 <input
251 placeholder="Seleccione Articulo" 254 placeholder="Seleccione Articulo"
252 class="form-control form-control-sm" 255 class="form-control form-control-sm"
253 readonly 256 readonly
254 ng-click="seleccionarArticulo()" 257 ng-click="seleccionarArticulo()"
255 /> 258 />
256 </td> 259 </td>
257 </tr> 260 </tr>
258 <tr class="d-flex"> 261 <tr class="d-flex">
259 <td colspan="4" class="no-border-top"> 262 <td colspan="4" class="no-border-top">
260 <strong>Items:</strong> 263 <strong>Items:</strong>
261 <a ng-bind="articulosTabla.length"></a> 264 <a ng-bind="articulosTabla.length"></a>
262 </td> 265 </td>
263 <td class="text-right ml-auto table-celda-total no-border-top"> 266 <td class="text-right ml-auto table-celda-total no-border-top">
264 <h3>Total:</h3> 267 <h3>Total:</h3>
265 </td> 268 </td>
266 <td class="table-celda-total text-right no-border-top" colspan="1"> 269 <td class="table-celda-total text-right no-border-top" colspan="1">
267 <h3>{{getTotal() | currency: notaPedido.moneda.simbolo}}</h3> 270 <h3>{{getTotal() | currency: notaPedido.moneda.simbolo}}</h3>
268 </td> 271 </td>
269 <td class="text-right no-border-top"> 272 <td class="text-right no-border-top">
270 <button 273 <button
271 type="button" 274 type="button"
272 class="btn btn-default btn-sm" 275 class="btn btn-default btn-sm"
273 > 276 >
274 Totales 277 Totales
275 </button> 278 </button>
276 </td> 279 </td>
277 </tr> 280 </tr>
278 </tfoot> 281 </tfoot>
279 </table> 282 </table>
280 </div> 283 </div>
281 284
282 <!-- MOBILE --> 285 <!-- MOBILE -->
283 <div class="row d-sm-none"> 286 <div class="row d-sm-none">
284 <table class="table table-sm table-striped table-dark margin-bottom-mobile"> 287 <table class="table table-sm table-striped table-dark margin-bottom-mobile">
285 <thead> 288 <thead>
286 <tr class="d-flex"> 289 <tr class="d-flex">
287 <th class="">#</th> 290 <th class="">#</th>
288 <th class="col px-0"> 291 <th class="col px-0">
289 <div class="d-flex"> 292 <div class="d-flex">
290 <div class="col-4 px-1">Código</div> 293 <div class="col-4 px-1">Código</div>
291 <div class="col-8 px-1">Descripción</div> 294 <div class="col-8 px-1">Descripción</div>
292 </div> 295 </div>
293 <div class="d-flex"> 296 <div class="d-flex">
294 <div class="col-3 px-1">Cantidad</div> 297 <div class="col-3 px-1">Cantidad</div>
295 <div class="col px-1 text-right">P. Uni.</div> 298 <div class="col px-1 text-right">P. Uni.</div>
296 <div class="col px-1 text-right">Subtotal</div> 299 <div class="col px-1 text-right">Subtotal</div>
297 </div> 300 </div>
298 </th> 301 </th>
299 <th class="text-center tamaño-boton"> 302 <th class="text-center tamaño-boton">
300 &nbsp; 303 &nbsp;
301 </th> 304 </th>
302 </tr> 305 </tr>
303 </thead> 306 </thead>
304 <tbody> 307 <tbody>
305 <tr 308 <tr
306 ng-repeat="(key, articulo) in articulosTabla" 309 ng-repeat="(key, articulo) in articulosTabla"
307 ng-show="show || key == articulosTabla.length - 1" 310 ng-show="show || key == articulosTabla.length - 1"
308 > 311 >
309 <td class="w-100 align-middle d-flex p-0"> 312 <td class="w-100 align-middle d-flex p-0">
310 <div class="align-middle p-1"> 313 <div class="align-middle p-1">
311 <span ng-bind="key+1" class="align-middle"></span> 314 <span ng-bind="key+1" class="align-middle"></span>
312 </div> 315 </div>
313 <div class="col px-0"> 316 <div class="col px-0">
314 <div class="d-flex"> 317 <div class="d-flex">
315 <div class="col-4 px-1"> 318 <div class="col-4 px-1">
316 <span 319 <span
317 ng-bind="articulo.sector + '-' + articulo.codigo" 320 ng-bind="articulo.sector + '-' + articulo.codigo"
318 ></span> 321 ></span>
319 </div> 322 </div>
320 <div class="col-8 px-1"> 323 <div class="col-8 px-1">
321 <span ng-bind="articulo.descripcion"></span> 324 <span ng-bind="articulo.descripcion"></span>
322 </div> 325 </div>
323 </div> 326 </div>
324 <div class="d-flex"> 327 <div class="d-flex">
325 <div class="col-3 px-1"> 328 <div class="col-3 px-1">
326 <span ng-bind="'x' + articulo.cantidad"></span> 329 <span ng-bind="'x' + articulo.cantidad"></span>
327 </div> 330 </div>
328 <div class="col-3 px-1 text-right"> 331 <div class="col-3 px-1 text-right">
329 <span ng-bind="articulo.precio | currency: notaPedido.moneda.simbolo : 4"></span> 332 <span ng-bind="articulo.precio | currency: notaPedido.moneda.simbolo : 4"></span>
330 </div> 333 </div>
331 <div class="col px-1 text-right"> 334 <div class="col px-1 text-right">
332 <span 335 <span
333 ng-bind="(articulo.precio * articulo.cantidad) | currency: notaPedido.moneda.simbolo" 336 ng-bind="(articulo.precio * articulo.cantidad) | currency: notaPedido.moneda.simbolo"
334 > 337 >
335 </span> 338 </span>
336 </div> 339 </div>
337 </div> 340 </div>
338 </div> 341 </div>
339 <div class="align-middle p-1"> 342 <div class="align-middle p-1">
340 <button 343 <button
341 class="btn btn-outline-secondary" 344 class="btn btn-outline-secondary"
342 ng-click="quitarArticulo(key)" 345 ng-click="quitarArticulo(key)"
343 > 346 >
344 <i class="fa fa-trash"></i> 347 <i class="fa fa-trash"></i>
345 </button> 348 </button>
346 </div> 349 </div>
347 </td> 350 </td>
348 </tr> 351 </tr>
349 </tbody> 352 </tbody>
350 <tfoot> 353 <tfoot>
351 <!-- CARGANDO ITEM --> 354 <!-- CARGANDO ITEM -->
352 <tr ng-show="!cargando" class="d-flex"> 355 <tr ng-show="!cargando" class="d-flex">
353 <td 356 <td
354 class="align-middle p-1" 357 class="align-middle p-1"
355 ng-bind="articulosTabla.length + 1" 358 ng-bind="articulosTabla.length + 1"
356 ></td> 359 ></td>
357 <td class="col p-0"> 360 <td class="col p-0">
358 <div class="d-flex"> 361 <div class="d-flex">
359 <div class="col-4 px-1"> 362 <div class="col-4 px-1">
360 <span 363 <span
361 ng-bind="articuloACargar.sectorCodigo" 364 ng-bind="articuloACargar.sectorCodigo"
362 ></span> 365 ></span>
363 </div> 366 </div>
364 <div class="col-8 px-1"> 367 <div class="col-8 px-1">
365 <span ng-bind="articuloACargar.descripcion"></span> 368 <span ng-bind="articuloACargar.descripcion"></span>
366 </div> 369 </div>
367 </div> 370 </div>
368 <div class="d-flex"> 371 <div class="d-flex">
369 <div class="col-3 px-1 m-1"> 372 <div class="col-3 px-1 m-1">
370 <input 373 <input
371 class="form-control p-1" 374 class="form-control p-1"
372 type="number" 375 type="number"
373 min="1" 376 min="1"
374 ng-model="articuloACargar.cantidad" 377 ng-model="articuloACargar.cantidad"
375 foca-focus="!cargando" 378 foca-focus="!cargando"
376 ng-keypress="agregarATabla($event.keyCode)" 379 ng-keypress="agregarATabla($event.keyCode)"
377 style="height: auto; line-height: 1.1em" 380 style="height: auto; line-height: 1.1em"
378 > 381 >
379 </div> 382 </div>
380 <div class="col-3 px-1 text-right"> 383 <div class="col-3 px-1 text-right">
381 <span ng-bind="articuloACargar.precio | currency: notaPedido.moneda.simbolo : 4"></span> 384 <span ng-bind="articuloACargar.precio | currency: notaPedido.moneda.simbolo : 4"></span>
382 </div> 385 </div>
383 <div class="col px-1 text-right"> 386 <div class="col px-1 text-right">
384 <span 387 <span
385 ng-bind="getSubTotal() | currency: notaPedido.moneda.simbolo" 388 ng-bind="getSubTotal() | currency: notaPedido.moneda.simbolo"
386 > 389 >
387 </span> 390 </span>
388 </div> 391 </div>
389 </div> 392 </div>
390 </td> 393 </td>
391 <td class="text-center align-middle"> 394 <td class="text-center align-middle">
392 <button 395 <button
393 class="btn btn-outline-secondary" 396 class="btn btn-outline-secondary"
394 ng-click="agregarATabla(13)" 397 ng-click="agregarATabla(13)"
395 > 398 >
396 <i class="fa fa-save"></i> 399 <i class="fa fa-save"></i>
397 </button> 400 </button>
398 </td> 401 </td>
399 </tr> 402 </tr>
400 <!-- SELECCIONAR PRODUCTO --> 403 <!-- SELECCIONAR PRODUCTO -->
401 <tr ng-show="cargando" class="d-flex"> 404 <tr ng-show="cargando" class="d-flex">
402 <td class="col-12"> 405 <td class="col-12">
403 <input 406 <input
404 placeholder="Seleccione Articulo" 407 placeholder="Seleccione Articulo"
405 class="form-control form-control-sm" 408 class="form-control form-control-sm"
406 readonly 409 readonly
407 ng-click="seleccionarArticulo()" 410 ng-click="seleccionarArticulo()"
408 /> 411 />
409 </td> 412 </td>
410 </tr> 413 </tr>
411 <!-- TOOGLE EXPANDIR --> 414 <!-- TOOGLE EXPANDIR -->
412 <tr> 415 <tr>
413 <td class="col"> 416 <td class="col">
414 <button 417 <button
415 class="btn btn-outline-secondary selectable w-100" 418 class="btn btn-outline-secondary selectable w-100"
416 ng-click="show = !show; masMenos()" 419 ng-click="show = !show; masMenos()"
417 ng-show="articulosTabla.length > 0" 420 ng-show="articulosTabla.length > 0"
418 > 421 >
419 <i 422 <i
420 class="fa fa-chevron-down" 423 class="fa fa-chevron-down"
421 ng-hide="show" 424 ng-hide="show"
422 aria-hidden="true" 425 aria-hidden="true"
423 > 426 >
424 </i> 427 </i>
425 <i 428 <i
426 class="fa fa-chevron-up" 429 class="fa fa-chevron-up"
427 ng-show="show" 430 ng-show="show"
428 aria-hidden="true"> 431 aria-hidden="true">
429 </i> 432 </i>
430 </button> 433 </button>
431 </td> 434 </td>
432 </tr> 435 </tr>
433 <!-- FOOTER --> 436 <!-- FOOTER -->
434 <tr class="d-flex"> 437 <tr class="d-flex">
435 <td class="align-middle no-border-top" colspan="2"> 438 <td class="align-middle no-border-top" colspan="2">
436 <strong>Cantidad Items:</strong> 439 <strong>Cantidad Items:</strong>
437 <a ng-bind="articulosTabla.length"></a> 440 <a ng-bind="articulosTabla.length"></a>
438 </td> 441 </td>
439 <td class="text-right ml-auto table-celda-total no-border-top"> 442 <td class="text-right ml-auto table-celda-total no-border-top">
440 <h3>Total:</h3> 443 <h3>Total:</h3>
441 </td> 444 </td>
442 <td class="table-celda-total text-right no-border-top"> 445 <td class="table-celda-total text-right no-border-top">
443 <h3>{{getTotal() | currency: notaPedido.moneda.simbolo}}</h3> 446 <h3>{{getTotal() | currency: notaPedido.moneda.simbolo}}</h3>
444 </td> 447 </td>
445 </tr> 448 </tr>
446 </tfoot> 449 </tfoot>
447 </table> 450 </table>
448 </div> 451 </div>
449 </div> 452 </div>
450 <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> 453 <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block">
451 <div class="row align-items-end"> 454 <div class="row align-items-end">
452 <div class="col-12"> 455 <div class="col-12">
453 <button 456 <button
454 ng-click="crearNotaPedido()" 457 ng-click="crearNotaPedido()"
455 type="submit" 458 type="submit"
456 title="Crear nota pedido" 459 title="Crear nota pedido"
457 class="btn btn-default btn-block mb-2"> 460 class="btn btn-default btn-block mb-2">
458 Guardar 461 Guardar
459 </button> 462 </button>
460 <button 463 <button
461 ng-click="salir()" 464 ng-click="salir()"
462 type="button" 465 type="button"
463 title="Salir" 466 title="Salir"
464 class="btn btn-default btn-block"> 467 class="btn btn-default btn-block">
465 Salir 468 Salir
466 </button> 469 </button>
467 </div> 470 </div>
468 </div> 471 </div>
469 </div> 472 </div>
470 </div> 473 </div>
471 <div class="row d-md-none fixed-bottom"> 474 <div class="row d-md-none fixed-bottom">
472 <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> 475 <div class="w-100 bg-dark d-flex px-3 acciones-mobile">
473 <span class="ml-3 text-muted" ng-click="salir()">Salir</span> 476 <span class="ml-3 text-muted" ng-click="salir()">Salir</span>
474 <span class="mr-3 ml-auto" ng-click="crearNotaPedido()">Guardar</span> 477 <span class="mr-3 ml-auto" ng-click="crearNotaPedido()">Guardar</span>
475 </div> 478 </div>