Commit ab8df73738803b5a36dbbe3d904bf8c817f5d82c
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request modulos-npm/foca-crear-nota-pedido!1
Showing
8 changed files
Show diff stats
.gitignore
index.html
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +<html ng-app="focaCrearNotaPedido"> | |
| 2 | + <head> | |
| 3 | + <meta charset="UTF-8"/> | |
| 4 | + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| 5 | + | |
| 6 | + <!--CSS--> | |
| 7 | + <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | |
| 8 | + <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | |
| 9 | + | |
| 10 | + <!--VENDOR JS--> | |
| 11 | + <script src="node_modules/jquery/dist/jquery.min.js"></script> | |
| 12 | + <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | |
| 13 | + <script src="node_modules/angular/angular.min.js"></script> | |
| 14 | + <script src="node_modules/angular-route/angular-route.min.js"></script> | |
| 15 | + <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | |
| 16 | + | |
| 17 | + <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> | |
| 18 | + <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> | |
| 19 | + <script src="node_modules/foca-modal-petroleras/dist/foca-modal-petroleras.min.js"></script> | |
| 20 | + <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> | |
| 21 | + | |
| 22 | + <script src="src/js/app.js"></script> | |
| 23 | + <script src="src/js/controller.js"></script> | |
| 24 | + <script src="src/js/service.js"></script> | |
| 25 | + <script src="src/etc/develop.js"></script> | |
| 26 | + </head> | |
| 27 | + <body ng-view> | |
| 28 | + | |
| 29 | + </body> | |
| 30 | +</html> |
package.json
| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | +{ | |
| 2 | + "name": "foca-crear-nota-pedido", | |
| 3 | + "version": "0.0.1", | |
| 4 | + "description": "Listado y ABM nota de pedidos", | |
| 5 | + "main": "index.js", | |
| 6 | + "scripts": { | |
| 7 | + "test": "echo \"Error: no test specified\" && exit 1", | |
| 8 | + "compile": "gulp uglify && gulp html", | |
| 9 | + "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js" | |
| 10 | + }, | |
| 11 | + "repository": { | |
| 12 | + "type": "git", | |
| 13 | + "url": "https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git" | |
| 14 | + }, | |
| 15 | + "author": "Foca Software", | |
| 16 | + "license": "ISC", | |
| 17 | + "dependencies": { | |
| 18 | + "angular": "^1.7.x", | |
| 19 | + "angular-route": "^1.7.4", | |
| 20 | + "bootstrap": "^4.1.x", | |
| 21 | + "font-awesome": "^4.7.x", | |
| 22 | + "gulp": "^3.9.x", | |
| 23 | + "gulp-concat": "2.6.x", | |
| 24 | + "gulp-jshint": "^2.1.x", | |
| 25 | + "gulp-rename": "^1.4.x", | |
| 26 | + "gulp-replace": "^1.0.x", | |
| 27 | + "gulp-uglify-es": "^1.0.x", | |
| 28 | + "jquery": "^3.3.x", | |
| 29 | + "jshint": "^2.9.x", | |
| 30 | + "pump": "^3.0.x", | |
| 31 | + "ui-bootstrap4": "^3.0.5" | |
| 32 | + }, | |
| 33 | + "devDependencies": { | |
| 34 | + "gulp-connect": "^5.6.1", | |
| 35 | + "jasmine-core": "3.2.1", | |
| 36 | + "pre-commit": "^1.2.2" | |
| 37 | + } | |
| 38 | +} |
src/js/app.js
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +angular.module('focaCrearNotaPedido', ['ngRoute', 'ui.bootstrap', 'focaModalVendedores', | |
| 2 | + 'focaBusquedaProductos', 'focaModalPetroleras', 'focaBusquedaCliente']) | |
| 3 | + .config(['$routeProvider', function($routeProvider) { | |
| 4 | + $routeProvider.when('/venta-nota-pedido', { | |
| 5 | + controller: 'notaPedidoListaCtrl', | |
| 6 | + templateUrl: 'src/views/nota-pedido-lista.html' | |
| 7 | + }); | |
| 8 | + }]) | |
| 9 | + .config(['$routeProvider', function($routeProvider) { | |
| 10 | + $routeProvider.when('/venta-nota-pedido/abm', { | |
| 11 | + controller: 'notaPedidoCtrl', | |
| 12 | + templateUrl: 'src/views/nota-pedido.html' | |
| 13 | + }); | |
| 14 | + }]); |
src/js/controller.js
| ... | ... | @@ -0,0 +1,186 @@ |
| 1 | +angular.module('focaCrearNotaPedido') | |
| 2 | + .controller('notaPedidoCtrl', | |
| 3 | + [ | |
| 4 | + '$scope', | |
| 5 | + '$uibModal', | |
| 6 | + 'crearNotaPedidoService', | |
| 7 | + function ($scope, $uibModal, crearNotaPedidoService) { | |
| 8 | + $scope.notaPedido = {}; | |
| 9 | + $scope.articulosTabla = []; | |
| 10 | + var idLista; | |
| 11 | + var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | |
| 12 | + $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1); | |
| 13 | + crearNotaPedidoService.getPrecioCondicion().then( | |
| 14 | + function (res) { | |
| 15 | + $scope.precioCondiciones = res.data; | |
| 16 | + } | |
| 17 | + ); | |
| 18 | + if (notaPedidoTemp != undefined) { | |
| 19 | + notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); | |
| 20 | + $scope.notaPedido = notaPedidoTemp; | |
| 21 | + $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); | |
| 22 | + $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); | |
| 23 | + idLista= $scope.notaPedido.precioCondicion; | |
| 24 | + | |
| 25 | + } else { | |
| 26 | + $scope.notaPedido.fechaCarga = new Date(); | |
| 27 | + $scope.notaPedido.domicilio = [{ id: 0 }] | |
| 28 | + $scope.notaPedido.bomba = '1'; | |
| 29 | + $scope.notaPedido.flete = '1'; | |
| 30 | + idLista = undefined; | |
| 31 | + } | |
| 32 | + $scope.addNewDom = function () { | |
| 33 | + $scope.notaPedido.domicilio.push({ 'id': 0 }); | |
| 34 | + } | |
| 35 | + $scope.removeNewChoice = function (choice) { | |
| 36 | + if ($scope.notaPedido.domicilio.length > 1) { | |
| 37 | + $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(c => c.$$hashKey == choice.$$hashKey), 1) | |
| 38 | + } | |
| 39 | + } | |
| 40 | + $scope.crearNotaPedido = function () { | |
| 41 | + var notaPedido = { | |
| 42 | + idNotaPedido: 0, | |
| 43 | + precioCondicion: $scope.notaPedido.precioCondicion, | |
| 44 | + fechaCarga: $scope.notaPedido.fechaCarga, | |
| 45 | + vendedor: $scope.notaPedido.vendedor, | |
| 46 | + cliente: $scope.notaPedido.cliente, | |
| 47 | + producto: $scope.notaPedido.producto, | |
| 48 | + bomba: $scope.notaPedido.bomba, | |
| 49 | + petrolera: $scope.notaPedido.petrolera, | |
| 50 | + domicilio: $scope.notaPedido.domicilio, | |
| 51 | + kilometros: $scope.notaPedido.kilometros, | |
| 52 | + jurisdiccionIIBB: $scope.notaPedido.jurisdiccionIIBB, | |
| 53 | + costoFinanciacion: $scope.notaPedido.costoFinanciacion, | |
| 54 | + flete: $scope.notaPedido.flete, | |
| 55 | + costoUnitarioKmFlete: $scope.notaPedido.costoUnitarioKmFlete, | |
| 56 | + articulosTabla: $scope.articulosTabla | |
| 57 | + } | |
| 58 | + crearNotaPedidoService.crearNotaPedido(notaPedido).then( | |
| 59 | + function (res) { | |
| 60 | + alert('Nota pedido creada') | |
| 61 | + } | |
| 62 | + ) | |
| 63 | + } | |
| 64 | + $scope.siguienteTab = function () { | |
| 65 | + $scope.active = 1; | |
| 66 | + } | |
| 67 | + $scope.seleccionarArticulo = function () { | |
| 68 | + if(idLista==undefined){ | |
| 69 | + alert('primero seleccione una lista de precio y condicion'); | |
| 70 | + return; | |
| 71 | + } | |
| 72 | + var modalInstance = $uibModal.open( | |
| 73 | + { | |
| 74 | + ariaLabelledBy: 'Busqueda de Productos', | |
| 75 | + templateUrl: 'modal-busqueda-productos.html', | |
| 76 | + controller: 'modalBusquedaProductosCtrl', | |
| 77 | + resolve: {idLista: function() {return idLista}}, | |
| 78 | + size: 'lg' | |
| 79 | + } | |
| 80 | + ) | |
| 81 | + modalInstance.result.then( | |
| 82 | + function (producto) { | |
| 83 | + var newArt = | |
| 84 | + { | |
| 85 | + codigo: producto.FiltroSectorCodigo, | |
| 86 | + item: $scope.articulosTabla.length + 1, | |
| 87 | + nombre: producto.descripcion, | |
| 88 | + precio: producto.precio, | |
| 89 | + costoUnitario: producto.costo, | |
| 90 | + cantidad: 1 | |
| 91 | + } | |
| 92 | + $scope.articulosTabla.unshift(newArt); | |
| 93 | + }, function () { | |
| 94 | + // funcion ejecutada cuando se cancela el modal | |
| 95 | + } | |
| 96 | + ); | |
| 97 | + } | |
| 98 | + $scope.seleccionarVendedor = function () { | |
| 99 | + var modalInstance = $uibModal.open( | |
| 100 | + { | |
| 101 | + ariaLabelledBy: 'Busqueda de Vendedores', | |
| 102 | + templateUrl: 'modal-vendedores.html', | |
| 103 | + controller: 'modalVendedoresCtrl', | |
| 104 | + size: 'lg' | |
| 105 | + } | |
| 106 | + ) | |
| 107 | + modalInstance.result.then( | |
| 108 | + function (vendedor) { | |
| 109 | + $scope.notaPedido.vendedor = vendedor.NomVen; | |
| 110 | + }, function () { | |
| 111 | + | |
| 112 | + } | |
| 113 | + ); | |
| 114 | + } | |
| 115 | + $scope.seleccionarPetrolera = function() { | |
| 116 | + var modalInstance = $uibModal.open( | |
| 117 | + { | |
| 118 | + ariaLabelledBy: 'Busqueda de Petrolera', | |
| 119 | + templateUrl: 'modal-petroleras.html', | |
| 120 | + controller: 'modalPetrolerasCtrl', | |
| 121 | + size: 'lg' | |
| 122 | + } | |
| 123 | + ) | |
| 124 | + modalInstance.result.then( | |
| 125 | + function (petrolera) { | |
| 126 | + $scope.notaPedido.petrolera = petrolera.NOM; | |
| 127 | + }, function () { | |
| 128 | + | |
| 129 | + } | |
| 130 | + ); | |
| 131 | + } | |
| 132 | + $scope.seleccionarCliente = function() { | |
| 133 | + var modalInstance = $uibModal.open( | |
| 134 | + { | |
| 135 | + ariaLabelledBy: 'Busqueda de Cliente', | |
| 136 | + templateUrl: 'foca-busqueda-cliente-modal.html', | |
| 137 | + controller: 'focaBusquedaClienteModalController', | |
| 138 | + size: 'lg' | |
| 139 | + } | |
| 140 | + ) | |
| 141 | + modalInstance.result.then( | |
| 142 | + function (cliente) { | |
| 143 | + $scope.notaPedido.cliente = cliente.nom; | |
| 144 | + }, function () { | |
| 145 | + | |
| 146 | + } | |
| 147 | + ); | |
| 148 | + } | |
| 149 | + $scope.obtenerDomicilios = function (id) { | |
| 150 | + crearNotaPedidoService.getDomicilios(id).then( | |
| 151 | + function (res) { | |
| 152 | + $scope.notaPedido.domicilio = res.data; | |
| 153 | + } | |
| 154 | + ) | |
| 155 | + } | |
| 156 | + $scope.getSubTotal = function(item) { | |
| 157 | + var subTotal=0; | |
| 158 | + var array = $scope.articulosTabla.filter(a=>a.item<=item); | |
| 159 | + for(var i = 0; i< array.length; i++) { | |
| 160 | + subTotal+=array[i].precio*array[i].cantidad | |
| 161 | + } | |
| 162 | + return subTotal.toFixed(2); | |
| 163 | + } | |
| 164 | + $scope.cargarArticulos = function() { | |
| 165 | + idLista=$scope.notaPedido.precioCondicion; | |
| 166 | + } | |
| 167 | + } | |
| 168 | + ] | |
| 169 | + ) | |
| 170 | + .controller('notaPedidoListaCtrl', [ | |
| 171 | + '$scope', | |
| 172 | + 'crearNotaPedidoService', | |
| 173 | + '$location', | |
| 174 | + function ($scope, crearNotaPedidoService, $location) { | |
| 175 | + crearNotaPedidoService.obtenerNotaPedido().then(function (datos) { | |
| 176 | + $scope.notaPedidos = datos.data; | |
| 177 | + }); | |
| 178 | + $scope.editar = function (notaPedido) { | |
| 179 | + crearNotaPedidoService.setNotaPedido(notaPedido); | |
| 180 | + $location.path('/venta-nota-pedido/abm/'); | |
| 181 | + } | |
| 182 | + $scope.crearPedido = function () { | |
| 183 | + $location.path('/venta-nota-pedido/abm/'); | |
| 184 | + } | |
| 185 | + } | |
| 186 | + ]) |
src/js/service.js
| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | +angular.module('focaCrearNotaPedido') | |
| 2 | + .service('crearNotaPedidoService', ['$http',function($http) { | |
| 3 | + var route = 'http://192.168.0.23:9900'; | |
| 4 | + var notaPedido; | |
| 5 | + return { | |
| 6 | + crearNotaPedido: function(obj) { | |
| 7 | + return $http.get(route + '/nota-pedidos/crear'); | |
| 8 | + }, | |
| 9 | + obtenerNotaPedido: function() { | |
| 10 | + return $http.get(route +'/nota-pedido'); | |
| 11 | + }, | |
| 12 | + setNotaPedido: function(notaPedido) { | |
| 13 | + this.notaPedido = notaPedido; | |
| 14 | + }, | |
| 15 | + getNotaPedido: function() { | |
| 16 | + return this.notaPedido; | |
| 17 | + }, | |
| 18 | + //EN DESARROLLO | |
| 19 | + getDomicilios: function(id) { | |
| 20 | + // return $http.get(route + '/'+id) | |
| 21 | + var domicilio = [ | |
| 22 | + { | |
| 23 | + id: 1, | |
| 24 | + dom: 'RISSO PATRON 781' | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + id: 2, | |
| 28 | + dom: 'MARIANO MORENO 533' | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + id: 3, | |
| 32 | + dom: 'SALTA 796' | |
| 33 | + } | |
| 34 | + ] | |
| 35 | + return domicilio; | |
| 36 | + }, | |
| 37 | + getPrecioCondicion: function() { | |
| 38 | + return $http.get(route + '/precio-condicion') | |
| 39 | + }, | |
| 40 | + getPrecioCondicionById: function(id) { | |
| 41 | + return $http.get(route + '/precio-condicion/' + id) | |
| 42 | + }, | |
| 43 | + getPlazoPagoByPrecioCondicion: function(id) { | |
| 44 | + return $http.get(route + '/plazo-pago/precio-condicion/'+ id) | |
| 45 | + } | |
| 46 | + } | |
| 47 | + }]) |
src/views/nota-pedido-lista.html
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +<table class="table table-sm table-hover table-nonfluid"> | |
| 2 | + <thead> | |
| 3 | + <tr> | |
| 4 | + <th>Código</th> | |
| 5 | + <th>Vendedor</th> | |
| 6 | + <th>Cliente</th> | |
| 7 | + <th>Petrolera</th> | |
| 8 | + <th><button class="btn btn-primary" ng-click="crearPedido()">Crear</button></th> | |
| 9 | + </tr> | |
| 10 | + </thead> | |
| 11 | + <tbody> | |
| 12 | + <tr ng-repeat="item in notaPedidos"> | |
| 13 | + <td ng-bind="item.id"></td> | |
| 14 | + <td ng-bind="item.vendedor"></td> | |
| 15 | + <td ng-bind="item.cliente"></td> | |
| 16 | + <td ng-bind="item.petrolera"></td> | |
| 17 | + <td> | |
| 18 | + <button class="btn btn-info" ng-click="editar(item)"><i class="fa fa-edit"></i></button> | |
| 19 | + <!-- <button class="btn btn-danger" ng-click="borrar(item.id)"><i class="fa fa-trash"></i></button> --> | |
| 20 | + </td> | |
| 21 | + </tr> | |
| 22 | + </tbody> | |
| 23 | +</table> |
src/views/nota-pedido.html
| ... | ... | @@ -0,0 +1,245 @@ |
| 1 | +<form name="formCrearNota" ng-submit="siguienteTab()"> | |
| 2 | + <uib-tabset active="active"> | |
| 3 | + <uib-tab index="0" heading="General"> | |
| 4 | + <input type="hidden" name="id" ng-model="notaPedido.id" /> | |
| 5 | + <div> | |
| 6 | + <div class="col-auto my-2"> | |
| 7 | + <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> | |
| 8 | + </div> | |
| 9 | + </div> | |
| 10 | + <br> | |
| 11 | + <br> | |
| 12 | + <div class="row"> | |
| 13 | + <div class="col-md-2"> | |
| 14 | + <div class="col-auto"> | |
| 15 | + <label>Fecha de carga</label> | |
| 16 | + </div> | |
| 17 | + </div> | |
| 18 | + <div class="col-md-3"> | |
| 19 | + <div class="col-auto"> | |
| 20 | + <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> | |
| 21 | + </div> | |
| 22 | + </div> | |
| 23 | + <div class="col-md-2"> | |
| 24 | + <div class="col-auto"> | |
| 25 | + <label>Kilómetros</label> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + <div class="col-md-3"> | |
| 29 | + <div class="col-auto"> | |
| 30 | + <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" | |
| 31 | + ng-model="notaPedido.kilometros" ng-required="true"> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + <div class="row my-3"> | |
| 36 | + <div class="col-md-2"> | |
| 37 | + <div class="col-auto"> | |
| 38 | + <label>Jurisdicción de IIBB</label> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + <div class="col-md-3"> | |
| 42 | + <div class="col-auto"> | |
| 43 | + <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" | |
| 44 | + ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + <div class="col-md-2"> | |
| 48 | + <div class="col-auto"> | |
| 49 | + <label>Costo de financiación</label> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + <div class="col-md-3"> | |
| 53 | + <div class="col-auto"> | |
| 54 | + <div class="input-group mb-2"> | |
| 55 | + <div class="input-group-prepend"> | |
| 56 | + <div class="input-group-text">$</div> | |
| 57 | + </div> | |
| 58 | + <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" | |
| 59 | + ng-model="notaPedido.costoFinanciacion"> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | + <div class="row"> | |
| 65 | + <div class="col-md-2"> | |
| 66 | + <div class="col-auto"> | |
| 67 | + <label>Bomba</label> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + <div class="col-md-1"> | |
| 71 | + <div class="col-auto"> | |
| 72 | + <div class="form-check custom-radio custom-control-inline"> | |
| 73 | + <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> | |
| 74 | + <label class="form-check-label"> | |
| 75 | + Si | |
| 76 | + </label> | |
| 77 | + </div> | |
| 78 | + <div class="form-check custom-radio custom-control-inline"> | |
| 79 | + <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> | |
| 80 | + <label class="form-check-label"> | |
| 81 | + No | |
| 82 | + </label> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + <div class="col-md-1"> | |
| 87 | + <div class="col-auto"> | |
| 88 | + <label>Flete</label> | |
| 89 | + </div> | |
| 90 | + </div> | |
| 91 | + <div class="col-md-1"> | |
| 92 | + <div class="col-auto"> | |
| 93 | + <div class="form-check custom-radio custom-control-inline"> | |
| 94 | + <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> | |
| 95 | + <label class="form-check-label"> | |
| 96 | + Si | |
| 97 | + </label> | |
| 98 | + </div> | |
| 99 | + <div class="form-check custom-radio custom-control-inline"> | |
| 100 | + <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> | |
| 101 | + <label class="form-check-label"> | |
| 102 | + FOB | |
| 103 | + </label> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + <div class="col-md-2"> | |
| 108 | + <div class="col-auto"> | |
| 109 | + <label>Costo unitario kilometro flete</label> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + <div class="col-md-3"> | |
| 113 | + <div class="col-auto"> | |
| 114 | + <div class="input-group mb-2"> | |
| 115 | + <div class="input-group-prepend"> | |
| 116 | + <div class="input-group-text">$</div> | |
| 117 | + </div> | |
| 118 | + <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" | |
| 119 | + ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> | |
| 120 | + </div> | |
| 121 | + </div> | |
| 122 | + </div> | |
| 123 | + </div> | |
| 124 | + <div class="row my-3"> | |
| 125 | + <div class="col-md-2"> | |
| 126 | + <div class="col-auto"> | |
| 127 | + <label>Vendedor</label> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 130 | + <div class="col-md-3"> | |
| 131 | + <div class="col-auto"> | |
| 132 | + <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" | |
| 133 | + ng-click="seleccionarVendedor()" readonly> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + <div class="col-md-2"> | |
| 137 | + <div class="col-auto"> | |
| 138 | + <label>Petrolera</label> | |
| 139 | + </div> | |
| 140 | + </div> | |
| 141 | + <div class="col-md-3"> | |
| 142 | + <div class="col-auto"> | |
| 143 | + <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" | |
| 144 | + ng-click="seleccionarPetrolera()" readonly> | |
| 145 | + </div> | |
| 146 | + </div> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + <div class="row"> | |
| 150 | + <div class="col-md-2"> | |
| 151 | + <div class="col-auto"> | |
| 152 | + <label>Cliente</label> | |
| 153 | + </div> | |
| 154 | + </div> | |
| 155 | + <div class="col-md-3"> | |
| 156 | + <div class="col-auto"> | |
| 157 | + <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" | |
| 158 | + ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> | |
| 159 | + </div> | |
| 160 | + </div> | |
| 161 | + <div class="col-md-2"> | |
| 162 | + <div class="col-auto"> | |
| 163 | + <label>Domicilio</label> | |
| 164 | + </div> | |
| 165 | + </div> | |
| 166 | + <div class="col-md-4"> | |
| 167 | + <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> | |
| 168 | + <div class="col-auto"> | |
| 169 | + <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" | |
| 170 | + domi.dom | |
| 171 | + for domi | |
| 172 | + in domiciliosCliente | |
| 173 | + " | |
| 174 | + typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" | |
| 175 | + class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> | |
| 176 | + <i ng-show="cargandoClientes" class="fas fa-sync"></i> | |
| 177 | + <div ng-show="sinResultados"> | |
| 178 | + No se encontraron resultados. | |
| 179 | + </div> | |
| 180 | + </div> | |
| 181 | + <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> | |
| 182 | + <a class="btn" ng-click="addNewDom()">+</a> | |
| 183 | + </div> | |
| 184 | + </div> | |
| 185 | + </div> | |
| 186 | + </uib-tab> | |
| 187 | + <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> | |
| 188 | + <div> | |
| 189 | + <div class="col-auto my-2"> | |
| 190 | + <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> | |
| 191 | + </div> | |
| 192 | + </div> | |
| 193 | + <br> | |
| 194 | + <br> | |
| 195 | + <div class="row"> | |
| 196 | + <div class="col-md-2"> | |
| 197 | + <div class="col-auto"> | |
| 198 | + <label>Precios y condiciones</label> | |
| 199 | + </div> | |
| 200 | + </div> | |
| 201 | + <div class="col-md-4"> | |
| 202 | + <div class="col-auto"> | |
| 203 | + <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> | |
| 204 | + </select> | |
| 205 | + </div> | |
| 206 | + </div> | |
| 207 | + <div class="col-md-2"> | |
| 208 | + <div class="col-auto"> | |
| 209 | + <label>Producto</label> | |
| 210 | + </div> | |
| 211 | + </div> | |
| 212 | + <div class="col-md-4"> | |
| 213 | + <div class="col-auto"> | |
| 214 | + <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" | |
| 215 | + ng-click="seleccionarArticulo()" readonly> | |
| 216 | + </div> | |
| 217 | + </div> | |
| 218 | + </div> | |
| 219 | + <div class="col-md-12"> | |
| 220 | + <table class="table my-3 table-hover table-nonfluid"> | |
| 221 | + <thead> | |
| 222 | + <tr> | |
| 223 | + <th>Código</th> | |
| 224 | + <th>Nombre</th> | |
| 225 | + <th>Precio unitario</th> | |
| 226 | + <th>Costo unitario bruto</th> | |
| 227 | + <th>Cantidad</th> | |
| 228 | + <th>Subtotal</th> | |
| 229 | + </tr> | |
| 230 | + </thead> | |
| 231 | + <tbody> | |
| 232 | + <tr ng-repeat="articulo in articulosTabla"> | |
| 233 | + <td ng-bind="articulo.codigo"></td> | |
| 234 | + <td ng-bind="articulo.nombre"></td> | |
| 235 | + <td ng-bind="articulo.precio"></td> | |
| 236 | + <td ng-bind="articulo.costoUnitario"></td> | |
| 237 | + <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> | |
| 238 | + <td ng-bind="getSubTotal(articulo.item)"></td> | |
| 239 | + </tr> | |
| 240 | + </tbody> | |
| 241 | + </table> | |
| 242 | + </div> | |
| 243 | + </uib-tab> | |
| 244 | + </uib-tabset> | |
| 245 | +</form> | |
| 0 | 246 | \ No newline at end of file |