Commit 1d6ba7bafe7279e5e304c04c5b0f332746718249
1 parent
6b748181ee
Exists in
master
validación despachos
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -106,6 +106,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
| 106 | 106 | }); |
| 107 | 107 | |
| 108 | 108 | $scope.factura.vendedor = res.data; |
| 109 | + $scope.inicial.vendedor = res.data; | |
| 109 | 110 | |
| 110 | 111 | getProductosByPlanilla(res.data.NplVen); |
| 111 | 112 | }) |
| ... | ... | @@ -450,6 +451,13 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
| 450 | 451 | function getProductosByPlanilla(numeroPlanilla) { |
| 451 | 452 | |
| 452 | 453 | crearFacturaService.getProductosByPlanilla(numeroPlanilla).then(function (res) { |
| 454 | + | |
| 455 | + if (!res.data.length) { | |
| 456 | + | |
| 457 | + focaModalService.alert('No hay despachos disponibles por el momento'); | |
| 458 | + return; | |
| 459 | + } | |
| 460 | + | |
| 453 | 461 | $scope.botoneraProductos.length = 0; |
| 454 | 462 | res.data.forEach(function (producto) { |
| 455 | 463 |