Commit 21e8f5701a6c96d927e9aceb6c9fbe49c1eb8514
1 parent
5f0ec22995
Exists in
master
- Modificaciones para que funcione correctamente.
Showing
13 changed files
with
113 additions
and
360 deletions
Show diff stats
.gitignore
foca-busqueda-cliente-modal.html
... | ... | @@ -1,35 +0,0 @@ |
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> |
gulpfile.js
... | ... | @@ -43,7 +43,7 @@ gulp.task('html', function() { |
43 | 43 | }) |
44 | 44 | |
45 | 45 | gulp.task('sass', function() { |
46 | - return gulp.src('src/style/scss/**/*.scss') | |
46 | + return gulp.src('src/sass/*.scss') | |
47 | 47 | .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) |
48 | 48 | .pipe(gulp.dest('css')); |
49 | 49 | }); |
... | ... | @@ -60,7 +60,7 @@ gulp.task('pre-commit', function() { |
60 | 60 | gulp.start('uglify'); |
61 | 61 | gulp.start('sass'); |
62 | 62 | }); |
63 | - | |
63 | + | |
64 | 64 | gulp.task('webserver', function() { |
65 | 65 | pump [ |
66 | 66 | connect.server( |
index.html
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | <!--CSS--> |
8 | 8 | <link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> |
9 | 9 | <link href="./node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> |
10 | + <link href="css/general.css" rel="stylesheet"/> | |
10 | 11 | |
11 | 12 | <!--VENDOR JS--> |
12 | 13 | <script src="./node_modules/jquery/dist/jquery.min.js"></script> |
... | ... | @@ -16,12 +17,13 @@ |
16 | 17 | <script src="./node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
17 | 18 | |
18 | 19 | <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> | |
20 | + <script src="./node_modules/foca-botonera-horizontal/dist/botonera-horizontal.min.js"></script> | |
20 | 21 | <script src="./node_modules/foca-turno-apertura/dist/foca-turno-apertura.min.js"></script> |
21 | 22 | <script src="./node_modules/foca-abm-plazo-pago/dist/foca-abm-plazo-pago.min.js"></script> |
22 | 23 | <script src="./node_modules/foca-abm-precios-condiciones/dist/foca-abm-precios-condiciones.min.js"></script> |
23 | 24 | <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-crear-nota-pedido/dist/foca-crear-nota-pedido.min.js"></script> | |
26 | + <script src="./node_modules/foca-modal/dist/foca-modal.min.js"></script> | |
25 | 27 | <script src="./node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> |
26 | 28 | <script src="./node_modules/foca-modal-petroleras/dist/foca-modal-petroleras.min.js"></script> |
27 | 29 | <script src="./node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> |
... | ... | @@ -29,19 +31,14 @@ |
29 | 31 | |
30 | 32 | <!-- BUILD --> |
31 | 33 | <script src="./src/js/app.js"></script> |
34 | + <script src="./src/etc/develop.js"></script> | |
32 | 35 | <!-- /BUILD --> |
33 | 36 | |
34 | 37 | </head> |
35 | 38 | <body> |
36 | 39 | <style> |
37 | - .selectable { | |
38 | - cursor: pointer; | |
39 | - } | |
40 | - | |
41 | - .table-nonfluid { | |
42 | - width: auto; | |
43 | - } | |
44 | 40 | </style> |
45 | 41 | <botonera-horizontal></botonera-horizontal> |
42 | + <div ng-view class="container contenedor"></div> | |
46 | 43 | </body> |
47 | 44 | </html> |
package.json
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | "type": "git", |
18 | 18 | "url": "https://192.168.0.11/Wrappers/wrapper-demo.git" |
19 | 19 | }, |
20 | - "author": "Nicolas Guarnieri", | |
20 | + "author": "Foca Software", | |
21 | 21 | "license": "ISC", |
22 | 22 | "dependencies": { |
23 | 23 | "angular": "^1.7.4", |
... | ... | @@ -28,7 +28,9 @@ |
28 | 28 | "foca-abm-sectores": "git+https://192.168.0.11/modulos-npm/foca-abm-sectores", |
29 | 29 | "foca-botonera-horizontal": "git+https://192.168.0.11/modulos-npm/foca-botonera-horizontal.git", |
30 | 30 | "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente.git", |
31 | + "foca-crear-nota-pedido": "git+https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git", | |
31 | 32 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git", |
33 | + "foca-modal": "git+https://192.168.0.11/modulos-npm/foca-modal", | |
32 | 34 | "foca-modal-busqueda-productos": "git+https://192.168.0.11/nguarnieri/foca-modal-busqueda-productos", |
33 | 35 | "foca-modal-petroleras": "git+https://192.168.0.11/modulos-npm/foca-modal-petroleras.git", |
34 | 36 | "foca-modal-vendedores": "git+https://192.168.0.11/modulos-npm/foca-modal-vendedores.git", |
... | ... | @@ -38,21 +40,23 @@ |
38 | 40 | "gulp-htmlmin": "^5.0.1", |
39 | 41 | "gulp-uglify": "^3.0.1", |
40 | 42 | "jquery": "3.3.1", |
43 | + "node-sass": "4.9.4", | |
41 | 44 | "uglify": "^0.1.5", |
42 | 45 | "ui-bootstrap4": "^3.0.5" |
43 | 46 | }, |
44 | 47 | "devDependencies": { |
45 | 48 | "electron": "^3.0.2", |
46 | 49 | "gulp": "^3.9.1", |
47 | - "gulp-concat": "2.6.1", | |
50 | + "gulp-clean": "^0.4.0", | |
51 | + "gulp-concat": "^2.6.1", | |
48 | 52 | "gulp-connect": "^5.6.1", |
49 | 53 | "gulp-jshint": "^2.1.0", |
50 | - "gulp-rename": "1.4.0", | |
54 | + "gulp-rename": "^1.4.0", | |
51 | 55 | "gulp-replace": "^1.0.0", |
52 | - "gulp-sass": "4.0.1", | |
56 | + "gulp-sass": "^4.0.1", | |
53 | 57 | "gulp-uglify-es": "^1.0.4", |
54 | 58 | "gulp-watch": "^5.0.1", |
55 | - "jasmine-core": "3.2.1", | |
59 | + "jasmine-core": "^3.2.1", | |
56 | 60 | "jshint": "^2.9.6", |
57 | 61 | "pre-commit": "^1.2.2", |
58 | 62 | "pump": "^3.0.0" |
src/etc/develop.ejemplo.js
src/js/app.js
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 | - | |
1 | +angular.module('appWrapperDemo', [ | |
2 | + 'ngRoute', | |
3 | + 'ui.bootstrap', | |
4 | + 'focaBotoneraHorizontal', | |
5 | + 'focaTurnoApertura', | |
6 | + 'focaAbmPreciosCondiciones', | |
7 | + 'focaAbmPlazoPago', | |
8 | + 'focaAbmSectores', | |
9 | + 'focaBusquedaCliente', | |
10 | + 'focaCrearNotaPedido', | |
11 | + 'focaModal' | |
12 | +]); |
src/sass/_contenedor.scss
src/sass/_lista.scss
... | ... | @@ -0,0 +1,34 @@ |
1 | +.lista { | |
2 | + background-color: rgba(0,0,0,0.8); | |
3 | + padding: 10px; | |
4 | + tr { | |
5 | + background: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.5)); | |
6 | + } | |
7 | + tbody { | |
8 | + td { | |
9 | + border-top: none; | |
10 | + color: #ffffff; | |
11 | + } | |
12 | + } | |
13 | + thead { | |
14 | + th { | |
15 | + border-bottom: 1px solid #ffffff; | |
16 | + border-top: none; | |
17 | + color: #ffffff; | |
18 | + font-family: sans-serif; | |
19 | + font-size: 12px; | |
20 | + } | |
21 | + } | |
22 | + .boton { | |
23 | + &-accion { | |
24 | + background: none; | |
25 | + color: #ffffff; | |
26 | + border: 1px solid #ffffff; | |
27 | + border-radius: 30px; | |
28 | + padding: 5px 7px; | |
29 | + i { | |
30 | + font-size: 16px; | |
31 | + } | |
32 | + } | |
33 | + } | |
34 | +} |
src/sass/_login.scss
... | ... | @@ -0,0 +1,28 @@ |
1 | +.login { | |
2 | + background-color: #bdbdbd; | |
3 | + border: 1px solid #000000; | |
4 | + border-radius: 3px; | |
5 | + height: 150px; | |
6 | + left: calc(50% - 130px); | |
7 | + opacity: 0.7; | |
8 | + position: absolute; | |
9 | + text-align: center; | |
10 | + top: 190px; | |
11 | + width: 260px; | |
12 | + &-titulo { | |
13 | + border-bottom: 1px solid #ffffff; | |
14 | + padding: 5px 0; | |
15 | + } | |
16 | + &-campo { | |
17 | + label { | |
18 | + display: block; | |
19 | + font-size: 12px; | |
20 | + margin: 5px 0 0; | |
21 | + } | |
22 | + input { | |
23 | + &:focus { | |
24 | + outline: 3px solid #ff9900; | |
25 | + } | |
26 | + } | |
27 | + } | |
28 | +} |
src/sass/_tabla.scss
src/sass/general.scss
vendor/foca-crear-nota-pedido.js
... | ... | @@ -1,291 +0,0 @@ |
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>');}]); | |
292 | 0 | \ No newline at end of file |