Commit 2f1b8cfed02c4254293422edd82b8c47a29dd7b7
1 parent
4cee7ed923
Exists in
master
demo
Showing
2 changed files
with
22 additions
and
1 deletions
Show diff stats
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const clean = require('gulp-clean'); | 2 | const clean = require('gulp-clean'); |
3 | const concat = require('gulp-concat'); | 3 | const concat = require('gulp-concat'); |
4 | const htmlmin = require('gulp-htmlmin'); | 4 | const htmlmin = require('gulp-htmlmin'); |
5 | const rename = require('gulp-rename'); | 5 | const rename = require('gulp-rename'); |
6 | const uglify = require('gulp-uglify'); | 6 | const uglify = require('gulp-uglify'); |
7 | const gulp = require('gulp'); | 7 | const gulp = require('gulp'); |
8 | const pump = require('pump'); | 8 | const pump = require('pump'); |
9 | const jshint = require('gulp-jshint'); | 9 | const jshint = require('gulp-jshint'); |
10 | const replace = require('gulp-replace'); | 10 | const replace = require('gulp-replace'); |
11 | const connect = require('gulp-connect'); | 11 | const connect = require('gulp-connect'); |
12 | 12 | ||
13 | var paths = { | 13 | var paths = { |
14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
17 | dist: 'dist/' | 17 | dist: 'dist/' |
18 | }; | 18 | }; |
19 | 19 | ||
20 | gulp.task('templates', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], function() { |
21 | return pump( | 21 | return pump( |
22 | [ | 22 | [ |
23 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
24 | htmlmin(), | 24 | htmlmin(), |
25 | templateCache('views.js', { | 25 | templateCache('views.js', { |
26 | module: 'focaCrearNotaPedido', | 26 | module: 'focaCrearNotaPedido', |
27 | root: '' | 27 | root: '' |
28 | }), | 28 | }), |
29 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
30 | ] | 30 | ] |
31 | ); | 31 | ); |
32 | }); | 32 | }); |
33 | 33 | ||
34 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
35 | return pump( | 35 | return pump( |
36 | [ | 36 | [ |
37 | gulp.src([ | 37 | gulp.src([ |
38 | paths.srcJS, | 38 | paths.srcJS, |
39 | 'tmp/views.js' | 39 | 'tmp/views.js' |
40 | ]), | 40 | ]), |
41 | concat('foca-crear-nota-pedido.js'), | 41 | concat('foca-crear-nota-pedido.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
44 | rename('foca-crear-nota-pedido.min.js'), | 44 | rename('foca-crear-nota-pedido.min.js'), |
45 | uglify(), | 45 | uglify(), |
46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
47 | '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion",'+ | 47 | '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
48 | '"focaModalFlete","focaModal"', ''), | 48 | '"focaModalFlete","focaDirectivas","focaModal"', ''), |
49 | gulp.dest(paths.dist) | 49 | gulp.dest(paths.dist) |
50 | ] | 50 | ] |
51 | ); | 51 | ); |
52 | }); | 52 | }); |
53 | 53 | ||
54 | gulp.task('clean', function(){ | 54 | gulp.task('clean', function(){ |
55 | return gulp.src(['tmp', 'dist'], {read: false}) | 55 | return gulp.src(['tmp', 'dist'], {read: false}) |
56 | .pipe(clean()); | 56 | .pipe(clean()); |
57 | }); | 57 | }); |
58 | 58 | ||
59 | gulp.task('pre-commit', function() { | 59 | gulp.task('pre-commit', function() { |
60 | return pump( | 60 | return pump( |
61 | [ | 61 | [ |
62 | gulp.src(paths.srcJS), | 62 | gulp.src(paths.srcJS), |
63 | jshint('.jshintrc'), | 63 | jshint('.jshintrc'), |
64 | jshint.reporter('default'), | 64 | jshint.reporter('default'), |
65 | jshint.reporter('fail') | 65 | jshint.reporter('fail') |
66 | ] | 66 | ] |
67 | ); | 67 | ); |
68 | 68 | ||
69 | gulp.start('uglify'); | 69 | gulp.start('uglify'); |
70 | }); | 70 | }); |
71 | 71 | ||
72 | gulp.task('webserver', function() { | 72 | gulp.task('webserver', function() { |
73 | pump [ | 73 | pump [ |
74 | connect.server({port: 3000}) | 74 | connect.server({port: 3000}) |
75 | ] | 75 | ] |
76 | }); | 76 | }); |
77 | 77 | ||
78 | gulp.task('clean-post-install', function() { | 78 | gulp.task('clean-post-install', function() { |
79 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 79 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
80 | 'index.html'], {read: false}) | 80 | 'index.html'], {read: false}) |
81 | .pipe(clean()); | 81 | .pipe(clean()); |
82 | }); | 82 | }); |
83 | 83 | ||
84 | gulp.task('default', ['webserver']); | 84 | gulp.task('default', ['webserver']); |
85 | 85 |
src/views/nota-pedido.html
1 | <div class="row"> | 1 | <div class="row"> |
2 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 2 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
3 | <div class="row bg-secondary p-3"> | 3 | <div class="row bg-secondary p-3"> |
4 | <div class="form-group col-12 col-sm-6 col-md-4"> | 4 | <div class="form-group col-12 col-sm-6 col-md-4"> |
5 | <div class="input-group"> | 5 | <div class="input-group"> |
6 | <input | 6 | <input |
7 | type="text" | 7 | type="text" |
8 | class="form-control" | 8 | class="form-control" |
9 | uib-datepicker-popup="dd/MM/yyyy" | 9 | uib-datepicker-popup="dd/MM/yyyy" |
10 | ng-model="notaPedido.fechaCarga" | 10 | ng-model="notaPedido.fechaCarga" |
11 | is-open="popup1.opened" | 11 | is-open="popup1.opened" |
12 | datepicker-options="dateOptions" | 12 | datepicker-options="dateOptions" |
13 | close-text="Cerrar" | 13 | close-text="Cerrar" |
14 | current-text="Hoy" | 14 | current-text="Hoy" |
15 | clear-text="Borrar" | 15 | clear-text="Borrar" |
16 | alt-input-formats="altInputFormats" | 16 | alt-input-formats="altInputFormats" |
17 | /> | 17 | /> |
18 | <span class="input-group-append"> | 18 | <span class="input-group-append"> |
19 | <button type="button" class="btn btn-default" ng-click="popup1.opened = true"> | 19 | <button type="button" class="btn btn-default" ng-click="popup1.opened = true"> |
20 | <i class="fa fa-calendar"></i> | 20 | <i class="fa fa-calendar"></i> |
21 | </button> | 21 | </button> |
22 | </span> | 22 | </span> |
23 | </div> | 23 | </div> |
24 | </div> | 24 | </div> |
25 | <div class="form-group col-12 col-sm-6 col-md-4"> | 25 | <div class="form-group col-12 col-sm-6 col-md-4"> |
26 | <div class="input-group"> | 26 | <div class="input-group"> |
27 | <input | 27 | <input |
28 | class="form-control" | 28 | class="form-control" |
29 | type="text" | 29 | type="text" |
30 | ng-model="notaPedido.vendedor.nombre" | 30 | ng-model="notaPedido.vendedor.nombre" |
31 | placeholder="Seleccione Vendedor" | 31 | placeholder="Seleccione Vendedor" |
32 | readonly="true" | 32 | readonly="true" |
33 | > | 33 | > |
34 | <span class="input-group-append"> | 34 | <span class="input-group-append"> |
35 | <button type="button" class="btn btn-default" ng-click="seleccionarVendedor()"> | 35 | <button type="button" class="btn btn-default" ng-click="seleccionarVendedor()"> |
36 | <i class="fa fa-search"></i> | 36 | <i class="fa fa-search"></i> |
37 | </button> | 37 | </button> |
38 | </span> | 38 | </span> |
39 | </div> | 39 | </div> |
40 | </div> | 40 | </div> |
41 | <div class="form-group col-12 col-sm-6 col-md-4"> | 41 | <div class="form-group col-12 col-sm-6 col-md-4"> |
42 | <div class="input-group"> | 42 | <div class="input-group"> |
43 | <input | 43 | <input |
44 | class="form-control selectable" | 44 | class="form-control selectable" |
45 | type="text" | 45 | type="text" |
46 | ng-model="notaPedido.cliente.nombre" | 46 | ng-model="notaPedido.cliente.nombre" |
47 | placeholder="Seleccione Cliente" | 47 | placeholder="Seleccione Cliente" |
48 | readonly="true" | 48 | readonly="true" |
49 | ng-click="seleccionarCliente()" | 49 | ng-click="seleccionarCliente()" |
50 | > | 50 | > |
51 | <span class="input-group-append"> | 51 | <span class="input-group-append"> |
52 | <button type="button" class="btn btn-default" ng-click="seleccionarCliente()"> | 52 | <button type="button" class="btn btn-default" ng-click="seleccionarCliente()"> |
53 | <i class="fa fa-search"></i> | 53 | <i class="fa fa-search"></i> |
54 | </button> | 54 | </button> |
55 | </span> | 55 | </span> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | <div class="form-group col-12 col-sm-6 col-md-4"> | 58 | <div class="form-group col-12 col-sm-6 col-md-4"> |
59 | <input | 59 | <input |
60 | class="form-control selectable" | 60 | class="form-control selectable" |
61 | type="text" | 61 | type="text" |
62 | ng-model="domicilio.dom" | 62 | ng-model="domicilio.dom" |
63 | ng-click="abrirModalDomicilio()" | 63 | ng-click="abrirModalDomicilio()" |
64 | placeholder="Seleccione Domicilio" | 64 | placeholder="Seleccione Domicilio" |
65 | uib-typeahead=" | 65 | uib-typeahead=" |
66 | domi.dom | 66 | domi.dom |
67 | for domi | 67 | for domi |
68 | in domiciliosCliente | 68 | in domiciliosCliente |
69 | " | 69 | " |
70 | typeahead-min-length="0" | 70 | typeahead-min-length="0" |
71 | > | 71 | > |
72 | </div> | 72 | </div> |
73 | <div class="form-group col-12 col-sm-6 col-md-4"> | 73 | <div class="form-group col-12 col-sm-6 col-md-4"> |
74 | <input | 74 | <input |
75 | class="form-control selectable" | 75 | class="form-control selectable" |
76 | type="text" | 76 | type="text" |
77 | readonly="true" | 77 | readonly="true" |
78 | ng-model="notaPedido.precioCondicion" | 78 | ng-model="notaPedido.precioCondicion" |
79 | ng-click="abrirModalListaPrecio()" | 79 | ng-click="abrirModalListaPrecio()" |
80 | placeholder="Seleccione Lista de precio" | 80 | placeholder="Seleccione Lista de precio" |
81 | > | 81 | > |
82 | </div> | 82 | </div> |
83 | <div class="form-group col-12 col-sm-6 col-md-4"> | 83 | <div class="form-group col-12 col-sm-6 col-md-4"> |
84 | <label>Bomba</label> | ||
85 | <div class="form-check custom-radio custom-control-inline"> | ||
86 | <input | ||
87 | class="form-check-input" | ||
88 | type="radio" | ||
89 | name="radioBomba" | ||
90 | value="1" | ||
91 | ng-model="notaPedido.bomba"> | ||
92 | <label class="form-check-label">Si</label> | ||
93 | </div> | ||
94 | <div class="form-check custom-radio custom-control-inline"> | ||
95 | <input | ||
96 | class="form-check-input" | ||
97 | type="radio" | ||
98 | name="radioBomba" | ||
99 | value="0" | ||
100 | ng-model="notaPedido.bomba"> | ||
101 | <label class="form-check-label">No</label> | ||
102 | </div> | ||
103 | </div> | ||
104 | <div class="form-group col-12 col-sm-6 col-md-4"> | ||
84 | <label>Flete</label> | 105 | <label>Flete</label> |
85 | <div class="form-check custom-radio custom-control-inline"> | 106 | <div class="form-check custom-radio custom-control-inline"> |
86 | <input | 107 | <input |
87 | ng-change="limpiarFlete()" | 108 | ng-change="limpiarFlete()" |
88 | class="form-check-input" | 109 | class="form-check-input" |
89 | type="radio" | 110 | type="radio" |
90 | name="radioFlete" | 111 | name="radioFlete" |
91 | value="1" | 112 | value="1" |
92 | ng-model="notaPedido.flete"> | 113 | ng-model="notaPedido.flete"> |
93 | <label class="form-check-label">Si</label> | 114 | <label class="form-check-label">Si</label> |
94 | </div> | 115 | </div> |
95 | <div class="form-check custom-radio custom-control-inline"> | 116 | <div class="form-check custom-radio custom-control-inline"> |
96 | <input | 117 | <input |
97 | class="form-check-input" | 118 | class="form-check-input" |
98 | type="radio" | 119 | type="radio" |
99 | name="radioFlete" | 120 | name="radioFlete" |
100 | value="0" | 121 | value="0" |
101 | ng-model="notaPedido.flete"> | 122 | ng-model="notaPedido.flete"> |
102 | <label class="form-check-label">No</label> | 123 | <label class="form-check-label">No</label> |
103 | </div> | 124 | </div> |
104 | </div> | 125 | </div> |
105 | <div class="form-group col-12 col-sm-6 col-md-4"> | 126 | <div class="form-group col-12 col-sm-6 col-md-4"> |
106 | <input | 127 | <input |
107 | class="form-control selectable" | 128 | class="form-control selectable" |
108 | type="text" | 129 | type="text" |
109 | readonly="true" | 130 | readonly="true" |
110 | ng-show="notaPedido.flete == 1" | 131 | ng-show="notaPedido.flete == 1" |
111 | ng-model="notaPedido.fleteNombre" | 132 | ng-model="notaPedido.fleteNombre" |
112 | ng-click="abrirModalFlete()" | 133 | ng-click="abrirModalFlete()" |
113 | placeholder="Seleccione Flete" | 134 | placeholder="Seleccione Flete" |
114 | > | 135 | > |
115 | </div> | 136 | </div> |
116 | <div class="form-group col-12 col-sm-6 col-md-4"> | 137 | <div class="form-group col-12 col-sm-6 col-md-4"> |
117 | <input | 138 | <input |
118 | class="form-control selectable" | 139 | class="form-control selectable" |
119 | type="text" | 140 | type="text" |
120 | ng-show="notaPedido.flete == 1" | 141 | ng-show="notaPedido.flete == 1" |
121 | ng-model="notaPedido.chofer" | 142 | ng-model="notaPedido.chofer" |
122 | placeholder="Seleccione Chofer" | 143 | placeholder="Seleccione Chofer" |
123 | uib-typeahead="chofer.nombre for chofer in choferes" | 144 | uib-typeahead="chofer.nombre for chofer in choferes" |
124 | typeahead-min-length="0" | 145 | typeahead-min-length="0" |
125 | > | 146 | > |
126 | </div> | 147 | </div> |
127 | <div class="form-group col-12 col-sm-6 col-md-4"> | 148 | <div class="form-group col-12 col-sm-6 col-md-4"> |
128 | <input | 149 | <input |
129 | class="form-control selectable" | 150 | class="form-control selectable" |
130 | type="text" | 151 | type="text" |
131 | ng-show="notaPedido.flete == 1" | 152 | ng-show="notaPedido.flete == 1" |
132 | ng-model="notaPedido.vehiculo" | 153 | ng-model="notaPedido.vehiculo" |
133 | placeholder="Seleccione Vehículo" | 154 | placeholder="Seleccione Vehículo" |
134 | uib-typeahead="vehiculo.tractor for vehiculo in vehiculos" | 155 | uib-typeahead="vehiculo.tractor for vehiculo in vehiculos" |
135 | typeahead-min-length="0" | 156 | typeahead-min-length="0" |
136 | > | 157 | > |
137 | </div> | 158 | </div> |
138 | <div class="form-group col-12 col-sm-6 col-md-4"> | 159 | <div class="form-group col-12 col-sm-6 col-md-4"> |
139 | <input | 160 | <input |
140 | class="form-control selectable" | 161 | class="form-control selectable" |
141 | type="number" | 162 | type="number" |
142 | step="0.01" | 163 | step="0.01" |
143 | ng-show="notaPedido.flete == 1" | 164 | ng-show="notaPedido.flete == 1" |
144 | ng-model="notaPedido.costoUnitarioKmFlete" | 165 | ng-model="notaPedido.costoUnitarioKmFlete" |
145 | placeholder="Costo por kilómetro" | 166 | placeholder="Costo por kilómetro" |
146 | > | 167 | > |
147 | </div> | 168 | </div> |
148 | <div class="form-group col-12 col-sm-6 col-md-4"> | 169 | <div class="form-group col-12 col-sm-6 col-md-4"> |
149 | <input | 170 | <input |
150 | class="form-control selectable" | 171 | class="form-control selectable" |
151 | type="number" | 172 | type="number" |
152 | step="0.1" | 173 | step="0.1" |
153 | ng-show="notaPedido.flete == 1" | 174 | ng-show="notaPedido.flete == 1" |
154 | ng-model="notaPedido.kilometros" | 175 | ng-model="notaPedido.kilometros" |
155 | placeholder="Kilómetros recorridos" | 176 | placeholder="Kilómetros recorridos" |
156 | > | 177 | > |
157 | </div> | 178 | </div> |
158 | </div> | 179 | </div> |
159 | </div> | 180 | </div> |
160 | <div class="col-auto my-2"> | 181 | <div class="col-auto my-2"> |
161 | <button ng-click="crearPedidoDemo()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> | 182 | <button ng-click="crearPedidoDemo()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> |
162 | </div> | 183 | </div> |
163 | </div> | 184 | </div> |
164 | <div class="row"> | 185 | <div class="row"> |
165 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 186 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
166 | <div class="row"> | 187 | <div class="row"> |
167 | </div> | 188 | </div> |
168 | <div class="row"> | 189 | <div class="row"> |
169 | <table class="table table-striped table-sm"> | 190 | <table class="table table-striped table-sm"> |
170 | <thead> | 191 | <thead> |
171 | <tr> | 192 | <tr> |
172 | <th>Sector</th> | 193 | <th>Sector</th> |
173 | <th>Código</th> | 194 | <th>Código</th> |
174 | <th>Descripción</th> | 195 | <th>Descripción</th> |
175 | <th>Precio Unitario</th> | 196 | <th>Precio Unitario</th> |
176 | <th>Cantidad</th> | 197 | <th>Cantidad</th> |
177 | <th>SubTotal</th> | 198 | <th>SubTotal</th> |
178 | <th> | 199 | <th> |
179 | <button class="btn btn-outline-secondary selectable" style="float: right;" ng-click="show = !show; masMenos()" > | 200 | <button class="btn btn-outline-secondary selectable" style="float: right;" ng-click="show = !show; masMenos()" > |
180 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> | 201 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> |
181 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> | 202 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> |
182 | </button> | 203 | </button> |
183 | </th> | 204 | </th> |
184 | </tr> | 205 | </tr> |
185 | </thead> | 206 | </thead> |
186 | <tbody> | 207 | <tbody> |
187 | <tr ng-show="!articuloACargar"> | 208 | <tr ng-show="!articuloACargar"> |
188 | <td colspan="2"><input placeholder="Seleccione Articulo" class="form-control" readonly ng-click="seleccionarArticulo()"></td> | 209 | <td colspan="2"><input placeholder="Seleccione Articulo" class="form-control" readonly ng-click="seleccionarArticulo()"></td> |
189 | <td></td> | 210 | <td></td> |
190 | <td></td> | 211 | <td></td> |
191 | <td></td> | 212 | <td></td> |
192 | <td></td> | 213 | <td></td> |
193 | <td></td> | 214 | <td></td> |
194 | </tr> | 215 | </tr> |
195 | <tr ng-show="articuloACargar"> | 216 | <tr ng-show="articuloACargar"> |
196 | <td><input | 217 | <td><input |
197 | class="form-control" | 218 | class="form-control" |
198 | ng-model="articuloACargar.sector" | 219 | ng-model="articuloACargar.sector" |
199 | readonly></td> | 220 | readonly></td> |
200 | <td><input | 221 | <td><input |
201 | class="form-control" | 222 | class="form-control" |
202 | ng-model="articuloACargar.codigo" | 223 | ng-model="articuloACargar.codigo" |
203 | readonly></td> | 224 | readonly></td> |
204 | <td><input | 225 | <td><input |
205 | class="form-control" | 226 | class="form-control" |
206 | ng-model="articuloACargar.descripcion" | 227 | ng-model="articuloACargar.descripcion" |
207 | readonly></td> | 228 | readonly></td> |
208 | <td><input | 229 | <td><input |
209 | class="form-control" | 230 | class="form-control" |
210 | ng-value="articuloACargar.precio | currency:'$'" | 231 | ng-value="articuloACargar.precio | currency:'$'" |
211 | readonly></td> | 232 | readonly></td> |
212 | <td><input | 233 | <td><input |
213 | class="form-control" | 234 | class="form-control" |
214 | type="number" | 235 | type="number" |
215 | min="1" | 236 | min="1" |
216 | value="1" | 237 | value="1" |
217 | ng-model="articuloACargar.cantidad" | 238 | ng-model="articuloACargar.cantidad" |
218 | foca-focus="articuloACargar.cantidad == 1" | 239 | foca-focus="articuloACargar.cantidad == 1" |
219 | ng-keypress="agregarATabla($event.keyCode)"></td> | 240 | ng-keypress="agregarATabla($event.keyCode)"></td> |
220 | <td><input | 241 | <td><input |
221 | class="form-control" | 242 | class="form-control" |
222 | ng-value="getSubTotal() | currency:'$'" | 243 | ng-value="getSubTotal() | currency:'$'" |
223 | readonly></td> | 244 | readonly></td> |
224 | <td class="text-center"><button | 245 | <td class="text-center"><button |
225 | class="btn btn-outline-secondary btn-sm" | 246 | class="btn btn-outline-secondary btn-sm" |
226 | ng-click="agregarATabla(13)"> | 247 | ng-click="agregarATabla(13)"> |
227 | <i class="fa fa-save"></i> | 248 | <i class="fa fa-save"></i> |
228 | </button></td> | 249 | </button></td> |
229 | </tr> | 250 | </tr> |
230 | <tr ng-repeat="(key, articulo) in articulosTabla" ng-show="show || key == 0"> | 251 | <tr ng-repeat="(key, articulo) in articulosTabla" ng-show="show || key == 0"> |
231 | <td ng-bind="articulo.sector"></td> | 252 | <td ng-bind="articulo.sector"></td> |
232 | <td ng-bind="articulo.codigo"></td> | 253 | <td ng-bind="articulo.codigo"></td> |
233 | <td ng-bind="articulo.descripcion"></td> | 254 | <td ng-bind="articulo.descripcion"></td> |
234 | <td ng-bind="articulo.precio | currency:'$'"></td> | 255 | <td ng-bind="articulo.precio | currency:'$'"></td> |
235 | <td><input | 256 | <td><input |
236 | ng-show="edit" | 257 | ng-show="edit" |
237 | ng-model="articulo.cantidad" | 258 | ng-model="articulo.cantidad" |
238 | class="form-control" | 259 | class="form-control" |
239 | type="number" | 260 | type="number" |
240 | min="1" | 261 | min="1" |
241 | value="1" | 262 | value="1" |
242 | foca-focus="edit" | 263 | foca-focus="edit" |
243 | ng-keypress="editarArticulo($event.keyCode)"> | 264 | ng-keypress="editarArticulo($event.keyCode)"> |
244 | <i class="selectable" ng-click="cambioEdit()" ng-hide="edit" ng-bind="articulo.cantidad"></i> | 265 | <i class="selectable" ng-click="cambioEdit()" ng-hide="edit" ng-bind="articulo.cantidad"></i> |
245 | </td> | 266 | </td> |
246 | <td ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"></td> | 267 | <td ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"></td> |
247 | <td class="text-center"> | 268 | <td class="text-center"> |
248 | <button class="btn btn-outline-secondary btn-sm" ng-click="quitarArticulo(key)"> | 269 | <button class="btn btn-outline-secondary btn-sm" ng-click="quitarArticulo(key)"> |
249 | <i class="fa fa-trash"></i> | 270 | <i class="fa fa-trash"></i> |
250 | </button> | 271 | </button> |
251 | </td> | 272 | </td> |
252 | </tr> | 273 | </tr> |
253 | </tbody> | 274 | </tbody> |
254 | <tfoot> | 275 | <tfoot> |
255 | <tr class="table-secondary"> | 276 | <tr class="table-secondary"> |
256 | <td colspan="5"><b>Cantidad Items:</b> <a ng-bind="articulosTabla.length"></a> </td> | 277 | <td colspan="5"><b>Cantidad Items:</b> <a ng-bind="articulosTabla.length"></a> </td> |
257 | <td colspan="3">{{getTotal() | currency:'$'}}</td> | 278 | <td colspan="3">{{getTotal() | currency:'$'}}</td> |
258 | </tr> | 279 | </tr> |
259 | </tfoot> | 280 | </tfoot> |
260 | </table> | 281 | </table> |
261 | </div> | 282 | </div> |
262 | </div> | 283 | </div> |
263 | </div> | 284 | </div> |
264 | 285 | ||
265 | <!-- | 286 | <!-- |
266 | <form name="formCrearNota"> | 287 | <form name="formCrearNota"> |
267 | <uib-tabset active="active"> | 288 | <uib-tabset active="active"> |
268 | <uib-tab index="0" heading="General"> | 289 | <uib-tab index="0" heading="General"> |
269 | <input type="hidden" name="id" ng-model="notaPedido.id" /> | 290 | <input type="hidden" name="id" ng-model="notaPedido.id" /> |
270 | <div> | 291 | <div> |
271 | <div class="col-auto my-2"> | 292 | <div class="col-auto my-2"> |
272 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> | 293 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> |
273 | </div> | 294 | </div> |
274 | </div> | 295 | </div> |
275 | <br> | 296 | <br> |
276 | <br> | 297 | <br> |
277 | <div class="row"> | 298 | <div class="row"> |
278 | <div class="col-md-2"> | 299 | <div class="col-md-2"> |
279 | <div class="col-auto"> | 300 | <div class="col-auto"> |
280 | <label>Fecha de carga</label> | 301 | <label>Fecha de carga</label> |
281 | </div> | 302 | </div> |
282 | </div> | 303 | </div> |
283 | <div class="col-md-3"> | 304 | <div class="col-md-3"> |
284 | <div class="col-auto"> | 305 | <div class="col-auto"> |
285 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> | 306 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> |
286 | </div> | 307 | </div> |
287 | </div> | 308 | </div> |
288 | <div class="col-md-2"> | 309 | <div class="col-md-2"> |
289 | <div class="col-auto"> | 310 | <div class="col-auto"> |
290 | <label>Kilómetros</label> | 311 | <label>Kilómetros</label> |
291 | </div> | 312 | </div> |
292 | </div> | 313 | </div> |
293 | <div class="col-md-3"> | 314 | <div class="col-md-3"> |
294 | <div class="col-auto"> | 315 | <div class="col-auto"> |
295 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" | 316 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" |
296 | ng-model="notaPedido.kilometros" ng-required="true"> | 317 | ng-model="notaPedido.kilometros" ng-required="true"> |
297 | </div> | 318 | </div> |
298 | </div> | 319 | </div> |
299 | </div> | 320 | </div> |
300 | <div class="row my-3"> | 321 | <div class="row my-3"> |
301 | <div class="col-md-2"> | 322 | <div class="col-md-2"> |
302 | <div class="col-auto"> | 323 | <div class="col-auto"> |
303 | <label>Jurisdicción de IIBB</label> | 324 | <label>Jurisdicción de IIBB</label> |
304 | </div> | 325 | </div> |
305 | </div> | 326 | </div> |
306 | <div class="col-md-3"> | 327 | <div class="col-md-3"> |
307 | <div class="col-auto"> | 328 | <div class="col-auto"> |
308 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" | 329 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" |
309 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> | 330 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> |
310 | </div> | 331 | </div> |
311 | </div> | 332 | </div> |
312 | <div class="col-md-2"> | 333 | <div class="col-md-2"> |
313 | <div class="col-auto"> | 334 | <div class="col-auto"> |
314 | <label>Costo de financiación</label> | 335 | <label>Costo de financiación</label> |
315 | </div> | 336 | </div> |
316 | </div> | 337 | </div> |
317 | <div class="col-md-3"> | 338 | <div class="col-md-3"> |
318 | <div class="col-auto"> | 339 | <div class="col-auto"> |
319 | <div class="input-group mb-2"> | 340 | <div class="input-group mb-2"> |
320 | <div class="input-group-prepend"> | 341 | <div class="input-group-prepend"> |
321 | <div class="input-group-text">$</div> | 342 | <div class="input-group-text">$</div> |
322 | </div> | 343 | </div> |
323 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" | 344 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" |
324 | ng-model="notaPedido.costoFinanciacion"> | 345 | ng-model="notaPedido.costoFinanciacion"> |
325 | </div> | 346 | </div> |
326 | </div> | 347 | </div> |
327 | </div> | 348 | </div> |
328 | </div> | 349 | </div> |
329 | <div class="row"> | 350 | <div class="row"> |
330 | <div class="col-md-2"> | 351 | <div class="col-md-2"> |
331 | <div class="col-auto"> | 352 | <div class="col-auto"> |
332 | <label>Bomba</label> | 353 | <label>Bomba</label> |
333 | </div> | 354 | </div> |
334 | </div> | 355 | </div> |
335 | <div class="col-md-1"> | 356 | <div class="col-md-1"> |
336 | <div class="col-auto"> | 357 | <div class="col-auto"> |
337 | <div class="form-check custom-radio custom-control-inline"> | 358 | <div class="form-check custom-radio custom-control-inline"> |
338 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> | 359 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> |
339 | <label class="form-check-label"> | 360 | <label class="form-check-label"> |
340 | Si | 361 | Si |
341 | </label> | 362 | </label> |
342 | </div> | 363 | </div> |
343 | <div class="form-check custom-radio custom-control-inline"> | 364 | <div class="form-check custom-radio custom-control-inline"> |
344 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> | 365 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> |
345 | <label class="form-check-label"> | 366 | <label class="form-check-label"> |
346 | No | 367 | No |
347 | </label> | 368 | </label> |
348 | </div> | 369 | </div> |
349 | </div> | 370 | </div> |
350 | </div> | 371 | </div> |
351 | <div class="col-md-1"> | 372 | <div class="col-md-1"> |
352 | <div class="col-auto"> | 373 | <div class="col-auto"> |
353 | <label>Flete</label> | 374 | <label>Flete</label> |
354 | </div> | 375 | </div> |
355 | </div> | 376 | </div> |
356 | <div class="col-md-1"> | 377 | <div class="col-md-1"> |
357 | <div class="col-auto"> | 378 | <div class="col-auto"> |
358 | <div class="form-check custom-radio custom-control-inline"> | 379 | <div class="form-check custom-radio custom-control-inline"> |
359 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> | 380 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> |
360 | <label class="form-check-label"> | 381 | <label class="form-check-label"> |
361 | Si | 382 | Si |
362 | </label> | 383 | </label> |
363 | </div> | 384 | </div> |
364 | <div class="form-check custom-radio custom-control-inline"> | 385 | <div class="form-check custom-radio custom-control-inline"> |
365 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> | 386 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> |
366 | <label class="form-check-label"> | 387 | <label class="form-check-label"> |
367 | FOB | 388 | FOB |
368 | </label> | 389 | </label> |
369 | </div> | 390 | </div> |
370 | </div> | 391 | </div> |
371 | </div> | 392 | </div> |
372 | <div class="col-md-2"> | 393 | <div class="col-md-2"> |
373 | <div class="col-auto"> | 394 | <div class="col-auto"> |
374 | <label>Costo unitario kilometro flete</label> | 395 | <label>Costo unitario kilometro flete</label> |
375 | </div> | 396 | </div> |
376 | </div> | 397 | </div> |
377 | <div class="col-md-3"> | 398 | <div class="col-md-3"> |
378 | <div class="col-auto"> | 399 | <div class="col-auto"> |
379 | <div class="input-group mb-2"> | 400 | <div class="input-group mb-2"> |
380 | <div class="input-group-prepend"> | 401 | <div class="input-group-prepend"> |
381 | <div class="input-group-text">$</div> | 402 | <div class="input-group-text">$</div> |
382 | </div> | 403 | </div> |
383 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" | 404 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" |
384 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> | 405 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> |
385 | </div> | 406 | </div> |
386 | </div> | 407 | </div> |
387 | </div> | 408 | </div> |
388 | </div> | 409 | </div> |
389 | <div class="row my-3"> | 410 | <div class="row my-3"> |
390 | <div class="col-md-2"> | 411 | <div class="col-md-2"> |
391 | <div class="col-auto"> | 412 | <div class="col-auto"> |
392 | <label>Vendedor</label> | 413 | <label>Vendedor</label> |
393 | </div> | 414 | </div> |
394 | </div> | 415 | </div> |
395 | <div class="col-md-3"> | 416 | <div class="col-md-3"> |
396 | <div class="col-auto"> | 417 | <div class="col-auto"> |
397 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" | 418 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" |
398 | ng-click="seleccionarVendedor()" readonly> | 419 | ng-click="seleccionarVendedor()" readonly> |
399 | </div> | 420 | </div> |
400 | </div> | 421 | </div> |
401 | <div class="col-md-2"> | 422 | <div class="col-md-2"> |
402 | <div class="col-auto"> | 423 | <div class="col-auto"> |
403 | <label>Petrolera</label> | 424 | <label>Petrolera</label> |
404 | </div> | 425 | </div> |
405 | </div> | 426 | </div> |
406 | <div class="col-md-3"> | 427 | <div class="col-md-3"> |
407 | <div class="col-auto"> | 428 | <div class="col-auto"> |
408 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" | 429 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" |
409 | ng-click="seleccionarPetrolera()" readonly> | 430 | ng-click="seleccionarPetrolera()" readonly> |
410 | </div> | 431 | </div> |
411 | </div> | 432 | </div> |
412 | </div> | 433 | </div> |
413 | </div> | 434 | </div> |
414 | <div class="row"> | 435 | <div class="row"> |
415 | <div class="col-md-2"> | 436 | <div class="col-md-2"> |
416 | <div class="col-auto"> | 437 | <div class="col-auto"> |
417 | <label>Cliente</label> | 438 | <label>Cliente</label> |
418 | </div> | 439 | </div> |
419 | </div> | 440 | </div> |
420 | <div class="col-md-3"> | 441 | <div class="col-md-3"> |
421 | <div class="col-auto"> | 442 | <div class="col-auto"> |
422 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" | 443 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" |
423 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> | 444 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> |
424 | </div> | 445 | </div> |
425 | </div> | 446 | </div> |
426 | <div class="col-md-2"> | 447 | <div class="col-md-2"> |
427 | <div class="col-auto"> | 448 | <div class="col-auto"> |
428 | <label>Domicilio</label> | 449 | <label>Domicilio</label> |
429 | </div> | 450 | </div> |
430 | </div> | 451 | </div> |
431 | <div class="col-md-4"> | 452 | <div class="col-md-4"> |
432 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> | 453 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> |
433 | <div class="col-auto"> | 454 | <div class="col-auto"> |
434 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" | 455 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" |
435 | domi.dom | 456 | domi.dom |
436 | for domi | 457 | for domi |
437 | in domiciliosCliente | 458 | in domiciliosCliente |
438 | " | 459 | " |
439 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" | 460 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" |
440 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> | 461 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> |
441 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> | 462 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> |
442 | <div ng-show="sinResultados"> | 463 | <div ng-show="sinResultados"> |
443 | No se encontraron resultados. | 464 | No se encontraron resultados. |
444 | </div> | 465 | </div> |
445 | </div> | 466 | </div> |
446 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> | 467 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> |
447 | <a class="btn" ng-click="addNewDom()">+</a> | 468 | <a class="btn" ng-click="addNewDom()">+</a> |
448 | </div> | 469 | </div> |
449 | </div> | 470 | </div> |
450 | </div> | 471 | </div> |
451 | </uib-tab> | 472 | </uib-tab> |
452 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> | 473 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> |
453 | <div> | 474 | <div> |
454 | <div class="col-auto my-2"> | 475 | <div class="col-auto my-2"> |
455 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> | 476 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> |
456 | </div> | 477 | </div> |
457 | </div> | 478 | </div> |
458 | <br> | 479 | <br> |
459 | <br> | 480 | <br> |
460 | <div class="row"> | 481 | <div class="row"> |
461 | <div class="col-md-2"> | 482 | <div class="col-md-2"> |
462 | <div class="col-auto"> | 483 | <div class="col-auto"> |
463 | <label>Precios y condiciones</label> | 484 | <label>Precios y condiciones</label> |
464 | </div> | 485 | </div> |
465 | </div> | 486 | </div> |
466 | <div class="col-md-4"> | 487 | <div class="col-md-4"> |
467 | <div class="col-auto"> | 488 | <div class="col-auto"> |
468 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> | 489 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> |
469 | </select> | 490 | </select> |
470 | </div> | 491 | </div> |
471 | </div> | 492 | </div> |
472 | <div class="col-md-2"> | 493 | <div class="col-md-2"> |
473 | <div class="col-auto"> | 494 | <div class="col-auto"> |
474 | <label>Producto</label> | 495 | <label>Producto</label> |
475 | </div> | 496 | </div> |
476 | </div> | 497 | </div> |
477 | <div class="col-md-4"> | 498 | <div class="col-md-4"> |
478 | <div class="col-auto"> | 499 | <div class="col-auto"> |
479 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" | 500 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" |
480 | ng-click="seleccionarArticulo()" readonly> | 501 | ng-click="seleccionarArticulo()" readonly> |
481 | </div> | 502 | </div> |
482 | </div> | 503 | </div> |
483 | </div> | 504 | </div> |
484 | <div class="col-md-12"> | 505 | <div class="col-md-12"> |
485 | <table class="table my-3 table-hover table-nonfluid"> | 506 | <table class="table my-3 table-hover table-nonfluid"> |
486 | <thead> | 507 | <thead> |
487 | <tr> | 508 | <tr> |
488 | <th>Código</th> | 509 | <th>Código</th> |
489 | <th>Nombre</th> | 510 | <th>Nombre</th> |
490 | <th>Precio unitario</th> | 511 | <th>Precio unitario</th> |
491 | <th>Costo unitario bruto</th> | 512 | <th>Costo unitario bruto</th> |
492 | <th>Cantidad</th> | 513 | <th>Cantidad</th> |
493 | <th>Subtotal</th> | 514 | <th>Subtotal</th> |
494 | </tr> | 515 | </tr> |
495 | </thead> | 516 | </thead> |
496 | <tbody> | 517 | <tbody> |
497 | <tr ng-repeat="articulo in articulosTabla"> | 518 | <tr ng-repeat="articulo in articulosTabla"> |
498 | <td ng-bind="articulo.codigo"></td> | 519 | <td ng-bind="articulo.codigo"></td> |
499 | <td ng-bind="articulo.nombre"></td> | 520 | <td ng-bind="articulo.nombre"></td> |
500 | <td ng-bind="articulo.precio"></td> | 521 | <td ng-bind="articulo.precio"></td> |
501 | <td ng-bind="articulo.costoUnitario"></td> | 522 | <td ng-bind="articulo.costoUnitario"></td> |
502 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> | 523 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> |
503 | <td ng-bind="getSubTotal(articulo.item)"></td> | 524 | <td ng-bind="getSubTotal(articulo.item)"></td> |
504 | </tr> | 525 | </tr> |
505 | </tbody> | 526 | </tbody> |
506 | </table> | 527 | </table> |
507 | </div> | 528 | </div> |
508 | </uib-tab> | 529 | </uib-tab> |
509 | </uib-tabset> | 530 | </uib-tabset> |
510 | </form>--> | 531 | </form>--> |