Commit 71cf101438a4b28fe7dc5f748d972db55d3b281f
Exists in
master
Merge branch 'master' into 'develop'
Master(efernandez) See merge request !19
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -67,6 +67,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
67 | 67 | proveedor: {}, |
68 | 68 | domicilio: { dom: '' }, |
69 | 69 | moneda: {}, |
70 | + formaPago: 1, // Por defecto paga contado | |
70 | 71 | cotizacion: $scope.cotizacionPorDefecto || {}, |
71 | 72 | articulosFactura: [], |
72 | 73 | despachos: [] |
... | ... | @@ -125,7 +126,14 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
125 | 126 | }, true); |
126 | 127 | |
127 | 128 | $scope.seleccionarFormaDePago = function () { |
129 | + | |
128 | 130 | if (!validarGuardar()) return; |
131 | + | |
132 | + if ($scope.factura.formaPago == 2) { | |
133 | + $scope.crearFactura(); | |
134 | + return; | |
135 | + } | |
136 | + | |
129 | 137 | var modalInstance = $uibModal.open( |
130 | 138 | { |
131 | 139 | templateUrl: 'modal-forma-pago.html', |
... | ... | @@ -165,7 +173,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
165 | 173 | DTO: 0, |
166 | 174 | FEC: $filter('date')($scope.now, 'yyyy-MM-dd HH:mm:ss'), |
167 | 175 | FEC_ANT: '19000101', |
168 | - FPA: 0, // 0 <- MĂșltiple formas de pago, 2 cta corriente | |
176 | + FPA: $scope.factura.formaPago, | |
169 | 177 | IDEXCEPCION: 0, |
170 | 178 | IDLP: $scope.factura.cliente.mod.trim() || 0, |
171 | 179 | IDPERSONERIA: 0, |
... | ... | @@ -252,6 +260,8 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
252 | 260 | modalInstance.result |
253 | 261 | .then(function (data) { |
254 | 262 | |
263 | + $scope.factura.formaPago = data.formaDePago; | |
264 | + | |
255 | 265 | $scope.factura.cliente = cliente; |
256 | 266 | |
257 | 267 | $scope.$broadcast('addCabecera', { |
... | ... | @@ -265,7 +275,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
265 | 275 | |
266 | 276 | $scope.$broadcast('addCabecera', { |
267 | 277 | label: 'Tipo de pago: ', |
268 | - valor: data | |
278 | + valor: data.tipo | |
269 | 279 | }); |
270 | 280 | }) |
271 | 281 | .catch(function () { |
src/views/modal-estado-cuenta.html
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | type="button" |
56 | 56 | class="btn btn-sm btn-block btn-tarjeta rounded border p-1" |
57 | 57 | ng-disabled="!estadoCuenta.situacion" |
58 | - ng-click="elegirTipoDePago('Contado')" | |
58 | + ng-click="elegirTipoDePago({tipo: 'Contado', formaDePago: 1})" | |
59 | 59 | > |
60 | 60 | <img ng-src="./img/contado.png" alt=""> |
61 | 61 | <p class="m-0">Contado</p> |
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | class="btn btn-sm btn-block btn-tarjeta rounded border p-1" |
68 | 68 | ng-disabled="!estadoCuenta.situacion" |
69 | 69 | foca-focus="true" |
70 | - ng-click="elegirTipoDePago('Cuenta Corriente')" | |
70 | + ng-click="elegirTipoDePago({tipo: 'Cuenta Corriente', formaDePago: 2})" | |
71 | 71 | > |
72 | 72 | <img ng-src="./img/cuentaCorriente.png" alt=""> |
73 | 73 | <p class="m-0">Cta. Corriente</p> |