Commit 0c56db6464041762d73a0902d96619bdfdf5e11e

Authored by Eric Fernandez
1 parent 30db065229
Exists in master and in 1 other branch develop

foca crear factura

Showing 1 changed file with 24 additions and 23 deletions   Show diff stats
src/js/controller.js
... ... @@ -172,9 +172,9 @@ angular.module('focaCrearFactura').controller('facturaController', [
172 172 factura: {
173 173  
174 174 BONIF: 0,
175   - CLI: $scope.factura.cliente.cod,
176   - CUI: $scope.factura.cliente.cuit,
177   - CTA: $scope.factura.cliente.cod,
  175 + CLI: $scope.factura.cliente.COD,
  176 + CUI: $scope.factura.cliente.CUIT,
  177 + CTA: $scope.factura.cliente.COD,
178 178 DC1: '',
179 179 DC2: '',
180 180 DE1: '',
... ... @@ -185,7 +185,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
185 185 FEC_ANT: '19000101',
186 186 FPA: $scope.factura.formaPago,
187 187 IDEXCEPCION: 0,
188   - IDLP: $scope.factura.cliente.mod.trim() || 0,
  188 + IDLP: $scope.factura.cliente.MOD.trim() || 0,
189 189 IDPERSONERIA: 0,
190 190 IMI: getImporte('IMI'),
191 191 IMI2: getImporte('IMI2'),
... ... @@ -200,7 +200,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
200 200 NET: getImporte('NET'),
201 201 NFI: '',
202 202 NNP: 0,
203   - NOM: $scope.factura.cliente.nom,
  203 + NOM: $scope.factura.cliente.NOM,
204 204 OPE: $scope.factura.vendedor.CodVen,
205 205 PAG: $scope.getTotal(),
206 206 PER: 0,
... ... @@ -212,8 +212,8 @@ angular.module('focaCrearFactura').controller('facturaController', [
212 212 TCA: 1,
213 213 TCO: 'FT',
214 214 TFI: '',
215   - TIP: $scope.factura.cliente.tipoFactura,
216   - TIV: $scope.factura.cliente.iva,
  215 + TIP: $scope.factura.cliente.TIP,
  216 + TIV: $scope.factura.cliente.IVA,
217 217 TOT: $scope.getTotal(),
218 218 TUR: $scope.factura.vendedor.TurVen,
219 219 VEN: $scope.factura.vendedor.CodVen,
... ... @@ -249,8 +249,12 @@ angular.module('focaCrearFactura').controller('facturaController', [
249 249 templateUrl: 'foca-busqueda-cliente-modal.html',
250 250 controller: 'focaBusquedaClienteModalController',
251 251 resolve: {
252   - vendedor: function () { return null; },
253   - cobrador: function () { return null; }
  252 + parametros: function () {
  253 + return {
  254 + vendedor: function () { return null; },
  255 + cobrador: function () { return null; }
  256 + };
  257 + }
254 258 },
255 259 size: 'lg'
256 260 }
... ... @@ -265,8 +269,8 @@ angular.module('focaCrearFactura').controller('facturaController', [
265 269 resolve: {
266 270 parametros: function () {
267 271 return {
268   - idCliente: cliente.cod,
269   - nombreCliente: cliente.nom
  272 + idCliente: cliente.COD,
  273 + nombreCliente: cliente.NOM
270 274 };
271 275 },
272 276 }
... ... @@ -281,8 +285,8 @@ angular.module('focaCrearFactura').controller('facturaController', [
281 285  
282 286 $scope.$broadcast('addCabecera', {
283 287 label: 'Cliente:',
284   - valor: $filter('rellenarDigitos')(cliente.cod, 3) +
285   - ' - ' + cliente.nom
  288 + valor: $filter('rellenarDigitos')(cliente.COD, 3) +
  289 + ' - ' + cliente.NOM
286 290 });
287 291  
288 292 $filter('filter')($scope.botonera,
... ... @@ -293,10 +297,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
293 297 valor: data.tipo
294 298 });
295 299 })
296   - .catch(function () {
297   -
298   - $scope.seleccionarCliente();
299   - });
  300 + .catch($scope.seleccionarCliente);
300 301  
301 302 }, function () {
302 303 }
... ... @@ -559,7 +560,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
559 560 .then(function (producto) {
560 561  
561 562 var articulo = {
562   - TIP: $scope.factura.cliente.tipoFactura,
  563 + TIP: $scope.factura.cliente.TIP,
563 564 TCO: 'FT',
564 565 SUC: parseInt($scope.puntoVenta),
565 566 ORD: $scope.articulosFiltro().length + 1,
... ... @@ -626,7 +627,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
626 627 modalInstance.result.then(function (producto) {
627 628  
628 629 var articulo = {
629   - TIP: $scope.factura.cliente.tipoFactura,
  630 + TIP: $scope.factura.cliente.TIP,
630 631 TCO: 'FT',
631 632 SUC: parseInt($scope.puntoVenta),
632 633 ORD: $scope.articulosFiltro().length + 1,
... ... @@ -713,7 +714,7 @@ angular.module('focaCrearFactura').controller('facturaController', [
713 714 modalInstance.result.then(function (despacho) {
714 715  
715 716 var articulo = {
716   - TIP: $scope.factura.cliente.tipoFactura,
  717 + TIP: $scope.factura.cliente.TIP,
717 718 TCO: 'FT',
718 719 SUC: parseInt($scope.puntoVenta),
719 720 ORD: $scope.articulosFiltro().length + 1,
... ... @@ -892,11 +893,11 @@ angular.module('focaCrearFactura').controller('facturaController', [
892 893 // $filter('filter')($scope.botonera, { label: 'Moneda' })[0].checked = true;
893 894 }
894 895  
895   - if (factura.cliente && factura.cliente.cod) {
  896 + if (factura.cliente && factura.cliente.COD) {
896 897 $scope.cabeceras.push({
897 898 label: 'Cliente:',
898   - valor: $filter('rellenarDigitos')(factura.cliente.cod, 3) + ' - ' +
899   - factura.cliente.nom
  899 + valor: $filter('rellenarDigitos')(factura.cliente.COD, 3) + ' - ' +
  900 + factura.cliente.NOM
900 901 });
901 902  
902 903 $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = true;