Commit 89b9bfdb5f893a226f7b8b60f88e2aa5fc59ef96
Exists in
master
Merge branch 'master' into 'master'
Master(mpuebla) See merge request !9
Showing
3 changed files
Show diff stats
src/js/controller.js
1 | angular.module('focaModalDescarga') | 1 | angular.module('focaModalDescarga') |
2 | .controller('focaModalDescargaCtrl', [ | 2 | .controller('focaModalDescargaCtrl', [ |
3 | '$scope', | 3 | '$scope', |
4 | 'focaModalDescargasService', | 4 | 'focaModalDescargasService', |
5 | '$filter', | 5 | '$filter', |
6 | 'focaModalService', | 6 | 'focaModalService', |
7 | '$timeout', | 7 | '$timeout', |
8 | '$uibModalInstance', | 8 | '$uibModalInstance', |
9 | '$uibModal', | 9 | '$uibModal', |
10 | 'remito', | 10 | 'remito', |
11 | 'focaModalDetalleHojaRutaService', | 11 | 'focaModalDetalleHojaRutaService', |
12 | 'focaSeguimientoService', | 12 | 'focaSeguimientoService', |
13 | 'crearRemitoService', | 13 | 'crearRemitoService', |
14 | function ($scope, focaModalDescargasService, $filter, | 14 | function ($scope, focaModalDescargasService, $filter, |
15 | focaModalService, $timeout, $uibModalInstance, $uibModal, remito, | 15 | focaModalService, $timeout, $uibModalInstance, $uibModal, remito, |
16 | focaModalDetalleHojaRutaService, focaSeguimientoService, crearRemitoService) { | 16 | focaModalDetalleHojaRutaService, focaSeguimientoService, crearRemitoService) { |
17 | 17 | ||
18 | //#region variables | 18 | //#region variables |
19 | $scope.remito = {}; | 19 | $scope.remito = {}; |
20 | $scope.remito = remito; | 20 | $scope.remito = remito; |
21 | $scope.nroRecibo = 0; | 21 | $scope.nroRecibo = 0; |
22 | $scope.cisternas = remito.cisternas; | 22 | $scope.cisternas = remito.cisternas; |
23 | $scope.nroSucursal = "00" + remito.sucursal; | 23 | $scope.nroSucursal; |
24 | $scope.nroRemito; | 24 | $scope.nroRemito; |
25 | $scope.articulos = []; | 25 | $scope.articulos = []; |
26 | $scope.hasErrorSucursalRemito = false; | ||
26 | //#endregion | 27 | //#endregion |
27 | 28 | ||
28 | function init () { | 29 | function init() { |
29 | crearRemitoService.getNumeroRemito().then( | 30 | crearRemitoService.getNumeroRemito().then( |
30 | function (res) { | 31 | function (res) { |
31 | 32 | $scope.nroSucursal = res.data.sucursal; | |
32 | $scope.nroRemito = rellenar(res.data.sucursal, 4) + '-' + | 33 | $scope.nroRemito = res.data.numeroRemito; |
33 | rellenar(res.data.numeroRemito, 8); | 34 | $scope.validateSucursalRemito($scope.nroSucursal, $scope.nroRemito); |
34 | }, | 35 | }, |
35 | function (err) { | 36 | function (err) { |
36 | focaModalService.alert('La terminal no esta configurada correctamente'); | 37 | focaModalService.alert('La terminal no esta configurada correctamente'); |
37 | console.info(err); | 38 | console.info(err); |
38 | } | 39 | } |
39 | ); | 40 | ); |
40 | }; | 41 | }; |
41 | 42 | ||
42 | init(); | 43 | init(); |
43 | 44 | ||
44 | $scope.crearRemito = function () { | 45 | $scope.crearRemito = function () { |
45 | if (!$scope.remito.cliente) { | 46 | if (!$scope.remito.cliente) { |
46 | focaModalService.alert("No has seleccionado cliente"); | 47 | focaModalService.alert("No has seleccionado cliente"); |
47 | return; | 48 | return; |
48 | } | 49 | } |
49 | if (validarDescarga()) { | 50 | if (validarDescarga()) { |
50 | return; | 51 | return; |
51 | } | 52 | } |
52 | //#region OBJETO REMITO | 53 | //#region OBJETO REMITO |
53 | var remito = { | 54 | var remito = { |
54 | id: 0, | 55 | id: 0, |
55 | fechaRemito: new Date().toISOString().slice(0, 19).replace('T', ' '), | 56 | fechaRemito: new Date().toISOString().slice(0, 19).replace('T', ' '), |
56 | idCliente: $scope.remito.cliente.cod, | 57 | idCliente: $scope.remito.cliente.cod, |
57 | nombreCliente: $scope.remito.cliente.nom, | 58 | nombreCliente: $scope.remito.cliente.nom, |
58 | cuitCliente: $scope.remito.cliente.cuit, | 59 | cuitCliente: $scope.remito.cliente.cuit, |
59 | total: $scope.getTotal() * $scope.remito.cotizacion.VENDEDOR, | 60 | total: $scope.getTotal() * $scope.remito.cotizacion.VENDEDOR, |
60 | numeroNotaPedido: $scope.remito.numeroNotaPedido, | 61 | numeroNotaPedido: $scope.remito.numeroNotaPedido, |
61 | idVendedor: $scope.remito.cliente.ven, | 62 | idVendedor: $scope.remito.cliente.ven, |
62 | idProveedor: $scope.remito.proveedor.COD, | 63 | idProveedor: $scope.remito.proveedor.COD, |
63 | idDomicilio: 0, | 64 | idDomicilio: 0, |
64 | idCotizacion: $scope.remito.cotizacion.ID, | 65 | idCotizacion: $scope.remito.cotizacion.ID, |
65 | idListaPrecio: $scope.remito.cliente.mod, | 66 | idListaPrecio: parseInt($scope.remito.cliente.mod), |
66 | flete: $scope.remito.flete, | 67 | flete: $scope.remito.flete, |
67 | fob: $scope.remito.fob, | 68 | fob: $scope.remito.fob, |
68 | bomba: $scope.remito.bomba, | 69 | bomba: $scope.remito.bomba, |
69 | kilometros: $scope.remito.kilometros, | 70 | kilometros: $scope.remito.kilometros, |
70 | domicilioStamp: $scope.remito.cliente.DOM, | 71 | domicilioStamp: $scope.remito.cliente.DOM, |
71 | observaciones: $scope.remito.observaciones, | 72 | observaciones: $scope.remito.observaciones, |
72 | numeroRemito: parseInt($scope.comprobante), | 73 | numeroRemito: parseInt($scope.nroRemito), |
73 | sucursal: parseInt($scope.puntoVenta), | 74 | sucursal: parseInt($scope.nroSucursal), |
74 | responsabilidadIvaCliente: $scope.remito.cliente.iva, | 75 | responsabilidadIvaCliente: $scope.remito.cliente.iva, |
75 | descuento: 0,//TODO, | 76 | descuento: 0,//TODO, |
76 | importeNeto: getImporte('netoUnitario'), | 77 | importeNeto: getImporte('netoUnitario'), |
77 | importeExento: getImporte('exentoUnitario'), | 78 | importeExento: getImporte('exentoUnitario'), |
78 | importeIva: getImporte('ivaUnitario'), | 79 | importeIva: getImporte('ivaUnitario'), |
79 | importeIvaServicios: 0,//TODO | 80 | importeIvaServicios: 0,//TODO |
80 | importeImpuestoInterno: getImporte('impuestoInternoUnitario'), | 81 | importeImpuestoInterno: getImporte('impuestoInternoUnitario'), |
81 | importeImpuestoInterno1: getImporte('impuestoInterno1Unitario'), | 82 | importeImpuestoInterno1: getImporte('impuestoInterno1Unitario'), |
82 | importeImpuestoInterno2: getImporte('impuestoInterno2Unitario'), | 83 | importeImpuestoInterno2: getImporte('impuestoInterno2Unitario'), |
83 | percepcion: 0,//TODO | 84 | percepcion: 0,//TODO |
84 | percepcionIva: 0,//TODO | 85 | percepcionIva: 0,//TODO |
85 | redondeo: 0,//TODO | 86 | redondeo: 0,//TODO |
86 | anulado: false, | 87 | anulado: false, |
87 | planilla: $filter('date')($scope.now, 'ddMMyyyy'), | 88 | planilla: $filter('date')($scope.now, 'ddMMyyyy'), |
88 | lugar: parseInt($scope.puntoVenta), | 89 | lugar: parseInt($scope.puntoVenta), |
89 | cuentaMadre: 0,//TODO | 90 | cuentaMadre: 0,//TODO |
90 | cuentaContable: 0,//TODO | 91 | cuentaContable: 0,//TODO |
91 | asiento: 0,//TODO | 92 | asiento: 0,//TODO |
92 | e_hd: '',//TODO | 93 | e_hd: '',//TODO |
93 | c_hd: '', | 94 | c_hd: '', |
94 | numeroLiquidoProducto: 0,//TODO | 95 | numeroLiquidoProducto: 0,//TODO |
95 | estado: 0, | 96 | estado: 0, |
96 | destinoVenta: 0,//TODO | 97 | destinoVenta: 0,//TODO |
97 | operacionTipo: 0, //TODO | 98 | operacionTipo: 0, //TODO |
98 | idHojaRuta: $scope.remito.idHojaRuta | 99 | idHojaRuta: $scope.remito.idHojaRuta |
99 | } | 100 | } |
100 | //#endregion | 101 | //#endregion |
101 | focaModalDescargasService.crearRemito({ remito: remito, notaPedido: { id: 0 } }) | 102 | focaModalDescargasService.crearRemito({ remito: remito, notaPedido: { id: 0 } }) |
102 | .then(function (res) { | 103 | .then(function (res) { |
103 | remitoId = res.data.id | 104 | remitoId = res.data.id |
104 | descargar(remitoId); | 105 | descargar(remitoId); |
105 | focaModalDescargasService. | 106 | focaModalDescargasService. |
106 | addArticulos($scope.remito.articulosRemito, $scope.articulos, remitoId, 1); | 107 | addArticulos($scope.remito.articulosRemito, $scope.articulos, remitoId, 1); |
107 | focaModalService.alert("Descarga realizada") | 108 | focaModalService.alert("Descarga realizada") |
108 | .then(function () { | 109 | .then(function () { |
109 | $uibModalInstance.dismiss(); | 110 | $uibModalInstance.dismiss(); |
110 | }) | 111 | }) |
111 | }) | 112 | }) |
112 | .catch(function (e) { console.log(e); }) | 113 | .catch(function (e) { console.log(e); }) |
113 | 114 | ||
114 | }; | 115 | }; |
115 | $scope.getTotal = function () { | 116 | $scope.getTotal = function () { |
116 | var total = 0; | 117 | var total = 0; |
117 | $scope.cisternas.forEach(function (cisterna) { | 118 | $scope.cisternas.forEach(function (cisterna) { |
118 | 119 | ||
119 | total += cisterna.cisternaCarga.articulo.PreVen * cisterna.cisternaCarga.descargar; | 120 | total += cisterna.cisternaCarga.articulo.PreVen * cisterna.cisternaCarga.descargar; |
120 | cisterna.cisternaCarga.articulo.cantidad = cisterna.cisternaCarga.descargar; | 121 | cisterna.cisternaCarga.articulo.cantidad = cisterna.cisternaCarga.descargar; |
121 | $scope.articulos.push(cisterna.cisternaCarga.articulo); | 122 | $scope.articulos.push(cisterna.cisternaCarga.articulo); |
122 | }); | 123 | }); |
123 | return parseFloat(total.toFixed(2)); | 124 | return parseFloat(total.toFixed(2)); |
124 | }; | 125 | }; |
125 | function descargar(idRemito) { | 126 | function descargar(idRemito) { |
126 | 127 | ||
127 | for (var i = 0; i < $scope.cisternas.length; i++) { | 128 | for (var i = 0; i < $scope.cisternas.length; i++) { |
128 | var descarga = $scope.cisternas[i].cisternaCarga.descargar; | 129 | var descarga = $scope.cisternas[i].cisternaCarga.descargar; |
129 | var hojaRutaMovimientos = []; | 130 | var hojaRutaMovimientos = []; |
130 | var cisternaMovimientos = []; | 131 | var cisternaMovimientos = []; |
131 | var cisternaCargas = []; | 132 | var cisternaCargas = []; |
132 | var cisternaCarga = $scope.cisternas[i].cisternaCarga; | 133 | var cisternaCarga = $scope.cisternas[i].cisternaCarga; |
133 | if (!descarga) continue; | 134 | if (!descarga) continue; |
134 | cisternaCarga.cantidad -= descarga; | 135 | cisternaCarga.cantidad -= descarga; |
135 | 136 | ||
136 | //Guardar | 137 | //Guardar |
137 | var now = new Date(); | 138 | var now = new Date(); |
138 | var cisternaMovimiento = { | 139 | var cisternaMovimiento = { |
139 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), | 140 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), |
140 | cantidad: descarga, | 141 | cantidad: descarga, |
141 | metodo: 'descarga', | 142 | metodo: 'descarga', |
142 | idCisternaCarga: cisternaCarga.id, | 143 | idCisternaCarga: cisternaCarga.id, |
143 | idRemito: idRemito | 144 | idRemito: idRemito |
144 | }; | 145 | }; |
145 | var hojaRutaMovimiento = { | 146 | var hojaRutaMovimiento = { |
146 | reciboDescarga: $scope.nroRecibo, | 147 | reciboDescarga: $scope.nroRecibo, |
147 | idRemito: idRemito | 148 | idRemito: idRemito |
148 | }; | 149 | }; |
149 | 150 | ||
150 | cisternaCarga = angular.copy($scope.cisternas[i].cisternaCarga); | 151 | cisternaCarga = angular.copy($scope.cisternas[i].cisternaCarga); |
151 | 152 | ||
152 | delete cisternaCarga.articulo; | 153 | delete cisternaCarga.articulo; |
153 | delete cisternaCarga.descargar; | 154 | delete cisternaCarga.descargar; |
154 | cisternaCargas.push(cisternaCarga); | 155 | cisternaCargas.push(cisternaCarga); |
155 | cisternaMovimientos.push(cisternaMovimiento); | 156 | cisternaMovimientos.push(cisternaMovimiento); |
156 | hojaRutaMovimientos.push(hojaRutaMovimiento); | 157 | hojaRutaMovimientos.push(hojaRutaMovimiento); |
157 | } | 158 | } |
158 | var save = { | 159 | var save = { |
159 | cisternaCargas: cisternaCargas, | 160 | cisternaCargas: cisternaCargas, |
160 | cisternaMovimientos: cisternaMovimientos, | 161 | cisternaMovimientos: cisternaMovimientos, |
161 | hojaRutaMovimientos: hojaRutaMovimientos, | 162 | hojaRutaMovimientos: hojaRutaMovimientos, |
162 | articulo: $scope.articuloSeleccionado | 163 | articulo: $scope.articuloSeleccionado |
163 | }; | 164 | }; |
164 | focaModalDetalleHojaRutaService | 165 | focaModalDetalleHojaRutaService |
165 | .postMovimientoHojaRuta(save) | 166 | .postMovimientoHojaRuta(save) |
166 | .then(guardarSeguimiento) | 167 | .then(guardarSeguimiento) |
167 | .catch(function () { }); | 168 | .catch(function () { }); |
168 | function guardarSeguimiento(res) { | 169 | function guardarSeguimiento(res) { |
169 | focaSeguimientoService | 170 | focaSeguimientoService |
170 | .guardarPosicion( | 171 | .guardarPosicion( |
171 | 'Entrega de producto', | 172 | 'Entrega de producto', |
172 | res.data[0].id, | 173 | res.data[0].id, |
173 | ''); | 174 | ''); |
174 | $scope.aDescargar = []; | 175 | $scope.aDescargar = []; |
175 | }; | 176 | }; |
176 | }; | 177 | }; |
177 | function getImporte(propiedad) { | 178 | function getImporte(propiedad) { |
178 | var importe = 0; | 179 | var importe = 0; |
179 | $scope.remito.articulosRemito.forEach(function (articulo) { | 180 | $scope.remito.articulosRemito.forEach(function (articulo) { |
180 | if (articulo[propiedad]) { | 181 | if (articulo[propiedad]) { |
181 | importe += articulo[propiedad] * articulo.cantidad; | 182 | importe += articulo[propiedad] * articulo.cantidad; |
182 | } | 183 | } |
183 | return; | 184 | return; |
184 | }); | 185 | }); |
185 | return importe; | 186 | return importe; |
186 | }; | 187 | }; |
187 | function validarDescarga() { | 188 | function validarDescarga() { |
188 | for (var i = 0; i < $scope.cisternas.length; i++) { | 189 | for (var i = 0; i < $scope.cisternas.length; i++) { |
189 | if (parseInt($scope.cisternas[i].cisternaCarga.descargar) > | 190 | if (parseInt($scope.cisternas[i].cisternaCarga.descargar) > |
190 | $scope.cisternas[i].cisternaCarga.cantidad || | 191 | $scope.cisternas[i].cisternaCarga.cantidad || |
191 | parseInt($scope.cisternas[i].cisternaCarga.descargar) < 0) { | 192 | parseInt($scope.cisternas[i].cisternaCarga.descargar) < 0) { |
192 | focaModalService.alert("Cantidad de descarga ingresada erronea"); | 193 | focaModalService.alert("Cantidad de descarga ingresada erronea"); |
193 | return true; | 194 | return true; |
194 | } | 195 | } |
195 | } | 196 | } |
196 | return false; | 197 | return false; |
197 | }; | 198 | }; |
198 | $scope.seleccionarCliente = function () { | 199 | $scope.seleccionarCliente = function () { |
199 | var modalInstance = $uibModal.open( | 200 | var modalInstance = $uibModal.open( |
200 | { | 201 | { |
201 | ariaLabelledBy: 'Busqueda de Cliente', | 202 | ariaLabelledBy: 'Busqueda de Cliente', |
202 | templateUrl: 'foca-busqueda-cliente-modal.html', | 203 | templateUrl: 'foca-busqueda-cliente-modal.html', |
203 | controller: 'focaBusquedaClienteModalController', | 204 | controller: 'focaBusquedaClienteModalController', |
204 | resolve: { | 205 | resolve: { |
205 | vendedor: function () { return null; }, | 206 | vendedor: function () { return null; }, |
206 | cobrador: function () { return null; } | 207 | cobrador: function () { return null; } |
207 | }, | 208 | }, |
208 | size: 'lg' | 209 | size: 'lg' |
209 | } | 210 | } |
210 | ); | 211 | ); |
211 | modalInstance.result.then(function (cliente) { | 212 | modalInstance.result.then(function (cliente) { |
212 | $scope.remito.cliente = cliente; | 213 | $scope.remito.cliente = cliente; |
213 | }, function () { | 214 | }, function () { |
214 | //funcion ejecutada al cancelar modal | 215 | //funcion ejecutada al cancelar modal |
215 | }); | 216 | }); |
216 | }; | 217 | }; |
218 | $scope.validateSucursalRemito = function (sucursal, remito) { | ||
219 | if (!sucursal || !remito) { | ||
220 | $scope.hasErrorSucursalRemito = false; | ||
221 | return; | ||
222 | } | ||
223 | |||
224 | focaModalDescargasService.validarSucursalRemito(sucursal, remito) | ||
225 | .then(function (res) { | ||
226 | if (res.data.data === 1) { | ||
227 | $scope.hasErrorSucursalRemito = true; | ||
228 | } else { | ||
229 | $scope.hasErrorSucursalRemito = false; | ||
230 | } | ||
231 | }) | ||
232 | .catch(function (e) { console.error(e); }); | ||
233 | }; | ||
217 | $scope.cancelar = function () { | 234 | $scope.cancelar = function () { |
218 | $uibModalInstance.dismiss(); | 235 | $uibModalInstance.dismiss(); |
219 | } | 236 | }; |
220 | |||
221 | |||
222 | function rellenar(relleno, longitud) { | 237 | function rellenar(relleno, longitud) { |
223 | relleno = '' + relleno; | 238 | relleno = '' + relleno; |
224 | while (relleno.length < longitud) { | 239 | while (relleno.length < longitud) { |
225 | relleno = '0' + relleno; | 240 | relleno = '0' + relleno; |
226 | } | 241 | } |
227 | return relleno; | 242 | return relleno; |
228 | } | 243 | }; |
229 | } | 244 | } |
src/js/service.js
1 | angular.module('focaModalDescarga') | 1 | angular.module('focaModalDescarga') |
2 | .factory('focaModalDescargasService', ['$http', 'API_ENDPOINT', 'crearRemitoService', | 2 | .factory('focaModalDescargasService', ['$http', 'API_ENDPOINT', 'crearRemitoService', |
3 | function ($http, API_ENDPOINT, crearRemitoService) { | 3 | function ($http, API_ENDPOINT, crearRemitoService) { |
4 | var route = API_ENDPOINT.URL; | 4 | var route = API_ENDPOINT.URL; |
5 | return { | 5 | return { |
6 | crearRemito: function (remito) { | 6 | crearRemito: function (remito) { |
7 | return $http.post(route + '/remito', remito); | 7 | return $http.post('http://10.231.45.197:9900' + '/remito/mobile', remito); |
8 | }, | ||
9 | validarSucursalRemito: function (sucursal, remito) { | ||
10 | return $http.get('http://10.231.45.197:9900' + '/remito/validar/' + | ||
11 | sucursal + '/' + remito); | ||
8 | }, | 12 | }, |
9 | addArticulos: function (articulosRemito, articulosBase, idRemito, cotizacion) { | 13 | addArticulos: function (articulosRemito, articulosBase, idRemito, cotizacion) { |
10 | 14 | ||
11 | for (var i = 0; i < articulosRemito.length; i++) { | 15 | for (var i = 0; i < articulosRemito.length; i++) { |
12 | 16 | ||
13 | var articuloReferencia = articulosBase.filter(function(articulo) { | 17 | var articuloReferencia = articulosBase.filter(function (articulo) { |
14 | return articulosRemito[i].idArticulo == articulo.id; | 18 | return articulosRemito[i].idArticulo == articulo.id; |
15 | })[0]; | 19 | })[0]; |
16 | 20 | ||
17 | delete articulosRemito[i].id | 21 | delete articulosRemito[i].id |
18 | delete articulosRemito[i].editCantidad; | 22 | delete articulosRemito[i].editCantidad; |
19 | delete articulosRemito[i].editPrecio; | 23 | delete articulosRemito[i].editPrecio; |
20 | 24 | ||
21 | articulosRemito[i].idRemito = articulosRemito[i].idRemito !== -1 ? | 25 | articulosRemito[i].idRemito = articulosRemito[i].idRemito !== -1 ? |
22 | idRemito : articulosRemito[i].idRemito; | 26 | idRemito : articulosRemito[i].idRemito; |
23 | 27 | ||
24 | articulosRemito[i].precio = articuloReferencia.PreVen * cotizacion; | 28 | articulosRemito[i].precio = articuloReferencia.PreVen * cotizacion; |
25 | articulosRemito[i].cantidad = articuloReferencia.cantidad; | 29 | articulosRemito[i].cantidad = articuloReferencia.cantidad; |
26 | articulosRemito[i].cantidadDescargada = articuloReferencia.cantidad; | 30 | articulosRemito[i].cantidadDescargada = articuloReferencia.cantidad; |
27 | 31 | ||
28 | delete articulosRemito[i].idNotaPedido; | 32 | delete articulosRemito[i].idNotaPedido; |
29 | crearRemitoService.crearArticulosParaRemito(articulosRemito[i]); | 33 | crearRemitoService.crearArticulosParaRemito(articulosRemito[i]); |
30 | } | 34 | } |
31 | } | 35 | } |
32 | }; | 36 | }; |
33 | }]); | 37 | }]); |
34 | 38 |
src/views/foca-modal-descarga.html
1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
2 | <h5>Detalle de descarga</h5> | 2 | <h5>Detalle de descarga</h5> |
3 | </div> | 3 | </div> |
4 | <div class="modal-body"> | 4 | <div class="modal-body"> |
5 | <div class="row px-1"> | 5 | <div class="row px-1"> |
6 | <div class="col-3 align-self-center mt-1 pl-1"> | 6 | <div class="col-3 align-self-center mt-1 pl-1"> |
7 | <strong>Cliente</strong> | 7 | <strong>Cliente</strong> |
8 | </div> | 8 | </div> |
9 | <div class="col-9"> | 9 | <div class="col-9"> |
10 | <div class="input-group"> | 10 | <div class="input-group"> |
11 | <input | 11 | <input |
12 | type="text" | 12 | type="text" |
13 | ladda="searchLoading" | 13 | ladda="searchLoading" |
14 | class="form-control form-control-sm foca-input" | 14 | class="form-control form-control-sm foca-input" |
15 | placeholder="Busqueda cliente" | 15 | placeholder="Busqueda cliente" |
16 | ng-model="remito.cliente.nom" | 16 | ng-model="remito.cliente.nom" |
17 | readonly | 17 | readonly |
18 | > | 18 | > |
19 | <div class="input-group-append"> | 19 | <div class="input-group-append"> |
20 | <button | 20 | <button |
21 | ladda="searchLoading" | 21 | ladda="searchLoading" |
22 | data-spinner-color="#FF0000" | 22 | data-spinner-color="#FF0000" |
23 | class="btn btn-outline-secondary" | 23 | class="btn btn-outline-secondary" |
24 | type="button" | 24 | type="button" |
25 | ng-click="seleccionarCliente()" | 25 | ng-click="seleccionarCliente()" |
26 | > | 26 | > |
27 | <i class="fa fa-search fa-x1" aria-hidden="true"></i> | 27 | <i class="fa fa-search fa-x1" aria-hidden="true"></i> |
28 | </button> | 28 | </button> |
29 | </div> | 29 | </div> |
30 | </div> | 30 | </div> |
31 | </div> | 31 | </div> |
32 | <div class="col-3 align-self-center pl-1 mt-1"> | 32 | <div class="col-3 align-self-center pl-1 mt-1"> |
33 | <strong>Domicilio</strong> | 33 | <strong>Domicilio</strong> |
34 | </div> | 34 | </div> |
35 | <div class="col-9 align-self-center mt-1"> | 35 | <div class="col-9 align-self-center mt-1"> |
36 | <label ng-bind="remito.cliente.DOM"></label> | 36 | <label ng-bind="remito.cliente.DOM"></label> |
37 | </div> | 37 | </div> |
38 | <div class="col-3 align-self-center px-1 mt-1"> | 38 | <div class="col-3 align-self-center px-1 mt-1"> |
39 | <strong>Remito Nº</strong> | 39 | <strong>Remito Nº</strong> |
40 | </div> | 40 | </div> |
41 | <div class="col-3 pr-0 mt-1"> | 41 | <div class="col-3 pr-0 mt-1"> |
42 | <input | 42 | <input |
43 | type="text" class="text-center form-control form-control-sm" | 43 | type="number" class="text-center form-control form-control-sm" |
44 | ng-model="nroSucursal" readonly> | 44 | ng-focus="$event.target.select();" |
45 | ng-model="nroSucursal" | ||
46 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)"> | ||
45 | </div> | 47 | </div> |
46 | <div class="col-6 mt-1"> | 48 | <div class="col-6 mt-1"> |
47 | <input | 49 | <input |
48 | type="number" class="text-center form-control form-control-sm" | 50 | type="number" class="text-center form-control form-control-sm" |
49 | ng-model="remito.numeroRemito"> | 51 | ng-focus="$event.target.select();" |
52 | ng-model="nroRemito" | ||
53 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)"> | ||
54 | </div> | ||
55 | <div | ||
56 | class="col-12 mt-1 alert alert-danger text-center" role="alert" | ||
57 | ng-show="hasErrorSucursalRemito"> | ||
58 | Error numero de remito existente!<br>Ingrese otro número | ||
50 | </div> | 59 | </div> |
51 | <div class="col-12 mt-3 p-0"> | 60 | <div class="col-12 mt-3 p-0"> |
52 | <table class="table"> | 61 | <table class="table"> |
53 | <thead> | 62 | <thead> |
54 | <tr> | 63 | <tr> |
55 | <th>Cisterna</th> | 64 | <th>Cisterna</th> |
56 | <th>Articulo/Disponibles</th> | 65 | <th>Articulo/Disponibles</th> |
57 | <th>Descargar</th> | 66 | <th>Descargar</th> |
58 | </tr> | 67 | </tr> |
59 | </thead> | 68 | </thead> |
60 | <tbody> | 69 | <tbody> |
61 | <tr ng-repeat="cisterna in cisternas"> | 70 | <tr ng-repeat="cisterna in cisternas"> |
62 | <td class="text-center" ng-bind="cisterna.codigo"></td> | 71 | <td class="text-center" ng-bind="cisterna.codigo"></td> |
63 | <td class="text-center"> | 72 | <td class="text-center"> |
64 | {{cisterna.cisternaCarga.articulo.DetArt}}<br> | 73 | {{cisterna.cisternaCarga.articulo.DetArt}}<br> |
65 | {{cisterna.cisternaCarga.cantidad}} | 74 | {{cisterna.cisternaCarga.cantidad}} |
66 | </td> | 75 | </td> |
67 | <td> | 76 | <td> |
68 | <input | 77 | <input |
69 | ng-init="cisterna.cisternaCarga.descargar = | 78 | ng-init="cisterna.cisternaCarga.descargar = |
70 | cisterna.cisternaCarga.cantidad" | 79 | cisterna.cisternaCarga.cantidad" |
71 | ng-model="cisterna.cisternaCarga.descargar" | 80 | ng-model="cisterna.cisternaCarga.descargar" |
72 | type="number" class="text-center form-control col-12"> | 81 | ng-focus="$event.target.select();" |
82 | class="text-center form-control col-12"> | ||
73 | </td> | 83 | </td> |
74 | </tr> | 84 | </tr> |
75 | </tbody> | 85 | </tbody> |
76 | </table> | 86 | </table> |
77 | </div> | 87 | </div> |
78 | <div class="col-3 align-self-center px-1"> | 88 | <div class="col-3 align-self-center px-1"> |
79 | <strong>Nº Recibo</strong> | 89 | <strong>Nº Recibo</strong> |
80 | </div> | 90 | </div> |
81 | <div class="col-9"> | 91 | <div class="col-9"> |
82 | <input | 92 | <input |
83 | ng-model="nroRecibo" class="form-control" | 93 | ng-model="nroRecibo" class="form-control" |
94 | ng-focus="$event.target.select();" | ||
84 | type="number" placeholder="Nº de recibo"> | 95 | type="number" placeholder="Nº de recibo"> |
85 | </div> | 96 | </div> |
86 | </div> | 97 | </div> |
87 | </div> | 98 | </div> |
88 | <div class="modal-footer"> | 99 | <div class="modal-footer"> |
89 | <button | 100 | <button |
90 | class="btn btn-sm btn-secondary" | 101 | class="btn btn-sm btn-secondary" |
91 | ladda="cargando" | 102 | ladda="cargando" |
92 | type="button" | 103 | type="button" |
93 | ng-click="cancelar()">Cancelar</button> | 104 | ng-click="cancelar()">Cancelar</button> |
94 | <button | 105 | <button |
95 | class="btn btn-sm btn-primary" | 106 | class="btn btn-sm btn-primary" |
96 | ladda="cargando" | 107 | ladda="cargando" |
97 | type="button" | 108 | type="button" |
98 | ng-click="crearRemito()" | 109 | ng-click="crearRemito()" |
99 | ng-disabled="tieneArticulosPendientes() || idRemito === -1" | 110 | ng-disabled="tieneArticulosPendientes() || |
111 | idRemito === -1 || hasErrorSucursalRemito || !nroSucursal || !nroRemito" | ||
100 | foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Descargar</button> | 112 | foca-focus="!tieneArticulosPendientes() && idRemito !== -1">Descargar</button> |
101 | </div> | 113 | </div> |
102 | 114 |