Commit e700d7112a73b8ca1d3e769cd1cd85bb226d1990

Authored by Eric Fernandez
Exists in master

Merge branch 'master' into 'master'

Master(efernandez)

See merge request modulos-npm/foca-crear-nota-pedido!15
... ... @@ -8,7 +8,7 @@
8 8 "compile": "gulp uglify",
9 9 "gulp-pre-commit": "gulp pre-commit",
10 10 "postinstall": "npm run compile && gulp clean-post-install",
11   - "install-dev": "npm install -D jasmine-core pre-commit angular 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-petroleras.git git+https://debo.suite.repo/nguarnieri/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"
  11 + "install-dev": "npm install -D jasmine-core pre-commit angular 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-petroleras.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"
12 12 },
13 13 "pre-commit": [
14 14 "gulp-pre-commit"
... ... @@ -22,7 +22,7 @@
22 22 "peerDependencies": {
23 23 "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git",
24 24 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git",
25   - "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos",
  25 + "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos",
26 26 "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git",
27 27 "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git"
28 28 },
... ... @@ -33,7 +33,7 @@
33 33 "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git",
34 34 "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git",
35 35 "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git",
36   - "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos",
  36 + "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos",
37 37 "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete",
38 38 "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git",
39 39 "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git",
src/js/controller.js
1 1 angular.module('focaCrearNotaPedido')
2 2 .controller('notaPedidoCtrl',
3   - ['$scope', '$uibModal', '$location', 'crearNotaPedidoService', 'focaModalService',
4   - function($scope, $uibModal, $location, crearNotaPedidoService, focaModalService) {
  3 + ['$scope', '$uibModal', 'crearNotaPedidoService', 'focaModalService',
  4 + function($scope, $uibModal, crearNotaPedidoService, focaModalService) {
5 5 $scope.show = false;
6 6 $scope.cargando = true;
7 7 $scope.dateOptions = {
... ... @@ -10,12 +10,12 @@ angular.module('focaCrearNotaPedido')
10 10 };
11 11 $scope.notaPedido = {
12 12 vendedor: {},
13   - cliente: {}
  13 + cliente: {},
  14 + domicilio: { dom: ''}
14 15 };
15 16 $scope.articulosTabla = [];
16 17 var idLista;
17   - var notaPedidoTemp = crearNotaPedidoService.getNotaPedido();
18   - $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1);
  18 + var notaPedidoTemp = crearNotaPedidoService.getNotaPedido();
19 19 crearNotaPedidoService.getPrecioCondicion().then(
20 20 function(res) {
21 21 $scope.precioCondiciones = res.data;
... ... @@ -33,81 +33,77 @@ angular.module('focaCrearNotaPedido')
33 33 $scope.articulosTabla = res.data;
34 34 }
35 35 );
36   - crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then(
37   - function(res) {
38   - $scope.notaPedido.domicilio = res.data;
39   - }
40   - );
  36 + //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO
  37 + //(NO REQUERIDO EN ESTA VERSION)
  38 + // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then(
  39 + // function(res) {
  40 + // $scope.notaPedido.domicilio = res.data;
  41 + // }
  42 + // );
41 43 } else {
42   - $scope.notaPedido.fechaCarga = new Date();
43   - $scope.notaPedido.domicilio = [{ id: 0 }];
44   - $scope.notaPedido.bomba = '1';
  44 + $scope.notaPedido.fechaCarga = new Date();
  45 + $scope.notaPedido.bomba = '0';
45 46 $scope.notaPedido.flete = '0';
46 47 idLista = undefined;
47 48 }
48   - $scope.addNewDom = function() {
49   - $scope.notaPedido.domicilio.push({ 'id': 0 });
50   - };
51   - $scope.removeNewChoice = function(choice) {
52   - if ($scope.notaPedido.domicilio.length > 1) {
53   - $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(
54   - function(c) {
55   - return c.$$hashKey === choice.$$hashKey;
56   - }
57   - ), 1);
58   - }
59   - };
  49 + //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO
  50 + // $scope.addNewDom = function() {
  51 + // $scope.notaPedido.domicilio.push({ 'id': 0 });
  52 + // };
  53 + // $scope.removeNewChoice = function(choice) {
  54 + // if ($scope.notaPedido.domicilio.length > 1) {
  55 + // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(
  56 + // function(c) {
  57 + // return c.$$hashKey === choice.$$hashKey;
  58 + // }
  59 + // ), 1);
  60 + // }
  61 + // };
60 62 $scope.crearNotaPedido = function() {
  63 + if($scope.articulosTabla.length === 0) {
  64 + focaModalService.alert('Debe cargar almenos un articulo');
  65 + return;
  66 + }
  67 + if($scope.notaPedido.domicilio.id === undefined) {
  68 + $scope.notaPedido.domicilio.id = 0;
  69 + }
  70 + var date = new Date();
61 71 var notaPedido = {
62 72 id: 0,
63   - fechaCarga: $scope.notaPedido.fechaCarga,
  73 + fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000))
  74 + .toISOString().slice(0, 19).replace('T', ' '),
64 75 vendedor: $scope.notaPedido.vendedor.nombre,
65   - cliente: $scope.notaPedido.cliente.nombre,
66   - domicilio: $scope.notaPedido.domicilio.id,
  76 + idCliente: $scope.notaPedido.cliente.id,
  77 + domicilio: $scope.notaPedido.domicilio,
67 78 precioCondicion: $scope.notaPedido.precioCondicion,
68 79 bomba: $scope.notaPedido.bomba,
69 80 flete: $scope.notaPedido.flete,
70 81 total: $scope.getTotal()
71 82 };
72 83 crearNotaPedidoService.crearNotaPedido(notaPedido).then(
73   - function() {
  84 + function(data) {
74 85 focaModalService.alert('Nota pedido creada');
75   - // $location.path('/venta-nota-pedido');
76   - // var flete = {
77   - // idNotaPedido: data.data.id,
78   - // idTransportista: $scope.notaPedido.fleteId,
79   - // idChofer: $scope.chofer.id,
80   - // idVehiculo: $scope.vehiculo.id,
81   - // kilometros: $scope.notaPedido.kilometros,
82   - // costoKilometro: $scope.notaPedido.costoUnitarioKmFlete
83   - // };
84   - //TO DO - Insert de flete
  86 + if($scope.notaPedido.flete === 1) {
  87 + var flete = {
  88 + idNotaPedido: data.data.id,
  89 + idTransportista: $scope.notaPedido.fleteId,
  90 + idChofer: $scope.notaPedido.chofer.id,
  91 + idVehiculo: $scope.notaPedido.vehiculo.id,
  92 + kilometros: $scope.notaPedido.kilometros,
  93 + costoKilometro: $scope.notaPedido.costoUnitarioKmFlete
  94 + };
  95 + crearNotaPedidoService.crearFlete(flete);
  96 + }
  97 + var articulosNotaPedido = $scope.articulosTabla;
  98 + for(var i = 0; i < articulosNotaPedido.length; i++) {
  99 + delete articulosNotaPedido[i].edit;
  100 + articulosNotaPedido[i].idNotaPedido = data.data.id;
  101 + crearNotaPedidoService
  102 + .crearArticulosParaNotaPedido(articulosNotaPedido[i]);
  103 + }
  104 + $scope.limpiarPantalla();
85 105 }
86 106 );
87   - var articulosNotaPedido = $scope.articulosTabla;
88   - for(var i = 0; i< articulosNotaPedido.length;i++) {
89   - delete articulosNotaPedido[i].edit;
90   - crearNotaPedidoService
91   - .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then(
92   - function() {
93   - return;
94   - }
95   - );
96   - }
97   - $scope.notaPedido.precioCondicion = '';
98   - $scope.articulosTabla = [];
99   - $scope.notaPedido.fleteNombre = '';
100   - $scope.notaPedido.chofer = '';
101   - $scope.notaPedido.vehiculo = '';
102   - $scope.notaPedido.kilometros = '';
103   - $scope.notaPedido.costoUnitarioKmFlete = '';
104   - $scope.notaPedido.vendedor.nombre = '';
105   - $scope.notaPedido.cliente.nombre = '';
106   - $scope.domicilio = '';
107   - $scope.notaPedido.flete = 0;
108   - };
109   - $scope.siguienteTab = function() {
110   - $scope.active = 1;
111 107 };
112 108 $scope.seleccionarArticulo = function() {
113 109 if (idLista === undefined) {
... ... @@ -190,7 +186,25 @@ angular.module(&#39;focaCrearNotaPedido&#39;)
190 186 );
191 187 modalInstance.result.then(
192 188 function(cliente) {
  189 + $scope.limpiarPantalla();
193 190 $scope.notaPedido.cliente.nombre = cliente.nom;
  191 + $scope.notaPedido.cliente.id = cliente.cod;
  192 + crearNotaPedidoService.getDomiciliosByIdCliente(cliente.cod).then(
  193 + function(data) {
  194 + if(data.data.length === 0){
  195 + focaModalService
  196 + .alert('El cliente no tienen domicilios de entrega')
  197 + .then(
  198 + function() {
  199 + $scope.seleccionarCliente();
  200 + $scope.notaPedido.cliente = {nombre: ''};
  201 + }
  202 + );
  203 + return;
  204 + }
  205 + $scope.domiciliosCliente = data.data;
  206 + }
  207 + );
194 208 }, function() {
195 209  
196 210 }
... ... @@ -206,18 +220,11 @@ angular.module(&#39;focaCrearNotaPedido&#39;)
206 220 }
207 221 );
208 222 };
209   - $scope.obtenerDomicilios = function(id) {
210   - crearNotaPedidoService.getDomicilios(id).then(
211   - function(res) {
212   - $scope.notaPedido.domicilio = res.data;
213   - }
214   - );
215   - };
216 223 $scope.getTotal = function() {
217 224 var total = 0;
218   - var array = $scope.articulosTabla;
219   - for (var i = 0; i < array.length; i++) {
220   - total += array[i].precio * array[i].cantidad;
  225 + var arrayTempArticulos = $scope.articulosTabla;
  226 + for (var i = 0; i < arrayTempArticulos.length; i++) {
  227 + total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad;
221 228 }
222 229 return total.toFixed(2);
223 230 };
... ... @@ -226,10 +233,6 @@ angular.module(&#39;focaCrearNotaPedido&#39;)
226 233 return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad;
227 234 }
228 235 };
229   - $scope.cargarArticulos = function() {
230   - idLista = $scope.notaPedido.precioCondicion;
231   - $scope.articulosTabla = [];
232   - };
233 236 $scope.abrirModalListaPrecio = function() {
234 237 var modalInstance = $uibModal.open(
235 238 {
... ... @@ -261,11 +264,7 @@ angular.module(&#39;focaCrearNotaPedido&#39;)
261 264 );
262 265 modalInstance.result.then(
263 266 function(flete) {
264   - $scope.choferes = '';
265   - $scope.vehiculos = '';
266   - $scope.notaPedido.chofer = '';
267   - $scope.notaPedido.vehiculo = '';
268   - $scope.notaPedido.costoUnitarioKmFlete = '';
  267 + $scope.limpiarFlete();
269 268 $scope.notaPedido.fleteNombre = flete.nombre;
270 269 $scope.notaPedido.fleteId = flete.id;
271 270 $scope.choferes = flete.chofer;
... ... @@ -310,25 +309,27 @@ angular.module(&#39;focaCrearNotaPedido&#39;)
310 309 $scope.notaPedido.vehiculo = '';
311 310 $scope.notaPedido.kilometros = '';
312 311 $scope.notaPedido.costoUnitarioKmFlete = '';
  312 + $scope.choferes = '';
  313 + $scope.vehiculos = '';
313 314 };
314   - $scope.crearPedidoDemo = function() {
315   - focaModalService.alert('Pedido Creado');
  315 + $scope.limpiarPantalla = function() {
  316 + $scope.limpiarFlete();
  317 + $scope.notaPedido.flete = '0';
  318 + $scope.notaPedido.bomba = '0';
316 319 $scope.notaPedido.precioCondicion = '';
317   - $scope.articulosTabla = [];
318   - $scope.notaPedido.fleteNombre = '';
319   - $scope.notaPedido.chofer = '';
320   - $scope.notaPedido.vehiculo = '';
321   - $scope.notaPedido.kilometros = '';
322   - $scope.notaPedido.costoUnitarioKmFlete = '';
  320 + $scope.articulosTabla = [];
323 321 $scope.notaPedido.vendedor.nombre = '';
324   - $scope.notaPedido.cliente.nombre = '';
325   - $scope.domicilio.dom = '';
326   - $scope.notaPedido.flete = 0;
  322 + $scope.notaPedido.cliente = {nombre: ''};
  323 + $scope.notaPedido.domicilio = {dom: ''};
  324 + $scope.domiciliosCliente = [];
327 325 };
328 326 $scope.resetFilter = function() {
329 327 $scope.articuloACargar = {};
330 328 $scope.cargando = true;
331 329 };
  330 + $scope.selectFocus = function ($event) {
  331 + $event.target.select();
  332 + };
332 333 }
333 334 ]
334 335 )
... ... @@ -27,25 +27,9 @@ angular.module(&#39;focaCrearNotaPedido&#39;)
27 27 getDomiciliosByIdNotaPedido: function(id) {
28 28 return $http.get(route +'/nota-pedido/'+id+'/domicilios');
29 29 },
30   - //EN DESARROLLO
31   - getDomicilios: function(id) {
32   - // return $http.get(route + '/'+id)
33   - id='le asigno un valor para pasar pre commit';
34   - var domicilio = [
35   - {
36   - id: 1,
37   - dom: 'RISSO PATRON 781'
38   - },
39   - {
40   - id: 2,
41   - dom: 'MARIANO MORENO 533'
42   - },
43   - {
44   - id: 3,
45   - dom: 'SALTA 796'
46   - }
47   - ];
48   - return domicilio;
  30 + getDomiciliosByIdCliente: function(id) {
  31 + var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega)
  32 + return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id );
49 33 },
50 34 getPrecioCondicion: function() {
51 35 return $http.get(route + '/precio-condicion');
src/views/nota-pedido.html
1   -<div class="row">
2   - <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
3   - <div class="row bg-secondary p-3">
4   - <div class="form-group col-12 col-sm-6 col-md-4">
5   - <div class="input-group">
  1 +<form name="formCrearNota" ng-submit="crearNotaPedido()">
  2 + <div class="row">
  3 + <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
  4 + <div class="row bg-secondary p-3">
  5 + <div class="form-group col-12 col-sm-6 col-md-4">
  6 + <div class="input-group">
  7 + <input
  8 + type="text"
  9 + class="form-control"
  10 + uib-datepicker-popup="dd/MM/yyyy"
  11 + ng-model="notaPedido.fechaCarga"
  12 + is-open="popup1.opened"
  13 + datepicker-options="dateOptions"
  14 + close-text="Cerrar"
  15 + current-text="Hoy"
  16 + clear-text="Borrar"
  17 + alt-input-formats="altInputFormats"
  18 + ng-required="true"
  19 + />
  20 + <span class="input-group-append">
  21 + <button type="button" class="btn btn-default" ng-click="popup1.opened = true">
  22 + <i class="fa fa-calendar"></i>
  23 + </button>
  24 + </span>
  25 + </div>
  26 + </div>
  27 + <div class="form-group col-12 col-sm-6 col-md-4">
  28 + <div class="input-group">
  29 + <input
  30 + class="form-control selectable"
  31 + type="text"
  32 + ng-model="notaPedido.cliente.nombre"
  33 + placeholder="Seleccione Cliente"
  34 + readonly="true"
  35 + ng-click="seleccionarCliente()"
  36 + ng-required="true"
  37 + >
  38 + <span class="input-group-append">
  39 + <button type="button" class="btn btn-default" ng-click="seleccionarCliente()">
  40 + <i class="fa fa-search"></i>
  41 + </button>
  42 + </span>
  43 + </div>
  44 + </div>
  45 + <div class="form-group col-12 col-sm-6 col-md-4">
  46 + <div class="input-group">
  47 + <input
  48 + class="form-control"
  49 + type="text"
  50 + ng-model="notaPedido.vendedor.nombre"
  51 + placeholder="Seleccione Vendedor"
  52 + readonly="true"
  53 + >
  54 + <span class="input-group-append">
  55 + <button type="button" class="btn btn-default" ng-click="seleccionarVendedor()">
  56 + <i class="fa fa-search"></i>
  57 + </button>
  58 + </span>
  59 + </div>
  60 + </div>
  61 + <div class="form-group col-12 col-sm-6 col-md-4">
6 62 <input
  63 + class="form-control selectable"
7 64 type="text"
8   - class="form-control"
9   - uib-datepicker-popup="dd/MM/yyyy"
10   - ng-model="notaPedido.fechaCarga"
11   - is-open="popup1.opened"
12   - datepicker-options="dateOptions"
13   - close-text="Cerrar"
14   - current-text="Hoy"
15   - clear-text="Borrar"
16   - alt-input-formats="altInputFormats"
17   - />
18   - <span class="input-group-append">
19   - <button type="button" class="btn btn-default" ng-click="popup1.opened = true">
20   - <i class="fa fa-calendar"></i>
21   - </button>
22   - </span>
  65 + ng-model="notaPedido.domicilio"
  66 + placeholder="Seleccione Domicilio"
  67 + typeahead-min-length="0"
  68 + uib-typeahead="domi as domi.dom for domi in domiciliosCliente"
  69 + >
23 70 </div>
24   - </div>
25   - <div class="form-group col-12 col-sm-6 col-md-4">
26   - <div class="input-group">
  71 + <div class="form-group col-12 col-sm-6 col-md-4">
27 72 <input
28   - class="form-control"
  73 + class="form-control selectable"
29 74 type="text"
30   - ng-model="notaPedido.vendedor.nombre"
31   - placeholder="Seleccione Vendedor"
32 75 readonly="true"
  76 + ng-model="notaPedido.precioCondicion"
  77 + ng-click="abrirModalListaPrecio()"
  78 + placeholder="Seleccione Lista de precio"
33 79 >
34   - <span class="input-group-append">
35   - <button type="button" class="btn btn-default" ng-click="seleccionarVendedor()">
36   - <i class="fa fa-search"></i>
37   - </button>
38   - </span>
39 80 </div>
40   - </div>
41   - <div class="form-group col-12 col-sm-6 col-md-4">
42   - <div class="input-group">
43   - <input
  81 + <div class="form-group col-12 col-sm-6 col-md-4">
  82 + <label>Bomba</label>
  83 + <div class="form-check custom-radio custom-control-inline">
  84 + <input
  85 + class="form-check-input"
  86 + type="radio"
  87 + name="radioBomba"
  88 + value="1"
  89 + ng-model="notaPedido.bomba">
  90 + <label class="form-check-label">Si</label>
  91 + </div>
  92 + <div class="form-check custom-radio custom-control-inline">
  93 + <input
  94 + class="form-check-input"
  95 + type="radio"
  96 + name="radioBomba"
  97 + value="0"
  98 + ng-model="notaPedido.bomba">
  99 + <label class="form-check-label">No</label>
  100 + </div>
  101 + </div>
  102 + <div class="form-group col-12 col-sm-6 col-md-4">
  103 + <label>Flete</label>
  104 + <div class="form-check custom-radio custom-control-inline">
  105 + <input
  106 + ng-change="limpiarFlete()"
  107 + class="form-check-input"
  108 + type="radio"
  109 + name="radioFlete"
  110 + value="1"
  111 + ng-model="notaPedido.flete">
  112 + <label class="form-check-label">Si</label>
  113 + </div>
  114 + <div class="form-check custom-radio custom-control-inline">
  115 + <input
  116 + class="form-check-input"
  117 + type="radio"
  118 + name="radioFlete"
  119 + value="0"
  120 + ng-model="notaPedido.flete">
  121 + <label class="form-check-label">No</label>
  122 + </div>
  123 + </div>
  124 + <div class="form-group col-12 col-sm-6 col-md-4">
  125 + <input
44 126 class="form-control selectable"
45 127 type="text"
46   - ng-model="notaPedido.cliente.nombre"
47   - placeholder="Seleccione Cliente"
48 128 readonly="true"
49   - ng-click="seleccionarCliente()"
  129 + ng-show="notaPedido.flete == 1"
  130 + ng-model="notaPedido.fleteNombre"
  131 + ng-click="abrirModalFlete()"
  132 + placeholder="Seleccione Flete"
50 133 >
51   - <span class="input-group-append">
52   - <button type="button" class="btn btn-default" ng-click="seleccionarCliente()">
53   - <i class="fa fa-search"></i>
54   - </button>
55   - </span>
56 134 </div>
57   - </div>
58   - <div class="form-group col-12 col-sm-6 col-md-4">
59   - <input
60   - class="form-control selectable"
61   - type="text"
62   - ng-model="domicilio"
63   - placeholder="Seleccione Domicilio"
64   - typeahead-min-length="0"
65   - uib-typeahead="domi as domi.dom for domi in domiciliosCliente"
66   - >
67   - </div>
68   - <div class="form-group col-12 col-sm-6 col-md-4">
69   - <input
70   - class="form-control selectable"
71   - type="text"
72   - readonly="true"
73   - ng-model="notaPedido.precioCondicion"
74   - ng-click="abrirModalListaPrecio()"
75   - placeholder="Seleccione Lista de precio"
76   - >
77   - </div>
78   - <div class="form-group col-12 col-sm-6 col-md-4">
79   - <label>Bomba</label>
80   - <div class="form-check custom-radio custom-control-inline">
81   - <input
82   - class="form-check-input"
83   - type="radio"
84   - name="radioBomba"
85   - value="1"
86   - ng-model="notaPedido.bomba">
87   - <label class="form-check-label">Si</label>
88   - </div>
89   - <div class="form-check custom-radio custom-control-inline">
  135 + <div class="form-group col-12 col-sm-6 col-md-4">
90 136 <input
91   - class="form-check-input"
92   - type="radio"
93   - name="radioBomba"
94   - value="0"
95   - ng-model="notaPedido.bomba">
96   - <label class="form-check-label">No</label>
  137 + class="form-control selectable"
  138 + type="text"
  139 + ng-show="notaPedido.flete == 1"
  140 + ng-model="notaPedido.chofer"
  141 + placeholder="Seleccione Chofer"
  142 + uib-typeahead="chofer as chofer.nombre for chofer in choferes"
  143 + typeahead-min-length="0"
  144 + >
97 145 </div>
98   - </div>
99   - <div class="form-group col-12 col-sm-6 col-md-4">
100   - <label>Flete</label>
101   - <div class="form-check custom-radio custom-control-inline">
  146 + <div class="form-group col-12 col-sm-6 col-md-4">
102 147 <input
103   - ng-change="limpiarFlete()"
104   - class="form-check-input"
105   - type="radio"
106   - name="radioFlete"
107   - value="1"
108   - ng-model="notaPedido.flete">
109   - <label class="form-check-label">Si</label>
110   - </div>
111   - <div class="form-check custom-radio custom-control-inline">
112   - <input
113   - class="form-check-input"
114   - type="radio"
115   - name="radioFlete"
116   - value="0"
117   - ng-model="notaPedido.flete">
118   - <label class="form-check-label">No</label>
  148 + class="form-control selectable"
  149 + type="text"
  150 + ng-show="notaPedido.flete == 1"
  151 + ng-model="notaPedido.vehiculo"
  152 + placeholder="Seleccione Vehículo"
  153 + uib-typeahead="vehiculo as vehiculo.tractor for vehiculo in vehiculos"
  154 + typeahead-min-length="0"
  155 + >
  156 + </div>
  157 + <div class="form-group col-12 col-sm-6 col-md-4">
  158 + <input
  159 + class="form-control selectable"
  160 + type="number"
  161 + step="0.01"
  162 + ng-show="notaPedido.flete == 1"
  163 + ng-model="notaPedido.costoUnitarioKmFlete"
  164 + placeholder="Costo por kilómetro"
  165 + >
  166 + </div>
  167 + <div class="form-group col-12 col-sm-6 col-md-4">
  168 + <input
  169 + class="form-control selectable"
  170 + type="number"
  171 + step="0.1"
  172 + ng-show="notaPedido.flete == 1"
  173 + ng-model="notaPedido.kilometros"
  174 + placeholder="Kilómetros recorridos"
  175 + >
119 176 </div>
120   - </div>
121   - <div class="form-group col-12 col-sm-6 col-md-4">
122   - <input
123   - class="form-control selectable"
124   - type="text"
125   - readonly="true"
126   - ng-show="notaPedido.flete == 1"
127   - ng-model="notaPedido.fleteNombre"
128   - ng-click="abrirModalFlete()"
129   - placeholder="Seleccione Flete"
130   - >
131   - </div>
132   - <div class="form-group col-12 col-sm-6 col-md-4">
133   - <input
134   - class="form-control selectable"
135   - type="text"
136   - ng-show="notaPedido.flete == 1"
137   - ng-model="notaPedido.chofer"
138   - placeholder="Seleccione Chofer"
139   - uib-typeahead="chofer as chofer.nombre for chofer in choferes"
140   - typeahead-min-length="0"
141   - >
142   - </div>
143   - <div class="form-group col-12 col-sm-6 col-md-4">
144   - <input
145   - class="form-control selectable"
146   - type="text"
147   - ng-show="notaPedido.flete == 1"
148   - ng-model="notaPedido.vehiculo"
149   - placeholder="Seleccione Vehículo"
150   - uib-typeahead="vehiculo as vehiculo.tractor for vehiculo in vehiculos"
151   - typeahead-min-length="0"
152   - >
153   - </div>
154   - <div class="form-group col-12 col-sm-6 col-md-4">
155   - <input
156   - class="form-control selectable"
157   - type="number"
158   - step="0.01"
159   - ng-show="notaPedido.flete == 1"
160   - ng-model="notaPedido.costoUnitarioKmFlete"
161   - placeholder="Costo por kilómetro"
162   - >
163   - </div>
164   - <div class="form-group col-12 col-sm-6 col-md-4">
165   - <input
166   - class="form-control selectable"
167   - type="number"
168   - step="0.1"
169   - ng-show="notaPedido.flete == 1"
170   - ng-model="notaPedido.kilometros"
171   - placeholder="Kilómetros recorridos"
172   - >
173 177 </div>
174 178 </div>
  179 + <div class="col-auto my-2">
  180 + <button
  181 + ng-click="crearNotaPedido()"
  182 + type="submit"
  183 + title="Crear nota pedido"
  184 + class="btn btn-primary float-right">
  185 + Guardar
  186 + </button>
  187 + </div>
175 188 </div>
176   - <div class="col-auto my-2">
177   - <button
178   - ng-click="crearNotaPedido()"
179   - type="button"
180   - title="Crear nota pedido"
181   - class="btn btn-primary float-right">
182   - Guardar
183   - </button>
184   - </div>
185   -</div>
  189 +</form>
186 190 <div class="row">
187 191 <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2">
188 192 <div class="row">
... ... @@ -211,7 +215,8 @@
211 215 placeholder="Seleccione Articulo"
212 216 class="form-control"
213 217 readonly
214   - ng-click="seleccionarArticulo()"></td>
  218 + ng-click="seleccionarArticulo()"
  219 + foca-focus="cargando"></td>
215 220 <td></td>
216 221 <td></td>
217 222 <td></td>
... ... @@ -265,7 +270,9 @@
265 270 type="number"
266 271 min="1"
267 272 foca-focus="articulo.edit"
268   - ng-keypress="editarArticulo($event.keyCode, articulo)">
  273 + ng-keypress="editarArticulo($event.keyCode, articulo)"
  274 + ng-focus="selectFocus($event)"
  275 + >
269 276 <i
270 277 class="selectable"
271 278 ng-click="cambioEdit(articulo)"