Commit 5786e5447fbaeacc2c536a9b20b88042618272bc

Authored by Eric Fernandez
Exists in master

Merge branch 'master' into 'develop'

Master(mpuebla)

See merge request !17
src/js/controller.js
... ... @@ -4,8 +4,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
4 4 '$localStorage', 'APP', 'focaLoginService',
5 5 function (
6 6 $scope, $uibModal, $location, $filter, crearFacturaService, $timeout, focaModalService,
7   - crearRemitoService, $rootScope, focaBotoneraLateralService, $localStorage, APP, loginServ)
8   - {
  7 + crearRemitoService, $rootScope, focaBotoneraLateralService, $localStorage, APP, loginServ) {
9 8  
10 9 config();
11 10  
... ... @@ -466,20 +465,19 @@ angular.module('focaCrearFactura').controller('facturaController', [
466 465 image: producto.nombreImagen,
467 466 imageDefault: 'productoDefault.png'
468 467 });
469   -
470   -
  468 +
471 469 crearFuncionesProductos(producto);
472   -
473   - });
474   - $scope.botoneraProductos.push({
475   - label: 'Busqueda Productos',
476   - image: 'buscarProductos.png',
477   - imageDefault: 'productoDefault.png'
478 470 });
479 471 });
480 472 }
481 473  
482 474 $scope.seleccionarBusquedaProductos = function () {
  475 +
  476 + if (angular.equals({}, $scope.factura.vendedor)) {
  477 +
  478 + focaModalService.alert('Seleccione Vendedor');
  479 + return false;
  480 + }
483 481  
484 482 var modalInstance = $uibModal.open(
485 483 {
src/js/controllerCombustibles.js
... ... @@ -9,26 +9,27 @@ angular.module('focaCrearFactura')
9 9 $scope.mangueras = [];
10 10 $scope.colorTexto = { color: 'black' };
11 11 var productosByMangera = [];
12   -
  12 +
13 13 config();
14   -
  14 +
15 15 function config() {
16 16  
17 17 $scope.nombreProducto = parametros.nombreProducto;
18 18 setColorNombreProducto();
19 19 parametros.despachos.forEach(function (despacho) {
20   -
  20 +
21 21 var findCsu = productosByMangera.filter(function (csu) {
22   - return csu.csu == despacho.CSU.trim();
  22 + return csu.csu === despacho.CSU.trim();
23 23 })[0];
24   -
  24 +
25 25 if (!findCsu) {
26   -
  26 +
27 27 var mangera = {
28 28 csu: despacho.CSU.trim(),
29   - despachos: [despacho]
  29 + despachos: [despacho],
  30 + show: true
30 31 };
31   -
  32 +
32 33 productosByMangera.unshift(mangera);
33 34 } else {
34 35 findCsu.despachos.push(despacho);
... ... @@ -32,12 +32,20 @@ angular.module('focaCrearFactura')
32 32 label: 'Vendedor',
33 33 image: 'vendedor.png'
34 34 };
35   -
  35 + // $scope.botoneraProductos.push({
  36 + // label: 'Busqueda Productos',
  37 + // image: 'buscarProductos.png',
  38 + // imageDefault: 'productoDefault.png'
  39 + // });
36 40 var botones = [
37 41 {
38 42 label: 'Cliente',
39 43 image: 'cliente.png'
40 44 },
  45 + {
  46 + label: 'Busqueda Productos',
  47 + image: 'productos.png'
  48 + }
41 49 // {
42 50 // label: 'Moneda',
43 51 // image: 'moneda.png'
... ... @@ -48,7 +56,7 @@ angular.module('focaCrearFactura')
48 56 // }
49 57 ];
50 58  
51   - if (APP != 'facturador') {
  59 + if (APP !== 'facturador') {
52 60 botones.unshift(vendedor);
53 61 }
54 62