Commit 4c6c3994baa05fa857f225f9cc48214d994b3219
1 parent
b9d8b31449
Exists in
master
and in
1 other branch
código basura, muestro plazos
Showing
1 changed file
with
13 additions
and
113 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -4,8 +4,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 4 | 4 | 'focaModalService', 'notaPedidoBusinessService', '$rootScope', 'focaSeguimientoService', |
| 5 | 5 | function( |
| 6 | 6 | $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService, |
| 7 | - notaPedidoBusinessService, $rootScope, focaSeguimientoService | |
| 8 | - ) { | |
| 7 | + notaPedidoBusinessService, $rootScope, focaSeguimientoService) | |
| 8 | + { | |
| 9 | 9 | $scope.botonera = [ |
| 10 | 10 | {texto: 'Vendedor', accion: function() { |
| 11 | 11 | validarNotaRemitada($scope.seleccionarVendedor);}}, |
| ... | ... | @@ -61,8 +61,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 61 | 61 | $scope.comprobante = '00000000'; |
| 62 | 62 | $scope.articulosTabla = []; |
| 63 | 63 | $scope.idLista = undefined; |
| 64 | - //La pantalla solo se usa para cargar pedidos | |
| 65 | - //var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | |
| 66 | 64 | |
| 67 | 65 | crearNotaPedidoService.getPrecioCondicion().then( |
| 68 | 66 | function(res) { |
| ... | ... | @@ -80,45 +78,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 80 | 78 | console.info(err); |
| 81 | 79 | } |
| 82 | 80 | ); |
| 83 | - //La pantalla solo se usa para cargar pedidos | |
| 84 | - // if (notaPedidoTemp !== undefined) { | |
| 85 | - // notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); | |
| 86 | - // $scope.notaPedido = notaPedidoTemp; | |
| 87 | - // $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); | |
| 88 | - // $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); | |
| 89 | - // $scope.idLista = $scope.notaPedido.precioCondicion; | |
| 90 | - // crearNotaPedidoService | |
| 91 | - // .getArticulosByIdNotaPedido($scope.notaPedido.id).then( | |
| 92 | - // function(res) { | |
| 93 | - // $scope.articulosTabla = res.data; | |
| 94 | - // } | |
| 95 | - // ); | |
| 96 | - //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO | |
| 97 | - //(NO REQUERIDO EN ESTA VERSION) | |
| 98 | - // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( | |
| 99 | - // function(res) { | |
| 100 | - // $scope.notaPedido.domicilio = res.data; | |
| 101 | - // } | |
| 102 | - // ); | |
| 103 | - // } else { | |
| 104 | - // $scope.notaPedido.fechaCarga = new Date(); | |
| 105 | - // $scope.notaPedido.bomba = '0'; | |
| 106 | - // $scope.notaPedido.flete = '0'; | |
| 107 | - // $scope.idLista = undefined; | |
| 108 | - // } | |
| 109 | - //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO | |
| 110 | - // $scope.addNewDom = function() { | |
| 111 | - // $scope.notaPedido.domicilio.push({ 'id': 0 }); | |
| 112 | - // }; | |
| 113 | - // $scope.removeNewChoice = function(choice) { | |
| 114 | - // if ($scope.notaPedido.domicilio.length > 1) { | |
| 115 | - // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( | |
| 116 | - // function(c) { | |
| 117 | - // return c.$$hashKey === choice.$$hashKey; | |
| 118 | - // } | |
| 119 | - // ), 1); | |
| 120 | - // } | |
| 121 | - // }; | |
| 122 | 81 | |
| 123 | 82 | $scope.crearNotaPedido = function() { |
| 124 | 83 | if(!$scope.notaPedido.vendedor.CodVen) { |
| ... | ... | @@ -250,9 +209,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 250 | 209 | $scope.now = new Date(notaPedido.fechaCarga); |
| 251 | 210 | //añado cabeceras |
| 252 | 211 | $scope.notaPedido.id = notaPedido.id; |
| 253 | - removeCabecera('Moneda:'); | |
| 254 | - removeCabecera('Fecha cotizacion:'); | |
| 255 | - removeCabecera('Cotizacion:'); | |
| 212 | + removeCabecera('Bomba:'); | |
| 213 | + removeCabecera('Kilometros:'); | |
| 256 | 214 | var cabeceras = [ |
| 257 | 215 | { |
| 258 | 216 | label: 'Moneda:', |
| ... | ... | @@ -284,16 +242,17 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 284 | 242 | valor: notaPedido.proveedor[0].NOM |
| 285 | 243 | }, |
| 286 | 244 | { |
| 245 | + label: 'Precio condicion:', | |
| 246 | + valor: valorPrecioCondicion() + ' ' + | |
| 247 | + notaPedidoBusinessService.plazoToString(notaPedido.plazoPago) | |
| 248 | + }, | |
| 249 | + { | |
| 287 | 250 | label: 'Flete:', |
| 288 | 251 | valor: notaPedido.fob === 1 ? 'FOB' : ( |
| 289 | 252 | notaPedido.flete === 1 ? 'Si' : 'No') |
| 290 | - }, | |
| 291 | - { | |
| 292 | - label: 'Precio condicion:', | |
| 293 | - valor: valorPrecioCondicion() | |
| 294 | 253 | } |
| 295 | 254 | ]; |
| 296 | - //TODO MOSTRAR PLAZOS | |
| 255 | + | |
| 297 | 256 | function valorPrecioCondicion() { |
| 298 | 257 | if(notaPedido.idPrecioCondicion > 0) { |
| 299 | 258 | return notaPedido.precioCondicion[0].nombre; |
| ... | ... | @@ -304,12 +263,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 304 | 263 | |
| 305 | 264 | if(notaPedido.flete === 1) { |
| 306 | 265 | var cabeceraBomba = { |
| 307 | - label: 'Bomba', | |
| 266 | + label: 'Bomba:', | |
| 308 | 267 | valor: notaPedido.bomba === 1 ? 'Si' : 'No' |
| 309 | 268 | }; |
| 310 | 269 | if(notaPedido.kilometros) { |
| 311 | 270 | var cabeceraKilometros = { |
| 312 | - label: 'Kilometros', | |
| 271 | + label: 'Kilometros:', | |
| 313 | 272 | valor: notaPedido.kilometros |
| 314 | 273 | }; |
| 315 | 274 | cabeceras.push(cabeceraKilometros); |
| ... | ... | @@ -685,28 +644,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 685 | 644 | } |
| 686 | 645 | }; |
| 687 | 646 | |
| 688 | - $scope.limpiarFlete = function() { | |
| 689 | - $scope.notaPedido.fleteNombre = ''; | |
| 690 | - $scope.notaPedido.chofer = ''; | |
| 691 | - $scope.notaPedido.vehiculo = ''; | |
| 692 | - $scope.notaPedido.kilometros = ''; | |
| 693 | - $scope.notaPedido.costoUnitarioKmFlete = ''; | |
| 694 | - $scope.choferes = ''; | |
| 695 | - $scope.vehiculos = ''; | |
| 696 | - }; | |
| 697 | - | |
| 698 | - $scope.limpiarPantalla = function() { | |
| 699 | - $scope.limpiarFlete(); | |
| 700 | - $scope.notaPedido.flete = '0'; | |
| 701 | - $scope.notaPedido.bomba = '0'; | |
| 702 | - $scope.notaPedido.precioCondicion = ''; | |
| 703 | - $scope.articulosTabla = []; | |
| 704 | - $scope.notaPedido.vendedor.nombre = ''; | |
| 705 | - $scope.notaPedido.cliente = {nombre: ''}; | |
| 706 | - $scope.notaPedido.domicilio = {dom: ''}; | |
| 707 | - $scope.domiciliosCliente = []; | |
| 708 | - }; | |
| 709 | - | |
| 710 | 647 | $scope.resetFilter = function() { |
| 711 | 648 | $scope.articuloACargar = {}; |
| 712 | 649 | $scope.cargando = true; |
| ... | ... | @@ -777,41 +714,4 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 777 | 714 | } |
| 778 | 715 | } |
| 779 | 716 | } |
| 780 | - ] | |
| 781 | -) | |
| 782 | -.controller('notaPedidoListaCtrl', [ | |
| 783 | - '$scope', | |
| 784 | - 'crearNotaPedidoService', | |
| 785 | - '$location', | |
| 786 | - function($scope, crearNotaPedidoService, $location) { | |
| 787 | - crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | |
| 788 | - $scope.notaPedidos = datos.data; | |
| 789 | - }); | |
| 790 | - $scope.editar = function(notaPedido) { | |
| 791 | - crearNotaPedidoService.setNotaPedido(notaPedido); | |
| 792 | - $location.path('/venta-nota-pedido/abm/'); | |
| 793 | - }; | |
| 794 | - $scope.crearPedido = function() { | |
| 795 | - crearNotaPedidoService.clearNotaPedido(); | |
| 796 | - $location.path('/venta-nota-pedido/abm/'); | |
| 797 | - }; | |
| 798 | - } | |
| 799 | -]) | |
| 800 | -.controller('focaCrearNotaPedidoFichaClienteController', [ | |
| 801 | - '$scope', | |
| 802 | - 'crearNotaPedidoService', | |
| 803 | - '$location', | |
| 804 | - function($scope, crearNotaPedidoService, $location) { | |
| 805 | - crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | |
| 806 | - $scope.notaPedidos = datos.data; | |
| 807 | - }); | |
| 808 | - $scope.editar = function(notaPedido) { | |
| 809 | - crearNotaPedidoService.setNotaPedido(notaPedido); | |
| 810 | - $location.path('/venta-nota-pedido/abm/'); | |
| 811 | - }; | |
| 812 | - $scope.crearPedido = function() { | |
| 813 | - crearNotaPedidoService.clearNotaPedido(); | |
| 814 | - $location.path('/venta-nota-pedido/abm/'); | |
| 815 | - }; | |
| 816 | - } | |
| 817 | -]); | |
| 717 | + ]); |