Commit c0a509ef731624ec484e0fb7865b1a1b732af48d

Authored by Eric Fernandez
Exists in master

Merge branch 'master' into 'develop'

Master

See merge request !61
src/js/controllerDetalles.js
1 angular.module('focaCrearHojaRuta') 1 angular.module('focaCrearHojaRuta')
2 .controller('focaModalDetalleController', [ 2 .controller('focaModalDetalleController', [
3 '$scope', '$timeout', '$uibModalInstance', 'focaModalService', 3 '$scope', '$timeout', '$uibModalInstance', 'focaModalService',
4 'focaCrearHojaRutaService', 'hojasRutas', 4 'focaCrearHojaRutaService', 'hojasRutas',
5 function ($scope, $timeout, $uibModalInstance, focaModalService, 5 function ($scope, $timeout, $uibModalInstance, focaModalService,
6 focaCrearHojaRutaService, hojasRutas) { 6 focaCrearHojaRutaService, hojasRutas) {
7 7
8 $scope.mostrar = false; 8 $scope.mostrar = false;
9 $scope.articulos = []; 9 $scope.articulos = [];
10 $scope.cisternaMovimientos = []; 10 $scope.cisternaMovimientos = [];
11 11
12 init(); 12 init();
13 function init() { 13 function init() {
14 $scope.hojasRutas = hojasRutas; 14 $scope.hojasRutas = hojasRutas;
15 15
16 $scope.hojasRutas.vehiculo.cisternas = $scope.hojasRutas.vehiculo.cisternas.filter( 16 $scope.hojasRutas.vehiculo.cisternas = $scope.hojasRutas.vehiculo.cisternas.filter(
17 function (cisterna) { 17 function (cisterna) {
18 return !cisterna.desactivado; 18 return !cisterna.desactivado;
19 } 19 }
20 ); 20 );
21 focaCrearHojaRutaService.getArticulos() 21 focaCrearHojaRutaService.getArticulos()
22 .then(function (articulos) { 22 .then(function (articulos) {
23 $scope.articulos = articulos.data; 23 $scope.articulos = articulos.data;
24 }); 24 });
25 } 25 }
26 26
27 $scope.validarCisternaDisponible = function (cisterna) { 27 $scope.validarCisternaDisponible = function (cisterna) {
28 if (parseInt(cisterna.disponible) > cisterna.capacidad) { 28 if (parseInt(cisterna.disponible) > cisterna.capacidad) {
29 focaModalService.alert('No se puede ingresar una capacidad disponible ' + 29 focaModalService.alert('No se puede ingresar una capacidad disponible ' +
30 'superior a la ' + 'capacidad del vehiculo '); 30 'superior a la ' + 'capacidad del vehiculo ');
31 cisterna.disponible = cisterna.capacidad; 31 cisterna.disponible = cisterna.capacidad;
32 return; 32 return;
33 } 33 }
34 }; 34 };
35 35
36 $scope.seleccionarProductos = function (key, cisterna) { 36 $scope.seleccionarProductos = function (key, cisterna) {
37 focaModalService.modal({ 37 focaModalService.modal({
38 titulo: 'Productos', 38 titulo: 'Productos',
39 data: $scope.articulos, 39 data: $scope.articulos,
40 size: 'md', 40 size: 'md',
41 columnas: [ 41 columnas: [
42 { 42 {
43 propiedad: 'CodRub', 43 propiedad: 'CodRub',
44 nombre: 'Codigo' 44 nombre: 'Codigo'
45 }, 45 },
46 { 46 {
47 propiedad: 'descripcion', 47 propiedad: 'descripcion',
48 nombre: 'Nombre' 48 nombre: 'Nombre'
49 }, 49 },
50 ], 50 ],
51 }).then(function (res) { 51 }).then(function (res) {
52 cisterna.disponible = cisterna.capacidad; 52 cisterna.disponible = cisterna.capacidad;
53 var newArt = 53 var newArt =
54 { 54 {
55 id: 0, 55 id: 0,
56 idRemito: 0, 56 idRemito: 0,
57 codigo: res.codigo, 57 codigo: res.codigo,
58 sector: res.sector, 58 sector: res.sector,
59 sectorCodigo: res.sector + '-' + res.codigo, 59 sectorCodigo: res.sector + '-' + res.codigo,
60 descripcion: res.descripcion, 60 descripcion: res.descripcion,
61 item: key + 1, 61 item: key + 1,
62 nombre: res.descripcion, 62 nombre: res.descripcion,
63 precio: parseFloat(res.precio).toFixed(4), 63 precio: parseFloat(res.precio).toFixed(4),
64 costoUnitario: res.costo, 64 costoUnitario: res.costo,
65 editCantidad: false, 65 editCantidad: false,
66 editPrecio: false, 66 editPrecio: false,
67 rubro: res.CodRub, 67 rubro: res.CodRub,
68 ivaUnitario: res.IMPIVA, 68 ivaUnitario: res.IMPIVA,
69 impuestoInternoUnitario: res.ImpInt, 69 impuestoInternoUnitario: res.ImpInt,
70 impuestoInterno1Unitario: res.ImpInt2, 70 impuestoInterno1Unitario: res.ImpInt2,
71 impuestoInterno2Unitario: res.ImpInt3, 71 impuestoInterno2Unitario: res.ImpInt3,
72 precioLista: res.precio, 72 precioLista: res.precio,
73 combustible: 1, 73 combustible: 1,
74 facturado: 0, 74 facturado: 0,
75 idArticulo: res.id, 75 idArticulo: res.id,
76 tasaIva: res.tasaIVA 76 tasaIva: res.tasaIVA
77 }; 77 };
78 78
79 newArt.exentoUnitario = newArt.ivaUnitario ? 0 : res.neto; 79 newArt.exentoUnitario = newArt.ivaUnitario ? 0 : res.neto;
80 newArt.netoUnitario = newArt.ivaUnitario ? res.neto : 0; 80 newArt.netoUnitario = newArt.ivaUnitario ? res.neto : 0;
81 81
82 cisterna.articuloSeleccionado = newArt; 82 cisterna.articuloSeleccionado = newArt;
83 cisterna.nombreArticulo = res.descripcion; 83 cisterna.nombreArticulo = res.descripcion;
84 }).catch(function (e) { 84 }).catch(function (e) {
85 console.log(e); 85 console.log(e);
86 }); 86 });
87 }; 87 };
88 88
89 $scope.guardar = function () { 89 $scope.guardar = function () {
90 90
91 var cisternasFilter = validarArticulos(); 91 var cisternasFilter = validarArticulos();
92 92
93 var articulos = []; 93 var articulos = [];
94 if (cisternasFilter === undefined) { 94 if (cisternasFilter === undefined) {
95 return; 95 return;
96 } 96 }
97 cisternasFilter.forEach(function (cisterna) { 97 cisternasFilter.forEach(function (cisterna) {
98 98
99 var fechaReparto = $scope.hojasRutas.fechaReparto; 99 var fechaReparto = $scope.hojasRutas.fechaReparto;
100 100
101 var filtroCisternaCarga = cisterna.cisternasCarga.filter(function(carga) { 101 var filtroCisternaCarga = cisterna.cisternasCarga.filter(function(carga) {
102 return carga.fechaReparto === fechaReparto; 102 return carga.fechaReparto === fechaReparto;
103 }); 103 });
104 104
105 if (filtroCisternaCarga.length) { 105 if (filtroCisternaCarga.length) {
106 cisterna.cisternaCarga = filtroCisternaCarga[0]; 106 cisterna.cisternaCarga = filtroCisternaCarga[0];
107 } else { 107 } else {
108 cisterna.cisternaCarga = { 108 cisterna.cisternaCarga = {
109 confirmado: null, 109 confirmado: null,
110 fechaReparto: fechaReparto, 110 fechaReparto: fechaReparto,
111 idCisterna: cisterna.id, 111 idCisterna: cisterna.id,
112 }; 112 };
113 } 113 }
114 114
115 //cargar 115 //cargar
116 if (cisterna.cisternaCarga.cantidad) { 116 if (cisterna.cisternaCarga.cantidad) {
117 cisterna.cisternaCarga.cantidad += cisterna.disponible; 117 cisterna.cisternaCarga.cantidad += cisterna.disponible;
118 } else { 118 } else {
119 cisterna.cisternaCarga.cantidad = cisterna.disponible; 119 cisterna.cisternaCarga.cantidad = cisterna.disponible;
120 cisterna.cisternaCarga.idProducto = 120 cisterna.cisternaCarga.idProducto =
121 cisterna.articuloSeleccionado.idArticulo; 121 cisterna.articuloSeleccionado.idArticulo;
122 } 122 }
123 123
124 //Guardar 124 //Guardar
125 var now = new Date(); 125 var now = new Date();
126 var cisternaMovimiento = { 126 var cisternaMovimiento = {
127 fecha: now.toISOString().slice(0, 19).replace('T', ' '), 127 fecha: now.toISOString().slice(0, 19).replace('T', ' '),
128 cantidad: cisterna.disponible, 128 cantidad: cisterna.disponible,
129 metodo: 'carga', 129 metodo: 'carga',
130 idCisternaCarga: cisterna.cisternaCarga.id, 130 idCisternaCarga: cisterna.cisternaCarga.id,
131 }; 131 };
132 132
133 cisterna.cisternaCarga.fechaReparto = fechaReparto; 133 cisterna.cisternaCarga.fechaReparto = fechaReparto;
134 cisterna.articuloSeleccionado.cantidad = cisterna.disponible; 134 cisterna.articuloSeleccionado.cantidad = cisterna.disponible;
135 articulos.push(cisterna.articuloSeleccionado); 135 articulos.push(cisterna.articuloSeleccionado);
136 $scope.cisternaMovimientos.push(cisternaMovimiento); 136 $scope.cisternaMovimientos.push(cisternaMovimiento);
137 }); 137 });
138 138
139 $uibModalInstance.close({ 139 $uibModalInstance.close({
140 cisternas: cisternasFilter, 140 cisternas: cisternasFilter,
141 movimientos: $scope.cisternaMovimientos, 141 movimientos: $scope.cisternaMovimientos,
142 articulos: articulos 142 articulos: articulos
143 }); 143 });
144 }; 144 };
145 145
146 $scope.cancel = function () { 146 $scope.cancel = function () {
147 var validarCisternas = validarArticulos(); 147 $uibModalInstance.dismiss(null);
148 if (validarCisternas !== undefined) {
149 $uibModalInstance.dismiss(null);
150 }
151 }; 148 };
152 149
153 function validarArticulos () { 150 function validarArticulos () {
154 var cisternasFilter = $scope.hojasRutas.vehiculo.cisternas 151 var cisternasFilter = $scope.hojasRutas.vehiculo.cisternas
155 .filter(function (cisterna) { 152 .filter(function (cisterna) {
156 return parseInt(cisterna.disponible) > 0 || cisterna.articuloSeleccionado; 153 return parseInt(cisterna.disponible) > 0 || cisterna.articuloSeleccionado;
157 }); 154 });
158 155
159 var cisternasIncompletas = cisternasFilter.filter(function(cisterna) { 156 var cisternasIncompletas = cisternasFilter.filter(function(cisterna) {
160 return (cisterna.articuloSeleccionado && !cisterna.disponible) || 157 return (cisterna.articuloSeleccionado && !cisterna.disponible) ||
161 (!cisterna.articuloSeleccionado && cisterna.disponible); 158 (!cisterna.articuloSeleccionado && cisterna.disponible);
162 }); 159 });
163 160
164 if (cisternasIncompletas.length || !cisternasFilter.length) { 161 if (cisternasIncompletas.length > 0 && cisternasFilter.length > 0 ) {
165 focaModalService.alert('Ingrese todos los campos para completar el remito'); 162 focaModalService.alert('Ingrese todos los campos para completar el remito');
166 cisternasFilter = undefined; 163 cisternasFilter = undefined;
167 } 164 }
168 return cisternasFilter; 165 return cisternasFilter;
169 } 166 }
170 } 167 }
171 ]); 168 ]);
172 169
1 angular.module('focaCrearHojaRuta') 1 angular.module('focaCrearHojaRuta')
2 .service('focaCrearHojaRutaService', ['$http', 'API_ENDPOINT', '$cookies', 2 .service('focaCrearHojaRutaService', ['$http', 'API_ENDPOINT', '$cookies',
3 function($http, API_ENDPOINT, $cookies) { 3 function($http, API_ENDPOINT, $cookies) {
4 var route = API_ENDPOINT.URL; 4 var route = API_ENDPOINT.URL;
5 return { 5 return {
6 idUsuario: $cookies.get('vendedorCobrador'), 6 idUsuario: $cookies.get('vendedorCobrador'),
7 crearHojaRuta: function(hojaRuta) { 7 crearHojaRuta: function(hojaRuta) {
8 return $http.post(route + '/hoja-ruta', hojaRuta); 8 return $http.post(route + '/hoja-ruta', hojaRuta);
9 }, 9 },
10 crearRemito: function(remito) { 10 crearRemito: function(remito) {
11 console.log('Crear remito-----: ', remito);
12 // TODO: Cambiar para usar el servicio /remito 11 // TODO: Cambiar para usar el servicio /remito
13 return $http.post(route + '/remito', remito); 12 return $http.post(route + '/remito/guardar', remito);
14 }, 13 },
15 obtenerHojaRuta: function() { 14 obtenerHojaRuta: function() {
16 return $http.get(route +'/hoja-ruta'); 15 return $http.get(route +'/hoja-ruta');
17 }, 16 },
18 setHojaRuta: function(hojaRuta) { 17 setHojaRuta: function(hojaRuta) {
19 this.hojaRuta = hojaRuta; 18 this.hojaRuta = hojaRuta;
20 }, 19 },
21 clearHojaRuta: function() { 20 clearHojaRuta: function() {
22 this.hojaRuta = undefined; 21 this.hojaRuta = undefined;
23 }, 22 },
24 getHojaRuta: function() { 23 getHojaRuta: function() {
25 return this.hojaRuta; 24 return this.hojaRuta;
26 }, 25 },
27 getArticulosByIdHojaRuta: function(id) { 26 getArticulosByIdHojaRuta: function(id) {
28 return $http.get(route+'/articulos/hoja-ruta/'+id); 27 return $http.get(route+'/articulos/hoja-ruta/'+id);
29 }, 28 },
30 crearArticulosParaHojaRuta: function(articuloHojaRuta) { 29 crearArticulosParaHojaRuta: function(articuloHojaRuta) {
31 return $http.post(route + '/articulos/remito', 30 return $http.post(route + '/articulos/remito',
32 {articuloRemito: articuloHojaRuta}); 31 {articuloRemito: articuloHojaRuta});
33 }, 32 },
34 getDomiciliosByIdHojaRuta: function(id) { 33 getDomiciliosByIdHojaRuta: function(id) {
35 return $http.get(route +'/hoja-ruta/' + id + '/domicilios'); 34 return $http.get(route +'/hoja-ruta/' + id + '/domicilios');
36 }, 35 },
37 getDomiciliosByIdCliente: function(id) { 36 getDomiciliosByIdCliente: function(id) {
38 var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) 37 var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega)
39 return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); 38 return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id );
40 }, 39 },
41 getPrecioCondicion: function() { 40 getPrecioCondicion: function() {
42 return $http.get(route + '/precio-condicion'); 41 return $http.get(route + '/precio-condicion');
43 }, 42 },
44 getPrecioCondicionById: function(id) { 43 getPrecioCondicionById: function(id) {
45 return $http.get(route + '/precio-condicion/' + id); 44 return $http.get(route + '/precio-condicion/' + id);
46 }, 45 },
47 getPlazoPagoByPrecioCondicion: function(id) { 46 getPlazoPagoByPrecioCondicion: function(id) {
48 return $http.get(route + '/plazo-pago/precio-condicion/' + id); 47 return $http.get(route + '/plazo-pago/precio-condicion/' + id);
49 }, 48 },
50 crearFlete: function(flete) { 49 crearFlete: function(flete) {
51 return $http.post(route + '/flete', {flete : flete}); 50 return $http.post(route + '/flete', {flete : flete});
52 }, 51 },
53 crearPlazosParaHojaRuta: function(plazos) { 52 crearPlazosParaHojaRuta: function(plazos) {
54 return $http.post(route + '/plazo-pago/hoja-ruta', plazos); 53 return $http.post(route + '/plazo-pago/hoja-ruta', plazos);
55 }, 54 },
56 getCotizacionByIdMoneda: function(id) { 55 getCotizacionByIdMoneda: function(id) {
57 return $http.get(route + '/moneda/' + id); 56 return $http.get(route + '/moneda/' + id);
58 }, 57 },
59 crearEstadoParaHojaRuta: function(estado) { 58 crearEstadoParaHojaRuta: function(estado) {
60 return $http.post(route + '/estado', {estado: estado}); 59 return $http.post(route + '/estado', {estado: estado});
61 }, 60 },
62 getNumeroHojaRuta: function() { 61 getNumeroHojaRuta: function() {
63 return $http.get(route + '/hoja-ruta/numero-siguiente'); 62 return $http.get(route + '/hoja-ruta/numero-siguiente');
64 }, 63 },
65 getRemitosByIdVehiculo: function(idVehiculo, fechaReparto, sinConfirmar) { 64 getRemitosByIdVehiculo: function(idVehiculo, fechaReparto, sinConfirmar) {
66 var noCofirmados = sinConfirmar ? '/sinConfirmar' : ''; 65 var noCofirmados = sinConfirmar ? '/sinConfirmar' : '';
67 return $http.get(route + '/vehiculo/obtener/remitos/' + 66 return $http.get(route + '/vehiculo/obtener/remitos/' +
68 idVehiculo + '/' + fechaReparto.toISOString().substring(0, 10) + noCofirmados); 67 idVehiculo + '/' + fechaReparto.toISOString().substring(0, 10) + noCofirmados);
69 }, 68 },
70 desasociarRemitos: function(idsRemitos, idVehiculo, sinRemitos) { 69 desasociarRemitos: function(idsRemitos, idVehiculo, sinRemitos) {
71 return $http.post(route + '/vehiculo/desasociar-remitos', 70 return $http.post(route + '/vehiculo/desasociar-remitos',
72 { 71 {
73 idsRemitos: idsRemitos, 72 idsRemitos: idsRemitos,
74 idVehiculo: idVehiculo, 73 idVehiculo: idVehiculo,
75 vehiculoSinRemitos: sinRemitos 74 vehiculoSinRemitos: sinRemitos
76 }); 75 });
77 }, 76 },
78 getParametros: function() { 77 getParametros: function() {
79 return $http.get(API_ENDPOINT.URL + '/parametros/hojaRuta'); 78 return $http.get(API_ENDPOINT.URL + '/parametros/hojaRuta');
80 }, 79 },
81 getBotonera: function() { 80 getBotonera: function() {
82 return [ 81 return [
83 { 82 {
84 label: 'Fecha Entrega', 83 label: 'Fecha Entrega',
85 image: 'FechaEntrega.png' 84 image: 'FechaEntrega.png'
86 }, 85 },
87 { 86 {
88 label: 'Transportista', 87 label: 'Transportista',
89 image: 'transportista.png' 88 image: 'transportista.png'
90 }, 89 },
91 { 90 {
92 label: 'Chofer', 91 label: 'Chofer',
93 image: 'chofer.png' 92 image: 'chofer.png'
94 }, 93 },
95 { 94 {
96 label: 'Vehiculo', 95 label: 'Vehiculo',
97 image: 'vehiculos.png' 96 image: 'vehiculos.png'
98 }, 97 },
99 { 98 {
100 label: 'Tarifario', 99 label: 'Tarifario',
101 image: 'tarifario.png' 100 image: 'tarifario.png'
102 }, 101 },
103 { 102 {
104 label: 'Remitos', 103 label: 'Remitos',
105 image: 'remito.png' 104 image: 'remito.png'
106 }, 105 },
107 { 106 {
108 label: 'Vehiculos precargados', 107 label: 'Vehiculos precargados',
109 image: 'vehiculos.png' 108 image: 'vehiculos.png'
110 }, 109 },
111 { 110 {
112 label: 'Datos extra', 111 label: 'Datos extra',
113 image: 'tarifario.png' 112 image: 'tarifario.png'
114 } 113 }
115 ]; 114 ];
116 }, 115 },
117 getBotones: function () { 116 getBotones: function () {
118 return [ 117 return [
119 { 118 {
120 label: 'Precargados', 119 label: 'Precargados',
121 image: 'vehiculos.png' 120 image: 'vehiculos.png'
122 }, 121 },
123 { 122 {
124 label: 'Cargar Remitos', 123 label: 'Cargar Remitos',
125 image: 'remito.png' 124 image: 'remito.png'
126 }, 125 },
127 { 126 {
128 label: 'Remito Abierto', 127 label: 'Remito Abierto',
129 image: 'remitoabierto.png' 128 image: 'remitoabierto.png'
130 } 129 }
131 ]; 130 ];
132 }, 131 },
133 getRemitoAbierto: function () { 132 getRemitoAbierto: function () {
134 return [ 133 return [
135 { 134 {
136 label: 'Fecha Entrega', 135 label: 'Fecha Entrega',
137 image: 'FechaEntrega.png' 136 image: 'FechaEntrega.png'
138 }, 137 },
139 { 138 {
140 label: 'Transportista', 139 label: 'Transportista',
141 image: 'transportista.png' 140 image: 'transportista.png'
142 }, 141 },
143 { 142 {
144 label: 'Vehiculo', 143 label: 'Vehiculo',
145 image: 'vehiculos.png' 144 image: 'vehiculos.png'
146 }, 145 },
147 { 146 {
148 label: 'Chofer', 147 label: 'Chofer',
149 image: 'chofer.png' 148 image: 'chofer.png'
150 }, 149 },
151 { 150 {
152 label: 'Proveedor', 151 label: 'Proveedor',
153 image: 'proveedor.png' 152 image: 'proveedor.png'
154 }, 153 },
155 { 154 {
156 label: 'Tarifario', 155 label: 'Tarifario',
157 image: 'tarifario.png' 156 image: 'tarifario.png'
158 }, 157 },
159 { 158 {
160 label: 'Cliente', 159 label: 'Cliente',
161 image: 'cliente.png' 160 image: 'cliente.png'
162 }, 161 },
163 { 162 {
164 label: 'Detalle de Carga', 163 label: 'Detalle de Carga',
165 image: 'detalleDeCarga.png' 164 image: 'detalleDeCarga.png'
166 } 165 }
167 ]; 166 ];
168 }, 167 },
169 getArticulos : function () { 168 getArticulos : function () {
170 return $http.get(API_ENDPOINT.URL + '/articulos'); 169 return $http.get(API_ENDPOINT.URL + '/articulos');
171 }, 170 },
172 getVendedorById : function (idVendedor) { 171 getVendedorById : function (idVendedor) {
173 return $http.get(API_ENDPOINT.URL + '/vendedor-cobrador/' + idVendedor); 172 return $http.get(API_ENDPOINT.URL + '/vendedor-cobrador/' + idVendedor);
174 }, 173 },
175 getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { 174 getPuntosDescargaByClienDom: function(idDomicilio, idCliente) {
176 return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + 175 return $http.get(API_ENDPOINT.URL + '/punto-descarga/' +
177 idDomicilio + '/' + idCliente); 176 idDomicilio + '/' + idCliente);
178 }, 177 },
179 getBotonFecha : function () { 178 getBotonFecha : function () {
180 return [ 179 return [
181 { 180 {
182 label: 'Fecha Entrega', 181 label: 'Fecha Entrega',
183 image: 'FechaEntrega.png' 182 image: 'FechaEntrega.png'
184 }, 183 },
185 ]; 184 ];
186 }, 185 },
187 getBotoneraPrecargado: function () { 186 getBotoneraPrecargado: function () {
188 return [ 187 return [
189 188
190 { 189 {
191 label: 'Transportista', 190 label: 'Transportista',
192 image: 'transportista.png' 191 image: 'transportista.png'
193 }, 192 },
194 { 193 {
195 label: 'Chofer', 194 label: 'Chofer',
196 image: 'chofer.png' 195 image: 'chofer.png'
197 }, 196 },
198 { 197 {
199 label: 'Vehiculo', 198 label: 'Vehiculo',
200 image: 'vehiculos.png' 199 image: 'vehiculos.png'
201 }, 200 },
202 { 201 {
203 label: 'Tarifario', 202 label: 'Tarifario',
204 image: 'tarifario.png' 203 image: 'tarifario.png'
205 }, 204 },
206 { 205 {
207 label: 'Datos extra', 206 label: 'Datos extra',
208 image: 'tarifario.png' 207 image: 'tarifario.png'
209 } 208 }
210 ]; 209 ];
211 }, 210 },
212 getBotoneraCargarRemito: function () { 211 getBotoneraCargarRemito: function () {
213 return [ 212 return [
214 { 213 {
215 label: 'Transportista', 214 label: 'Transportista',
216 image: 'transportista.png' 215 image: 'transportista.png'
217 }, 216 },
218 { 217 {
219 label: 'Chofer', 218 label: 'Chofer',
220 image: 'chofer.png' 219 image: 'chofer.png'
221 }, 220 },
222 { 221 {
223 label: 'Vehiculo', 222 label: 'Vehiculo',
224 image: 'flete.png' 223 image: 'flete.png'
225 }, 224 },
226 { 225 {
227 label: 'Remitos', 226 label: 'Remitos',
228 image: 'remito.png' 227 image: 'remito.png'
229 }, 228 },
230 { 229 {
231 label: 'Tarifario', 230 label: 'Tarifario',
232 image: 'tarifario.png' 231 image: 'tarifario.png'
233 }, 232 },
234 { 233 {
235 label: 'Datos extra', 234 label: 'Datos extra',
236 image: 'tarifario.png' 235 image: 'tarifario.png'
237 } 236 }
238 ]; 237 ];
239 }, 238 },
240 guardarCisternas: function(cisterna, idRemito) { 239 guardarCisternas: function(cisterna, idRemito) {
241 240
242 cisterna.cisternaMovimientos.forEach(function(cisternaMovimiento) { 241 cisterna.cisternaMovimientos.forEach(function(cisternaMovimiento) {
243 cisternaMovimiento.idRemito = idRemito; 242 cisternaMovimiento.idRemito = idRemito;
244 }); 243 });
245 244
246 return $http.post(API_ENDPOINT.URL + '/cisterna/guardar/cargar/' + 245 return $http.post(API_ENDPOINT.URL + '/cisterna/guardar/cargar/' +
247 this.idUsuario + '/' + idRemito, cisterna); 246 this.idUsuario + '/' + idRemito, cisterna);
248 }, 247 },
249 crearArticulosParaRemito: function(articuloRemito) { 248 crearArticulosParaRemito: function(articuloRemito) {
250 return $http.post(route + '/articulos/remito', 249 return $http.post(route + '/articulos/remito',
251 {articuloRemito: articuloRemito}); 250 {articuloRemito: articuloRemito});
252 } 251 }
253 }; 252 };
254 }]); 253 }]);
255 254