Pregunta: | 67423 - ERROR EN PROCESO |
Autor: | Francisco |
Buen dia, queria ver quien me puede ayudar estoy revisando un programa y esta un proceso, el problema que tengo es que no encuentro el error pues se queda como trabajando y nunca termina, y cuando lo cierro a la fuerza reviso la tabla estadoclusu tiene miles de registros pero siempre es el mismo, el proceso es este: titulo1="ESTADO DE CUENTAS POR COBRAR" SELECT cxc IF vnivel=2 SET FILTER TO Cxc.registro_f = thisform.I_registro_f.value AND vruta=cxc.vendedor ELSE SET FILTER TO Cxc.registro_f = thisform.I_registro_f.value ENDIF SELECT estadoclusu SET FILTER TO vusuario=usuario AND Cxc.registro_f = thisform.I_registro_f.value GO top DELETE NEXT 10000 pack SELECT cxc GO TOP DO WHILE NOT EOF() select estadoclusu append blank replace next 1 registro_f with cxc.registro_f replace next 1 factura with cxc.factura replace next 1 cliente with cxc.cliente replace next 1 fecha_fac with cxc.fecha_fac REPLACE NEXT 1 dias_cr WITH cxc.dias_cr replace next 1 valor_fac with cxc.valor_fac REPLACE NEXT 1 abonos WITH cxc.abonos REPLACE NEXT 1 saldo WITH cxc.saldo REPLACE NEXT 1 tipodoc WITH cxc.tipodoc REPLACE NEXT 1 operacion WITH cxc.tipopago REPLACE NEXT 1 documento WITH cxc.registro_f REPLACE NEXT 1 usuario WITH vusuario UNLOCK SELECT cxc SKIP ENDDO SELECT estadoclusu SET FILTER TO vusuario=usuario AND registro_f = thisform.I_registro_f.value go top IF vnivel=2 scan for registro_f = thisform.I_registro_f.value AND vusuario=usuario select cxcpagos SET ORDER TO registro_f thisform.varregistro_f=estadoclusu.registro_f thisform.varfactura=estadoclusu.factura seek estadoclusu.registro_f+estadoclusu.factura if not eof() DO WHILE (cxcpagos.registro_f=thisform.varregistro_f AND cxcpagos.factura=thisform.varfactura) AND NOT EOF() select estadoclusu append blank replace next 1 registro_f with cxcpagos.registro_f replace next 1 factura with cxcpagos.factura replace next 1 cliente with cxcpagos.nomcli replace next 1 abonos with cxcpagos.valor replace next 1 fecha_fac with cxcpagos.fecha_pg REPLACE NEXT 1 usuario WITH vusuario if cxcpagos.operacion="3" replace next 1 operacion with "PG" replace next 1 documento with cxcpagos.quedan ELSE if cxcpagos.operacion="4" replace next 1 operacion with "PG" replace next 1 documento with cxcpagos.documento ELSE replace next 1 operacion with "DV" replace next 1 documento with cxcpagos.documento ENDIF ENDIF UNLOCK SELECT cxcpagos SKIP ENDDO ENDIF * select notacredito * seek estadoclusu.registro_f+estadoclusu.factura * if not eof() * select estadoclusu * append blank * replace next 1 registro_f with notacredito.registro_f * replace next 1 factura with notacredito.factura * replace next 1 cliente with notacredito.nomcli * replace next 1 abonos with notacredito.valor_total * replace next 1 fecha_fac with notacredito.fecha * replace next 1 operacion with "NC" * replace next 1 documento with notacredito.nota_credito * endif select estadoclusu ENDSCAN ELSE scan for registro_f = thisform.I_registro_f.value AND vusuario=usuario select cxcpagos SET ORDER TO registro_f thisform.varregistro_f=estadoclusu.registro_f thisform.varfactura=estadoclusu.factura seek estadoclusu.registro_f+estadoclusu.factura if not eof() DO WHILE (cxcpagos.registro_f=thisform.varregistro_f AND cxcpagos.factura=thisform.varfactura) AND NOT EOF() select estadoclusu append blank replace next 1 registro_f with cxcpagos.registro_f replace next 1 factura with cxcpagos.factura replace next 1 cliente with cxcpagos.nomcli replace next 1 abonos with cxcpagos.valor replace next 1 fecha_fac with cxcpagos.fecha_pg REPLACE NEXT 1 usuario WITH vusuario if cxcpagos.operacion="3" replace next 1 operacion with "PG" replace next 1 documento with cxcpagos.quedan ELSE if cxcpagos.operacion="4" replace next 1 operacion with "PG" replace next 1 documento with cxcpagos.documento ELSE replace next 1 operacion with "DV" replace next 1 documento with cxcpagos.documento ENDIF ENDIF UNLOCK SELECT cxcpagos SKIP ENDDO ENDIF * select notacredito * seek estadoclusu.registro_f+estadoclusu.factura * if not eof() * select estadoclusu * append blank * replace next 1 registro_f with notacredito.registro_f * replace next 1 factura with notacredito.factura * replace next 1 cliente with notacredito.nomcli * replace next 1 abonos with notacredito.valor_total * replace next 1 fecha_fac with notacredito.fecha * replace next 1 operacion with "NC" * replace next 1 documento with notacredito.nota_credito * endif select estadoclusu ENDSCAN ENDIF select estadoclusu set order to factura GO top IMPEMPRESA=ALLTRIM(NOMEMPRESA) *cPrinter = GETPRINTER( ) && selecciona impresor *IF MESSAGEBOX("Desea Imprimir?",4+32+256)=6 * REPORT FORM cxcestcta TO PRINTER NOCONSOLE *ELSE REPORT FORM cxcestcta TO PRINTER PROMPT PREVIEW *ENDIF select clientes |