-
Notifications
You must be signed in to change notification settings - Fork 0
/
OPLATA_.PRG
471 lines (446 loc) · 13.5 KB
/
OPLATA_.PRG
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
Function ChoiceOplata()
LOCAL old_col1:=setcolor(),screen:=win_save(11,28,24,79),fi:='',wid:=1,widsav:=1
LOCAL temptime:={},timecreate:={},spisok,pos:=1
local first:=.T.
spisok:={" «¥ªâà®í¥à£¨ï ",;
" ¥ï ",;
" ®¢ëè¥ ï ",;
" €¡®¨à®¢ ï ",;
" ¥ï ¨ ¯®¢ëè¥ ï ",;
" à®á¬®âà ç¨á«¥¨© ¯¥¨ ¨ ¯®¢ë襮© ",;
" Š®à४â¨à®¢ª á «ì¤® ¯¥¨ ¨ ¯®¢ë襮©",;
" §®áª ®¯« âë ",;
" §®áª ®¯« âë ç á⮣® ᥪâ®à ",;
" ‡ £à㧪 ®¯« â ¨§ ॥áâà ¡ ª "}
prev_rec=prev_rec-1
do while pos>0
if first
pos=1
first=.F.
endif
choice=vert_menu(spisok,"Ž¯« â ",,11,28,pos,'n/w,n/g,,,r/w',.F.)
pos=choice
wid=choice
widsav:=wid
do case
case wid=1
Oplata()
case wid=2
penqoplata()
case wid=3
highoplata()
case wid=4
AbonOplata()
case wid=5
highNpenq()
case wid=6
ViewPenHigh()
case wid=7
CorPenWHigh()
case wid=8
Raznoska()
case wid=9
ChastnOplata()
case wid=10
ReadBank()
otherwise
Exit
endcase
wid=if(file(Ddir+'otchet.gkv'),8,widsav)
enddo
M->prev_rec=-1
win_rest(screen)
setcolor(old_col1)
Return NIL
STATIC Function CorPenWHigh()
Local Clr:=SetColor(), Scr:=Win_Save(), Sel:=Select(),SumKorP:=0.00, SumKorH:=0.00
ColorWin(11,23,14,57,"n+/n")
Set Color To &GetColor
@ 10,22 SAY "ÚÄÄÄÄÄ ‘ «ì¤® ç «® £®¤ ÄÄÄÄÄ·"
//@ 10,22 SAY "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·"
@ 11,22 SAY "³ ¥ï º"
@ 12,22 SAY "³ ®¢ëè¥ ï º"
@ 13,22 SAY "ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"
Select Obormot
Seek Main->Lic_Schet
IF Found()
SumKorP:=SaldoP
SumKorH:=SaldoH
Select(Sel)
ENDIF
Set Cursor On
Set Confirm On
@ 11,41 Get SumKorP PICTURE "@K99999999.99"
@ 12,41 Get SumKorH PICTURE "@K99999999.99"
READ
Set Cursor off
Set Confirm Off
IF LastKey()!=27
IF Al_Box({"‚¥á⨠ª®à४â¨à®¢ª¨"},2)==1
Select Obormot
Seek Main->Lic_Schet
IF Found()
IF RecLock()
Replace SaldoP With SumKorP
Replace SaldoH With SumKorH
UNLOCK
ENDIF
EndIf
ENDIF
ENDIF
Clear Typeahead
Select(Sel)
SetColor(Clr)
Win_Rest(Scr)
Return NIL
****************************************************************
Static Function oplata()
Local aOplata:={0,0,0,0,0,0,0,.t.},NextRec:=0,MaxRec:=0
private rec_buf,ord_buf,buff,color_buf,nm1,nm2,nm3,nm4,t1,l1,b1,r1,old_sel,;
name,month,go_out,change,sum,debet_pres,kredit_pres,debet_last,kredit_last,scr1,;
what_pay
change=.f.
go_out=.f.
old_sel=select()
rec_buf=recno()
ord_buf=indexord()
buff=win_save()
color_buf=setcolor()
what_pay=1
if urov<1
endif
do while .t.
month_=month_menu(1)
if month_>0
message(" ˆ¤¥â ¯®¨áª ®¯« â ¯® ¯®âॡ¨â¥«î ")
month=Schet_Share+'o'+alltrim(str(month_))+".dbf"
if select()#44
select 44
endif
Load("44",Month, Schet_Share+'o'+alltrim(str(month_))+".ntx" ,,.f.)
// NetUse(month,,0)
Select 45
zap
select 44
seek main->lic_schet
Do While Licevoj==main->lic_schet
Select 44
aOplata[1]:=Vid_Dokum
aOplata[2]:=Num_Dokum
aOplata[3]:=Licevoj
aOplata[4]:=Summa
aOplata[5]:=Data
aOplata[6]:=Reestr
aOplata[7]:=RecNo()
select 45
Append Blank
Replace Vid_Dokum With aOplata[1]
Replace Num_Dokum With aOplata[2]
Replace Licevoj With aOplata[3]
Replace Summa With aOplata[4]
Replace Data With aOplata[5]
Replace Reestr With aOplata[6]
Replace RecNo With aOplata[7]
Select 44
Skip
ENDDO
Select 45
// set filter to licevoj=main->lic_schet
go top
set color to n/w
colorwin(1,3,3,77,'w/w')
declare zgl[5]
declare fil[5]
name='‘¯à ¢®ç¨ª ®¯« âë áç¥â®¢ § '+mesqc(month_)+' ¬¥áïæ'
@ 1,3 say replicate(' ',73)
@ 1,(79-len(name))/2 say name
name=alltrim(main->potrebitel)+;
IF(Asc(Substr(Main->LockMonth,Month_,1))==Month_," >> Ž‘ŒŽ’ <<","")
@ 2,(79-len(name))/2 say name
nm1=loarr('zgl','‚¨¤ ¤®ª.','®¬¥à ¤®ª.','‘㬬 ®¯« âë','„ â ®¯« âë','N ¥¥áâà ')
nm2=loarr('fil','vid_dokum','num_dokum','summa','data','reestr')
inp='0000'
************ Begin make box
t1=3 && Up
l1=3 && Left
b1=18 && Down
r1=77 && Right
************* End make
colorwin(3,3,19,78,'n+/n')
// DbEdit(3,3,18,77,Fil,,,,Zgl)
fsbrowse(7,1,20,78,'fil','zgl',inp,urov,kl,IF(Asc(Substr(Main->LockMonth,Month_,1))==Month_,.f.,.t.))
win_rest(buff)
// set filter to
// use
if change
select 45
MaxRec:=RecCount()
go top
For NextRec=1 To MaxRec
Select 45
Go NextRec
aOplata[1]:=Vid_Dokum
aOplata[2]:=Num_Dokum
aOplata[3]:=Licevoj
aOplata[4]:=Summa
aOplata[5]:=Data
aOplata[6]:=Reestr
aOplata[7]:=RecNo
aOplata[8]:=Deleted()
select 44
IF aOplata[7]==0
IF NetAppend()
aOplata[7]:=RecNo()
UNLOCK
ENDIF
ENDIF
Go aOplata[7]
IF RecLock()
Replace Vid_Dokum With aOplata[1]
Replace Num_Dokum With aOplata[2]
Replace Licevoj With aOplata[3]
Replace Summa With aOplata[4]
Replace Data With aOplata[5]
Replace Reestr With aOplata[6]
IF aOplata[8]==.T.
Delete
ENDIF
UNLOCK
ENDIF
Next
Select 45
aaa=savescreen(9,7,13,74)
message(" „ ë¥ ¡ë«¨ ¨§¬¥¥ë ! †¤¨â¥,¨¤¥â à áç¥â !!! ")
Select Main
do outex with month_
restscreen(9,7,13,74,aaa)
select 44
Close
endif
change=.f.
else
exit
endif
enddo
select(old_sel)
set color to (color_buf)
set order to ord_buf
go rec_buf
win_rest(buff)
return NIL
*********************************
Static Function highoplata
private recbuf,ordbuf,scrbuf,colorbuf,nm1,nm2,nm3,nm4,t1,l1,b1,r1,tmp,month_,database
sele=select()
recbuf=recno()
ordbuf=indexord()
scrbuf=win_save()
colorbuf=setcolor()
do while .t.
month_=month_menu(1)
if month_>0
database=Schet_Share+'h'+alltrim(str(month_))+'.dbf'
select 44
Load("44",Database, Schet_Share+'h'+alltrim(str(month_))+".ntx" ,,.f.)
// NetUse(database,,0)
set color to
set filter to licevoj=main->lic_schet
go top
set color to n/w
declare zgl[5]
declare fil[5]
colorwin(1,3,19,78,'n+/n')
name='‘¯à ¢®ç¨ª ®¯« âë ¯®¢ë襮© § '+mesqc(month_)+' ¬¥áïæ'
@ 1,3 say replicate(' ',75)
@ 2,3 say replicate(' ',75)
@ 1,(79-len(name))/2 say name
name=alltrim(main->potrebitel)
@ 2,(79-len(name))/2 say name
nm1=loarr('zgl','‚¨¤ ¤®ª.','®¬¥à ¤®ª.','‘㬬 ®¯« âë','„ â ®¯« âë','N ¥¥áâà ')
nm2=loarr('fil','vid_dokum','num_dokum','summa','data','reestr')
inp='00000'
************ Begin make box
t1=3 && Up
l1=3 && Left
b1=18 && Down
r1=77 && Right
************* End make
fsbrowse(7,1,20,78,'fil','zgl',inp,urov,kl)
win_rest(scrbuf)
set filter to
go top
use
else
exit
endif
enddo
select(sele)
set color to (colorbuf)
set order to ordbuf
go recbuf
win_rest(scrbuf)
return NIL
Static Function AbonOplata
private recbuf,ordbuf,scrbuf,colorbuf,nm1,nm2,nm3,nm4,t1,l1,b1,r1
Private tmp,month_,database,Change:=.F.
sele=select()
recbuf=recno()
ordbuf=indexord()
scrbuf=win_save()
colorbuf=setcolor()
do while .t.
month_=month_menu(1)
if month_>0
database=Schet_Share+'a'+alltrim(str(month_))+'.dbf'
select 44
Load("44",Database, Schet_Share+'a'+alltrim(str(month_))+".ntx" ,,.f.)
// NetUse(database,,0)
set color to
set filter to licevoj=main->lic_schet
go top
set color to n/w
declare zgl[5]
declare fil[5]
colorwin(1,3,19,78,'n+/n')
name='‘¯à ¢®ç¨ª ®¯« âë ¡®¨à®¢ ®© § '+mesqc(month_)+' ¬¥áïæ'
@ 1,3 say replicate(' ',75)
@ 2,3 say replicate(' ',75)
@ 1,(79-len(name))/2 say name
name=alltrim(main->potrebitel)
@ 2,(79-len(name))/2 say name
nm1=loarr('zgl','‚¨¤ ¤®ª.','®¬¥à ¤®ª.','‘㬬 ®¯« âë','„ â ®¯« âë','N ¥¥áâà ')
nm2=loarr('fil','vid_dokum','num_dokum','summa','data','reestr')
inp='00000'
************ Begin make box
t1=3 && Up
l1=3 && Left
b1=18 && Down
r1=77 && Right
************* End make
fsbrowse(7,1,20,78,'fil','zgl',inp,urov,kl)
win_rest(scrbuf)
set filter to
go top
use
IF Change
Select Main
aaa=savescreen(9,7,13,74)
message(" „ ë¥ ¡ë«¨ ¨§¬¥¥ë ! †¤¨â¥,¨¤¥â à áç¥â !!! ")
Do OutEx With Month_
restscreen(9,7,13,74,aaa)
ENDIF
else
exit
endif
enddo
select(sele)
set color to (colorbuf)
set order to ordbuf
go recbuf
win_rest(scrbuf)
return NIL
Static Function penqoplata
private recbuf,ordbuf,scr,colorbuf,nm1,nm2,nm3,nm4,t1,l1,b1,r1,tmp,month_,database
sele=select()
recbuf=recno()
ordbuf=indexord()
scr=win_save()
colorbuf=setcolor()
do while .t.
month_=month_menu(1)
if month_>0
database=Schet_Share+'p'+alltrim(str(month_))+'.dbf'
select 44
Load("44",Database, Schet_Share+'p'+alltrim(str(month_))+".ntx" ,,.f.)
// NetUse(database,,0)
set color to
set filter to licevoj=main->lic_schet
go top
set color to n/w
declare zgl[5]
declare fil[5]
colorwin(1,3,19,78,'n+/n')
name='‘¯à ¢®ç¨ª ®¯« âë ¯¥¨ § '+mesqc(month_)+' ¬¥áïæ'
@ 1,3 say replicate(' ',75)
@ 2,3 say replicate(' ',75)
@ 1,(79-len(name))/2 say name
name=alltrim(main->potrebitel)
@ 2,(79-len(name))/2 say name
nm1=loarr('zgl','‚¨¤ ¤®ª.','®¬¥à ¤®ª.','‘㬬 ®¯« âë','„ â ®¯« âë','N ¥¥áâà ')
nm2=loarr('fil','vid_dokum','num_dokum','summa','data','reestr')
inp='00000'
************ Begin make box
t1=3 && Up
l1=3 && Left
b1=18 && Down
r1=77 && Right
************* End make
colorwin(3,3,16,78,'n+/n')
fsbrowse(7,1,20,78,'fil','zgl',inp,urov,kl)
win_rest(scr)
set filter to
go top
use
else
exit
endif
enddo
select(sele)
set color to (colorbuf)
set order to ordbuf
go recbuf
win_rest(scr)
return NIL
****************************************************************
Static Function ViewPenHigh()
PRIVATE recbuf,ordbuf,buff,colorbuf,nm1,nm2,nm3,nm4,t1,l1,b1,r1,inp
recbuf=recno()
ordbuf=indexord()
buff=win_save(1,0,maxrow(),maxcol())
colorbuf=setcolor()
Sel=Select()
if urov<1
if (.not. file(schet_Share+'PH.dbf')) .or. (.not. file(schet_Share+'PH.ntx'))
sign(2)
Select(Sel)
set color to (colorbuf)
win_rest(buff)
return NIL
else
select 34
if empty(fieldname(1))
wosst=.T.
al_box({" § ¤ ëå ¥ ®¯à¥¤¥«¥ "})
return NIL
endif
endif
endif
devout("")
set color to n/w
@ 6, 0 clear to maxrow()-1,maxcol()
set color to n/w
@ 6, 1 say Center(' ç¨á«¥ë¥ èâà äë¥ á ªæ¨¨ '+Alltrim(Main->Potrebitel),77," ",.t.)
declare zgl[6]
declare fil[6]
nm1=loarr('zgl','‹¨æ.áç¥â','¥ï','®¢ëè¥ ï','/¬¥á.',"ਬ¥ç ¨¥","Œ/") &&,'Žâà á«ì')
nm2=loarr('fil','licevoj','PenqN','HighN','Month','Text','MN') &&,'kod_otr')
inp='1000000000'
Set Filter To Licevoj==Main->Lic_Schet
Seek Main->Lic_Schet
go RecNo()
t1=7
l1=1
b1=maxrow()-1
r1=maxcol()
*********
fsbrowse(7,1,23,78,'fil','zgl',inp,urov,kl)
devout("")
set color to (colorbuf)
set order to ordbuf
Set Filter To
Go Top
Select(Sel)
go recbuf
win_rest(buff)
return NIL
*********************************