diff --git a/index.html b/index.html index 81adb4f..f99f27f 100644 --- a/index.html +++ b/index.html @@ -34,6 +34,7 @@ + diff --git a/package.json b/package.json index 731e116..176253c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "compile": "gulp uglify", "gulp-pre-commit": "gulp pre-commit", "postinstall": "npm run compile && gulp clean-post-install", - "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 angular-route angular-cookies bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete git+https://debo.suite.repo/modulos-npm/foca-modal.git git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git git+https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git git+https://debo.suite.repo/modulos-npm/foca-configuracion.git" + "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 angular-route angular-cookies bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+http://git.focasoftware.com/npm/foca-directivas.git git+http://git.focasoftware.com/npm/foca-modal-vendedores.git git+http://git.focasoftware.com/npm/foca-modal-proveedor.git git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git git+http://git.focasoftware.com/npm/foca-modal-flete.git git+http://git.focasoftware.com/npm/foca-modal.git git+http://git.focasoftware.com/npm/foca-modal-domicilio.git git+http://git.focasoftware.com/npm/foca-seguimiento.git git+http://git.focasoftware.com/npm/foca-modal-moneda.git git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git git+http://git.focasoftware.com/npm/foca-configuracion.git" }, "pre-commit": [ "gulp-pre-commit" @@ -20,12 +20,12 @@ "author": "Foca Software", "license": "ISC", "peerDependencies": { - "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", - "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", - "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", - "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", - "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", - "foca-seguimiento": "git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git" + "foca-busqueda-cliente": "git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git", + "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", + "foca-modal-busqueda-productos": "git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git", + "foca-modal-proveedor": "git+http://git.focasoftware.com/npm/foca-modal-proveedor.git", + "foca-modal-vendedores": "git+http://git.focasoftware.com/npm/foca-modal-vendedores.git", + "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git" }, "devDependencies": { "angular": "^1.7.5", @@ -33,19 +33,20 @@ "angular-ladda": "^0.4.3", "angular-route": "^1.7.5", "bootstrap": "^4.1.3", - "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", - "foca-configuracion": "git+https://debo.suite.repo/modulos-npm/foca-configuracion.git", - "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", - "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", - "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", - "foca-modal-cotizacion": "git+https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git", - "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", - "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", - "foca-modal-moneda": "git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git", - "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", - "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", - "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", - "foca-seguimiento": "git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git", + "foca-botonera-facturador": "git+http://git.focasoftware.com/npm/foca-botonera-facturador.git", + "foca-busqueda-cliente": "git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git", + "foca-configuracion": "git+http://git.focasoftware.com/npm/foca-configuracion.git", + "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", + "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git", + "foca-modal-busqueda-productos": "git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git", + "foca-modal-cotizacion": "git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git", + "foca-modal-domicilio": "git+http://git.focasoftware.com/npm/foca-modal-domicilio.git", + "foca-modal-flete": "git+http://git.focasoftware.com/npm/foca-modal-flete.git", + "foca-modal-moneda": "git+http://git.focasoftware.com/npm/foca-modal-moneda.git", + "foca-modal-precio-condiciones": "git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git", + "foca-modal-proveedor": "git+http://git.focasoftware.com/npm/foca-modal-proveedor.git", + "foca-modal-vendedores": "git+http://git.focasoftware.com/npm/foca-modal-vendedores.git", + "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git", "font-awesome": "^4.7.0", "gulp": "^3.9.1", "gulp-angular-templatecache": "^2.2.5", diff --git a/src/js/controller.js b/src/js/controller.js index 5432fe8..af32776 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -6,30 +6,7 @@ angular.module('focaCrearRemito') .controller('remitoController', $scope, $uibModal, $location, $filter, crearRemitoService, focaModalService, remitoBusinessService, $rootScope) { - $scope.botonera = [ - {texto: 'Nota Pedido', imagen: '../img/abmPrecios.png', accion: function() { - varlidarRemitoFacturado($scope.seleccionarNotaPedido);}}, - {texto: 'Vendedor', imagen: '../img/abmPrecios.png', accion: function() { - varlidarRemitoFacturado($scope.seleccionarVendedor);}}, - {texto: 'Cliente', imagen: '../img/abmPrecios.png', accion: function() { - varlidarRemitoFacturado($scope.seleccionarCliente);}}, - {texto: 'Proveedor', imagen: '../img/abmPrecios.png', accion: function() { - varlidarRemitoFacturado($scope.seleccionarProveedor);}}, - {texto: 'Moneda', imagen: '../img/abmPrecios.png', accion: function() { - varlidarRemitoFacturado($scope.abrirModalMoneda);}}, - {texto: 'Precios y condiciones', imagen: '../img/abmPrecios.png', - accion: function() {varlidarRemitoFacturado($scope.abrirModalListaPrecio);}}, - {texto: 'Flete', imagen: '../img/abmPrecios.png', accion: function() { - varlidarRemitoFacturado($scope.abrirModalFlete);}}, - {texto: 'Productos', imagen: '../img/abmPrecios.png', accion: function() { - $scope.seleccionarArticulo(); - }}, - {texto: '', accion: function() {}}, - {texto: '', accion: function() {}}, - {texto: '', accion: function() {}}, - {texto: '', accion: function() {}} - - ]; + $scope.botonera = crearRemitoService.getBotonera(); $scope.isNumber = angular.isNumber; $scope.datepickerAbierto = false; $scope.show = false; @@ -89,115 +66,118 @@ angular.module('focaCrearRemito') .controller('remitoController', ); $scope.seleccionarNotaPedido = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Nota de Pedido', - templateUrl: 'foca-modal-nota-pedido.html', - controller: 'focaModalNotaPedidoController', - size: 'lg', - resolve: { - usadoPor: function() { - return 'remito'; + if(varlidarRemitoFacturado){ + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Nota de Pedido', + templateUrl: 'foca-modal-nota-pedido.html', + controller: 'focaModalNotaPedidoController', + size: 'lg', + resolve: { + usadoPor: function() { + return 'remito'; + } } } - } - ); - modalInstance.result.then( - function(notaPedido) { - //añado cabeceras - $scope.notaPedido.id = notaPedido.id; - removeCabecera('Bomba:'); - removeCabecera('Kilometros:'); - var cabeceras = [ - { - label: 'Moneda:', - valor: notaPedido.cotizacion.moneda.DETALLE - }, - { - label: 'Fecha cotizacion:', - valor: $filter('date')(notaPedido.cotizacion.FECHA, - 'dd/MM/yyyy') - }, - { - label: 'Cotizacion:', - valor: notaPedido.cotizacion.VENDEDOR - }, - { - label: 'Cliente:', - valor: notaPedido.cliente.NOM - }, - { - label: 'Domicilio:', - valor: notaPedido.domicilioStamp - }, - { - label: 'Vendedor:', - valor: notaPedido.vendedor.NomVen - }, - { - label: 'Proveedor:', - valor: notaPedido.proveedor.NOM - }, - { - label: 'Precio condicion:', - valor: valorPrecioCondicion() + ' ' + - remitoBusinessService.plazoToString(notaPedido.notaPedidoPlazo) - }, - { - label: 'Flete:', - valor: notaPedido.fob === 1 ? 'FOB' : ( - notaPedido.flete === 1 ? 'Si' : 'No') + ); + modalInstance.result.then( + function(notaPedido) { + //añado cabeceras + $scope.notaPedido.id = notaPedido.id; + removeCabecera('Bomba:'); + removeCabecera('Kilometros:'); + var cabeceras = [ + { + label: 'Moneda:', + valor: notaPedido.cotizacion.moneda.DETALLE + }, + { + label: 'Fecha cotizacion:', + valor: $filter('date')(notaPedido.cotizacion.FECHA, + 'dd/MM/yyyy') + }, + { + label: 'Cotizacion:', + valor: notaPedido.cotizacion.VENDEDOR + }, + { + label: 'Cliente:', + valor: notaPedido.cliente.NOM + }, + { + label: 'Domicilio:', + valor: notaPedido.domicilioStamp + }, + { + label: 'Vendedor:', + valor: notaPedido.vendedor.NomVen + }, + { + label: 'Proveedor:', + valor: notaPedido.proveedor.NOM + }, + { + label: 'Precio condicion:', + valor: valorPrecioCondicion() + ' ' + + remitoBusinessService + .plazoToString(notaPedido.notaPedidoPlazo) + }, + { + label: 'Flete:', + valor: notaPedido.fob === 1 ? 'FOB' : ( + notaPedido.flete === 1 ? 'Si' : 'No') + } + ]; + + function valorPrecioCondicion() { + if(notaPedido.idPrecioCondicion > 0) { + return notaPedido.precioCondicion.nombre; + } else { + return 'Ingreso Manual'; + } } - ]; - - function valorPrecioCondicion() { + + if(notaPedido.flete === 1) { + var cabeceraBomba = { + label: 'Bomba:', + valor: notaPedido.bomba === 1 ? 'Si' : 'No' + }; + if(notaPedido.kilometros) { + var cabeceraKilometros = { + label: 'Kilometros:', + valor: notaPedido.kilometros + }; + cabeceras.push(cabeceraKilometros); + } + cabeceras.push(cabeceraBomba); + } + + for (var i = notaPedido.articulosNotaPedido.length - 1; i >= 0; i--) { + notaPedido.articulosNotaPedido[i].id = 0; + } + + $scope.articulosTabla = notaPedido.articulosNotaPedido; + remitoBusinessService.calcularArticulos($scope.articulosTabla, + notaPedido.cotizacion.VENDEDOR); + if(notaPedido.idPrecioCondicion > 0) { - return notaPedido.precioCondicion.nombre; + $scope.idLista = notaPedido.precioCondicion.idListaPrecio; } else { - return 'Ingreso Manual'; - } - } - - if(notaPedido.flete === 1) { - var cabeceraBomba = { - label: 'Bomba:', - valor: notaPedido.bomba === 1 ? 'Si' : 'No' - }; - if(notaPedido.kilometros) { - var cabeceraKilometros = { - label: 'Kilometros:', - valor: notaPedido.kilometros - }; - cabeceras.push(cabeceraKilometros); + $scope.idLista = -1; } - cabeceras.push(cabeceraBomba); - } - - for (var i = notaPedido.articulosNotaPedido.length - 1; i >= 0; i--) { - notaPedido.articulosNotaPedido[i].id = 0; + + delete notaPedido.id; + $scope.remito = notaPedido; + $scope.remito.id = 0; + $scope.remito.moneda = notaPedido.cotizacion.moneda; + $scope.plazosPagos = notaPedido.notaPedidoPlazo; + addArrayCabecera(cabeceras); + + }, function() { + // funcion ejecutada cuando se cancela el modal } - - $scope.articulosTabla = notaPedido.articulosNotaPedido; - remitoBusinessService.calcularArticulos($scope.articulosTabla, - notaPedido.cotizacion.VENDEDOR); - - if(notaPedido.idPrecioCondicion > 0) { - $scope.idLista = notaPedido.precioCondicion.idListaPrecio; - } else { - $scope.idLista = -1; - } - - delete notaPedido.id; - $scope.remito = notaPedido; - $scope.remito.id = 0; - $scope.remito.moneda = notaPedido.cotizacion.moneda; - $scope.plazosPagos = notaPedido.notaPedidoPlazo; - addArrayCabecera(cabeceras); - - }, function() { - // funcion ejecutada cuando se cancela el modal - } - ); + ); + } }; $scope.seleccionarRemito = function() { @@ -431,7 +411,7 @@ angular.module('focaCrearRemito') .controller('remitoController', ); }; - $scope.seleccionarArticulo = function() { + $scope.seleccionarProductos = function() { if ($scope.idLista === undefined) { focaModalService.alert( 'Primero seleccione una lista de precio y condicion'); @@ -486,65 +466,71 @@ angular.module('focaCrearRemito') .controller('remitoController', }; $scope.seleccionarVendedor = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Vendedores', - templateUrl: 'modal-vendedores.html', - controller: 'modalVendedoresCtrl', - size: 'lg' - } - ); - modalInstance.result.then( - function(vendedor) { - addCabecera('Vendedor:', vendedor.NomVen); - $scope.remito.idVendedor = vendedor.CodVen; - }, function() { - - } - ); + if(varlidarRemitoFacturado){ + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Vendedores', + templateUrl: 'modal-vendedores.html', + controller: 'modalVendedoresCtrl', + size: 'lg' + } + ); + modalInstance.result.then( + function(vendedor) { + addCabecera('Vendedor:', vendedor.NomVen); + $scope.remito.idVendedor = vendedor.CodVen; + }, function() { + + } + ); + } }; $scope.seleccionarProveedor = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Proveedor', - templateUrl: 'modal-proveedor.html', - controller: 'focaModalProveedorCtrl', - size: 'lg', - resolve: { - transportista: function() { - return false; + if(varlidarRemitoFacturado) { + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Proveedor', + templateUrl: 'modal-proveedor.html', + controller: 'focaModalProveedorCtrl', + size: 'lg', + resolve: { + transportista: function() { + return false; + } } } - } - ); - modalInstance.result.then( - function(proveedor) { - $scope.remito.idProveedor = proveedor.COD; - addCabecera('Proveedor:', proveedor.NOM); - }, function() { - - } - ); + ); + modalInstance.result.then( + function(proveedor) { + $scope.remito.idProveedor = proveedor.COD; + addCabecera('Proveedor:', proveedor.NOM); + }, function() { + + } + ); + } }; $scope.seleccionarCliente = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Cliente', - templateUrl: 'foca-busqueda-cliente-modal.html', - controller: 'focaBusquedaClienteModalController', - size: 'lg' - } - ); - modalInstance.result.then( - function(cliente) { - $scope.abrirModalDomicilios(cliente); - }, function() { - - } - ); + if(varlidarRemitoFacturado()) { + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Cliente', + templateUrl: 'foca-busqueda-cliente-modal.html', + controller: 'focaBusquedaClienteModalController', + size: 'lg' + } + ); + modalInstance.result.then( + function(cliente) { + $scope.abrirModalDomicilios(cliente); + }, function() { + + } + ); + } }; $scope.abrirModalDomicilios = function(cliente) { @@ -605,107 +591,114 @@ angular.module('focaCrearRemito') .controller('remitoController', } }; - $scope.abrirModalListaPrecio = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Precio Condición', - templateUrl: 'modal-precio-condicion.html', - controller: 'focaModalPrecioCondicionController', - size: 'lg' - } - ); - modalInstance.result.then( - function(precioCondicion) { - var cabecera = ''; - var plazosConcat = ''; - if(!Array.isArray(precioCondicion)) { - $scope.remito.idPrecioCondicion = precioCondicion.id; - $scope.plazosPagos = precioCondicion.plazoPago; - $scope.idLista = precioCondicion.idListaPrecio; - for(var i = 0; i < precioCondicion.plazoPago.length; i++) { - plazosConcat += precioCondicion.plazoPago[i].dias + ' '; - } - cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); - } else { //Cuando se ingresan los plazos manualmente - $scope.remito.idPrecioCondicion = 0; - $scope.idLista = -1; //-1, el modal productos busca todos los productos - $scope.plazosPagos = precioCondicion; - for(var j = 0; j < precioCondicion.length; j++) { - plazosConcat += precioCondicion[j].dias + ' '; + $scope.seleccionarPreciosYCondiciones = function() { + if(varlidarRemitoFacturado){ + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Precio Condición', + templateUrl: 'modal-precio-condicion.html', + controller: 'focaModalPrecioCondicionController', + size: 'lg' + } + ); + modalInstance.result.then( + function(precioCondicion) { + var cabecera = ''; + var plazosConcat = ''; + if(!Array.isArray(precioCondicion)) { + $scope.remito.idPrecioCondicion = precioCondicion.id; + $scope.plazosPagos = precioCondicion.plazoPago; + $scope.idLista = precioCondicion.idListaPrecio; + for(var i = 0; i < precioCondicion.plazoPago.length; i++) { + plazosConcat += precioCondicion.plazoPago[i].dias + ' '; + } + cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); + } else { //Cuando se ingresan los plazos manualmente + $scope.remito.idPrecioCondicion = 0; + //-1, el modal productos busca todos los productos + $scope.idLista = -1; + $scope.plazosPagos = precioCondicion; + for(var j = 0; j < precioCondicion.length; j++) { + plazosConcat += precioCondicion[j].dias + ' '; + } + cabecera = 'Ingreso manual ' + plazosConcat.trim(); } - cabecera = 'Ingreso manual ' + plazosConcat.trim(); + $scope.articulosTabla = []; + addCabecera('Precios y condiciones:', cabecera); + }, function() { + } - $scope.articulosTabla = []; - addCabecera('Precios y condiciones:', cabecera); - }, function() { - - } - ); + ); + } }; - $scope.abrirModalFlete = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Flete', - templateUrl: 'modal-flete.html', - controller: 'focaModalFleteController', - size: 'lg', - resolve: { - parametrosFlete: - function() { - return { - flete: $scope.remito.flete ? '1' : - ($scope.remito.fob ? 'FOB' : - ($scope.remito.flete === undefined ? null : '0')), - bomba: $scope.remito.bomba ? '1' : - ($scope.remito.bomba === undefined ? null : '0'), - kilometros: $scope.remito.kilometros - }; - } + $scope.seleccionarFlete = function() { + if(varlidarRemitoFacturado){ + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Flete', + templateUrl: 'modal-flete.html', + controller: 'focaModalFleteController', + size: 'lg', + resolve: { + parametrosFlete: + function() { + return { + flete: $scope.remito.flete ? '1' : + ($scope.remito.fob ? 'FOB' : + ($scope.remito.flete === undefined ? null : '0')), + bomba: $scope.remito.bomba ? '1' : + ($scope.remito.bomba === undefined ? null : '0'), + kilometros: $scope.remito.kilometros + }; + } + } } - } - ); - modalInstance.result.then( - function(datos) { - $scope.remito.flete = datos.flete; - $scope.remito.fob = datos.FOB; - $scope.remito.bomba = datos.bomba; - $scope.remito.kilometros = datos.kilometros; - - addCabecera('Flete:', datos.flete ? 'Si' : - ($scope.remito.fob ? 'FOB' : 'No')); - if(datos.flete) { - addCabecera('Bomba:', datos.bomba ? 'Si' : 'No'); - addCabecera('Kilometros:', datos.kilometros); - } else { - removeCabecera('Bomba:'); - removeCabecera('Kilometros:'); - $scope.remito.fob = false; - $scope.remito.bomba = false; - $scope.remito.kilometros = null; + ); + modalInstance.result.then( + function(datos) { + $scope.remito.flete = datos.flete; + $scope.remito.fob = datos.FOB; + $scope.remito.bomba = datos.bomba; + $scope.remito.kilometros = datos.kilometros; + + addCabecera('Flete:', datos.flete ? 'Si' : + ($scope.remito.fob ? 'FOB' : 'No')); + if(datos.flete) { + addCabecera('Bomba:', datos.bomba ? 'Si' : 'No'); + addCabecera('Kilometros:', datos.kilometros); + } else { + removeCabecera('Bomba:'); + removeCabecera('Kilometros:'); + $scope.remito.fob = false; + $scope.remito.bomba = false; + $scope.remito.kilometros = null; + } + }, function() { + } - }, function() { - - } - ); + ); + } }; - $scope.abrirModalMoneda = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Moneda', - templateUrl: 'modal-moneda.html', - controller: 'focaModalMonedaController', - size: 'lg' - } - ); - modalInstance.result.then( - function(moneda) { - $scope.abrirModalCotizacion(moneda); - }, function() { - - } - ); + $scope.seleccionarMoneda = function() { + if(varlidarRemitoFacturado){ + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Moneda', + templateUrl: 'modal-moneda.html', + controller: 'focaModalMonedaController', + size: 'lg' + } + ); + modalInstance.result.then( + function(moneda) { + $scope.abrirModalCotizacion(moneda); + }, function() { + + } + ); + } }; $scope.abrirModalCotizacion = function(moneda) { @@ -863,12 +856,12 @@ angular.module('focaCrearRemito') .controller('remitoController', return relleno; } - function varlidarRemitoFacturado(funcion) { - if($scope.remito.estado === 5) { + function varlidarRemitoFacturado() { + if($scope.remito.estado !== 5) { + return true; + }else{ focaModalService.alert('No se puede editar un remito facturado'); - } - else { - funcion(); + return false(); } } } diff --git a/src/js/service.js b/src/js/service.js index 0b6216f..fc0d3b6 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -55,6 +55,10 @@ angular.module('focaCrearRemito') }, getNumeroRemito: function() { return $http.get(route + '/remito/numero-siguiente'); + }, + getBotonera: function() { + return ['Nota pedido', 'Vendedor', 'Cliente', 'Proveedor', + 'Moneda', 'Precios y condiciones', 'Flete', 'Productos']; } }; }]); diff --git a/src/views/remito.html b/src/views/remito.html index 1320d57..9340ec2 100644 --- a/src/views/remito.html +++ b/src/views/remito.html @@ -83,22 +83,7 @@
-
-
- -
-
+