Hola buenas noches Marcelo,gracias por tu interes de ayudarme con esa instruccion, pero esa instruccion ya la habia puesto antes y al igual me da lo mismo se me congela, expondre lo que quiero hacer,ya que actualmente a mi en lo particular, me piden unos reportes de estados de cuentas,y actualmente me imprime bien, pero ...ahora quiero que me muestre en el reporte, si hay pagos parciales o facturas provisionadas de mas .
Cuenta Fecha de pago Referencia Cargo Abono Dif Sdo
2010-0003-0001-1601 28/04/2014 E199 250.00 2,000.00 1,750.00 aqui no tengo ningun problema con esa instruccion.
Pero ahora necesito que me muestre de esa manera los pagos parcialesa detalle en el reporte...:
aDat[1]:= S91->CUENTAS // ID Principal de cuentas contables
aDat[2]:= S91->REFERE // ID Principal de referencias folios o facturas
DO WHILE S91->(!EOF())
IF S91->CUENTAS <> aDat[1] // ID Cuenta
oPrn:CmSay(nRow,8.0, REPLI("-",86) ,oFont1,,CLR_BLACK,,)
nRow = nRow + 0.4
oPrn:CmSay(nRow,10.2, TRANS(aSub[1],cPict),oFont1,,IF(aSub[1] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Cargos
oPrn:CmSay(nRow,12.2, TRANS(aSub[2],cPict),oFont1,,IF(aSub[2] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Abonos
oPrn:CmSay(nRow,14.1, TRANS(aSub[3],cPict),oFont1,,IF(aSub[3] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Dif Sdo
oPrn:CmSay(nRow,16.1, TRANS(aSub[4],cPict),oFont1,,IF(aSub[4] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Sdo Act
nRow := nRow + 0.4
PasaCta:= .T.
AFill(aSub,0)
ENDIF
IF PasaCta
IF lSelSeg
(S10)->(DbSeek(STR(S91->SEGNEG,4)+S91->CUENTAS))
oPrn:CmSAY(nRow, 0.6, Ext_xNiv(LTRIM((S10)->CUENTAS)) ,oFont1,,CLR_BLACK,,)
oPrn:CmSay(nRow, 3.5, SUBS((S10)->DESCRIP,1,40) ,oFont1,,CLR_BLACK,,)
ELSE
(S08)->(DbSeek(S91->CUENTAS))
oPrn:CmSAY(nRow, 0.6, Ext_xNiv(LTRIM((S08)->CUENTAS)) ,oFont1,,CLR_BLACK,,)
oPrn:CmSay(nRow, 3.5, SUBS((S08)->DESCRIP,1,40) ,oFont1,,CLR_BLACK,,)
ENDIF
nRow := nRow + 0.4
PasaCta:= .F.
ENDIF
IF S91->REFERE <> aDat[2] // ID Referencia
IF ( ROUND(aSum[3],2) <> 0.00 )
aSub[1] += aSum[1] // SubTotal
aSub[2] += aSum[2] // SubTotal
aSub[3] += aSum[3] // SubTotal Dif de saldos
aSub[4] += aSum[1] - aSum[2] // SubTotal Sdo Act
aTot[1] += aSum[1] // Total
aTot[2] += aSum[2] // Total
aTot[3] += aSum[3] // Total Dif de saldos
aTot[4] += aSum[1] - aSum[2] // Total Sdo Act
IF ( ROUND(aSum[1],2) <> 0.00 ) // S91->SALCARG
S91->(DbSetOrder(1))
S91->(DbGoTop())
S91->( DbSeek(aDat[1]+aDat[2]) )
// Aqui imprimiendo pagos parciales si los hay con la condicion de S99->CARGOS
DO WHILE S91->CUENTAS=aDat[1] .AND. S91->REFERE=aDat[2] .AND. S91->( !EOF() )
aSub[5] := S91->SALCARG - S91->SALCRED // Dif Sdo
aSub[6] += S91->SALCARG - S91->SALCRED // Sdo Act
oPrn:CmSay(nRow, 0.5, SUBS(S91->TIPO,1,2) ,oFont1,,CLR_BLACK,,2) // TIPO
oPrn:CmSay(nRow, 1.4, LTRIM(STR(S91->NUMPOL,5)) ,oFont1,,,,1) // NUMPOL
oPrn:CmSay(nRow, 1.7, DTOC(S91->FHAMOV) ,oFont1) // FHAMOV
oPrn:CmSay(nRow, 2.9, SUBS(S91->CONCEP,1,25) ,oFont1) // CONCEP
oPrn:CmSay(nRow, 7.2, SUBS(S91->REFERE,1,8) ,oFont1) // REFERE
oPrn:CmSay(nRow,10.2, TRANS(S91->SALCARG,cPict) ,oFont1,,IF(S91->SALCARG < 0,CLR_HRED,CLR_BLACK),,1) // SALCARG
oPrn:CmSay(nRow,12.2, TRANS(S91->SALCRED,cPict) ,oFont1,,IF(S91->SALCRED < 0,CLR_HRED,CLR_BLACK),,1) // SALCRED
oPrn:CmSay(nRow,14.1, TRANS(aSub[5],cPict) ,oFont1,,IF(aSub[5] < 0,CLR_HRED,CLR_BLACK),,1) // Dif Sdo
oPrn:CmSay(nRow,16.1, TRANS(aSub[6],cPict) ,oFont1,,IF(aSub[6] < 0,CLR_HRED,CLR_BLACK),,1) // Sdo Act
nRow := nRow + 0.4
S91->( DbSkip() )
ENDDO
ELSE
oPrn:CmSay(nRow, 0.5, SUBS(aDat[3],1,2) ,oFont1,,CLR_BLACK,,2) // TIPO
oPrn:CmSay(nRow, 1.4, LTRIM(STR(aDat[4],5)),oFont1,,,,1) // NUMPOL
oPrn:CmSay(nRow, 1.7, DTOC(aDat[5]) ,oFont1) // FHAMOV
oPrn:CmSay(nRow, 2.9, SUBS(aDat[6],1,25) ,oFont1) // CONCEP
oPrn:CmSay(nRow, 7.2, SUBS(aDat[2],1,8) ,oFont1) // REFERE
oPrn:CmSay(nRow,10.2, TRANS(aSum[1],cPict) ,oFont1,,IF(aSum[1] < 0,CLR_HRED,CLR_BLACK),,1) // SALCARG
oPrn:CmSay(nRow,12.2, TRANS(aSum[2],cPict) ,oFont1,,IF(aSum[2] < 0,CLR_HRED,CLR_BLACK),,1) // SALCRED
oPrn:CmSay(nRow,14.1, TRANS(aSum[3],cPict) ,oFont1,,IF(aSum[3] < 0,CLR_HRED,CLR_BLACK),,1) // Dif Sdo
oPrn:CmSay(nRow,16.1, TRANS(aSub[4],cPict) ,oFont1,,IF(aSum[4] < 0,CLR_HRED,CLR_BLACK),,1) // Sdo Act
nRow := nRow + 0.4
ENDIF
*IF S91->( !EOF() )
* S91->( DbSkip(-1) ) // Aqui lo tengo comentado,porque se me congela a pesar que le
*ENDIF // tengo puesto esta condicion
ENDIF
AFill(aSum,0)
ENDIF
aDat[1]:= S91->CUENTAS // ID Principal de cuentas contables
aDat[2]:= S91->REFERE // ID Principal de referencias folios o facturas
aDat[3]:= S91->TIPO
aDat[4]:= S91->NUMPOL
aDat[5]:= S91->FHAMOV
aDat[6]:= S91->CONCEP
aSum[1] += S91->SALCARG // Suma Cargos
aSum[2] += S91->SALCRED // Suma Abonos
aSum[3] += (S91->SALCARG - S91->SALCRED) // Suma Dif de saldos
aSum[4] += aSum[1] - aSum[2] // Sdo Act
S91->( DbSkip() )
IF nRow >= 25.5
PageEnd()
PageBegin()
TitEmpresa(TitRp, oPrn, oFont1)
TitDatos(oPrn, oFont1)
nRow := 3.0
ENDIF
ENDDO
oPrn:CmSay(nRow,8.0, REPLI("-",89) ,oFont1,,CLR_BLACK,,)
nRow = nRow + 0.4
oPrn:CmSay(nRow,10.2, TRANS(aSub[1],cPict),oFont1,,IF(aSub[1] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Cargos
oPrn:CmSay(nRow,12.2, TRANS(aSub[2],cPict),oFont1,,IF(aSub[2] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Abonos
oPrn:CmSay(nRow,14.1, TRANS(aSub[3],cPict),oFont1,,IF(aSub[3] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Dif Sdo
oPrn:CmSay(nRow,16.1, TRANS(aSub[4],cPict),oFont1,,IF(aSub[4] < 0,CLR_HRED,CLR_BLACK),,1) //Suma Sdo Act
nRow = nRow + 0.4
nRow = nRow + 0.4
oPrn:CmSay(nRow, 6.6, "Totales:" ,oFont1,,CLR_BLACK,,)
oPrn:CmSay(nRow,10.2, TRANS(aTot[1],cPict),oFont1,,IF(aTot[1] < 0,CLR_HRED,CLR_BLACK),,1) //Total Cargos
oPrn:CmSay(nRow,12.2, TRANS(aTot[2],cPict),oFont1,,IF(aTot[2] < 0,CLR_HRED,CLR_BLACK),,1) //Total Abonos
oPrn:CmSay(nRow,14.1, TRANS(aTot[3],cPict),oFont1,,IF(aTot[3] < 0,CLR_HRED,CLR_BLACK),,1) //Total Dif Sdo
oPrn:CmSay(nRow,16.1, TRANS(aTot[4],cPict),oFont1,,IF(aTot[4] < 0,CLR_HRED,CLR_BLACK),,1) //Total Sdo Act
PageEnd()
oFont1:End()
oFont2:End()
PrintEnd()
S91->(DbCloseArea())
oGet[01]:SetFocus()
*MsgInfo("Regresa por aca,antes de cerrar pantalla de reportes???")
Mes_Per := cMesPerAct
Ano_per := cAnoPerAct
Release oPrn, oFont,oFont1, oFont2, nVer, nHor
Release S91, Ind1Tmp1, Ind1Tmp2, CreaDbf1,TitRp,CtaIni, CtaFin,PasaCta, ;
cMA_Ini, cMA_Fin,cCtas,nSegNeg,cCtSN // oText
RETURN NIL
//------------------------------------------------------------------------------
STATIC FUNCTION TitDatos(oPrn, oFont1)
oPrn:CmSay(1.80, 0.5, REPLI("-",215) , oFont1)
oPrn:CmSay(2.10, 1.2, "Cuentas" , oFont1)
oPrn:CmSay(2.10, 3.5, "Descripción" , oFont1)
oPrn:CmSay(2.40, 0.6, "Tipo,Núm" , oFont1)
oPrn:CmSay(2.40, 2.0, "Fecha" , oFont1)
oPrn:CmSay(2.40, 3.6, "Concepto" , oFont1)
oPrn:CmSay(2.40, 7.0, "Referencia" , oFont1)
oPrn:CmSay(2.40, 9.4, "Debe" , oFont1)
oPrn:CmSay(2.40,11.3, "Haber" , oFont1)
oPrn:CmSay(2.40,12.9, "Dif. Sdo." , oFont1)
oPrn:CmSay(2.40,14.6, "Sdo. actual" , oFont1)
oPrn:CmSay(2.70, 0.5, REPLI("-",215) , oFont1)
RETURN NIL
Saludos y buenas noches .
Atte: Adrian C. C.