FIELD CUENTAS, SEGNEG, REFERE
CtaIni := SUBS(CtaInif,1,4)+SUBS(CtaInif,6,4)+SUBS(CtaInif,11,4)+SUBS(CtaInif,16,4)
CtaFin := SUBS(CtaFinf,1,4)+SUBS(CtaFinf,6,4)+SUBS(CtaFinf,11,4)+SUBS(CtaFinf,16,4)
cMA_Ini := SUBS(nMA_Ini,3,2)+SUBS(nMA_Ini,1,2)
cMA_Fin := SUBS(nMA_Fin,3,2)+SUBS(nMA_Fin,1,2)
***********************************************************************************
*----- Traspasando cuentas integración de saldos general en archivo temporal -----*
***********************************************************************************
S91 := "EMP"+TSTR(xEMP)+TRIM("\R_INTS"+nStation)+".DBF"
Ind1Tmp1:= "R_INTS"+nStation
Ind1Tmp2:= "R_INTSN"
nReg := 1
IF FILE(S91)
*S91->(DbCloseArea())
FERASE(S91)
FERASE("EMP"+TSTR(nNumEmp)+"\"+Ind1Tmp1+".CDX")
ENDIF
IF !FILE(S91)
CreaDbf1 := {{"TIPO " , "C" , 2 , 0 } ,; // 1
{"NUMPOL " , "N" , 5 , 0 } ,; // 2
{"FHAMOV " , "D" , 8 , 0 } ,; // 3
{"CUENTAS" , "C" , 16 , 0 } ,; // 4
{"SEGNEG" , "N" , 4 , 0 } ,; // 5
{"REFERE " , "C" , 10 , 0 } ,; // 6
{"CONCEP " , "C" , 60 , 0 } ,; // 7
{"SALCARG" , "N" , 12 , 2 } ,; // 8
{"SALCRED" , "N" , 12 , 2 } ,; // 9
{"SALDOS" , "N" , 12 , 2 } ,; //10 Sdo de factura a pagar
{"IMPBS1" , "N" , 12 , 2 } ,; //11 Base 1
{"TASA1" , "N" , 12 , 2 } ,; //12 Tasa 1
{"IVA_1" , "N" , 12 , 2 } ,; //13 IVA 10%
{"IMPBS2" , "N" , 12 , 2 } ,; //14 Base 2
{"TASA2" , "N" , 12 , 2 } ,; //15 Tasa 2
{"IVA_2" , "N" , 12 , 2 } ,; //16 IVA 15%
{"T_0" , "N" , 12 , 2 } ,; //17 Tasa 0
{"T_EXENT" , "N" , 12 , 2 } ,; //18 Exento
{"OTROS" , "N" , 12 , 2 } ,; //19 Otros
{"IMPBS3" , "N" , 12 , 2 } ,; //20 Otras tasas
{"T_Otras" , "N" , 12 , 2 } ,; //21 IVA x 0
{"RET_IVA" , "N" , 12 , 2 } ,; //22 Ret IVA
{"RET_ISR" , "N" , 12 , 2 } ,; //23 Ret ISR
{"TOTFAC" , "N" , 12 , 2 } ,; //24 Importe total por factura
{"REG " , "N" , 3 , 0 }} //25
DbCreate(S91,CreaDbf1)
USE (S91) ALIAS S91 EXCLUSIVE // NEW SHARED
INDEX ON CUENTAS+REFERE TAG (Ind1Tmp1) FOR !DELETED()
INDEX ON STR(SEGNEG,4)+CUENTAS+REFERE TAG (Ind1Tmp2) FOR !DELETED()
S91->(DbSetIndex(Ind1Tmp1))
S91->(OrdSetFocus(1))
ELSE
USE (S91) ALIAS S91 EXCLUSIVE // NEW SHARED
ZAP
INDEX ON CUENTAS+REFERE TAG (Ind1Tmp1) FOR !DELETED()
INDEX ON STR(SEGNEG,4)+CUENTAS+REFERE TAG (Ind1Tmp2) FOR !DELETED()
S91->(DbSetIndex(Ind1Tmp1))
S91->(OrdSetFocus(1))
ENDIF