diff --git a/gulpfile.js b/gulpfile.js index d40c76f..832aa83 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -46,7 +46,8 @@ gulp.task('uglify', ['templates'], function() { replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ - '"angular-ladda","focaModalMoneda","focaModalCotizacion"', ''), + '"focaModalMoneda","focaModalCotizacion","focaSeguimiento","angular-ladda",'+ + '"cordovaGeolocationModule"', ''), gulp.dest(paths.dist) ] ); diff --git a/index.html b/index.html index e264d43..fd948f1 100644 --- a/index.html +++ b/index.html @@ -17,6 +17,7 @@ + @@ -29,10 +30,12 @@ + + diff --git a/package.json b/package.json index ecf75fd..ccc9639 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 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-modal-moneda.git git+https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git" + "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 angular-route 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" }, "pre-commit": [ "gulp-pre-commit" @@ -24,7 +24,8 @@ "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-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" }, "devDependencies": { "angular": "^1.7.5", @@ -42,6 +43,7 @@ "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", "font-awesome": "^4.7.0", "gulp": "^3.9.1", "gulp-angular-templatecache": "^2.2.2", diff --git a/src/js/app.js b/src/js/app.js index b95430f..f31a2c6 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -10,7 +10,9 @@ angular.module('focaCrearNotaPedido', [ 'focaDirectivas', 'focaModal', 'focaModalDomicilio', - 'angular-ladda', 'focaModalMoneda', - 'focaModalCotizacion' + 'focaModalCotizacion', + 'focaSeguimiento', + 'angular-ladda', + 'cordovaGeolocationModule' ]); diff --git a/src/js/businessService.js b/src/js/businessService.js new file mode 100644 index 0000000..000abaf --- /dev/null +++ b/src/js/businessService.js @@ -0,0 +1,16 @@ +angular.module('focaCrearNotaPedido') + .service('notaPedidoBusinessService', [ + 'crearNotaPedidoService', + function(crearNotaPedidoService) { + return { + addArticulos: function(articulosNotaPedido, idNotaPedido, cotizacion) { + for(var i = 0; i < articulosNotaPedido.length; i++) { + delete articulosNotaPedido[i].editCantidad; + delete articulosNotaPedido[i].editPrecio; + articulosNotaPedido[i].idNotaPedido = idNotaPedido; + articulosNotaPedido[i].precio = articulosNotaPedido[i].precio * cotizacion; + crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]); + } + } + }; + }]); \ No newline at end of file diff --git a/src/js/controller.js b/src/js/controller.js index 934af99..8177837 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -1,9 +1,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', [ '$scope', '$uibModal', '$location', '$filter', 'crearNotaPedidoService', - 'focaModalService', + 'focaModalService', 'focaSeguimientoService', 'notaPedidoBusinessService', function( - $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService + $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService, + focaSeguimientoService, notaPedidoBusinessService ) { $scope.botonera = [ {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, @@ -155,9 +156,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }; crearNotaPedidoService.crearNotaPedido(notaPedido).then( function(data) { - crearNotaPedidoService.addArticulos($scope.articulosTabla, + notaPedidoBusinessService.addArticulos($scope.articulosTabla, data.data.id, $scope.notaPedido.cotizacion.COTIZACION); - + focaSeguimientoService.guardarPosicion('crear nota pedido', ''); var plazos = $scope.plazosPagos; for(var j = 0; j < plazos.length; j++) { var json = { diff --git a/vendor/cordovaGeolocationModule.min.js b/vendor/cordovaGeolocationModule.min.js new file mode 100644 index 0000000..4a78dd7 --- /dev/null +++ b/vendor/cordovaGeolocationModule.min.js @@ -0,0 +1 @@ +var cordovaGeolocationModule=angular.module("cordovaGeolocationModule",[]);cordovaGeolocationModule.constant("cordovaGeolocationConstants",{apiVersion:"1.0.0",cordovaVersion:">=3.4.0"});cordovaGeolocationModule.factory("cordovaGeolocationService",["$rootScope","$log","cordovaGeolocationConstants",function(e,t,n){return{apiVersion:function(){t.debug("cordovaGeolocationService.apiVersion.");return n.apiVersion},cordovaVersion:function(){t.debug("cordovaGeolocationService.cordovaVersion.");return n.cordovaVersion},checkGeolocationAvailability:function(){t.debug("cordovaGeolocationService.checkGeolocationAvailability.");if(!navigator.geolocation){t.warn("Geolocation API is not available.");return false}return true},getCurrentPosition:function(n,r,i){t.debug("cordovaGeolocationService.getCurrentPosition.");if(!this.checkGeolocationAvailability()){return}navigator.geolocation.getCurrentPosition(function(t){e.$apply(n(t))},function(t){e.$apply(r(t))},i)},watchPosition:function(n,r,i){t.debug("cordovaGeolocationService.watchPosition.");if(!this.checkGeolocationAvailability()){return}return navigator.geolocation.watchPosition(function(t){e.$apply(n(t))},function(t){e.$apply(r(t))},i)},clearWatch:function(e){t.debug("cordovaGeolocationService.clearWatch.");if(!this.checkGeolocationAvailability()){return}navigator.geolocation.clearWatch(e)}}}]) \ No newline at end of file