-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_odt_2.mac
More file actions
89 lines (72 loc) · 3.07 KB
/
test_odt_2.mac
File metadata and controls
89 lines (72 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import ClnInter, BankInter, CtgInter;
import globals;
import TOffDoc;
var dateReport={curdate};
var fAccount =TBFile("account.dbt", "R",4,null,"bank.def");
var fPT= TBFile("partyown.dbt", "R", 1,null,"bank.def");
var okPT:Bool;
var rep=TOpenDocForm("áç¥â ª«¨¥â®¢.odt");
rep.Section(); //‚ ®âçñ⥠¡ã¤¥â ¨á¯®«ì§®¢ âìáï ¬¥å ¨§¬ à §¤¥«®¢
//ˆ¬ï à §¤¥« ¥ 㪠§ ®, § ç¨â ¡ã¤¥â ¨á¯®«ì§®¢ âìáï " §¤¥«1"
rep.SetSectionFields("Š«¨¥â", "ˆ", "Š", "‘㬬 _¯®_áçñâã"); //¥à¥ç¨á«ïîâáï ¯®«ï, ª®â®àë¥ ®â®áïâáï ª à §¤¥«ã
//®«ï ª ¨ ˆá¯®«¨â¥«ì áî¤ ¥ ¢å®¤ïâ, § ç¨â íâ® "£«®¡ «ìë¥ ¯®«ï"
rep.SetField("ˆá¯®«¨â¥«ì",GetFioOper({oper}));
rep.SetField(" ª", {name_bank});
/* */
var flagNoAccount=true;
var sFullName, sShortName, sAddName;
var cntCln=0, cntAcc=0;
var sumAcc=$0;
macro OpenCloseAcc(CharOpenClose)
var aRow=TArray();
fAccount.rec.Open_Close=CharOpenClose;
fAccount.rec.Client=fPT.rec.ClientId;
fAccount.rec.Sort="";
var getOk=fAccount.GetGE();
while(getOk and (fAccount.rec.Open_Close==CharOpenClose) and (fAccount.rec.Client==fPT.rec.ClientId))
if ((fAccount.rec.Close_Date==Date(0,0,0)) or (fAccount.rec.Close_Date<=dateReport))
if (flagNoAccount)
rep.SectionAdd(); //ᥪæ¨î ¤®¡ ¢«ï¥¬ ⮫쪮 ª®£¤ ¥áâì áç¥â , ¨ ç¥ ¡ã¤ãâ ¯ãáâë¥ á¥ªæ¨¨ ¤«ï ª«¨¥â®¢ ¡¥§ áç¥â®¢
flagNoAccount=false;
rep.SetField("Š«¨¥â",sShortName);
rep.SetField("ˆ",GetClientINN(fPT.rec.ClientId));
rep.SetField("Š",GetClientKPP(fPT.rec.ClientId));
rep.iTableFooterRows=1; /* “ â ¡«¨æë ¥áâì ¯®¤¢ « */
rep.Table(); /* §¢ ¨¥ â ¡«¨æë, ¯® 㬮«ç ¨î "’ ¡«¨æ 1" */
end;
aRow[0]=fAccount.rec.Account;
aRow[1]=String(fAccount.rec.Final_Date:f);
aRow[2]=fAccount.rec.R0;
rep.WriteRow(aRow);
cntAcc=cntAcc+1;
sumAcc=sumAcc+fAccount.rec.R0;
end;
getOk=fAccount.Next();
end;
end;
fPT.rec.PartyKind=PTK_CLIENT;
fPT.rec.Sort="";
okPT=fPT.GetGE();
/* ¯¥à¥¡®à ¢á¥å ª«¨¥â®¢ */
while(okPT and (fPT.rec.PartyKind==PTK_CLIENT))
/* ®â¡¨à ¥¬ ž‹ */
if( PTLEGF_INST==GetClientLegalForm(fPT.rec.ClientId))
flagNoAccount=true;
sumAcc=$0;
GetClientNames(fPT.rec.ClientId, sFullName, sShortName, sAddName);
OpenCloseAcc("");
OpenCloseAcc("‡");
if (not flagNoAccount);
rep.SetField("‘㬬 _¯®_áçñâã", sumAcc);
end;
cntCln=cntCln+1;
message(cntCln);
end;
okPT=fPT.next();
//¤«ï ¯à¨¬¥à ®£à ¨ç¨¢ ¥¬ ¢à¥¬ï ¢ë¯®«¥¨ï ¬ ªà®á
if(cntCln>200)
okPT=false;
end;
end; //while
rep.SetField("‚ᥣ®_ª«¨¥â®¢", cntCln);
rep.SetField("‚ᥣ®_áç¥â®¢", cntAcc);