Commit b598c80ad3bd013ba1fbb755e2311836efea190f
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master(efernandez) See merge request !55
Showing
3 changed files
Show diff stats
gulpfile.js
| ... | ... | @@ -21,9 +21,11 @@ var paths = { |
| 21 | 21 | dist: 'dist/' |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | -gulp.task('uglify', gulpSequence('clean', ['templates', 'uglify-spec'], 'uglify-app')); | |
| 24 | +gulp.task('uglify', function(callback) { | |
| 25 | + gulpSequence('clean', ['templates', 'uglify-spec'], 'uglify-app')(callback); | |
| 26 | +}); | |
| 25 | 27 | |
| 26 | -gulp.task('templates', ['clean'], function() { | |
| 28 | +gulp.task('templates', function() { | |
| 27 | 29 | return pump( |
| 28 | 30 | [ |
| 29 | 31 | gulp.src(paths.srcViews), |
| ... | ... | @@ -68,8 +70,7 @@ gulp.task('uglify-spec', function() { |
| 68 | 70 | }); |
| 69 | 71 | |
| 70 | 72 | gulp.task('clean', function() { |
| 71 | - return gulp.src(['tmp', 'dist'], {read: false}) | |
| 72 | - .pipe(clean()); | |
| 73 | + return gulp.src(['tmp', 'dist'], {read: false}).pipe(clean()); | |
| 73 | 74 | }); |
| 74 | 75 | |
| 75 | 76 | gulp.task('pre-commit', function() { |
| ... | ... | @@ -84,7 +85,7 @@ gulp.task('pre-commit', function() { |
| 84 | 85 | |
| 85 | 86 | gulp.start('uglify'); |
| 86 | 87 | }); |
| 87 | - | |
| 88 | + | |
| 88 | 89 | gulp.task('webserver', function() { |
| 89 | 90 | pump [ |
| 90 | 91 | connect.server({port: 3300, host: '0.0.0.0'}) |
src/js/controller.js
| ... | ... | @@ -314,14 +314,19 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 314 | 314 | |
| 315 | 315 | crearRemitoService.crearRemito(save).then( |
| 316 | 316 | function(data) { |
| 317 | - remitoBusinessService.addArticulos($scope.remito.articulosRemito, | |
| 318 | - data.data.id, $scope.remito.cotizacion.COTIZACION); | |
| 319 | 317 | |
| 320 | 318 | focaBotoneraLateralService.endGuardar(true); |
| 321 | 319 | $scope.saveLoading = false; |
| 322 | 320 | |
| 323 | - //TODO: updatear plazos | |
| 321 | + // TODO: updatear plazos | |
| 324 | 322 | if ($scope.remito.id === 0) { |
| 323 | + | |
| 324 | + $scope.remito.id = data.data.id; | |
| 325 | + $scope.remito.numeroRemito = data.data.numero; | |
| 326 | + | |
| 327 | + remitoBusinessService.addArticulos($scope.remito.articulosRemito, | |
| 328 | + $scope.remito.id, $scope.remito.cotizacion.VENDEDOR); | |
| 329 | + | |
| 325 | 330 | var plazos = $scope.remito.remitoPlazo; |
| 326 | 331 | |
| 327 | 332 | for(var j = 0; j < plazos.length; j++) { |
| ... | ... | @@ -332,10 +337,14 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 332 | 337 | crearRemitoService.crearPlazosParaRemito(json); |
| 333 | 338 | } |
| 334 | 339 | } |
| 335 | - abrirModalMail(data.data.id, $scope.remito.cliente, $filter('comprobante')([ | |
| 336 | - data.data.sucursal, | |
| 337 | - data.data.numero | |
| 338 | - ])); | |
| 340 | + | |
| 341 | + abrirModalMail($scope.remito.id, | |
| 342 | + $scope.remito.cliente, | |
| 343 | + $filter('comprobante')([ | |
| 344 | + $scope.puntoVenta, | |
| 345 | + $scope.remito.numeroRemito | |
| 346 | + ]) | |
| 347 | + ); | |
| 339 | 348 | |
| 340 | 349 | init(); |
| 341 | 350 | |
| ... | ... | @@ -362,8 +371,8 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 362 | 371 | resolve: { |
| 363 | 372 | parametroProducto: { |
| 364 | 373 | idLista: $scope.idLista, |
| 365 | - cotizacion: $scope.remito.cotizacion.COTIZACION, | |
| 366 | - simbolo: $scope.remito.cotizacion.moneda.simbolo | |
| 374 | + cotizacion: $scope.remito.cotizacion.VENDEDOR, | |
| 375 | + simbolo: $scope.remito.cotizacion.moneda.SIMBOLO | |
| 367 | 376 | } |
| 368 | 377 | }, |
| 369 | 378 | size: 'lg' |
| ... | ... | @@ -802,13 +811,13 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 802 | 811 | var articulosTablaTemp = $scope.remito.articulosRemito; |
| 803 | 812 | for(var i = 0; i < articulosTablaTemp.length; i++) { |
| 804 | 813 | articulosTablaTemp[i].precio = articulosTablaTemp[i].precio * |
| 805 | - $scope.remito.cotizacion.COTIZACION; | |
| 814 | + $scope.remito.cotizacion.VENDEDOR; | |
| 806 | 815 | articulosTablaTemp[i].precio = articulosTablaTemp[i].precio / |
| 807 | - cotizacion.COTIZACION; | |
| 816 | + cotizacion.VENDEDOR; | |
| 808 | 817 | } |
| 809 | 818 | $scope.remito.articulosRemito = articulosTablaTemp; |
| 810 | - $scope.remito.cotizacion.moneda = moneda; | |
| 811 | 819 | $scope.remito.cotizacion = cotizacion; |
| 820 | + $scope.remito.cotizacion.moneda = moneda; | |
| 812 | 821 | if (moneda.DETALLE === 'PESOS ARGENTINOS') { |
| 813 | 822 | $scope.$broadcast('removeCabecera', 'Moneda:'); |
| 814 | 823 | $scope.$broadcast('removeCabecera', 'Fecha cotizacion:'); |
| ... | ... | @@ -824,7 +833,7 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 824 | 833 | }); |
| 825 | 834 | $scope.$broadcast('addCabecera',{ |
| 826 | 835 | label: 'Cotizacion:', |
| 827 | - valor: $filter('number')(cotizacion.COTIZACION, '2') | |
| 836 | + valor: $filter('number')(cotizacion.VENDEDOR, '2') | |
| 828 | 837 | }); |
| 829 | 838 | } |
| 830 | 839 | }, function() { |
src/views/remito.html
| ... | ... | @@ -195,7 +195,7 @@ |
| 195 | 195 | <h3>Total:</h3> |
| 196 | 196 | </td> |
| 197 | 197 | <td class="table-celda-total text-right no-border-top" colspan="1"> |
| 198 | - <h3>{{getTotal() | currency: remito.moneda.SIMBOLO}}</h3> | |
| 198 | + <h3>{{getTotal() | currency: remito.cotizacion.moneda.SIMBOLO}}</h3> | |
| 199 | 199 | </td> |
| 200 | 200 | <td class="text-right no-border-top"> |
| 201 | 201 | <button |
| ... | ... | @@ -209,183 +209,6 @@ |
| 209 | 209 | </tfoot> |
| 210 | 210 | </table> |
| 211 | 211 | </div> |
| 212 | - | |
| 213 | - <!-- MOBILE --> | |
| 214 | - <div class="row d-sm-none"> | |
| 215 | - <table class="table table-sm table-striped tabla-articulo margin-bottom-mobile"> | |
| 216 | - <thead> | |
| 217 | - <tr class="d-flex"> | |
| 218 | - <th class="">#</th> | |
| 219 | - <th class="col px-0"> | |
| 220 | - <div class="d-flex"> | |
| 221 | - <div class="col-4 px-1">Cรณdigo</div> | |
| 222 | - <div class="col-8 px-1">Descripciรณn</div> | |
| 223 | - </div> | |
| 224 | - <div class="d-flex"> | |
| 225 | - <div class="col-3 px-1">Cantidad</div> | |
| 226 | - <div class="col px-1 text-right">P. Uni.</div> | |
| 227 | - <div class="col px-1 text-right">Subtotal</div> | |
| 228 | - </div> | |
| 229 | - </th> | |
| 230 | - <th class="text-center tamaรฑo-boton"> | |
| 231 | - | |
| 232 | - </th> | |
| 233 | - </tr> | |
| 234 | - </thead> | |
| 235 | - <tbody> | |
| 236 | - <tr | |
| 237 | - ng-repeat="(key, articulo) in remito.articulosRemito" | |
| 238 | - ng-show="show || key == remito.articulosRemito.length - 1" | |
| 239 | - > | |
| 240 | - <td class="w-100 align-middle d-flex p-0"> | |
| 241 | - <div class="align-middle p-1"> | |
| 242 | - <span ng-bind="key+1" class="align-middle"></span> | |
| 243 | - </div> | |
| 244 | - <div class="col px-0"> | |
| 245 | - <div class="d-flex"> | |
| 246 | - <div class="col-4 px-1"> | |
| 247 | - <span | |
| 248 | - ng-bind="articulo.sector + '-' + articulo.codigo" | |
| 249 | - ></span> | |
| 250 | - </div> | |
| 251 | - <div class="col-8 px-1"> | |
| 252 | - <span | |
| 253 | - ng-bind="'x' + articulo.cantidad" | |
| 254 | - ng-hide="articulo.editCantidad" | |
| 255 | - ></span> | |
| 256 | - <i | |
| 257 | - class="fa fa-pencil text-white-50" | |
| 258 | - aria-hidden="true" | |
| 259 | - ng-hide="articulo.editCantidad" | |
| 260 | - ng-click="articulo.editCantidad = true" | |
| 261 | - ></i> | |
| 262 | - <input | |
| 263 | - ng-show="articulo.editCantidad" | |
| 264 | - ng-model="articulo.cantidad" | |
| 265 | - class="form-control" | |
| 266 | - foca-tipo-input | |
| 267 | - min="1" | |
| 268 | - step="0.001" | |
| 269 | - foca-focus="articulo.editCantidad" | |
| 270 | - ng-keypress="editarArticulo($event.keyCode, articulo)" | |
| 271 | - ng-focus="selectFocus($event)" | |
| 272 | - > | |
| 273 | - </div> | |
| 274 | - </div> | |
| 275 | - <div class="d-flex"> | |
| 276 | - <div class="col-3 px-1"> | |
| 277 | - <span ng-bind="'x' + articulo.cantidad"></span> | |
| 278 | - </div> | |
| 279 | - <div class="col px-1 text-right"> | |
| 280 | - <span ng-bind="articulo.precio | currency: remito.moneda.SIMBOLO : 4"></span> | |
| 281 | - </div> | |
| 282 | - <div class="col px-1 text-right"> | |
| 283 | - <span | |
| 284 | - ng-bind="(articulo.precio * articulo.cantidad) | currency: remito.moneda.SIMBOLO" | |
| 285 | - > | |
| 286 | - </span> | |
| 287 | - </div> | |
| 288 | - </div> | |
| 289 | - </div> | |
| 290 | - <div class="align-middle p-1"> | |
| 291 | - <button | |
| 292 | - class="btn btn-outline-light" | |
| 293 | - ng-click="quitarArticulo(key)" | |
| 294 | - > | |
| 295 | - <i class="fa fa-trash"></i> | |
| 296 | - </button> | |
| 297 | - </div> | |
| 298 | - </td> | |
| 299 | - </tr> | |
| 300 | - </tbody> | |
| 301 | - <tfoot> | |
| 302 | - <!-- CARGANDO ITEM --> | |
| 303 | - <tr ng-show="!cargando" class="d-flex"> | |
| 304 | - <td | |
| 305 | - class="align-middle p-1" | |
| 306 | - ng-bind="remito.articulosRemito.length + 1" | |
| 307 | - ></td> | |
| 308 | - <td class="col p-0"> | |
| 309 | - <div class="d-flex"> | |
| 310 | - <div class="col-4 px-1"> | |
| 311 | - <span | |
| 312 | - ng-bind="articuloACargar.sectorCodigo" | |
| 313 | - ></span> | |
| 314 | - </div> | |
| 315 | - <div class="col-8 px-1"> | |
| 316 | - <span ng-bind="articuloACargar.descripcion"></span> | |
| 317 | - </div> | |
| 318 | - </div> | |
| 319 | - <div class="d-flex"> | |
| 320 | - <div class="col-3 px-1 m-1"> | |
| 321 | - <input | |
| 322 | - class="form-control p-1" | |
| 323 | - foca-tipo-input | |
| 324 | - min="1" | |
| 325 | - ng-model="articuloACargar.cantidad" | |
| 326 | - foca-focus="!cargando" | |
| 327 | - ng-keypress="agregarATabla($event.keyCode)" | |
| 328 | - style="height: auto; line-height: 1.1em" | |
| 329 | - > | |
| 330 | - </div> | |
| 331 | - <div class="col px-1 text-right"> | |
| 332 | - <span ng-bind="articuloACargar.precio | currency: remito.moneda.SIMBOLO : 4"></span> | |
| 333 | - </div> | |
| 334 | - <div class="col px-1 text-right"> | |
| 335 | - <span | |
| 336 | - ng-bind="getSubTotal() | currency: remito.moneda.SIMBOLO" | |
| 337 | - > | |
| 338 | - </span> | |
| 339 | - </div> | |
| 340 | - </div> | |
| 341 | - </td> | |
| 342 | - <td class="text-center align-middle"> | |
| 343 | - <button | |
| 344 | - class="btn btn-outline-light" | |
| 345 | - ng-click="agregarATabla(13)" | |
| 346 | - > | |
| 347 | - <i class="fa fa-save"></i> | |
| 348 | - </button> | |
| 349 | - </td> | |
| 350 | - </tr> | |
| 351 | - <!-- TOOGLE EXPANDIR --> | |
| 352 | - <tr> | |
| 353 | - <td class="col"> | |
| 354 | - <button | |
| 355 | - class="btn btn-outline-light selectable w-100" | |
| 356 | - ng-click="show = !show; masMenos()" | |
| 357 | - ng-show="remito.articulosRemito.length > 0" | |
| 358 | - > | |
| 359 | - <i | |
| 360 | - class="fa fa-chevron-down" | |
| 361 | - ng-hide="show" | |
| 362 | - aria-hidden="true" | |
| 363 | - > | |
| 364 | - </i> | |
| 365 | - <i | |
| 366 | - class="fa fa-chevron-up" | |
| 367 | - ng-show="show" | |
| 368 | - aria-hidden="true"> | |
| 369 | - </i> | |
| 370 | - </button> | |
| 371 | - </td> | |
| 372 | - </tr> | |
| 373 | - <!-- FOOTER --> | |
| 374 | - <tr class="d-flex"> | |
| 375 | - <td class="align-middle no-border-top" colspan="2"> | |
| 376 | - <strong>Cantidad Items:</strong> | |
| 377 | - <a ng-bind="remito.articulosRemito.length"></a> | |
| 378 | - </td> | |
| 379 | - <td class="text-right ml-auto table-celda-total no-border-top"> | |
| 380 | - <h3>Total:</h3> | |
| 381 | - </td> | |
| 382 | - <td class="table-celda-total text-right no-border-top"> | |
| 383 | - <h3>{{getTotal() | currency: remito.moneda.SIMBOLO}}</h3> | |
| 384 | - </td> | |
| 385 | - </tr> | |
| 386 | - </tfoot> | |
| 387 | - </table> | |
| 388 | - </div> | |
| 389 | 212 | </div> |
| 390 | 213 | </div> |
| 391 | 214 | </div> |