Commit 5f0ec229956d0f5ad9bda097cf587322d244f291

Authored by Nicolás Guarnieri
1 parent c84f58dd46
Exists in master

demo 9/10

foca-busqueda-cliente-modal.html
... ... @@ -0,0 +1,35 @@
  1 +<div class="modal-header">
  2 + <h3 class="modal-title">Búsqueda de cliente</h3>
  3 +</div>
  4 +<div class="modal-body">
  5 + <form>
  6 + <div class="form-group row">
  7 + <label class="col-sm-4 col-form-label">Nombre o CUIT</label>
  8 + <div class="col-sm-8">
  9 + <input
  10 + type="text"
  11 + ng-model="cliente"
  12 + placeholder="Nombre o CUIT"
  13 + uib-typeahead="
  14 + cliente.nom + ' (' + cliente.cuit + ')'
  15 + for cliente
  16 + in obtenerClientesPorNombreOCuit($viewValue)
  17 + "
  18 + typeahead-loading="cargandoClientes"
  19 + typeahead-no-results="sinResultados"
  20 + typeahead-min-length="3"
  21 + typeahead-on-select="seleccionar($item)"
  22 + class="form-control"
  23 + >
  24 + <i ng-show="cargandoClientes" class="fas fa-sync"></i>
  25 + <div ng-show="sinResultados">
  26 + <i class="fa fa-minus"></i> No se encontraron resultados.
  27 + </div>
  28 + </div>
  29 + </div>
  30 + </form>
  31 +</div>
  32 +<div class="modal-footer">
  33 + <button class="btn" ng-click="aceptar()">Aceptar</button>
  34 + <button class="btn" ng-click="cancelar()">Cancelar</button>
  35 +</div>
... ... @@ -66,7 +66,7 @@ gulp.task(&#39;webserver&#39;, function() {
66 66 connect.server(
67 67 {
68 68 port: 3000,
69   - livereload: true
  69 + host: '0.0.0.0'
70 70 }
71 71 )
72 72 ]
... ... @@ -13,15 +13,35 @@
13 13 <script src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
14 14 <script src="./node_modules/angular/angular.min.js"></script>
15 15 <script src="./node_modules/angular-route/angular-route.min.js"></script>
16   - <script src="./node_modules/foca-botonera-horizontal/dist/botonera-horizontal.min.js"></script>
  16 + <script src="./node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script>
  17 +
  18 + <script src="./node_modules/foca-directivas/dist/foca-directivas.min.js"></script>
  19 + <script src="./node_modules/foca-botonera-horizontal/dist/foca-botonera-horizontal.min.js"></script>
17 20 <script src="./node_modules/foca-turno-apertura/dist/foca-turno-apertura.min.js"></script>
  21 + <script src="./node_modules/foca-abm-plazo-pago/dist/foca-abm-plazo-pago.min.js"></script>
  22 + <script src="./node_modules/foca-abm-precios-condiciones/dist/foca-abm-precios-condiciones.min.js"></script>
  23 + <script src="./node_modules/foca-abm-sectores/dist/foca-abm-sectores.min.js"></script>
  24 + <script src="./vendor/foca-crear-nota-pedido.js"></script>
  25 + <script src="./node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script>
  26 + <script src="./node_modules/foca-modal-petroleras/dist/foca-modal-petroleras.min.js"></script>
  27 + <script src="./node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script>
  28 + <script src="./node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script>
18 29  
19 30 <!-- BUILD -->
20 31 <script src="./src/js/app.js"></script>
21 32 <!-- /BUILD -->
  33 +
22 34 </head>
23 35 <body>
  36 + <style>
  37 + .selectable {
  38 + cursor: pointer;
  39 + }
  40 +
  41 + .table-nonfluid {
  42 + width: auto;
  43 + }
  44 + </style>
24 45 <botonera-horizontal></botonera-horizontal>
25   - <div ng-view id="contenedor" class="container-fluid" style="margin-bottom: 100px"></div>
26 46 </body>
27 47 </html>
... ... @@ -23,13 +23,27 @@
23 23 "angular": "^1.7.4",
24 24 "angular-route": "1.7.3",
25 25 "bootstrap": "4.1.3",
  26 + "foca-abm-plazo-pago": "git+https://192.168.0.11/modulos-npm/foca-abm-plazo-pago.git",
  27 + "foca-abm-precios-condiciones": "git+https://192.168.0.11/modulos-npm/foca-abm-precios-condiciones.git",
  28 + "foca-abm-sectores": "git+https://192.168.0.11/modulos-npm/foca-abm-sectores",
26 29 "foca-botonera-horizontal": "git+https://192.168.0.11/modulos-npm/foca-botonera-horizontal.git",
  30 + "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente.git",
  31 + "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git",
  32 + "foca-modal-busqueda-productos": "git+https://192.168.0.11/nguarnieri/foca-modal-busqueda-productos",
  33 + "foca-modal-petroleras": "git+https://192.168.0.11/modulos-npm/foca-modal-petroleras.git",
  34 + "foca-modal-vendedores": "git+https://192.168.0.11/modulos-npm/foca-modal-vendedores.git",
27 35 "foca-turno-apertura": "git+https://192.168.0.11/modulos-npm/foca-turno-apertura.git",
28 36 "font-awesome": "4.7.0",
29   - "jquery": "3.3.1"
  37 + "gulp-angular-templatecache": "^2.2.1",
  38 + "gulp-htmlmin": "^5.0.1",
  39 + "gulp-uglify": "^3.0.1",
  40 + "jquery": "3.3.1",
  41 + "uglify": "^0.1.5",
  42 + "ui-bootstrap4": "^3.0.5"
30 43 },
31 44 "devDependencies": {
32   - "gulp": "3.9.1",
  45 + "electron": "^3.0.2",
  46 + "gulp": "^3.9.1",
33 47 "gulp-concat": "2.6.1",
34 48 "gulp-connect": "^5.6.1",
35 49 "gulp-jshint": "^2.1.0",
1   -angular.module('appWrapperDemo', ['ngRoute', 'focaBotoneraHorizontal', 'focaTurnoApertura']);
  1 +angular
  2 + .module('appWrapperDemo', [
  3 + 'ngRoute',
  4 + 'ui.bootstrap',
  5 +
  6 + 'focaBotoneraHorizontal',
  7 + 'focaTurnoApertura',
  8 + 'focaAbmPreciosCondiciones',
  9 + 'focaAbmPlazoPago',
  10 + 'focaAbmSectores',
  11 + 'focaBusquedaCliente',
  12 + 'focaCrearNotaPedido'
  13 + ])
  14 + .constant("API_ENDPOINT", {
  15 + 'URL': '//201.190.140.28:9900'
  16 + });
  17 +
vendor/foca-crear-nota-pedido.js
... ... @@ -0,0 +1,291 @@
  1 +angular.module('focaCrearNotaPedido', ['ngRoute', 'ui.bootstrap', 'focaModalVendedores',
  2 + 'focaBusquedaProductos', 'focaModalPetroleras', 'focaBusquedaCliente'])
  3 + .config(['$routeProvider', function($routeProvider) {
  4 + $routeProvider.when('/venta-nota-pedido/crear', {
  5 + controller: 'notaPedidoListaCtrl',
  6 + templateUrl: 'nota-pedido-lista.html'
  7 + });
  8 + }])
  9 + .config(['$routeProvider', function($routeProvider) {
  10 + $routeProvider.when('/venta-nota-pedido/abm', {
  11 + controller: 'notaPedidoCtrl',
  12 + templateUrl: 'nota-pedido.html'
  13 + });
  14 + }]);
  15 +
  16 +angular.module('focaCrearNotaPedido')
  17 + .controller('notaPedidoCtrl',
  18 + [
  19 + '$scope',
  20 + '$uibModal',
  21 + '$location',
  22 + 'crearNotaPedidoService',
  23 + function($scope, $uibModal, $location, crearNotaPedidoService) {
  24 + $scope.notaPedido = {};
  25 + $scope.articulosTabla = [];
  26 + var idLista;
  27 + var notaPedidoTemp = crearNotaPedidoService.getNotaPedido();
  28 + $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1);
  29 + crearNotaPedidoService.getPrecioCondicion().then(
  30 + function(res) {
  31 + $scope.precioCondiciones = res.data;
  32 + }
  33 + );
  34 + if (notaPedidoTemp != undefined) {
  35 + notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga);
  36 + $scope.notaPedido = notaPedidoTemp;
  37 + $scope.notaPedido.flete = ($scope.notaPedido.flete).toString();
  38 + $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString();
  39 + idLista = $scope.notaPedido.precioCondicion;
  40 + crearNotaPedidoService.getArticulosByIdNotaPedido($scope.notaPedido.id).then(
  41 + function(res) {
  42 + $scope.articulosTabla = res.data;
  43 + }
  44 + );
  45 + crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then(
  46 + function(res) {
  47 + $scope.notaPedido.domicilio = res.data;
  48 + }
  49 + )
  50 + } else {
  51 + $scope.notaPedido.fechaCarga = new Date();
  52 + $scope.notaPedido.domicilio = [{ id: 0 }]
  53 + $scope.notaPedido.bomba = '1';
  54 + $scope.notaPedido.flete = '1';
  55 + idLista = undefined;
  56 + }
  57 + $scope.addNewDom = function() {
  58 + $scope.notaPedido.domicilio.push({ 'id': 0 });
  59 + }
  60 + $scope.removeNewChoice = function(choice) {
  61 + if ($scope.notaPedido.domicilio.length > 1) {
  62 + $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(c => c.$$hashKey == choice.$$hashKey), 1)
  63 + }
  64 + }
  65 + $scope.crearNotaPedido = function() {
  66 + var total = 0;
  67 + for (var i = $scope.articulosTabla.length - 1; i >= 0; i--) {
  68 + total += $scope.articulosTabla[i].precio * $scope.articulosTabla[i].cantidad;
  69 + }
  70 +
  71 + var notaPedido = {
  72 + id: 0,
  73 + precioCondicion: $scope.notaPedido.precioCondicion,
  74 + fechaCarga: $scope.notaPedido.fechaCarga,
  75 + vendedor: $scope.notaPedido.vendedor,
  76 + cliente: $scope.notaPedido.cliente,
  77 + producto: $scope.notaPedido.producto,
  78 + bomba: $scope.notaPedido.bomba,
  79 + petrolera: $scope.notaPedido.petrolera,
  80 + domicilio: $scope.notaPedido.domicilio,
  81 + kilometros: $scope.notaPedido.kilometros,
  82 + jurisdiccionIIBB: $scope.notaPedido.jurisdiccionIIBB,
  83 + costoFinanciacion: $scope.notaPedido.costoFinanciacion,
  84 + flete: $scope.notaPedido.flete,
  85 + costoUnitarioKmFlete: $scope.notaPedido.costoUnitarioKmFlete,
  86 + total : total
  87 + }
  88 + crearNotaPedidoService.crearNotaPedido(notaPedido).then(
  89 + function(res) {
  90 + $location.path('/venta-nota-pedido/crear');
  91 + }
  92 + )
  93 + var articulosNotaPedido = $scope.articulosTabla;
  94 + for(var i = 0; i< articulosNotaPedido.length;i++) {
  95 + crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]).then(
  96 + function(res) {
  97 + return;
  98 + }
  99 + )
  100 + }
  101 +
  102 + }
  103 + $scope.siguienteTab = function() {
  104 + $scope.active = 1;
  105 + }
  106 + $scope.seleccionarArticulo = function() {
  107 + if (idLista == undefined) {
  108 + alert('primero seleccione una lista de precio y condicion');
  109 + return;
  110 + }
  111 + var modalInstance = $uibModal.open(
  112 + {
  113 + ariaLabelledBy: 'Busqueda de Productos',
  114 + templateUrl: 'modal-busqueda-productos.html',
  115 + controller: 'modalBusquedaProductosCtrl',
  116 + resolve: { idLista: function() { return idLista } },
  117 + size: 'lg'
  118 + }
  119 + )
  120 + modalInstance.result.then(
  121 + function(producto) {
  122 + var newArt =
  123 + {
  124 + id: 0,
  125 + codigo: producto.FiltroSectorCodigo,
  126 + item: $scope.articulosTabla.length + 1,
  127 + nombre: producto.descripcion,
  128 + precio: producto.precio,
  129 + costoUnitario: producto.costo,
  130 + cantidad: 1
  131 + }
  132 + $scope.articulosTabla.unshift(newArt);
  133 + }, function() {
  134 + // funcion ejecutada cuando se cancela el modal
  135 + }
  136 + );
  137 + }
  138 + $scope.seleccionarVendedor = function() {
  139 + var modalInstance = $uibModal.open(
  140 + {
  141 + ariaLabelledBy: 'Busqueda de Vendedores',
  142 + templateUrl: 'modal-vendedores.html',
  143 + controller: 'modalVendedoresCtrl',
  144 + size: 'lg'
  145 + }
  146 + )
  147 + modalInstance.result.then(
  148 + function(vendedor) {
  149 + $scope.notaPedido.vendedor = vendedor.NomVen;
  150 + }, function() {
  151 +
  152 + }
  153 + );
  154 + }
  155 + $scope.seleccionarPetrolera = function() {
  156 + var modalInstance = $uibModal.open(
  157 + {
  158 + ariaLabelledBy: 'Busqueda de Petrolera',
  159 + templateUrl: 'modal-petroleras.html',
  160 + controller: 'modalPetrolerasCtrl',
  161 + size: 'lg'
  162 + }
  163 + )
  164 + modalInstance.result.then(
  165 + function(petrolera) {
  166 + $scope.notaPedido.petrolera = petrolera.NOM;
  167 + }, function() {
  168 +
  169 + }
  170 + );
  171 + }
  172 + $scope.seleccionarCliente = function() {
  173 + var modalInstance = $uibModal.open(
  174 + {
  175 + ariaLabelledBy: 'Busqueda de Cliente',
  176 + templateUrl: 'foca-busqueda-cliente-modal.html',
  177 + controller: 'focaBusquedaClienteModalController',
  178 + size: 'lg'
  179 + }
  180 + )
  181 + modalInstance.result.then(
  182 + function(cliente) {
  183 + $scope.notaPedido.cliente = cliente.nom;
  184 + }, function() {
  185 +
  186 + }
  187 + );
  188 + }
  189 + $scope.obtenerDomicilios = function(id) {
  190 + crearNotaPedidoService.getDomicilios(id).then(
  191 + function(res) {
  192 + $scope.notaPedido.domicilio = res.data;
  193 + }
  194 + )
  195 + }
  196 + $scope.getSubTotal = function(item) {
  197 + var subTotal = 0;
  198 + var array = $scope.articulosTabla.filter(a => a.item <= item);
  199 + for (var i = 0; i < array.length; i++) {
  200 + subTotal += array[i].precio * array[i].cantidad
  201 + }
  202 + return subTotal.toFixed(2);
  203 + }
  204 + $scope.cargarArticulos = function() {
  205 + idLista = $scope.notaPedido.precioCondicion;
  206 + $scope.articulosTabla = [];
  207 + }
  208 + }
  209 + ]
  210 + )
  211 + .controller('notaPedidoListaCtrl', [
  212 + '$scope',
  213 + 'crearNotaPedidoService',
  214 + '$location',
  215 + function($scope, crearNotaPedidoService, $location) {
  216 + crearNotaPedidoService.obtenerNotaPedido().then(function(datos) {
  217 + $scope.notaPedidos = datos.data;
  218 + });
  219 + $scope.editar = function(notaPedido) {
  220 + crearNotaPedidoService.setNotaPedido(notaPedido);
  221 + $location.path('/venta-nota-pedido/abm/');
  222 + }
  223 + $scope.crearPedido = function() {
  224 + crearNotaPedidoService.clearNotaPedido();
  225 + $location.path('/venta-nota-pedido/abm/');
  226 + }
  227 + }
  228 + ])
  229 +
  230 +angular.module('focaCrearNotaPedido')
  231 + .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT',function($http, API_ENDPOINT) {
  232 + var route = API_ENDPOINT.URL;
  233 + var notaPedido;
  234 + return {
  235 + crearNotaPedido: function(notaPedido) {
  236 + return $http.post(route + '/nota-pedido', {notaPedido: notaPedido});
  237 + },
  238 + obtenerNotaPedido: function() {
  239 + return $http.get(route +'/nota-pedido');
  240 + },
  241 + setNotaPedido: function(notaPedido) {
  242 + this.notaPedido = notaPedido;
  243 + },
  244 + clearNotaPedido: function() {
  245 + this.notaPedido = undefined;
  246 + },
  247 + getNotaPedido: function() {
  248 + return this.notaPedido;
  249 + },
  250 + getArticulosByIdNotaPedido: function(id) {
  251 + return $http.get(route+'/articulos/nota-pedido/'+id);
  252 + },
  253 + crearArticulosParaNotaPedido: function(articuloNotaPedido) {
  254 + return $http.post(route + '/articulos/nota-pedido', {articuloNotaPedido});
  255 + },
  256 + getDomiciliosByIdNotaPedido: function(id) {
  257 + return $http.get(route +'/nota-pedido/'+id+'/domicilios');
  258 + },
  259 + //EN DESARROLLO
  260 + getDomicilios: function(id) {
  261 + // return $http.get(route + '/'+id)
  262 + var domicilio = [
  263 + {
  264 + id: 1,
  265 + dom: 'RISSO PATRON 781'
  266 + },
  267 + {
  268 + id: 2,
  269 + dom: 'MARIANO MORENO 533'
  270 + },
  271 + {
  272 + id: 3,
  273 + dom: 'SALTA 796'
  274 + }
  275 + ]
  276 + return domicilio;
  277 + },
  278 + getPrecioCondicion: function() {
  279 + return $http.get(route + '/precio-condicion')
  280 + },
  281 + getPrecioCondicionById: function(id) {
  282 + return $http.get(route + '/precio-condicion/' + id)
  283 + },
  284 + getPlazoPagoByPrecioCondicion: function(id) {
  285 + return $http.get(route + '/plazo-pago/precio-condicion/'+ id)
  286 + }
  287 + }
  288 + }])
  289 +
  290 +angular.module('focaCrearNotaPedido').run(['$templateCache', function($templateCache) {$templateCache.put('nota-pedido-lista.html','<table class="table table-sm table-hover table-nonfluid">\r\n <thead>\r\n <tr>\r\n <th>C\xF3digo</th>\r\n <th>Vendedor</th>\r\n <th>Cliente</th>\r\n <th>Petrolera</th>\r\n <th>Total</th>\r\n <th><button class="btn btn-primary" ng-click="crearPedido()">Crear</button></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr ng-repeat="item in notaPedidos">\r\n <td ng-bind="item.id"></td>\r\n <td ng-bind="item.vendedor"></td>\r\n <td ng-bind="item.cliente"></td>\r\n <td ng-bind="item.petrolera"></td>\r\n <td ng-bind="item.total | currency"></td>\r\n <td>\r\n <button class="btn btn-info" ng-show="false" ng-click="editar(item)"><i class="fa fa-edit"></i></button>\r\n <!-- <button class="btn btn-danger" ng-click="borrar(item.id)"><i class="fa fa-trash"></i></button> -->\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>\r\n');
  291 +$templateCache.put('nota-pedido.html','<form name="formCrearNota" ng-submit="siguienteTab()">\r\n <uib-tabset active="active">\r\n <uib-tab index="0" heading="General">\r\n <input type="hidden" name="id" ng-model="notaPedido.id">\r\n <div>\r\n <div class="col-auto my-2">\r\n <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n <div class="row">\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Fecha de carga</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true">\r\n </div>\r\n </div>\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Kil\xF3metros</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <input type="number" min="0" step="0.01" class="form-control" placeholder="Kil\xF3metros recorridos para la entrega en el cliente" ng-model="notaPedido.kilometros" ng-required="true">\r\n </div>\r\n </div>\r\n </div>\r\n <div class="row my-3">\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Jurisdicci\xF3n de IIBB</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <input type="text" class="form-control" placeholder="Jurisdicci\xF3n de IIBB donde se realiza la entrega" ng-model="notaPedido.jurisdiccionIIBB" ng-required="true">\r\n </div>\r\n </div>\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Costo de financiaci\xF3n</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <div class="input-group mb-2">\r\n <div class="input-group-prepend">\r\n <div class="input-group-text">$</div>\r\n </div>\r\n <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiaci\xF3n" ng-model="notaPedido.costoFinanciacion">\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Bomba</label>\r\n </div>\r\n </div>\r\n <div class="col-md-1">\r\n <div class="col-auto">\r\n <div class="form-check custom-radio custom-control-inline">\r\n <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba">\r\n <label class="form-check-label">\r\n Si\r\n </label>\r\n </div>\r\n <div class="form-check custom-radio custom-control-inline">\r\n <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba">\r\n <label class="form-check-label">\r\n No\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-1">\r\n <div class="col-auto">\r\n <label>Flete</label>\r\n </div>\r\n </div>\r\n <div class="col-md-1">\r\n <div class="col-auto">\r\n <div class="form-check custom-radio custom-control-inline">\r\n <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete">\r\n <label class="form-check-label">\r\n Si\r\n </label>\r\n </div>\r\n <div class="form-check custom-radio custom-control-inline">\r\n <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete">\r\n <label class="form-check-label">\r\n FOB\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Costo unitario kilometro flete</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <div class="input-group mb-2">\r\n <div class="input-group-prepend">\r\n <div class="input-group-text">$</div>\r\n </div>\r\n <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true">\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="row my-3">\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Vendedor</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" ng-click="seleccionarVendedor()" readonly="readonly">\r\n </div>\r\n </div>\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Petrolera</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" ng-click="seleccionarPetrolera()" readonly="readonly">\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class="row">\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Cliente</label>\r\n </div>\r\n </div>\r\n <div class="col-md-3">\r\n <div class="col-auto">\r\n <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly="readonly">\r\n </div>\r\n </div>\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Domicilio</label>\r\n </div>\r\n </div>\r\n <div class="col-md-4">\r\n <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio">\r\n <div class="col-auto">\r\n <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead="\r\n domi.dom\r\n for domi\r\n in domiciliosCliente\r\n " typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true">\r\n <i ng-show="cargandoClientes" class="fas fa-sync"></i>\r\n <div ng-show="sinResultados">\r\n No se encontraron resultados.\r\n </div>\r\n </div>\r\n <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a>\r\n <a class="btn" ng-click="addNewDom()">+</a>\r\n </div>\r\n </div>\r\n </div>\r\n </uib-tab>\r\n <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid">\r\n <div>\r\n <div class="col-auto my-2">\r\n <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n <div class="row">\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Precios y condiciones</label>\r\n </div>\r\n </div>\r\n <div class="col-md-4">\r\n <div class="col-auto">\r\n <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones">\r\n </select>\r\n </div>\r\n </div>\r\n <div class="col-md-2">\r\n <div class="col-auto">\r\n <label>Producto</label>\r\n </div>\r\n </div>\r\n <div class="col-md-4">\r\n <div class="col-auto">\r\n <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" ng-click="seleccionarArticulo()" readonly="readonly">\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-12">\r\n <table class="table my-3 table-hover table-nonfluid">\r\n <thead>\r\n <tr>\r\n <th>C\xF3digo</th>\r\n <th>Nombre</th>\r\n <th>Precio unitario</th>\r\n <th>Costo unitario bruto</th>\r\n <th>Cantidad</th>\r\n <th>Subtotal</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr ng-repeat="articulo in articulosTabla">\r\n <td ng-bind="articulo.codigo"></td>\r\n <td ng-bind="articulo.nombre"></td>\r\n <td ng-bind="articulo.precio"></td>\r\n <td ng-bind="articulo.costoUnitario"></td>\r\n <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td>\r\n <td ng-bind="getSubTotal(articulo.item)"></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </uib-tab>\r\n </uib-tabset>\r\n</form>');}]);
0 292 \ No newline at end of file