Commit 752bebe05ddc0a6b24522b76e99c263b2e099ea8

Authored by Eric Fernandez
1 parent 104c0b8674
Exists in master and in 1 other branch develop

fix número factura

Showing 2 changed files with 18 additions and 15 deletions   Show diff stats
... ... @@ -8,9 +8,12 @@
8 8 "refresh": "gulp uglify && cp tmp/foca-crear-factura.js ../wrapper-demo/node_modules/foca-crear-factura/dist/foca-crear-factura.min.js",
9 9 "test": "echo \"Error: no test specified\" && exit 1",
10 10 "compile": "gulp uglify",
  11 + "gulp-pre-commit": "gulp pre-commit",
11 12 "postinstall": "npm run compile && gulp clean-post-install",
  13 +
12 14 "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"
13 15 },
  16 + "pre-commit": "gulp-pre-commit",
14 17 "repository": {
15 18 "type": "git",
16 19 "url": "http://git.focasoftware.com/npm/foca-crear-factura.git"
src/js/controller.js
... ... @@ -80,7 +80,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
80 80  
81 81 getNumeroFactura('B');
82 82  
83   - if (APP == 'facturador') {
  83 + if (APP === 'facturador') {
84 84 crearFacturaService
85 85 .getVendedorPlayaById(loginServ.getLoginData().vendedorPlaya)
86 86 .then(function (res) {
... ... @@ -109,7 +109,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
109 109 focaModalService.alert('Ocurrió un error al intentar recuperar' +
110 110 'el vendedor logeado');
111 111 });
112   - })
  112 + });
113 113 }
114 114 }
115 115  
... ... @@ -124,7 +124,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
124 124  
125 125 if (!validarGuardar()) return;
126 126  
127   - if ($scope.factura.formaPago == 2) {
  127 + if ($scope.factura.formaPago === 2) {
128 128 $scope.crearFactura();
129 129 return;
130 130 }
... ... @@ -146,7 +146,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
146 146 modalInstance.result
147 147 .then(function (data) {
148 148  
149   - if (data.tipo == 'tarjeta') {
  149 + if (data.tipo === 'tarjeta') {
150 150 $scope.factura.formaPago = 4;
151 151 } else {
152 152 $scope.factura.formaPago = 1;
... ... @@ -217,7 +217,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
217 217 formaPago: formaPago
218 218 };
219 219  
220   - crearFacturaService.guardarFactura(save).then(function (res) {
  220 + crearFacturaService.guardarFactura(save).then(function () {
221 221  
222 222 focaBotoneraLateralService.endGuardar(true);
223 223  
... ... @@ -271,9 +271,9 @@ angular.module('focaCrearFactura').controller('facturaController', [
271 271 .then(function (data) {
272 272  
273 273 $scope.factura.formaPago = data.formaDePago;
274   -
275 274 $scope.factura.cliente = cliente;
276   - getNumeroFactura(cliente.TIP)
  275 +
  276 + getNumeroFactura(cliente.TIP);
277 277  
278 278 $scope.$broadcast('addCabecera', {
279 279 label: 'Cliente:',
... ... @@ -452,7 +452,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
452 452  
453 453 $scope.quitarDespacho = function (articulo, index) {
454 454  
455   - if (articulo.SUR == 0) {
  455 + if (articulo.SUR === 0) {
456 456 articulo.desactivado = true;
457 457 return;
458 458 }
... ... @@ -562,8 +562,8 @@ angular.module('focaCrearFactura').controller('facturaController', [
562 562 DES: producto.descripcionLarga,
563 563 PUN: producto.precio,
564 564 IVA: producto.IMPIVA,
565   - NET: producto.IvaCO != 0 ? parseFloat(producto.neto) : 0,
566   - NEX: producto.IvaCO == 0 ? parseFloat(producto.neto) : 0,
  565 + NET: producto.IvaCO !== 0 ? parseFloat(producto.neto) : 0,
  566 + NEX: producto.IvaCO === 0 ? parseFloat(producto.neto) : 0,
567 567 IMI: producto.ImpInt,
568 568 IMI2: producto.ImpInt2,
569 569 IMI3: producto.ImpInt3,
... ... @@ -717,8 +717,8 @@ angular.module('focaCrearFactura').controller('facturaController', [
717 717 CAN: despacho.LTS,
718 718 PUN: producto.PreVen,
719 719 IVA: producto.IMPIVA,
720   - NET: producto.IvaCO != 0 ? producto.PreNet : 0,
721   - NEX: producto.IvaCO == 0 ? producto.PreNet : 0,
  720 + NET: producto.IvaCO !== 0 ? producto.PreNet : 0,
  721 + NEX: producto.IvaCO === 0 ? producto.PreNet : 0,
722 722 IMI: producto.ImpInt,
723 723 IMI2: producto.ImpInt2,
724 724 IMI3: producto.ImpInt3,
... ... @@ -824,7 +824,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
824 824  
825 825 })
826 826 .catch(function (err) {
827   - console.log(err)
  827 + console.log(err);
828 828 reject();
829 829 });
830 830 });
... ... @@ -856,7 +856,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
856 856 } else {
857 857 $location.path('/');
858 858 }
859   - }
  859 + };
860 860  
861 861 function setearFactura(factura) {
862 862  
... ... @@ -920,7 +920,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
920 920 }
921 921  
922 922 $scope.cambioEdit = function (articulo, propiedad) {
923   - if (propiedad === 'cantidad' && articulo.SUR == 0) {
  923 + if (propiedad === 'cantidad' && articulo.SUR === 0) {
924 924 articulo.editCantidad = true;
925 925 }
926 926 };