4. September 2014 14:51
25. September 2014 14:14
CLEAR(Buffer);
BufferIndex := 1;
FirstField := TRUE;
imax := 4;
IF ExportEB THEN
imax := 5;
IF ExportAdvancedInformation THEN
imax := 7;
FOR i := 1 TO imax DO BEGIN
IF NOT ExportEB THEN
IF i = 5 THEN
i+=1;
CLEAR(AddString);
IF NOT FirstField THEN BEGIN
CASE FieldSeparator OF
'<TAB>':
AddString := AddString + FORMAT(TAB);
ELSE
AddString := AddString + FieldSeparator;
END;
END;
IF FieldNames THEN BEGIN
CASE i OF
1: Add2String("G/L Account".FIELDCAPTION("No."));
2: Add2String("G/L Account".FIELDCAPTION(Name));
3: Add2String("G/L Account".FIELDCAPTION("Income/Balance"));
4: Add2String("G/L Account".FIELDCAPTION("Net Change"));
5: Add2String(Text011);
6: Add2String("G/L Account".FIELDCAPTION("Balance at Date"));
7: Add2String("G/L Account".FIELDCAPTION("No. 2"));
END;
END ELSE BEGIN
CASE i OF
1: Add2String(FORMAT("G/L Account"."No."));
2: Add2String(FORMAT("G/L Account".Name));
3: Add2String(FORMAT("G/L Account"."Income/Balance"));
4:
BEGIN
"G/L Account".CALCFIELDS("Net Change");
Add2String(FORMAT("G/L Account"."Net Change"));
END;
5:
BEGIN
CLEAR(EB);
IF "G/L Account".GETFILTER("Date Filter") <> '' THEN BEGIN
GLAccountEB.GET("G/L Account"."No.");
GLAccountEB.COPYFILTERS("G/L Account");
GLAccountEB.SETRANGE("Date Filter",01010000D,CLOSINGDATE("G/L Account".GETRANGEMIN("Date Filter") - 1));
GLAccountEB.CALCFIELDS("Balance at Date");
EB := GLAccountEB."Balance at Date";
END;
Add2String(FORMAT(EB));
END;
6:
BEGIN
"G/L Account".CALCFIELDS("Balance at Date");
Add2String(FORMAT("G/L Account"."Balance at Date"));
END;
7: Add2String(FORMAT("G/L Account"."No. 2"));
END;
END;
FirstField := FALSE;
WHILE STRLEN(AddString) <> 0 DO BEGIN
IF ((STRLEN(AddString) + STRLEN(Buffer[BufferIndex])) <= MAXSTRLEN(Buffer[BufferIndex])) THEN BEGIN
Buffer[BufferIndex] := Buffer[BufferIndex] + AddString;
CLEAR(AddString);
END ELSE BEGIN
BufferIndex += 1;
END;
END;
END;