Commit 52cbcf74026cddf57c518ef782dcaa7b6d2d8d1e
1 parent
f2a2f73568
Exists in
master
boton pausar funcionando
Showing
3 changed files
with
126 additions
and
108 deletions
Show diff stats
src/js/controller.js
| 1 | angular.module('focaCrearCobranza') .controller('cobranzaController', | 1 | angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 2 | [ | 2 | [ |
| 3 | '$scope', '$timeout', '$uibModal', '$location', | 3 | '$scope', '$timeout', '$uibModal', '$location', |
| 4 | 'focaCrearCobranzaService', 'focaModalService', '$filter', 'focaSeguimientoService', | 4 | 'focaCrearCobranzaService', 'focaModalService', '$filter', 'focaSeguimientoService', |
| 5 | 'focaBotoneraLateralService', 'APP', 'focaLoginService', | 5 | 'focaBotoneraLateralService', 'APP', 'focaLoginService', '$localStorage', |
| 6 | function($scope, $timeout, $uibModal, $location, focaCrearCobranzaService, | 6 | function($scope, $timeout, $uibModal, $location, focaCrearCobranzaService, |
| 7 | focaModalService, $filter, focaSeguimientoService, focaBotoneraLateralService, | 7 | focaModalService, $filter, focaSeguimientoService, focaBotoneraLateralService, |
| 8 | APP, loginService) | 8 | APP, loginService, $localStorage) |
| 9 | { | 9 | { |
| 10 | config(); | 10 | config(); |
| 11 | 11 | ||
| 12 | function config() { | 12 | function config() { |
| 13 | $scope.datepickerAbierto = false; | 13 | $scope.datepickerAbierto = false; |
| 14 | $scope.cobroDeuda = true; | 14 | $scope.cobroDeuda = true; |
| 15 | $scope.show = false; | 15 | $scope.show = false; |
| 16 | $scope.cargando = true; | 16 | $scope.cargando = true; |
| 17 | $scope.fecha = new Date(); | ||
| 18 | $scope.puntoVenta = $filter('rellenarDigitos')(0, 4); | 17 | $scope.puntoVenta = $filter('rellenarDigitos')(0, 4); |
| 19 | $scope.comprobante = $filter('rellenarDigitos')(0, 8); | 18 | $scope.comprobante = $filter('rellenarDigitos')(0, 8); |
| 20 | 19 | ||
| 21 | $scope.dateOptions = { | 20 | $scope.dateOptions = { |
| 22 | maxDate: new Date(), | 21 | maxDate: new Date(), |
| 23 | minDate: new Date(2010, 0, 1) | 22 | minDate: new Date(2010, 0, 1) |
| 24 | }; | 23 | }; |
| 25 | 24 | ||
| 26 | var monedaPorDefecto; | 25 | var monedaPorDefecto; |
| 27 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' | 26 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' |
| 28 | focaCrearCobranzaService.getCotizacionByIdMoneda(1).then(function(res) { | 27 | focaCrearCobranzaService.getCotizacionByIdMoneda(1).then(function(res) { |
| 29 | monedaPorDefecto = res.data[0]; | 28 | monedaPorDefecto = res.data[0]; |
| 30 | 29 | ||
| 31 | $scope.cobranza.moneda = monedaPorDefecto; | 30 | $scope.cobranza.cotizacion = Object.assign( |
| 32 | $scope.inicial.cobranza.moneda = $scope.cobranza.moneda; | 31 | {moneda: monedaPorDefecto}, monedaPorDefecto.cotizaciones[0] |
| 32 | ); | ||
| 33 | 33 | ||
| 34 | $scope.cobranza.cotizacion = monedaPorDefecto.cotizaciones[0]; | 34 | $scope.inicial.cotizacion = $scope.cobranza.cotizacion; |
| 35 | $scope.inicial.cobranza.cotizacion = $scope.cobranza.cotizacion; | ||
| 36 | }); | 35 | }); |
| 37 | 36 | ||
| 38 | $timeout(function() { | 37 | $timeout(function() { |
| 39 | focaBotoneraLateralService.showSalir(false); | 38 | focaBotoneraLateralService.showSalir(false); |
| 40 | focaBotoneraLateralService.showPausar(true); | 39 | focaBotoneraLateralService.showPausar(true); |
| 41 | focaBotoneraLateralService.showGuardar(true, $scope.crearCobranza); | 40 | focaBotoneraLateralService.showGuardar(true, $scope.crearCobranza); |
| 42 | focaBotoneraLateralService.addCustomButton('Salir', salir); | 41 | focaBotoneraLateralService.addCustomButton('Salir', salir); |
| 43 | }); | 42 | }); |
| 44 | 43 | ||
| 45 | if (APP === 'cobranza') { | 44 | if (APP === 'cobranza') { |
| 46 | $scope.idCobrador = loginService.getLoginData().vendedorCobrador; | 45 | $scope.idCobrador = loginService.getLoginData().vendedorCobrador; |
| 47 | $scope.botonera = focaCrearCobranzaService.getBotonera($scope.idCobrador); | 46 | $scope.botonera = focaCrearCobranzaService.getBotonera($scope.idCobrador); |
| 48 | } else { | 47 | } else { |
| 49 | $scope.botonera = focaCrearCobranzaService.getBotonera(); | 48 | $scope.botonera = focaCrearCobranzaService.getBotonera(); |
| 50 | } | 49 | } |
| 51 | 50 | ||
| 52 | init(); | 51 | init(); |
| 52 | $timeout(function() {getLSCobranza();}); | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | function init() { | 55 | function init() { |
| 56 | $scope.$broadcast('cleanCabecera'); | 56 | $scope.$broadcast('cleanCabecera'); |
| 57 | 57 | ||
| 58 | $scope.cobranza = {}; | 58 | $scope.cobranza = { |
| 59 | $scope.facturaTabla = []; | 59 | fecha: new Date() |
| 60 | $scope.cobrosTabla = []; | 60 | }; |
| 61 | 61 | $scope.cobranza.facturas = []; | |
| 62 | $scope.cobranza.cobros = []; | ||
| 63 | |||
| 62 | if (APP === 'cobranza') { | 64 | if (APP === 'cobranza') { |
| 63 | focaCrearCobranzaService.getCobradorById($scope.idCobrador).then( | 65 | focaCrearCobranzaService.getCobradorById($scope.idCobrador).then( |
| 64 | function(res) { | 66 | function(res) { |
| 65 | var cobrador = res.data; | 67 | var cobrador = res.data; |
| 66 | 68 | ||
| 67 | $scope.$broadcast('addCabecera', { | 69 | $scope.$broadcast('addCabecera', { |
| 68 | label: 'Cobrador:', | 70 | label: 'Cobrador:', |
| 69 | valor: $filter('rellenarDigitos')(cobrador.NUM, 3) + ' - ' + | 71 | valor: $filter('rellenarDigitos')(cobrador.NUM, 3) + ' - ' + |
| 70 | cobrador.NOM | 72 | cobrador.NOM |
| 71 | }); | 73 | }); |
| 72 | 74 | ||
| 73 | $scope.cobranza.cobrador = cobrador; | 75 | $scope.cobranza.cobrador = cobrador; |
| 74 | $scope.inicial.cobranza.cobrador = $scope.cobranza.cobrador; | 76 | $scope.inicial.cobranza.cobrador = $scope.cobranza.cobrador; |
| 75 | } | 77 | } |
| 76 | ); | 78 | ); |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 79 | $scope.inicial = { | 81 | $scope.inicial = angular.copy($scope.cobranza); |
| 80 | cobranza: angular.copy($scope.cobranza), | ||
| 81 | facturaTabla: angular.copy($scope.facturaTabla), | ||
| 82 | cobrosTabla: angular.copy($scope.cobrosTabla) | ||
| 83 | }; | ||
| 84 | 82 | ||
| 85 | focaCrearCobranzaService.getNumeroRecibo().then( | 83 | focaCrearCobranzaService.getNumeroRecibo().then( |
| 86 | function(res) { | 84 | function(res) { |
| 87 | $scope.puntoVenta = $filter('rellenarDigitos')( | 85 | $scope.puntoVenta = $filter('rellenarDigitos')( |
| 88 | res.data.sucursal, 4 | 86 | res.data.sucursal, 4 |
| 89 | ); | 87 | ); |
| 90 | 88 | ||
| 91 | $scope.comprobante = $filter('rellenarDigitos')( | 89 | $scope.comprobante = $filter('rellenarDigitos')( |
| 92 | res.data.numeroRecibo, 8 | 90 | res.data.numeroRecibo, 8 |
| 93 | ); | 91 | ); |
| 94 | }, | 92 | }, |
| 95 | function(err) { | 93 | function(err) { |
| 96 | focaModalService.alert( | 94 | focaModalService.alert( |
| 97 | 'La terminal no esta configurada correctamente' | 95 | 'La terminal no esta configurada correctamente' |
| 98 | ); | 96 | ); |
| 99 | console.info(err); | 97 | console.info(err); |
| 100 | } | 98 | } |
| 101 | ); | 99 | ); |
| 102 | } | 100 | } |
| 103 | 101 | ||
| 102 | $scope.$watch('cobranza', function(newValue) { | ||
| 103 | focaBotoneraLateralService.setPausarData({ | ||
| 104 | label: 'cobranza', | ||
| 105 | val: newValue | ||
| 106 | }); | ||
| 107 | }, true); | ||
| 108 | |||
| 104 | $scope.crearCobranza = function() { | 109 | $scope.crearCobranza = function() { |
| 105 | if(!$scope.cobranza.cliente) { | 110 | if(!$scope.cobranza.cliente) { |
| 106 | focaModalService.alert('Ingrese Cliente'); | 111 | focaModalService.alert('Ingrese Cliente'); |
| 107 | return; | 112 | return; |
| 108 | } | 113 | } |
| 109 | if(!$scope.cobranza.cobrador) { | 114 | if(!$scope.cobranza.cobrador) { |
| 110 | focaModalService.alert('Ingrese Cobrador'); | 115 | focaModalService.alert('Ingrese Cobrador'); |
| 111 | return; | 116 | return; |
| 112 | } | 117 | } |
| 113 | if($scope.facturaTabla.length < 1) { | 118 | if($scope.cobranza.facturas.length < 1) { |
| 114 | focaModalService.alert('Ingrese al menos una factura'); | 119 | focaModalService.alert('Ingrese al menos una factura'); |
| 115 | return; | 120 | return; |
| 116 | } | 121 | } |
| 117 | if($scope.getTotalCobrado() + $scope.getTotalDeuda() !== 0) { | 122 | if($scope.getTotalCobrado() + $scope.getTotalDeuda() !== 0) { |
| 118 | focaModalService.alert('La diferencia debe ser ' + | 123 | focaModalService.alert('La diferencia debe ser ' + |
| 119 | $scope.cobranza.moneda.SIMBOLO + '0,00'); | 124 | $scope.cobranza.moneda.SIMBOLO + '0,00'); |
| 120 | return; | 125 | return; |
| 121 | } | 126 | } |
| 122 | 127 | ||
| 123 | var cobranza = {}; | 128 | var cobranza = {}; |
| 124 | var cheques = []; | 129 | var cheques = []; |
| 125 | var cuerpos = []; | 130 | var cuerpos = []; |
| 126 | var imgs = []; | 131 | var imgs = []; |
| 127 | var observacion; | 132 | var observacion; |
| 128 | //TODO: habilitar edición | 133 | //TODO: habilitar edición |
| 129 | $scope.editando = false; | 134 | $scope.editando = false; |
| 130 | focaBotoneraLateralService.startGuardar(); | 135 | focaBotoneraLateralService.startGuardar(); |
| 131 | $scope.saveLoading = true; | 136 | $scope.saveLoading = true; |
| 132 | for(var i = 0; i < $scope.facturaTabla.length; i++) { | 137 | for(var i = 0; i < $scope.cobranza.facturas.length; i++) { |
| 133 | var cuerpoFactura = { | 138 | var cuerpoFactura = { |
| 134 | CYV: 'V', | 139 | CYV: 'V', |
| 135 | TIP: 'C', | 140 | TIP: 'C', |
| 136 | TCO: 'RC', | 141 | TCO: 'RC', |
| 137 | PVE: $scope.puntoVenta, | 142 | PVE: $scope.puntoVenta, |
| 138 | NCO: $scope.comprobante, | 143 | NCO: $scope.comprobante, |
| 139 | LOP: 'L', | 144 | LOP: 'L', |
| 140 | TIL: $scope.facturaTabla[i].TCO, | 145 | TIL: $scope.cobranza.facturas[i].TCO, |
| 141 | COM: $scope.facturaTabla[i].numeroFactura + '-' + | 146 | COM: $scope.cobranza.facturas[i].numeroFactura + '-' + |
| 142 | $filter('rellenarDigitos')($scope.facturaTabla[i].NCU,2), | 147 | $filter('rellenarDigitos')($scope.cobranza.facturas[i].NCU,2), |
| 143 | FEC: $scope.fecha.toISOString().slice(0, 19).replace('T', ' '), | 148 | FEC: new Date($scope.cobranza.fecha) |
| 144 | IMP: Math.abs($scope.facturaTabla[i].IPA), | 149 | .toISOString().slice(0, 19).replace('T', ' '), |
| 150 | IMP: Math.abs($scope.cobranza.facturas[i].IPA), | ||
| 145 | RES: 0,//caja de tesorería | 151 | RES: 0,//caja de tesorería |
| 146 | SUBM: 0, | 152 | SUBM: 0, |
| 147 | NCU: $scope.facturaTabla[i].NCU | 153 | NCU: $scope.cobranza.facturas[i].NCU |
| 148 | }; | 154 | }; |
| 149 | cuerpos.push(cuerpoFactura); | 155 | cuerpos.push(cuerpoFactura); |
| 150 | 156 | ||
| 151 | } | 157 | } |
| 152 | 158 | ||
| 153 | for (var j = 0; j < $scope.cobrosTabla.length; j++) { | 159 | for (var j = 0; j < $scope.cobranza.cobros.length; j++) { |
| 154 | 160 | ||
| 155 | var efectivo = $scope.cobrosTabla[j].tipo === 'Efectivo'; | 161 | var efectivo = $scope.cobranza.cobros[j].tipo === 'Efectivo'; |
| 156 | var cuerpoCobros = { | 162 | var cuerpoCobros = { |
| 157 | CYV: 'V', | 163 | CYV: 'V', |
| 158 | TIP: 'C', | 164 | TIP: 'C', |
| 159 | TCO: 'RC', | 165 | TCO: 'RC', |
| 160 | PVE: $scope.puntoVenta, | 166 | PVE: $scope.puntoVenta, |
| 161 | NCO: $scope.comprobante, | 167 | NCO: $scope.comprobante, |
| 162 | LOP: 'P', | 168 | LOP: 'P', |
| 163 | TIL: $scope.cobrosTabla[j].til, | 169 | TIL: $scope.cobranza.cobros[j].til, |
| 164 | COM: efectivo ? 'ef(COBRO EN EFECTIVO)' : $scope.cobrosTabla[j].tipo, | 170 | COM: efectivo ? 'ef(COBRO EN EFECTIVO)' : $scope.cobranza.cobros[j].tipo, |
| 165 | FEC: !$scope.cobrosTabla[j].fechaPresentacion ? | 171 | FEC: !$scope.cobranza.cobros[j].fechaPresentacion ? |
| 166 | $scope.cobrosTabla[j].fecha | 172 | new Date($scope.cobranza.cobros[j].fecha) |
| 167 | .toISOString().slice(0, 19).replace('T', ' ') : | 173 | .toISOString().slice(0, 19).replace('T', ' ') : |
| 168 | $scope.cobrosTabla[j].fechaPresentacion | 174 | new Date($scope.cobranza.cobros[j].fechaPresentacion) |
| 169 | .toISOString().slice(0, 19).replace('T', ' '), | 175 | .toISOString().slice(0, 19).replace('T', ' '), |
| 170 | IMP: Math.abs($scope.cobrosTabla[j].importe), | 176 | IMP: Math.abs($scope.cobranza.cobros[j].importe), |
| 171 | RES: 0,//caja de tesorería | 177 | RES: 0,//caja de tesorería |
| 172 | SUBM: 0 | 178 | SUBM: 0 |
| 173 | }; | 179 | }; |
| 174 | cuerpos.push(cuerpoCobros); | 180 | cuerpos.push(cuerpoCobros); |
| 175 | 181 | ||
| 176 | if($scope.cobrosTabla[j].observacion) | 182 | if($scope.cobranza.cobros[j].observacion) |
| 177 | observacion = $scope.cobrosTabla[j].observacion; | 183 | observacion = $scope.cobranza.cobros[j].observacion; |
| 178 | 184 | ||
| 179 | if($scope.cobrosTabla[j].banco) { | 185 | if($scope.cobranza.cobros[j].banco) { |
| 180 | var cheque = { | 186 | var cheque = { |
| 181 | BCO: $scope.cobrosTabla[j].banco.ID, | 187 | BCO: $scope.cobranza.cobros[j].banco.ID, |
| 182 | NUM: $scope.comprobante, | 188 | NUM: $scope.comprobante, |
| 183 | FEP: $scope.cobrosTabla[j].fechaPresentacion | 189 | FEP: new Date($scope.cobranza.cobros[j].fechaPresentacion) |
| 184 | .toISOString().slice(0, 19).replace('T', ' '), | 190 | .toISOString().slice(0, 19).replace('T', ' '), |
| 185 | FEE: $scope.cobrosTabla[j].fechaEmision | 191 | FEE: new Date($scope.cobranza.cobros[j].fechaEmision) |
| 186 | .toISOString().slice(0, 19).replace('T', ' '), | 192 | .toISOString().slice(0, 19).replace('T', ' '), |
| 187 | LUG: $scope.cobrosTabla[j].localidad.NOMBRE, | 193 | LUG: $scope.cobranza.cobros[j].localidad.NOMBRE, |
| 188 | IMP: $scope.cobrosTabla[j].importe, | 194 | IMP: $scope.cobranza.cobros[j].importe, |
| 189 | LIB: $scope.cobrosTabla[j].librador, | 195 | LIB: $scope.cobranza.cobros[j].librador, |
| 190 | EST: 'C',//'D' depositado, 'E' entregado, 'C' en cartera | 196 | EST: 'C',//'D' depositado, 'E' entregado, 'C' en cartera |
| 191 | PCI: $scope.cobrosTabla[j].provincia.ID, | 197 | PCI: $scope.cobranza.cobros[j].provincia.ID, |
| 192 | LPLA: 0, | 198 | LPLA: 0, |
| 193 | PLA: 0, | 199 | PLA: 0, |
| 194 | VEN: $scope.cobranza.cobrador.id,//Id vendedor | 200 | VEN: $scope.cobranza.cobrador.id,//Id vendedor |
| 195 | CCLIE: $scope.cobranza.cliente.COD,//Id cliente | 201 | CCLIE: $scope.cobranza.cliente.COD,//Id cliente |
| 196 | REN: 0, | 202 | REN: 0, |
| 197 | PVEC: $scope.puntoVenta, | 203 | PVEC: $scope.puntoVenta, |
| 198 | NCOC: $scope.comprobante, | 204 | NCOC: $scope.comprobante, |
| 199 | OBSE: $scope.cobrosTabla[j].observaciones, | 205 | OBSE: $scope.cobranza.cobros[j].observaciones, |
| 200 | LUV: 0, | 206 | LUV: 0, |
| 201 | ORI: 've', | 207 | ORI: 've', |
| 202 | FER: '', | 208 | FER: '', |
| 203 | BIMP: 0, | 209 | BIMP: 0, |
| 204 | COMP: 'C ' +'RC ' + $scope.puntoVenta + '-' + $scope.comprobante, | 210 | COMP: 'C ' +'RC ' + $scope.puntoVenta + '-' + $scope.comprobante, |
| 205 | VAL_E: '',//Cuando egresa por ingresos y egresos en el numero de egreso | 211 | VAL_E: '',//Cuando egresa por ingresos y egresos en el numero de egreso |
| 206 | VAL_I: '',//Cuando Ingresa por ingresos y egresos en el numero ingreso | 212 | VAL_I: '',//Cuando Ingresa por ingresos y egresos en el numero ingreso |
| 207 | REC_CAJ: 'D', | 213 | REC_CAJ: 'D', |
| 208 | TIPO_C: 0,//?? | 214 | TIPO_C: 0,//?? |
| 209 | SALDO_CAJ: 'S', | 215 | SALDO_CAJ: 'S', |
| 210 | FECHA_INGRESO: $scope.fecha | 216 | FECHA_INGRESO: new Date($scope.cobranza.fecha) |
| 211 | .toISOString().slice(0, 19).replace('T', ' '), | 217 | .toISOString().slice(0, 19).replace('T', ' '), |
| 212 | Vendedor_valor: 0, | 218 | Vendedor_valor: 0, |
| 213 | FAMILIA: 0, | 219 | FAMILIA: 0, |
| 214 | CUIT_LIB: '', | 220 | CUIT_LIB: '', |
| 215 | COD_LUG: $scope.cobrosTabla[j].localidad.ID,//código lugar | 221 | COD_LUG: $scope.cobranza.cobros[j].localidad.ID,//código lugar |
| 216 | SEN: '', | 222 | SEN: '', |
| 217 | NRC: 0, | 223 | NRC: 0, |
| 218 | COD_LARGO: '', | 224 | COD_LARGO: '', |
| 219 | VN: 0, | 225 | VN: 0, |
| 220 | ID_LECTOR: 0, | 226 | ID_LECTOR: 0, |
| 221 | NATHB: '' | 227 | NATHB: '' |
| 222 | }; | 228 | }; |
| 223 | cheques.push(cheque); | 229 | cheques.push(cheque); |
| 224 | } | 230 | } |
| 225 | if ($scope.cobrosTabla[j].imgs) imgs = $scope.cobrosTabla[j].imgs; | 231 | if ($scope.cobranza.cobros[j].imgs) imgs = $scope.cobranza.cobros[j].imgs; |
| 226 | 232 | ||
| 227 | } | 233 | } |
| 228 | 234 | ||
| 229 | cobranza = { | 235 | cobranza = { |
| 230 | recibo: { | 236 | recibo: { |
| 231 | CYV: 'V', | 237 | CYV: 'V', |
| 232 | TIP: 'C', | 238 | TIP: 'C', |
| 233 | TCO: 'RC', | 239 | TCO: 'RC', |
| 234 | PVE: $scope.puntoVenta, //Sucursar, punto de venta | 240 | PVE: $scope.puntoVenta, //Sucursar, punto de venta |
| 235 | NCO: $scope.comprobante, //Numero de comprobante | 241 | NCO: $scope.comprobante, //Numero de comprobante |
| 236 | FEC: $scope.fecha.toISOString().slice(0, 19).replace('T', ' '), | 242 | FEC: new Date($scope.cobranza.fecha) |
| 243 | .toISOString().slice(0, 19).replace('T', ' '), | ||
| 237 | CLI: $scope.cobranza.cliente.COD, | 244 | CLI: $scope.cobranza.cliente.COD, |
| 238 | ATO: 0, //número de asiento | 245 | ATO: 0, //número de asiento |
| 239 | CFE: $scope.cobranza.cobrador.NOM, | 246 | CFE: $scope.cobranza.cobrador.NOM, |
| 240 | PLA: '',//Numero de planilla, sin uso | 247 | PLA: '',//Numero de planilla, sin uso |
| 241 | ID_MONEDA: $scope.cobranza.moneda.ID, | 248 | ID_MONEDA: $scope.cobranza.moneda.ID, |
| 242 | COTIZACION: $scope.cobranza.cotizacion.VENDEDOR, | 249 | COTIZACION: $scope.cobranza.cotizacion.VENDEDOR, |
| 243 | idCobrador: $scope.cobranza.cobrador.id | 250 | idCobrador: $scope.cobranza.cobrador.id |
| 244 | }, | 251 | }, |
| 245 | cuerpo: cuerpos, | 252 | cuerpo: cuerpos, |
| 246 | cheques: cheques, | 253 | cheques: cheques, |
| 247 | acobypag: { | 254 | acobypag: { |
| 248 | CYV: 'V', | 255 | CYV: 'V', |
| 249 | COD: $scope.cobranza.cliente.COD, | 256 | COD: $scope.cobranza.cliente.COD, |
| 250 | FEP: $scope.fecha.toISOString().slice(0, 19).replace('T', ' '), | 257 | FEP: new Date($scope.cobranza.fecha) |
| 258 | .toISOString().slice(0, 19).replace('T', ' '), | ||
| 251 | TIP: 'C', | 259 | TIP: 'C', |
| 252 | TCO: 'RC', | 260 | TCO: 'RC', |
| 253 | SUC: $scope.puntoVenta, | 261 | SUC: $scope.puntoVenta, |
| 254 | NCO: $scope.comprobante, | 262 | NCO: $scope.comprobante, |
| 255 | IPA: $scope.getTotalCobrado(), | 263 | IPA: $scope.getTotalCobrado(), |
| 256 | SAL: '',//?? | 264 | SAL: '',//?? |
| 257 | TCA: 1, | 265 | TCA: 1, |
| 258 | ZONA: 1, | 266 | ZONA: 1, |
| 259 | FPA: 2,//Forma de pago | 267 | FPA: 2,//Forma de pago |
| 260 | REC: 0, | 268 | REC: 0, |
| 261 | REP: 0, | 269 | REP: 0, |
| 262 | FER: null, | 270 | FER: null, |
| 263 | REM: 0, | 271 | REM: 0, |
| 264 | FRE: null,//?? | 272 | FRE: null,//?? |
| 265 | PRO: 'N', | 273 | PRO: 'N', |
| 266 | FEV: $scope.fecha.toISOString().slice(0, 19).replace('T', ' ') | 274 | FEV: new Date($scope.cobranza.fecha) |
| 275 | .toISOString().slice(0, 19).replace('T', ' ') | ||
| 267 | }, | 276 | }, |
| 268 | datosCobrador: { | 277 | datosCobrador: { |
| 269 | COD: $scope.cobranza.cobrador.NUM, | 278 | COD: $scope.cobranza.cobrador.NUM, |
| 270 | PVE: $scope.puntoVenta, | 279 | PVE: $scope.puntoVenta, |
| 271 | NUM: $scope.comprobante, | 280 | NUM: $scope.comprobante, |
| 272 | EST: 'C', | 281 | EST: 'C', |
| 273 | OBS: 'RC: ' + $scope.comprobante + '-' + $scope.fecha.toLocaleDateString(), | 282 | OBS: 'RC: ' + $scope.comprobante + '-' + |
| 283 | new Date($scope.cobranza.fecha).toLocaleDateString(), | ||
| 274 | DAT1: 'C', | 284 | DAT1: 'C', |
| 275 | CLI: $scope.cobranza.cliente.COD | 285 | CLI: $scope.cobranza.cliente.COD |
| 276 | }, | 286 | }, |
| 277 | cliente: $scope.cobranza.cliente, | 287 | cliente: $scope.cobranza.cliente, |
| 278 | imgs: imgs, | 288 | imgs: imgs, |
| 279 | observacion: observacion | 289 | observacion: observacion |
| 280 | }; | 290 | }; |
| 281 | //COPIO cobranzaMail Y A cobranza LE ELIMINO EL VALOR NCU DE LOS CUERPOS | 291 | //COPIO cobranzaMail Y A cobranza LE ELIMINO EL VALOR NCU DE LOS CUERPOS |
| 282 | var cobranzaMail = angular.copy(cobranza); | 292 | var cobranzaMail = angular.copy(cobranza); |
| 283 | cobranza.cuerpo = cobranza.cuerpo.map(function(c) { | 293 | cobranza.cuerpo = cobranza.cuerpo.map(function(c) { |
| 284 | if (c.NCU) delete c.NCU; | 294 | if (c.NCU) delete c.NCU; |
| 285 | return c; | 295 | return c; |
| 286 | }); | 296 | }); |
| 287 | 297 | ||
| 288 | focaCrearCobranzaService | 298 | focaCrearCobranzaService |
| 289 | .guardarCobranza(cobranza) | 299 | .guardarCobranza(cobranza) |
| 290 | .then( | 300 | .then( |
| 291 | function(result) { | 301 | function(result) { |
| 292 | var cliente = angular.copy($scope.cobranza.cliente); | 302 | var cliente = angular.copy($scope.cobranza.cliente); |
| 293 | focaBotoneraLateralService.endGuardar(true); | 303 | focaBotoneraLateralService.endGuardar(true); |
| 294 | $scope.saveLoading = false; | 304 | $scope.saveLoading = false; |
| 295 | 305 | ||
| 296 | focaModalService | 306 | focaModalService |
| 297 | .prompt('Ingrese los emails separados por coma para enviar comprobante', | 307 | .prompt('Ingrese los emails separados por coma para enviar comprobante', |
| 298 | cliente.MAIL) | 308 | cliente.MAIL) |
| 299 | .then(function(res) { | 309 | .then(function(res) { |
| 300 | return Promise.all([ | 310 | return Promise.all([ |
| 301 | focaCrearCobranzaService | 311 | focaCrearCobranzaService |
| 302 | .enviarComprobantePorMail(res, cobranzaMail), | 312 | .enviarComprobantePorMail(res, cobranzaMail), |
| 303 | focaCrearCobranzaService | 313 | focaCrearCobranzaService |
| 304 | .actualizarEmail(res, cliente.COD) | 314 | .actualizarEmail(res, cliente.COD) |
| 305 | ]); | 315 | ]); |
| 306 | }) | 316 | }) |
| 307 | .then(function() { | 317 | .then(function() { |
| 308 | focaModalService.alert('Mensaje enviado correctamente'); | 318 | focaModalService.alert('Mensaje enviado correctamente'); |
| 309 | }); | 319 | }); |
| 310 | 320 | ||
| 311 | focaSeguimientoService.guardarPosicion( | 321 | focaSeguimientoService.guardarPosicion( |
| 312 | 'Cobranza', | 322 | 'Cobranza', |
| 313 | result.data, | 323 | result.data, |
| 314 | '' | 324 | '' |
| 315 | ); | 325 | ); |
| 316 | 326 | ||
| 317 | init(); | 327 | init(); |
| 318 | }, function(error) { | 328 | }, function(error) { |
| 319 | focaModalService.alert('Hubo un problema al cargar la cobranza'); | 329 | focaModalService.alert('Hubo un problema al cargar la cobranza'); |
| 320 | focaBotoneraLateralService.endGuardar(); | 330 | focaBotoneraLateralService.endGuardar(); |
| 321 | $scope.saveLoading = false; | 331 | $scope.saveLoading = false; |
| 322 | console.info(error); | 332 | console.info(error); |
| 323 | } | 333 | } |
| 324 | ); | 334 | ); |
| 325 | }; | 335 | }; |
| 326 | 336 | ||
| 327 | $scope.seleccionarCobros = function() { | 337 | $scope.seleccionarCobros = function() { |
| 328 | $scope.cobroDeuda = false; | 338 | $scope.cobroDeuda = false; |
| 329 | }; | 339 | }; |
| 330 | 340 | ||
| 331 | $scope.seleccionarComprobantes = function() { | 341 | $scope.seleccionarComprobantes = function() { |
| 332 | $scope.cobroDeuda = true; | 342 | $scope.cobroDeuda = true; |
| 333 | }; | 343 | }; |
| 334 | 344 | ||
| 335 | $scope.seleccionarCobranza = function() { | 345 | $scope.seleccionarCobranza = function() { |
| 336 | 346 | ||
| 337 | var modalInstance = $uibModal.open( | 347 | var modalInstance = $uibModal.open( |
| 338 | { | 348 | { |
| 339 | ariaLabelledBy: 'Busqueda de Cobranzas', | 349 | ariaLabelledBy: 'Busqueda de Cobranzas', |
| 340 | templateUrl: 'foca-modal-cobranza.html', | 350 | templateUrl: 'foca-modal-cobranza.html', |
| 341 | controller: 'focaModalCobranzaController', | 351 | controller: 'focaModalCobranzaController', |
| 342 | size: 'lg' | 352 | size: 'lg' |
| 343 | } | 353 | } |
| 344 | ); | 354 | ); |
| 345 | modalInstance.result.then(function(cobranza) { | 355 | modalInstance.result.then(setearCobranza); |
| 346 | $scope.editando = true; | ||
| 347 | $scope.facturaTabla = []; | ||
| 348 | $scope.cobrosTabla = []; | ||
| 349 | $scope.$broadcast('cleanCabecera'); | ||
| 350 | |||
| 351 | $scope.fecha = new Date(cobranza.fecha); | ||
| 352 | |||
| 353 | $scope.$broadcast('addCabecera', { | ||
| 354 | label: 'Cliente:', | ||
| 355 | valor: $filter('rellenarDigitos')(cobranza.cliente.COD, 5) + ' - ' + | ||
| 356 | cobranza.cliente.NOM | ||
| 357 | }); | ||
| 358 | $scope.$broadcast('addCabecera', { | ||
| 359 | label: 'Cobrador:', | ||
| 360 | valor: cobranza.cobrador | ||
| 361 | //TODO: hacer la relación y traer el cobrador para poner su código | ||
| 362 | // valor: $filter('rellenarDigitos')(cobranza.cobrador.CodVen, 5) + ' - ' + | ||
| 363 | // cobranza.cobrador | ||
| 364 | }); | ||
| 365 | |||
| 366 | $scope.facturaTabla = cobranza.facturas; | ||
| 367 | $scope.cobrosTabla = cobranza.cobros; | ||
| 368 | }); | ||
| 369 | }; | 356 | }; |
| 370 | 357 | ||
| 371 | $scope.seleccionarCliente = function() { | 358 | $scope.seleccionarCliente = function() { |
| 372 | if(!$scope.cobranza.cobrador) { | 359 | if(!$scope.cobranza.cobrador) { |
| 373 | focaModalService.alert('Ingrese primero cobrador'); | 360 | focaModalService.alert('Ingrese primero cobrador'); |
| 374 | return; | 361 | return; |
| 375 | } | 362 | } |
| 376 | var modalInstance = $uibModal.open( | 363 | var modalInstance = $uibModal.open( |
| 377 | { | 364 | { |
| 378 | ariaLabelledBy: 'Busqueda de Cliente', | 365 | ariaLabelledBy: 'Busqueda de Cliente', |
| 379 | templateUrl: 'foca-busqueda-cliente-modal.html', | 366 | templateUrl: 'foca-busqueda-cliente-modal.html', |
| 380 | controller: 'focaBusquedaClienteModalController', | 367 | controller: 'focaBusquedaClienteModalController', |
| 381 | resolve: { | 368 | resolve: { |
| 382 | vendedor: function() { return null; } | 369 | vendedor: function() { return null; } |
| 383 | }, | 370 | }, |
| 384 | size: 'lg' | 371 | size: 'lg' |
| 385 | } | 372 | } |
| 386 | ); | 373 | ); |
| 387 | modalInstance.result.then( | 374 | modalInstance.result.then( |
| 388 | function(cliente) { | 375 | function(cliente) { |
| 389 | var clienteMayus = { | 376 | var clienteMayus = { |
| 390 | COD: cliente.cod, | 377 | COD: cliente.cod, |
| 391 | NOM: cliente.nom, | 378 | NOM: cliente.nom, |
| 392 | CUIT: cliente.cuit | 379 | CUIT: cliente.cuit |
| 393 | }; | 380 | }; |
| 394 | 381 | ||
| 395 | $scope.$broadcast('addCabecera', { | 382 | $scope.$broadcast('addCabecera', { |
| 396 | label: 'Cliente:', | 383 | label: 'Cliente:', |
| 397 | valor: $filter('rellenarDigitos')(clienteMayus.COD, 5) + ' - ' + | 384 | valor: $filter('rellenarDigitos')(clienteMayus.COD, 5) + ' - ' + |
| 398 | clienteMayus.NOM | 385 | clienteMayus.NOM |
| 399 | }); | 386 | }); |
| 400 | $scope.cobranza.cliente = clienteMayus; | 387 | $scope.cobranza.cliente = clienteMayus; |
| 401 | } | 388 | } |
| 402 | ); | 389 | ); |
| 403 | }; | 390 | }; |
| 404 | 391 | ||
| 405 | $scope.seleccionarFactura = function() { | 392 | $scope.seleccionarFactura = function() { |
| 406 | if(!$scope.cobranza.cliente) { | 393 | if(!$scope.cobranza.cliente) { |
| 407 | focaModalService.alert('Seleccione primero un cliente'); | 394 | focaModalService.alert('Seleccione primero un cliente'); |
| 408 | return; | 395 | return; |
| 409 | } | 396 | } |
| 410 | var modalInstance = $uibModal.open( | 397 | var modalInstance = $uibModal.open( |
| 411 | { | 398 | { |
| 412 | ariaLabelledBy: 'Busqueda de Facturas', | 399 | ariaLabelledBy: 'Busqueda de Facturas', |
| 413 | templateUrl: 'foca-modal-factura.html', | 400 | templateUrl: 'foca-modal-factura.html', |
| 414 | controller: 'focaModalFacturaController', | 401 | controller: 'focaModalFacturaController', |
| 415 | size: 'lg', | 402 | size: 'lg', |
| 416 | resolve: { | 403 | resolve: { |
| 417 | parametrosFactura: function() { | 404 | parametrosFactura: function() { |
| 418 | return { | 405 | return { |
| 419 | cliente: $scope.cobranza.cliente, | 406 | cliente: $scope.cobranza.cliente, |
| 420 | simbolo: $scope.cobranza.moneda.SIMBOLO, | 407 | simbolo: $scope.cobranza.moneda.SIMBOLO, |
| 421 | cotizacion: $scope.cobranza.cotizacion.VENDEDOR, | 408 | cotizacion: $scope.cobranza.cotizacion.VENDEDOR, |
| 422 | moneda: $scope.cobranza.moneda.ID | 409 | moneda: $scope.cobranza.moneda.ID |
| 423 | }; | 410 | }; |
| 424 | } | 411 | } |
| 425 | } | 412 | } |
| 426 | } | 413 | } |
| 427 | ); | 414 | ); |
| 428 | modalInstance.result.then( | 415 | modalInstance.result.then( |
| 429 | function(facturas) { | 416 | function(facturas) { |
| 430 | $scope.facturaTabla = $scope.facturaTabla.concat(facturas); | 417 | $scope.cobranza.facturas = $scope.cobranza.facturas.concat(facturas); |
| 431 | }, function() { | 418 | }, function() { |
| 432 | 419 | ||
| 433 | } | 420 | } |
| 434 | ); | 421 | ); |
| 435 | }; | 422 | }; |
| 436 | 423 | ||
| 437 | $scope.seleccionarCheque = function() { | 424 | $scope.seleccionarCheque = function() { |
| 438 | var modalInstance = $uibModal.open( | 425 | var modalInstance = $uibModal.open( |
| 439 | { | 426 | { |
| 440 | ariaLabelledBy: 'Carga de cheques', | 427 | ariaLabelledBy: 'Carga de cheques', |
| 441 | templateUrl: 'modal-cheque.html', | 428 | templateUrl: 'modal-cheque.html', |
| 442 | controller: 'focaModalChequeController', | 429 | controller: 'focaModalChequeController', |
| 443 | size: 'lg', | 430 | size: 'lg', |
| 444 | resolve: { | 431 | resolve: { |
| 445 | sugerido: function() { | 432 | sugerido: function() { |
| 446 | var sugerido = $scope.getTotalDeuda() + $scope.getTotalCobrado(); | 433 | var sugerido = $scope.getTotalDeuda() + $scope.getTotalCobrado(); |
| 447 | return sugerido < 0 ? sugerido : null; | 434 | return sugerido < 0 ? sugerido : null; |
| 448 | } | 435 | } |
| 449 | } | 436 | } |
| 450 | } | 437 | } |
| 451 | ); | 438 | ); |
| 452 | modalInstance.result.then( | 439 | modalInstance.result.then( |
| 453 | function(cheque) { | 440 | function(cheque) { |
| 454 | var cobro = { | 441 | var cobro = { |
| 455 | tipo: 'ch' + '(' + cheque.numero + ')' + ' ' + cheque.banco.desbco, | 442 | tipo: 'ch' + '(' + cheque.numero + ')' + ' ' + cheque.banco.desbco, |
| 456 | numero: cheque.numero, | 443 | numero: cheque.numero, |
| 457 | banco: cheque.banco, | 444 | banco: cheque.banco, |
| 458 | fecha: cheque.fechaEmision.toLocaleDateString() + '-' + | 445 | fecha: cheque.fechaEmision.toLocaleDateString() + '-' + |
| 459 | cheque.fechaPresentacion.toLocaleDateString(), | 446 | cheque.fechaPresentacion.toLocaleDateString(), |
| 460 | fechaPresentacion: cheque.fechaPresentacion, | 447 | fechaPresentacion: cheque.fechaPresentacion, |
| 461 | fechaEmision: cheque.fechaEmision, | 448 | fechaEmision: cheque.fechaEmision, |
| 462 | importe: cheque.importe * $scope.cobranza.cotizacion.VENDEDOR, | 449 | importe: cheque.importe * $scope.cobranza.cotizacion.VENDEDOR, |
| 463 | localidad: cheque.localidad, | 450 | localidad: cheque.localidad, |
| 464 | librador: cheque.librador, | 451 | librador: cheque.librador, |
| 465 | provincia: cheque.provincia, | 452 | provincia: cheque.provincia, |
| 466 | observaciones: cheque.observaciones, | 453 | observaciones: cheque.observaciones, |
| 467 | til: 'EF' | 454 | til: 'EF' |
| 468 | }; | 455 | }; |
| 469 | $scope.cobrosTabla.push(cobro); | 456 | $scope.cobranza.cobros.push(cobro); |
| 470 | }, function() { | 457 | }, function() { |
| 471 | 458 | ||
| 472 | } | 459 | } |
| 473 | ); | 460 | ); |
| 474 | }; | 461 | }; |
| 475 | 462 | ||
| 476 | $scope.seleccionarEfectivo = function() { | 463 | $scope.seleccionarEfectivo = function() { |
| 477 | var modalInstance = $uibModal.open( | 464 | var modalInstance = $uibModal.open( |
| 478 | { | 465 | { |
| 479 | ariaLabelledBy: 'Carga de cheques', | 466 | ariaLabelledBy: 'Carga de cheques', |
| 480 | templateUrl: 'modal-efectivo.html', | 467 | templateUrl: 'modal-efectivo.html', |
| 481 | controller: 'focaModalEfectivoController', | 468 | controller: 'focaModalEfectivoController', |
| 482 | size: 'sm', | 469 | size: 'sm', |
| 483 | resolve: { | 470 | resolve: { |
| 484 | sugerido: function() { | 471 | sugerido: function() { |
| 485 | var sugerido = $scope.getTotalDeuda() + $scope.getTotalCobrado(); | 472 | var sugerido = $scope.getTotalDeuda() + $scope.getTotalCobrado(); |
| 486 | return sugerido < 0 ? sugerido : null; | 473 | return sugerido < 0 ? sugerido : null; |
| 487 | } | 474 | } |
| 488 | } | 475 | } |
| 489 | } | 476 | } |
| 490 | ); | 477 | ); |
| 491 | modalInstance.result.then( | 478 | modalInstance.result.then( |
| 492 | function(efectivo) { | 479 | function(efectivo) { |
| 493 | var cobro = { | 480 | var cobro = { |
| 494 | tipo: 'Efectivo', | 481 | tipo: 'Efectivo', |
| 495 | fecha: new Date(), | 482 | fecha: new Date(), |
| 496 | importe: efectivo * $scope.cobranza.cotizacion.VENDEDOR, | 483 | importe: efectivo * $scope.cobranza.cotizacion.VENDEDOR, |
| 497 | til: 'EF' | 484 | til: 'EF' |
| 498 | }; | 485 | }; |
| 499 | $scope.cobrosTabla = $scope.cobrosTabla.filter(function(a) { | 486 | $scope.cobranza.cobros = $scope.cobranza.cobros.filter(function(a) { |
| 500 | return a.tipo !== 'Efectivo'; | 487 | return a.tipo !== 'Efectivo'; |
| 501 | }); | 488 | }); |
| 502 | $scope.cobrosTabla.push(cobro); | 489 | $scope.cobranza.cobros.push(cobro); |
| 503 | }, function() { | 490 | }, function() { |
| 504 | 491 | ||
| 505 | } | 492 | } |
| 506 | ); | 493 | ); |
| 507 | }; | 494 | }; |
| 508 | 495 | ||
| 509 | $scope.seleccionarDetalles = function() { | 496 | $scope.seleccionarDetalles = function() { |
| 510 | var modalInstance = $uibModal.open( | 497 | var modalInstance = $uibModal.open( |
| 511 | { | 498 | { |
| 512 | ariaLabelledBy: 'Carga de detalles', | 499 | ariaLabelledBy: 'Carga de detalles', |
| 513 | templateUrl: 'modal-detalles.html', | 500 | templateUrl: 'modal-detalles.html', |
| 514 | controller: 'focaModalDetallesController', | 501 | controller: 'focaModalDetallesController', |
| 515 | size: 'lg', | 502 | size: 'lg', |
| 516 | resolve: { | 503 | resolve: { |
| 517 | sugerido: function() { | 504 | sugerido: function() { |
| 518 | var sugerido = $scope.getTotalDeuda() + $scope.getTotalCobrado(); | 505 | var sugerido = $scope.getTotalDeuda() + $scope.getTotalCobrado(); |
| 519 | return sugerido < 0 ? sugerido : null; | 506 | return sugerido < 0 ? sugerido : null; |
| 520 | } | 507 | } |
| 521 | } | 508 | } |
| 522 | } | 509 | } |
| 523 | ); | 510 | ); |
| 524 | modalInstance.result.then( | 511 | modalInstance.result.then( |
| 525 | function(detalles) { | 512 | function(detalles) { |
| 526 | var cobro = { | 513 | var cobro = { |
| 527 | tipo: 'de(COBRO POR DETALLES)', | 514 | tipo: 'de(COBRO POR DETALLES)', |
| 528 | fecha: new Date(), | 515 | fecha: new Date(), |
| 529 | importe: detalles.monto * $scope.cobranza.cotizacion.VENDEDOR, | 516 | importe: detalles.monto * $scope.cobranza.cotizacion.VENDEDOR, |
| 530 | imgs: detalles.imgs, | 517 | imgs: detalles.imgs, |
| 531 | til: 'DE', | 518 | til: 'DE', |
| 532 | observacion: detalles.observacion | 519 | observacion: detalles.observacion |
| 533 | }; | 520 | }; |
| 534 | var existe = false; | 521 | var existe = false; |
| 535 | 522 | ||
| 536 | $scope.cobrosTabla.forEach(function(c, idx) { | 523 | $scope.cobranza.cobros.forEach(function(c, idx) { |
| 537 | if (c.til === 'DE') { | 524 | if (c.til === 'DE') { |
| 538 | $scope.cobrosTabla[idx] = cobro; | 525 | $scope.cobranza.cobros[idx] = cobro; |
| 539 | existe = true; | 526 | existe = true; |
| 540 | } | 527 | } |
| 541 | }); | 528 | }); |
| 542 | if (!existe) { | 529 | if (!existe) { |
| 543 | $scope.cobrosTabla.push(cobro); | 530 | $scope.cobranza.cobros.push(cobro); |
| 544 | } | 531 | } |
| 545 | }, function() {} | 532 | }, function() {} |
| 546 | ); | 533 | ); |
| 547 | }; | 534 | }; |
| 548 | 535 | ||
| 549 | $scope.seleccionarMoneda = function() { | 536 | $scope.seleccionarMoneda = function() { |
| 550 | var parametrosModal = { | 537 | var parametrosModal = { |
| 551 | titulo: 'Búsqueda de monedas', | 538 | titulo: 'Búsqueda de monedas', |
| 552 | query: '/moneda', | 539 | query: '/moneda', |
| 553 | columnas: [ | 540 | columnas: [ |
| 554 | { | 541 | { |
| 555 | propiedad: 'DETALLE', | 542 | propiedad: 'DETALLE', |
| 556 | nombre: 'Nombre' | 543 | nombre: 'Nombre' |
| 557 | }, | 544 | }, |
| 558 | { | 545 | { |
| 559 | propiedad: 'SIMBOLO', | 546 | propiedad: 'SIMBOLO', |
| 560 | nombre: 'Símbolo' | 547 | nombre: 'Símbolo' |
| 561 | } | 548 | } |
| 562 | ], | 549 | ], |
| 563 | size: 'md' | 550 | size: 'md' |
| 564 | }; | 551 | }; |
| 565 | focaModalService.modal(parametrosModal).then( | 552 | focaModalService.modal(parametrosModal).then( |
| 566 | function(moneda) { | 553 | function(moneda) { |
| 567 | $scope.seleccionarCotizacion(moneda); | 554 | $scope.seleccionarCotizacion(moneda); |
| 568 | }, function() { | 555 | }, function() { |
| 569 | 556 | ||
| 570 | } | 557 | } |
| 571 | ); | 558 | ); |
| 572 | }; | 559 | }; |
| 573 | 560 | ||
| 574 | $scope.seleccionarCotizacion = function(moneda) { | 561 | $scope.seleccionarCotizacion = function(moneda) { |
| 575 | var modalInstance = $uibModal.open( | 562 | var modalInstance = $uibModal.open( |
| 576 | { | 563 | { |
| 577 | ariaLabelledBy: 'Busqueda de Cotización', | 564 | ariaLabelledBy: 'Busqueda de Cotización', |
| 578 | templateUrl: 'modal-cotizacion.html', | 565 | templateUrl: 'modal-cotizacion.html', |
| 579 | controller: 'focaModalCotizacionController', | 566 | controller: 'focaModalCotizacionController', |
| 580 | size: 'lg', | 567 | size: 'lg', |
| 581 | resolve: {idMoneda: function() {return moneda.ID;}} | 568 | resolve: {idMoneda: function() {return moneda.ID;}} |
| 582 | } | 569 | } |
| 583 | ); | 570 | ); |
| 584 | modalInstance.result.then( | 571 | modalInstance.result.then( |
| 585 | function(cotizacion) { | 572 | function(cotizacion) { |
| 586 | $scope.cobranza.moneda = moneda; | 573 | $scope.cobranza.moneda = moneda; |
| 587 | $scope.cobranza.cotizacion = cotizacion; | 574 | $scope.cobranza.cotizacion = cotizacion; |
| 588 | if(moneda.DETALLE === 'PESOS ARGENTINOS') { | 575 | if(moneda.DETALLE === 'PESOS ARGENTINOS') { |
| 589 | $scope.$broadcast('removeCabecera', 'Moneda:'); | 576 | $scope.$broadcast('removeCabecera', 'Moneda:'); |
| 590 | $scope.$broadcast('removeCabecera', 'Fecha cotizacion:'); | 577 | $scope.$broadcast('removeCabecera', 'Fecha cotizacion:'); |
| 591 | $scope.$broadcast('removeCabecera', 'Cotizacion:'); | 578 | $scope.$broadcast('removeCabecera', 'Cotizacion:'); |
| 592 | }else { | 579 | }else { |
| 593 | $scope.$broadcast('addCabecera', { | 580 | $scope.$broadcast('addCabecera', { |
| 594 | label: 'Moneda:', | 581 | label: 'Moneda:', |
| 595 | valor: moneda.DETALLE | 582 | valor: moneda.DETALLE |
| 596 | }); | 583 | }); |
| 597 | $scope.$broadcast('addCabecera', { | 584 | $scope.$broadcast('addCabecera', { |
| 598 | label: 'Fecha cotizacion:', | 585 | label: 'Fecha cotizacion:', |
| 599 | valor: $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | 586 | valor: $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') |
| 600 | }); | 587 | }); |
| 601 | $scope.$broadcast('addCabecera', { | 588 | $scope.$broadcast('addCabecera', { |
| 602 | label: 'Cotizacion:', | 589 | label: 'Cotizacion:', |
| 603 | valor: $filter('number')(cotizacion.VENDEDOR, '2') | 590 | valor: $filter('number')(cotizacion.VENDEDOR, '2') |
| 604 | }); | 591 | }); |
| 605 | } | 592 | } |
| 606 | }, function() { | 593 | }, function() { |
| 607 | 594 | ||
| 608 | } | 595 | } |
| 609 | ); | 596 | ); |
| 610 | }; | 597 | }; |
| 611 | 598 | ||
| 612 | $scope.seleccionarCobrador = function() { | 599 | $scope.seleccionarCobrador = function() { |
| 613 | var parametrosModal = { | 600 | var parametrosModal = { |
| 614 | query: '/cobrador', | 601 | query: '/cobrador', |
| 615 | columnas: [ | 602 | columnas: [ |
| 616 | { | 603 | { |
| 617 | propiedad: 'NUM', | 604 | propiedad: 'NUM', |
| 618 | nombre: 'Codigo', | 605 | nombre: 'Codigo', |
| 619 | filtro: { | 606 | filtro: { |
| 620 | nombre: 'rellenarDigitos', | 607 | nombre: 'rellenarDigitos', |
| 621 | parametro: 3 | 608 | parametro: 3 |
| 622 | } | 609 | } |
| 623 | }, | 610 | }, |
| 624 | { | 611 | { |
| 625 | propiedad: 'NOM', | 612 | propiedad: 'NOM', |
| 626 | nombre: 'Nombre' | 613 | nombre: 'Nombre' |
| 627 | } | 614 | } |
| 628 | ], | 615 | ], |
| 629 | titulo:'Búsqueda de cobradores' | 616 | titulo:'Búsqueda de cobradores' |
| 630 | }; | 617 | }; |
| 631 | focaModalService.modal(parametrosModal).then( | 618 | focaModalService.modal(parametrosModal).then( |
| 632 | function(cobrador) { | 619 | function(cobrador) { |
| 633 | $scope.$broadcast('addCabecera', { | 620 | $scope.$broadcast('addCabecera', { |
| 634 | label: 'Cobrador:', | 621 | label: 'Cobrador:', |
| 635 | valor: $filter('rellenarDigitos')(cobrador.NUM, 3) + ' - ' + | 622 | valor: $filter('rellenarDigitos')(cobrador.NUM, 3) + ' - ' + |
| 636 | cobrador.NOM | 623 | cobrador.NOM |
| 637 | }); | 624 | }); |
| 638 | $scope.cobranza.cobrador = cobrador; | 625 | $scope.cobranza.cobrador = cobrador; |
| 639 | }, function() { | 626 | }, function() { |
| 640 | 627 | ||
| 641 | } | 628 | } |
| 642 | ); | 629 | ); |
| 643 | }; | 630 | }; |
| 644 | 631 | ||
| 645 | $scope.getTotalDeuda = function() { | 632 | $scope.getTotalDeuda = function() { |
| 646 | var total = 0; | 633 | var total = 0; |
| 647 | for (var i = 0; i < $scope.facturaTabla.length; i++) { | 634 | for (var i = 0; i < $scope.cobranza.facturas.length; i++) { |
| 648 | total += $scope.facturaTabla[i].IPA; | 635 | total += $scope.cobranza.facturas[i].IPA; |
| 649 | } | 636 | } |
| 650 | return parseFloat(total.toFixed(2)); | 637 | return parseFloat(total.toFixed(2)); |
| 651 | }; | 638 | }; |
| 652 | 639 | ||
| 653 | $scope.getTotalCobrado = function() { | 640 | $scope.getTotalCobrado = function() { |
| 654 | var total = 0; | 641 | var total = 0; |
| 655 | for (var i = 0; i < $scope.cobrosTabla.length; i++) { | 642 | for (var i = 0; i < $scope.cobranza.cobros.length; i++) { |
| 656 | total += $scope.cobrosTabla[i].importe; | 643 | total += $scope.cobranza.cobros[i].importe; |
| 657 | } | 644 | } |
| 658 | return parseFloat(total.toFixed(2)); | 645 | return parseFloat(total.toFixed(2)); |
| 659 | }; | 646 | }; |
| 660 | 647 | ||
| 661 | $scope.getSubTotal = function() { | 648 | $scope.getSubTotal = function() { |
| 662 | if ($scope.articuloACargar) { | 649 | if ($scope.articuloACargar) { |
| 663 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; | 650 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
| 664 | } | 651 | } |
| 665 | }; | 652 | }; |
| 666 | //Recibe aviso si el teclado está en uso | 653 | //Recibe aviso si el teclado está en uso |
| 667 | // $rootScope.$on('usarTeclado', function(event, data) { | 654 | // $rootScope.$on('usarTeclado', function(event, data) { |
| 668 | // if(data) { | 655 | // if(data) { |
| 669 | // $scope.mostrarTeclado = true; | 656 | // $scope.mostrarTeclado = true; |
| 670 | // return; | 657 | // return; |
| 671 | // } | 658 | // } |
| 672 | // $scope.mostrarTeclado = false; | 659 | // $scope.mostrarTeclado = false; |
| 673 | // }) | 660 | // }) |
| 674 | $scope.selectFocus = function($event) { | 661 | $scope.selectFocus = function($event) { |
| 675 | //Si el teclado esta en uso no selecciona el valor | 662 | //Si el teclado esta en uso no selecciona el valor |
| 676 | // if($scope.mostrarTeclado) { | 663 | // if($scope.mostrarTeclado) { |
| 677 | // return; | 664 | // return; |
| 678 | // } | 665 | // } |
| 679 | $event.target.select(); | 666 | $event.target.select(); |
| 680 | }; | 667 | }; |
| 681 | 668 | ||
| 682 | $scope.salir = function() { | 669 | $scope.salir = function() { |
| 683 | $location.path('/'); | 670 | $location.path('/'); |
| 684 | }; | 671 | }; |
| 685 | 672 | ||
| 686 | $scope.parsearATexto = function(articulo) { | 673 | $scope.parsearATexto = function(articulo) { |
| 687 | articulo.cantidad = parseFloat(articulo.cantidad); | 674 | articulo.cantidad = parseFloat(articulo.cantidad); |
| 688 | articulo.precio = parseFloat(articulo.precio); | 675 | articulo.precio = parseFloat(articulo.precio); |
| 689 | }; | 676 | }; |
| 690 | 677 | ||
| 691 | $scope.quitarFactura = function(key) { | 678 | $scope.quitarFactura = function(key) { |
| 692 | $scope.facturaTabla.splice(key, 1); | 679 | $scope.cobranza.facturas.splice(key, 1); |
| 693 | }; | 680 | }; |
| 694 | 681 | ||
| 695 | $scope.quitarCobro = function(key) { | 682 | $scope.quitarCobro = function(key) { |
| 696 | $scope.cobrosTabla.splice(key, 1); | 683 | $scope.cobranza.cobros.splice(key, 1); |
| 697 | }; | 684 | }; |
| 698 | 685 | ||
| 699 | function salir() { | 686 | function salir() { |
| 700 | var confirmacion = false; | 687 | var confirmacion = false; |
| 701 | 688 | ||
| 702 | angular.forEach($scope.inicial, function(valor, key) { | 689 | if (!angular.equals($scope.cobranza, $scope.inicial)) { |
| 703 | if (!angular.equals($scope[key], $scope.inicial[key])) { | 690 | confirmacion = true; |
| 704 | confirmacion = true; | 691 | } |
| 705 | } | ||
| 706 | }); | ||
| 707 | 692 | ||
| 708 | if (confirmacion) { | 693 | if (confirmacion) { |
| 709 | focaModalService.confirm( | 694 | focaModalService.confirm( |
| 710 | '¿Está seguro de que desea salir? Se perderán todos los datos cargados.' | 695 | '¿Está seguro de que desea salir? Se perderán todos los datos cargados.' |
| 711 | ).then(function(data) { | 696 | ).then(function(data) { |
| 712 | if (data) { | 697 | if (data) { |
| 713 | $location.path('/'); | 698 | $location.path('/'); |
| 714 | } | 699 | } |
| 715 | }); | 700 | }); |
| 716 | } else { | 701 | } else { |
| 717 | $location.path('/'); | 702 | $location.path('/'); |
| 718 | } | 703 | } |
| 719 | } | 704 | } |
| 705 | |||
| 706 | function setearCobranza(cobranza) { | ||
| 707 | $scope.editando = true; | ||
| 708 | $scope.$broadcast('cleanCabecera'); |
src/js/service.js
| 1 | angular.module('focaCrearCobranza') | 1 | angular.module('focaCrearCobranza') |
| 2 | .service('focaCrearCobranzaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('focaCrearCobranzaService', ['$http', 'API_ENDPOINT', |
| 3 | function($http, API_ENDPOINT) { | ||
| 3 | return { | 4 | return { |
| 4 | getNumeroRecibo: function() { | 5 | getNumeroRecibo: function() { |
| 5 | return $http.get(API_ENDPOINT.URL + '/recibo/numero-siguiente'); | 6 | return $http.get(API_ENDPOINT.URL + '/recibo/numero-siguiente'); |
| 6 | }, | 7 | }, |
| 7 | getCotizacionByIdMoneda: function(id) { | 8 | getCotizacionByIdMoneda: function(id) { |
| 8 | return $http.get(API_ENDPOINT.URL + '/moneda/' + id); | 9 | return $http.get(API_ENDPOINT.URL + '/moneda/' + id); |
| 9 | }, | 10 | }, |
| 10 | guardarCobranza: function(cobranza) { | 11 | guardarCobranza: function(cobranza) { |
| 11 | return $http.post(API_ENDPOINT.URL + '/recibo/guardar', cobranza); | 12 | return $http.post(API_ENDPOINT.URL + '/recibo/guardar', cobranza); |
| 12 | }, | 13 | }, |
| 13 | getCobradorById: function(id) { | 14 | getCobradorById: function(id) { |
| 14 | return $http.get(API_ENDPOINT.URL + '/vendedor-cobrador/' + id); | 15 | return $http.get(API_ENDPOINT.URL + '/vendedor-cobrador/' + id); |
| 15 | }, | 16 | }, |
| 16 | enviarComprobantePorMail: function(mail, data) { | 17 | enviarComprobantePorMail: function(mail, data) { |
| 17 | return $http.post(API_ENDPOINT.URL + '/mail/comprobante', | 18 | return $http.post(API_ENDPOINT.URL + '/mail/comprobante', |
| 18 | {receiver: mail, comprobante: data}); | 19 | {receiver: mail, comprobante: data}); |
| 19 | }, | 20 | }, |
| 20 | actualizarEmail: function(mail, idCliente) { | 21 | actualizarEmail: function(mail, idCliente) { |
| 21 | return $http.post(API_ENDPOINT.URL + '/cliente/update/email', | 22 | return $http.post(API_ENDPOINT.URL + '/cliente/update/email', |
| 22 | {mail: mail, id: idCliente}); | 23 | {mail: mail, id: idCliente}); |
| 23 | }, | 24 | }, |
| 24 | getBotonera: function(idCobrador) { | 25 | getBotonera: function(idCobrador) { |
| 25 | var result = [ | 26 | var result = [ |
| 26 | { | 27 | { |
| 27 | label: 'Cliente', | 28 | label: 'Cliente', |
| 28 | image: 'cliente.png' | 29 | image: 'cliente.png' |
| 29 | }, | 30 | }, |
| 30 | { | 31 | { |
| 31 | label: 'Comprobantes', | 32 | label: 'Comprobantes', |
| 32 | image: 'comprobante.png' | 33 | image: 'comprobante.png' |
| 33 | }, | 34 | }, |
| 34 | { | 35 | { |
| 35 | label: 'Cobros', | 36 | label: 'Cobros', |
| 36 | image: 'cobros.png' | 37 | image: 'cobros.png' |
| 37 | }, | 38 | }, |
| 38 | { | 39 | { |
| 39 | label: 'Moneda', | 40 | label: 'Moneda', |
| 40 | image: 'moneda.png' | 41 | image: 'moneda.png' |
| 41 | } | 42 | } |
| 42 | ]; | 43 | ]; |
| 43 | if(!idCobrador) { | 44 | if(!idCobrador) { |
| 44 | var cobradorBoton = { | 45 | var cobradorBoton = { |
| 45 | label: 'Cobrador', | 46 | label: 'Cobrador', |
| 46 | image: 'cobrador.png' | 47 | image: 'cobrador.png' |
| 47 | }; | 48 | }; |
| 48 | result.unshift(cobradorBoton); | 49 | result.unshift(cobradorBoton); |
| 49 | } | 50 | } |
| 50 | return result; | 51 | return result; |
| 51 | } | 52 | } |
| 52 | }; | 53 | }; |
| 53 | }]); | 54 | }]); |
| 54 | 55 |
src/views/cobranza.html
| 1 | <div class="crear-nota-pedido foca-crear row"> | 1 | <div class="crear-nota-pedido foca-crear row"> |
| 2 | <foca-cabecera-facturador | 2 | <foca-cabecera-facturador |
| 3 | titulo="'Recibo de cobranza'" | 3 | titulo="'Recibo de cobranza'" |
| 4 | numero="puntoVenta + '-' + comprobante" | 4 | numero="puntoVenta + '-' + comprobante" |
| 5 | fecha="fecha" | 5 | fecha="cobranza.fecha" |
| 6 | class="mb-0 col-lg-12" | 6 | class="mb-0 col-lg-12" |
| 7 | busqueda="seleccionarCobranza" | 7 | busqueda="seleccionarCobranza" |
| 8 | ></foca-cabecera-facturador> | 8 | ></foca-cabecera-facturador> |
| 9 | <div class="col-lg-12"> | 9 | <div class="col-lg-12"> |
| 10 | <div class="row mt-4"> | 10 | <div class="row mt-4"> |
| 11 | <div class="col-12 col-md-10 border border-light rounded"> | 11 | <div class="col-12 col-md-10 border border-light rounded"> |
| 12 | <div class="row px-5 py-2 botonera-secundaria"> | 12 | <div class="row px-5 py-2 botonera-secundaria"> |
| 13 | <div class="col-12"> | 13 | <div class="col-12"> |
| 14 | <foca-botonera-facturador botones="botonera" extra="7" class="row"></foca-botonera-facturador> | 14 | <foca-botonera-facturador botones="botonera" extra="7" class="row"></foca-botonera-facturador> |
| 15 | </div> | 15 | </div> |
| 16 | </div> | 16 | </div> |
| 17 | <!-- PC --> | 17 | <!-- PC --> |
| 18 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="cobroDeuda"> | 18 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="cobroDeuda"> |
| 19 | <table class="table tabla-articulo table-striped table-sm mb-0 rounded-bottom"> | 19 | <table class="table tabla-articulo table-striped table-sm mb-0 rounded-bottom"> |
| 20 | <thead> | 20 | <thead> |
| 21 | <tr class="d-flex"> | 21 | <tr class="d-flex"> |
| 22 | <th class="col-auto">#</th> | 22 | <th class="col-auto">#</th> |
| 23 | <th class="col">Comprobante</th> | 23 | <th class="col">Comprobante</th> |
| 24 | <th class="col">Fecha</th> | 24 | <th class="col">Fecha</th> |
| 25 | <th class="col">Importe</th> | 25 | <th class="col">Importe</th> |
| 26 | <th class="col-auto"> | 26 | <th class="col-auto"> |
| 27 | <button | 27 | <button |
| 28 | class="btn btn-outline-light selectable" | 28 | class="btn btn-outline-light selectable" |
| 29 | ng-click="show = !show; masMenos()" | 29 | ng-click="show = !show; masMenos()" |
| 30 | > | 30 | > |
| 31 | <i | 31 | <i |
| 32 | class="fa fa-chevron-down" | 32 | class="fa fa-chevron-down" |
| 33 | ng-show="show" | 33 | ng-show="show" |
| 34 | aria-hidden="true" | 34 | aria-hidden="true" |
| 35 | > | 35 | > |
| 36 | </i> | 36 | </i> |
| 37 | <i | 37 | <i |
| 38 | class="fa fa-chevron-up" | 38 | class="fa fa-chevron-up" |
| 39 | ng-hide="show" | 39 | ng-hide="show" |
| 40 | aria-hidden="true"> | 40 | aria-hidden="true"> |
| 41 | </i> | 41 | </i> |
| 42 | </button> | 42 | </button> |
| 43 | </th> | 43 | </th> |
| 44 | </th> | 44 | </th> |
| 45 | </tr> | 45 | </tr> |
| 46 | </thead> | 46 | </thead> |
| 47 | <tbody class="tabla-articulo-body"> | 47 | <tbody class="tabla-articulo-body"> |
| 48 | <tr | 48 | <tr |
| 49 | ng-repeat="(key, factura) in facturaTabla" | 49 | ng-repeat="(key, factura) in cobranza.facturas" |
| 50 | class="d-flex" | 50 | class="d-flex" |
| 51 | ng-show="show || key == facturaTabla.length - 1" | 51 | ng-show="show || key == cobranza.facturas.length - 1" |
| 52 | > | 52 | > |
| 53 | <td ng-bind="key + 1" class="col-auto"></td> | 53 | <td ng-bind="key + 1" class="col-auto"></td> |
| 54 | <td class="col" ng-bind="factura.numeroFactura" | 54 | <td class="col" ng-bind="factura.numeroFactura" |
| 55 | ></td> | 55 | ></td> |
| 56 | <td class="col" ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></td> | 56 | <td class="col" ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></td> |
| 57 | <td | 57 | <td |
| 58 | class="col" | 58 | class="col" |
| 59 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | | 59 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | |
| 60 | number: 4"></td> | 60 | number: 4"></td> |
| 61 | <td class="text-center col-auto"> | 61 | <td class="text-center col-auto"> |
| 62 | <button | 62 | <button |
| 63 | class="btn btn-outline-light" | 63 | class="btn btn-outline-light" |
| 64 | ng-click="quitarFactura(key)" | 64 | ng-click="quitarFactura(key)" |
| 65 | > | 65 | > |
| 66 | <i class="fa fa-trash"></i> | 66 | <i class="fa fa-trash"></i> |
| 67 | </button> | 67 | </button> |
| 68 | </td> | 68 | </td> |
| 69 | </tr> | 69 | </tr> |
| 70 | </tbody> | 70 | </tbody> |
| 71 | <tfoot> | 71 | <tfoot> |
| 72 | <tr ng-show="cargando" class="d-flex"> | 72 | <tr ng-show="cargando" class="d-flex"> |
| 73 | <td class="col-2 border-top-0"> | 73 | <td class="col-2 border-top-0"> |
| 74 | <a | 74 | <a |
| 75 | class="form-control form-control-sm btn btn-secondary" | 75 | class="form-control form-control-sm btn btn-secondary" |
| 76 | ng-click="seleccionarFactura()" | 76 | ng-click="seleccionarFactura()" |
| 77 | >Pendientes</a> | 77 | >Pendientes</a> |
| 78 | </td> | 78 | </td> |
| 79 | </tr> | 79 | </tr> |
| 80 | <tr class="d-flex"> | 80 | <tr class="d-flex"> |
| 81 | <td class="col-auto px-1 border-top-0"> | 81 | <td class="col-auto px-1 border-top-0"> |
| 82 | <strong>Comprobantes:</strong> | 82 | <strong>Comprobantes:</strong> |
| 83 | <a ng-bind="facturaTabla.length"></a> | 83 | <a ng-bind="cobranza.facturas.length"></a> |
| 84 | </td> | 84 | </td> |
| 85 | <td class="text-right ml-auto table-celda-total no-border-top"> | 85 | <td class="text-right ml-auto table-celda-total no-border-top"> |
| 86 | <strong>Cancela:</strong> | 86 | <strong>Cancela:</strong> |
| 87 | </td> | 87 | </td> |
| 88 | <td class="table-celda-total text-right no-border-top"> | 88 | <td class="table-celda-total text-right no-border-top"> |
| 89 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | | 89 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | |
| 90 | currency: cobranza.moneda.SIMBOLO}}</strong> | 90 | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 91 | </td> | 91 | </td> |
| 92 | <td class="text-right ml-auto table-celda-total no-border-top"> | 92 | <td class="text-right ml-auto table-celda-total no-border-top"> |
| 93 | <strong>Total Cobrado:</strong> | 93 | <strong>Total Cobrado:</strong> |
| 94 | </td> | 94 | </td> |
| 95 | <td class="table-celda-total text-right no-border-top"> | 95 | <td class="table-celda-total text-right no-border-top"> |
| 96 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | | 96 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | |
| 97 | currency: cobranza.moneda.SIMBOLO}}</strong> | 97 | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 98 | </td> | 98 | </td> |
| 99 | <td class="text-right ml-auto table-celda-total no-border-top"> | 99 | <td class="text-right ml-auto table-celda-total no-border-top"> |
| 100 | <strong>DF:</strong> | 100 | <strong>DF:</strong> |
| 101 | </td> | 101 | </td> |
| 102 | <td class="table-celda-total text-right no-border-top mr-1"> | 102 | <td class="table-celda-total text-right no-border-top mr-1"> |
| 103 | <strong>{{((getTotalCobrado() + getTotalDeuda()) / | 103 | <strong>{{((getTotalCobrado() + getTotalDeuda()) / |
| 104 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} | 104 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} |
| 105 | </strong> | 105 | </strong> |
| 106 | </td> | 106 | </td> |
| 107 | </tr> | 107 | </tr> |
| 108 | </tfoot> | 108 | </tfoot> |
| 109 | </table> | 109 | </table> |
| 110 | </div> | 110 | </div> |
| 111 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="!cobroDeuda"> | 111 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="!cobroDeuda"> |
| 112 | <table class="table tabla-articulo table-striped table-sm mb-0 rounded-bottom"> | 112 | <table class="table tabla-articulo table-striped table-sm mb-0 rounded-bottom"> |
| 113 | <thead> | 113 | <thead> |
| 114 | <tr class="d-flex"> | 114 | <tr class="d-flex"> |
| 115 | <th class="col-auto">#</th> | 115 | <th class="col-auto">#</th> |
| 116 | <th class="col">Cobro</th> | 116 | <th class="col">Cobro</th> |
| 117 | <th class="col">Fecha</th> | 117 | <th class="col">Fecha</th> |
| 118 | <th class="col">Importe</th> | 118 | <th class="col">Importe</th> |
| 119 | <th class="col-auto"> | 119 | <th class="col-auto"> |
| 120 | <button | 120 | <button |
| 121 | class="btn btn-outline-light selectable" | 121 | class="btn btn-outline-light selectable" |
| 122 | ng-click="show = !show; masMenos()" | 122 | ng-click="show = !show; masMenos()" |
| 123 | > | 123 | > |
| 124 | <i | 124 | <i |
| 125 | class="fa fa-chevron-down" | 125 | class="fa fa-chevron-down" |
| 126 | ng-show="show" | 126 | ng-show="show" |
| 127 | aria-hidden="true" | 127 | aria-hidden="true" |
| 128 | > | 128 | > |
| 129 | </i> | 129 | </i> |
| 130 | <i | 130 | <i |
| 131 | class="fa fa-chevron-up" | 131 | class="fa fa-chevron-up" |
| 132 | ng-hide="show" | 132 | ng-hide="show" |
| 133 | aria-hidden="true"> | 133 | aria-hidden="true"> |
| 134 | </i> | 134 | </i> |
| 135 | </button> | 135 | </button> |
| 136 | </th> | 136 | </th> |
| 137 | </th> | 137 | </th> |
| 138 | </tr> | 138 | </tr> |
| 139 | </thead> | 139 | </thead> |
| 140 | <tbody class="tabla-articulo-body"> | 140 | <tbody class="tabla-articulo-body"> |
| 141 | <tr | 141 | <tr |
| 142 | ng-repeat="(key, cobro) in cobrosTabla" | 142 | ng-repeat="(key, cobro) in cobranza.cobros" |
| 143 | class="d-flex" | 143 | class="d-flex" |
| 144 | ng-show="show || key == cobrosTabla.length - 1" | 144 | ng-show="show || key == cobranza.cobros.length - 1" |
| 145 | > | 145 | > |
| 146 | <td ng-bind="key + 1" class="col-auto"></td> | 146 | <td ng-bind="key + 1" class="col-auto"></td> |
| 147 | <td class="col" ng-bind="cobro.tipo"></td> | 147 | <td class="col" ng-bind="cobro.tipo"></td> |
| 148 | <td class="col" ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></td> | 148 | <td class="col" ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></td> |
| 149 | <td | 149 | <td |
| 150 | class="col" | 150 | class="col" |
| 151 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | | 151 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | |
| 152 | currency: cobranza.moneda.SIMBOLO : 4"></td> | 152 | currency: cobranza.moneda.SIMBOLO : 4"></td> |
| 153 | <td class="text-center col-auto"> | 153 | <td class="text-center col-auto"> |
| 154 | <button | 154 | <button |
| 155 | class="btn btn-outline-light" | 155 | class="btn btn-outline-light" |
| 156 | ng-click="quitarCobro(key)" | 156 | ng-click="quitarCobro(key)" |
| 157 | > | 157 | > |
| 158 | <i class="fa fa-trash"></i> | 158 | <i class="fa fa-trash"></i> |
| 159 | </button> | 159 | </button> |
| 160 | </td> | 160 | </td> |
| 161 | </tr> | 161 | </tr> |
| 162 | </tbody> | 162 | </tbody> |
| 163 | <tfoot> | 163 | <tfoot> |
| 164 | <tr ng-show="cargando" class="d-flex"> | 164 | <tr ng-show="cargando" class="d-flex"> |
| 165 | <td class="col-2 border-top-0"> | 165 | <td class="col-2 border-top-0"> |
| 166 | <a | 166 | <a |
| 167 | class="form-control form-control-sm btn btn-secondary" | 167 | class="form-control form-control-sm btn btn-secondary" |
| 168 | ng-click="seleccionarCheque()" | 168 | ng-click="seleccionarCheque()" |
| 169 | >Cheque</a> | 169 | >Cheque</a> |
| 170 | </td> | 170 | </td> |
| 171 | <td class="col-2 border-top-0"> | 171 | <td class="col-2 border-top-0"> |
| 172 | <a | 172 | <a |
| 173 | class="form-control form-control-sm btn btn-secondary" | 173 | class="form-control form-control-sm btn btn-secondary" |
| 174 | ng-click="seleccionarEfectivo()" | 174 | ng-click="seleccionarEfectivo()" |
| 175 | >Efectivo</a> | 175 | >Efectivo</a> |
| 176 | </td> | 176 | </td> |
| 177 | <td class="col-2 border-top-0"> | 177 | <td class="col-2 border-top-0"> |
| 178 | <a | 178 | <a |
| 179 | class="form-control form-control-sm btn btn-secondary" | 179 | class="form-control form-control-sm btn btn-secondary" |
| 180 | ng-click="seleccionarDetalles()" | 180 | ng-click="seleccionarDetalles()" |
| 181 | >Detalle</a> | 181 | >Detalle</a> |
| 182 | </td> | 182 | </td> |
| 183 | </tr> | 183 | </tr> |
| 184 | <tr class="d-flex"> | 184 | <tr class="d-flex"> |
| 185 | <td class="col-auto px-1 border-top-0"> | 185 | <td class="col-auto px-1 border-top-0"> |
| 186 | <strong>Cobros:</strong> | 186 | <strong>Cobros:</strong> |
| 187 | <a ng-bind="cobrosTabla.length"></a> | 187 | <a ng-bind="cobranza.cobros.length"></a> |
| 188 | </td> | 188 | </td> |
| 189 | <td class="text-right ml-auto table-celda-total no-border-top"> | 189 | <td class="text-right ml-auto table-celda-total no-border-top"> |
| 190 | <strong>Cancela:</strong> | 190 | <strong>Cancela:</strong> |
| 191 | </td> | 191 | </td> |
| 192 | <td class="table-celda-total text-right no-border-top"> | 192 | <td class="table-celda-total text-right no-border-top"> |
| 193 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | | 193 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | |
| 194 | currency: cobranza.moneda.SIMBOLO}}</strong> | 194 | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 195 | </td> | 195 | </td> |
| 196 | <td class="text-right ml-auto table-celda-total no-border-top"> | 196 | <td class="text-right ml-auto table-celda-total no-border-top"> |
| 197 | <strong>Total Cobrado:</strong> | 197 | <strong>Total Cobrado:</strong> |
| 198 | </td> | 198 | </td> |
| 199 | <td class="table-celda-total text-right no-border-top"> | 199 | <td class="table-celda-total text-right no-border-top"> |
| 200 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | | 200 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | |
| 201 | currency: cobranza.moneda.SIMBOLO}}</strong> | 201 | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 202 | </td> | 202 | </td> |
| 203 | <td class="text-right ml-auto table-celda-total no-border-top"> | 203 | <td class="text-right ml-auto table-celda-total no-border-top"> |
| 204 | <strong>DF:</strong> | 204 | <strong>DF:</strong> |
| 205 | </td> | 205 | </td> |
| 206 | <td class="table-celda-total text-right no-border-top mr-1"> | 206 | <td class="table-celda-total text-right no-border-top mr-1"> |
| 207 | <strong>{{((getTotalCobrado() + getTotalDeuda()) / | 207 | <strong>{{((getTotalCobrado() + getTotalDeuda()) / |
| 208 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} | 208 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} |
| 209 | </strong> | 209 | </strong> |
| 210 | </td> | 210 | </td> |
| 211 | </tr> | 211 | </tr> |
| 212 | </tfoot> | 212 | </tfoot> |
| 213 | </table> | 213 | </table> |
| 214 | </div> | 214 | </div> |
| 215 | <!-- MOBILE --> | 215 | <!-- MOBILE --> |
| 216 | <div class="row d-sm-none mb-5"> | 216 | <div class="row d-sm-none mb-5"> |
| 217 | <!-- FACTURAS --> | 217 | <!-- FACTURAS --> |
| 218 | <table class="table table-sm table-striped tabla-articulo mb-5" ng-show="cobroDeuda"> | 218 | <table class="table table-sm table-striped tabla-articulo mb-5" ng-show="cobroDeuda"> |
| 219 | <thead> | 219 | <thead> |
| 220 | <tr class="d-flex"> | 220 | <tr class="d-flex"> |
| 221 | <th class="">#</th> | 221 | <th class="">#</th> |
| 222 | <th class="col px-0"> | 222 | <th class="col px-0"> |
| 223 | <div class="d-flex"> | 223 | <div class="d-flex"> |
| 224 | <div class="col-4 px-1">Factura</div> | 224 | <div class="col-4 px-1">Factura</div> |
| 225 | <div class="col-4 px-1">Fecha</div> | 225 | <div class="col-4 px-1">Fecha</div> |
| 226 | <div class="col-4 px-1">Importe</div> | 226 | <div class="col-4 px-1">Importe</div> |
| 227 | </div> | 227 | </div> |
| 228 | </th> | 228 | </th> |
| 229 | <th class="text-center tamaño-boton"> | 229 | <th class="text-center tamaño-boton"> |
| 230 | | 230 | |
| 231 | </th> | 231 | </th> |
| 232 | </tr> | 232 | </tr> |
| 233 | </thead> | 233 | </thead> |
| 234 | <tbody> | 234 | <tbody> |
| 235 | <tr | 235 | <tr |
| 236 | ng-repeat="(key, factura) in facturaTabla" | 236 | ng-repeat="(key, factura) in cobranza.facturas" |
| 237 | ng-show="show || key == facturaTabla.length - 1" | 237 | ng-show="show || key == cobranza.facturas.length - 1" |
| 238 | > | 238 | > |
| 239 | <td class="w-100 align-middle d-flex p-0"> | 239 | <td class="w-100 align-middle d-flex p-0"> |
| 240 | <div class="align-middle p-1"> | 240 | <div class="align-middle p-1"> |
| 241 | <span ng-bind="key+1" class="align-middle"></span> | 241 | <span ng-bind="key+1" class="align-middle"></span> |
| 242 | </div> | 242 | </div> |
| 243 | <div class="col px-0"> | 243 | <div class="col px-0"> |
| 244 | <div class="d-flex"> | 244 | <div class="d-flex"> |
| 245 | <div class="col-4 p-1"> | 245 | <div class="col-4 p-1"> |
| 246 | <span ng-bind="factura.numeroFactura" | 246 | <span ng-bind="factura.numeroFactura" |
| 247 | ></span> | 247 | ></span> |
| 248 | </div> | 248 | </div> |
| 249 | <div class="col-4 p-1"> | 249 | <div class="col-4 p-1"> |
| 250 | <span ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></span> | 250 | <span ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></span> |
| 251 | </div> | 251 | </div> |
| 252 | <div class="col-4 p-1"> | 252 | <div class="col-4 p-1"> |
| 253 | <span | 253 | <span |
| 254 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | | 254 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | |
| 255 | currency:cobranza.moneda.SIMBOLO : 4"></span> | 255 | currency:cobranza.moneda.SIMBOLO : 4"></span> |
| 256 | </div> | 256 | </div> |
| 257 | </div> | 257 | </div> |
| 258 | </div> | 258 | </div> |
| 259 | <div class="align-middle p-1"> | 259 | <div class="align-middle p-1"> |
| 260 | <button | 260 | <button |
| 261 | class="btn btn-outline-light" | 261 | class="btn btn-outline-light" |
| 262 | ng-click="quitarFactura(key)" | 262 | ng-click="quitarFactura(key)" |
| 263 | > | 263 | > |
| 264 | <i class="fa fa-trash"></i> | 264 | <i class="fa fa-trash"></i> |
| 265 | </button> | 265 | </button> |
| 266 | </div> | 266 | </div> |
| 267 | </td> | 267 | </td> |
| 268 | </tr> | 268 | </tr> |
| 269 | </tbody> | 269 | </tbody> |
| 270 | <tfoot> | 270 | <tfoot> |
| 271 | <!-- SELECCIONAR PRODUCTO --> | 271 | <!-- SELECCIONAR PRODUCTO --> |
| 272 | <tr ng-show="cargando" class="d-flex"> | 272 | <tr ng-show="cargando" class="d-flex"> |
| 273 | <td class="col-12"> | 273 | <td class="col-12"> |
| 274 | <input | 274 | <input |
| 275 | placeholder="Seleccione Factura" | 275 | placeholder="Seleccione Factura" |
| 276 | class="form-control form-control-sm" | 276 | class="form-control form-control-sm" |
| 277 | readonly | 277 | readonly |
| 278 | ng-click="seleccionarFactura()" | 278 | ng-click="seleccionarFactura()" |
| 279 | /> | 279 | /> |
| 280 | </td> | 280 | </td> |
| 281 | </tr> | 281 | </tr> |
| 282 | <!-- TOOGLE EXPANDIR --> | 282 | <!-- TOOGLE EXPANDIR --> |
| 283 | <tr> | 283 | <tr> |
| 284 | <td class="col"> | 284 | <td class="col"> |
| 285 | <button | 285 | <button |
| 286 | class="btn btn-outline-light selectable w-100" | 286 | class="btn btn-outline-light selectable w-100" |
| 287 | ng-click="show = !show; masMenos()" | 287 | ng-click="show = !show; masMenos()" |
| 288 | ng-show="facturaTabla.length > 0" | 288 | ng-show="cobranza.facturas.length > 0" |
| 289 | > | 289 | > |
| 290 | <i | 290 | <i |
| 291 | class="fa fa-chevron-down" | 291 | class="fa fa-chevron-down" |
| 292 | ng-hide="show" | 292 | ng-hide="show" |
| 293 | aria-hidden="true" | 293 | aria-hidden="true" |
| 294 | > | 294 | > |
| 295 | </i> | 295 | </i> |
| 296 | <i | 296 | <i |
| 297 | class="fa fa-chevron-up" | 297 | class="fa fa-chevron-up" |
| 298 | ng-show="show" | 298 | ng-show="show" |
| 299 | aria-hidden="true"> | 299 | aria-hidden="true"> |
| 300 | </i> | 300 | </i> |
| 301 | </button> | 301 | </button> |
| 302 | </td> | 302 | </td> |
| 303 | </tr> | 303 | </tr> |
| 304 | <!-- FOOTER --> | 304 | <!-- FOOTER --> |
| 305 | <tr class="d-flex"> | 305 | <tr class="d-flex"> |
| 306 | <td class="align-middle no-border-top" colspan="2"> | 306 | <td class="align-middle no-border-top" colspan="2"> |
| 307 | <strong>Cantidad Items:</strong> | 307 | <strong>Cantidad Items:</strong> |
| 308 | <a ng-bind="facturaTabla.length"></a> | 308 | <a ng-bind="cobranza.facturas.length"></a> |
| 309 | </td> | 309 | </td> |
| 310 | </tr> | 310 | </tr> |
| 311 | </tfoot> | 311 | </tfoot> |
| 312 | </table> | 312 | </table> |
| 313 | <!-- COBROS --> | 313 | <!-- COBROS --> |
| 314 | <table class="table table-sm table-striped tabla-articulo mb-5" ng-show="!cobroDeuda"> | 314 | <table class="table table-sm table-striped tabla-articulo mb-5" ng-show="!cobroDeuda"> |
| 315 | <thead> | 315 | <thead> |
| 316 | <tr class="d-flex"> | 316 | <tr class="d-flex"> |
| 317 | <th class="">#</th> | 317 | <th class="">#</th> |
| 318 | <th class="col px-0"> | 318 | <th class="col px-0"> |
| 319 | <div class="d-flex"> | 319 | <div class="d-flex"> |
| 320 | <div class="col-4 px-1">Cobro</div> | 320 | <div class="col-4 px-1">Cobro</div> |
| 321 | <div class="col-4 px-1">Fecha</div> | 321 | <div class="col-4 px-1">Fecha</div> |
| 322 | <div class="col-4 px-1">Importe</div> | 322 | <div class="col-4 px-1">Importe</div> |
| 323 | </div> | 323 | </div> |
| 324 | </th> | 324 | </th> |
| 325 | <th class="text-center tamaño-boton"> | 325 | <th class="text-center tamaño-boton"> |
| 326 | | 326 | |
| 327 | </th> | 327 | </th> |
| 328 | </tr> | 328 | </tr> |
| 329 | </thead> | 329 | </thead> |
| 330 | <tbody> | 330 | <tbody> |
| 331 | <tr | 331 | <tr |
| 332 | ng-repeat="(key, cobro) in cobrosTabla" | 332 | ng-repeat="(key, cobro) in cobranza.cobros" |
| 333 | ng-show="show || key == cobrosTabla.length - 1" | 333 | ng-show="show || key == cobranza.cobros.length - 1" |
| 334 | > | 334 | > |
| 335 | <td class="w-100 align-middle d-flex p-0"> | 335 | <td class="w-100 align-middle d-flex p-0"> |
| 336 | <div class="align-middle p-1"> | 336 | <div class="align-middle p-1"> |
| 337 | <span ng-bind="key+1" class="align-middle"></span> | 337 | <span ng-bind="key+1" class="align-middle"></span> |
| 338 | </div> | 338 | </div> |
| 339 | <div class="col px-0"> | 339 | <div class="col px-0"> |
| 340 | <div class="d-flex"> | 340 | <div class="d-flex"> |
| 341 | <div class="col-4 p-1"> | 341 | <div class="col-4 p-1"> |
| 342 | <span ng-bind="cobro.tipo" | 342 | <span ng-bind="cobro.tipo" |
| 343 | ></span> | 343 | ></span> |
| 344 | </div> | 344 | </div> |
| 345 | <div class="col-4 p-1"> | 345 | <div class="col-4 p-1"> |
| 346 | <span ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></span> | 346 | <span ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></span> |
| 347 | </div> | 347 | </div> |
| 348 | <div class="col-4 p-1"> | 348 | <div class="col-4 p-1"> |
| 349 | <span | 349 | <span |
| 350 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | | 350 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | |
| 351 | currency: cobranza.moneda.SIMBOLO : 4"></span> | 351 | currency: cobranza.moneda.SIMBOLO : 4"></span> |
| 352 | </div> | 352 | </div> |
| 353 | </div> | 353 | </div> |
| 354 | </div> | 354 | </div> |
| 355 | <div class="align-middle p-1"> | 355 | <div class="align-middle p-1"> |
| 356 | <button | 356 | <button |
| 357 | class="btn btn-outline-light" | 357 | class="btn btn-outline-light" |
| 358 | ng-click="quitarCobro(key)" | 358 | ng-click="quitarCobro(key)" |
| 359 | > | 359 | > |
| 360 | <i class="fa fa-trash"></i> | 360 | <i class="fa fa-trash"></i> |
| 361 | </button> | 361 | </button> |
| 362 | </div> | 362 | </div> |
| 363 | </td> | 363 | </td> |
| 364 | </tr> | 364 | </tr> |
| 365 | </tbody> | 365 | </tbody> |
| 366 | <tfoot> | 366 | <tfoot> |
| 367 | <!-- SELECCIONAR PRODUCTO --> | 367 | <!-- SELECCIONAR PRODUCTO --> |
| 368 | <tr ng-show="cargando" class="d-flex"> | 368 | <tr ng-show="cargando" class="d-flex"> |
| 369 | <td class="col-4"> | 369 | <td class="col-4"> |
| 370 | <input | 370 | <input |
| 371 | placeholder="Cheque" | 371 | placeholder="Cheque" |
| 372 | class="form-control form-control-sm" | 372 | class="form-control form-control-sm" |
| 373 | readonly | 373 | readonly |
| 374 | ng-click="seleccionarCheque()" | 374 | ng-click="seleccionarCheque()" |
| 375 | /> | 375 | /> |
| 376 | </td> | 376 | </td> |
| 377 | <td class="col-4"> | 377 | <td class="col-4"> |
| 378 | <input | 378 | <input |
| 379 | placeholder="Efectivo" | 379 | placeholder="Efectivo" |
| 380 | class="form-control form-control-sm" | 380 | class="form-control form-control-sm" |
| 381 | readonly | 381 | readonly |
| 382 | ng-click="seleccionarEfectivo()" | 382 | ng-click="seleccionarEfectivo()" |
| 383 | /> | 383 | /> |
| 384 | </td> | 384 | </td> |
| 385 | <td class="col-4"> | 385 | <td class="col-4"> |
| 386 | <input | 386 | <input |
| 387 | placeholder="Detalles" | 387 | placeholder="Detalles" |
| 388 | class="form-control form-control-sm" | 388 | class="form-control form-control-sm" |
| 389 | readonly | 389 | readonly |
| 390 | ng-click="seleccionarDetalles()" | 390 | ng-click="seleccionarDetalles()" |
| 391 | /> | 391 | /> |
| 392 | </td> | 392 | </td> |
| 393 | </tr> | 393 | </tr> |
| 394 | <!-- TOOGLE EXPANDIR --> | 394 | <!-- TOOGLE EXPANDIR --> |
| 395 | <tr> | 395 | <tr> |
| 396 | <td class="col"> | 396 | <td class="col"> |
| 397 | <button | 397 | <button |
| 398 | class="btn btn-outline-light selectable w-100" | 398 | class="btn btn-outline-light selectable w-100" |
| 399 | ng-click="show = !show; masMenos()" | 399 | ng-click="show = !show; masMenos()" |
| 400 | ng-show="cobrosTabla.length > 0" | 400 | ng-show="cobranza.cobros.length > 0" |
| 401 | > | 401 | > |
| 402 | <i | 402 | <i |
| 403 | class="fa fa-chevron-down" | 403 | class="fa fa-chevron-down" |
| 404 | ng-hide="show" | 404 | ng-hide="show" |
| 405 | aria-hidden="true" | 405 | aria-hidden="true" |
| 406 | > | 406 | > |
| 407 | </i> | 407 | </i> |
| 408 | <i | 408 | <i |
| 409 | class="fa fa-chevron-up" | 409 | class="fa fa-chevron-up" |
| 410 | ng-show="show" | 410 | ng-show="show" |
| 411 | aria-hidden="true"> | 411 | aria-hidden="true"> |
| 412 | </i> | 412 | </i> |
| 413 | </button> | 413 | </button> |
| 414 | </td> | 414 | </td> |
| 415 | </tr> | 415 | </tr> |
| 416 | <!-- FOOTER --> | 416 | <!-- FOOTER --> |
| 417 | <tr class="d-flex"> | 417 | <tr class="d-flex"> |
| 418 | <td class="align-middle no-border-top col-6"> | 418 | <td class="align-middle no-border-top col-6"> |
| 419 | <strong>Cantidad Items:</strong> | 419 | <strong>Cantidad Items:</strong> |
| 420 | <a ng-bind="cobrosTabla.length"></a> | 420 | <a ng-bind="cobranza.cobros.length"></a> |
| 421 | </td> | 421 | </td> |
| 422 | </tfoot> | 422 | </tfoot> |
| 423 | </table> | 423 | </table> |
| 424 | </tr> | 424 | </tr> |
| 425 | <!-- DEUDA, COBRADO, DIFERENCIA --> | 425 | <!-- DEUDA, COBRADO, DIFERENCIA --> |
| 426 | <table class="table-responsive fixed-bottom mb-5"> | 426 | <table class="table-responsive fixed-bottom mb-5"> |
| 427 | <tr class="d-flex row"> | 427 | <tr class="d-flex row"> |
| 428 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 428 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
| 429 | <strong>Cancela:</strong> | 429 | <strong>Cancela:</strong> |
| 430 | </td> | 430 | </td> |
| 431 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 431 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
| 432 | <strong>Cobrado:</strong> | 432 | <strong>Cobrado:</strong> |
| 433 | </td> | 433 | </td> |
| 434 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 434 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
| 435 | <strong>Diferencia:</strong> | 435 | <strong>Diferencia:</strong> |
| 436 | </td> | 436 | </td> |
| 437 | <td class="table-celda-total text-center no-border-top col-4"> | 437 | <td class="table-celda-total text-center no-border-top col-4"> |
| 438 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 438 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 439 | </td> | 439 | </td> |
| 440 | <td class="table-celda-total text-center no-border-top col-4"> | 440 | <td class="table-celda-total text-center no-border-top col-4"> |
| 441 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 441 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 442 | </td> | 442 | </td> |
| 443 | <td class="table-celda-total text-center no-border-top col-4"> | 443 | <td class="table-celda-total text-center no-border-top col-4"> |
| 444 | <strong>{{((getTotalCobrado() + getTotalDeuda()) / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 444 | <strong>{{((getTotalCobrado() + getTotalDeuda()) / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
| 445 | </td> | 445 | </td> |
| 446 | </tr> | 446 | </tr> |
| 447 | </table> | 447 | </table> |
| 448 | </div> | 448 | </div> |
| 449 | </div> | 449 | </div> |
| 450 | </div> | 450 | </div> |
| 451 | </div> | 451 | </div> |
| 452 | <div class="row d-md-none fixed-bottom"> | 452 | <div class="row d-md-none fixed-bottom"> |
| 453 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> | 453 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> |
| 454 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> | 454 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
| 455 | <span | 455 | <span |
| 456 | class="mr-3 ml-auto" | 456 | class="mr-3 ml-auto" |
| 457 | ng-class="saveLoading ? 'text-muted' : ''" | 457 | ng-class="saveLoading ? 'text-muted' : ''" |
| 458 | ng-click="crearCobranza()" | 458 | ng-click="crearCobranza()" |
| 459 | ng-show="!editando" | 459 | ng-show="!editando" |
| 460 | ladda="saveLoading" | 460 | ladda="saveLoading" |
| 461 | data-style="expand-left" | 461 | data-style="expand-left" |
| 462 | >Guardar</span> | 462 | >Guardar</span> |
| 463 | </div> | 463 | </div> |
| 464 | </div> | 464 | </div> |
| 465 | </div> | 465 | </div> |
| 466 | 466 |