-
Notifications
You must be signed in to change notification settings - Fork 0
/
MURLO.PRG
122 lines (122 loc) · 4.3 KB
/
MURLO.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
func oraschet
private _para
paramet _para
* Ž¡®à®âª - 15 ®¡« áâì
* Ž¯« â - 44 ®¡« áâì
* ‘ç¥â稪¨ - 1-12 ®¡« áâì
* month_ - ¥à¥¬¥ ï á ¬¥áï楬 à áç¥â ¤./ªà.
sele_old=select()
buff_old=indexord()
numrec=recno()
if pcount()<2
colorwin(0,0,5,79,'n/n')
endif
debet=0
kredit=0
beznds=0
**************** ‘ç¨â î ᪮«ìª® £®à¥«® ¯® áç¥â稪 ¬ **************
sele(month_)
go top
do while !eof()
if licevoj=main->lic_schet
if tarif#6
debet=debet+summa
else
beznds=beznds+summa
endif
endif
skip
enddo
**************** ‘ç¨â î ®¯« âã á ¢®§¢à â ¬¨ ************************
if _para=.t.
sele 44
else
mm=alltrim(str(month_))
sele 44
use &mm
endif
go top
w_ozw1=0
w_ozw2=0
w_ozw3=0
do while !eof()
if licevoj=main->lic_schet
if alltrim(vid_dokum)#'® ¢®§¢à â'.and.alltrim(vid_dokum)#'® ‚®§¢à â';
.and.alltrim(vid_dokum)#'¯¥ï'.and.alltrim(vid_dokum)#'¥ï';
.and.alltrim(vid_dokum)#'‚®§¢à â'.and.alltrim(vid_dokum)#'¢®§¢à â';
.and.alltrim(vid_dokum)#' ¢®§¢à â'.and.alltrim(vid_dokum)#' ‚®§¢à â'
kredit=kredit+summa
else
if alltrim(vid_dokum)='® ¢®§¢à â'.or.alltrim(vid_dokum)='® ‚®§¢à â'
w_ozw1=w_ozw1+summa
else
if alltrim(vid_dokum)='¢®§¢à â'.or.alltrim(vid_dokum)='‚®§¢à â'
w_ozw2=w_ozw2+summa
else
if alltrim(vid_dokum)=' ¢®§¢à â'.or.alltrim(vid_dokum)=' ‚®§¢à â'
w_ozw3=w_ozw3+summa
endif
endif
endif
endif
endif
skip
enddo
if .not._para
use
endif
**************** ‘ç¨â î H„‘ ª ¯®«ã祮© á㬬¥ *********************
* debet+bez_nds - £®à¥«® ¯® áç¥â稪 ¬
* w_ozw - á㬬 ¢®§¢à â ¯® ç¨á«¥¨î
nds=round(debet*schet_nds/100,0)
debet=(debet+nds+beznds+w_ozw1)-w_ozw2-w_ozw3
kredit=kredit-w_ozw2
**************** ‚ëç¨á«ïî ¯à®è«ë© ¤¥¡¥â/ªà¥¤¨â *********************
sele 15
seek main->lic_schet
d_last=if(month_>1,'obormot->debet'+alltrim(str(month_-1)),'obormot->last_debet')
k_last=if(month_>1,'obormot->kredit'+alltrim(str(month_-1)),'obormot->last_kred')
if !empty(&d_last).and.!empty(&k_last)
Myerror("® áç¥âã "+alltrim(str(main->lic_schet))+" ¥áâì ¤¥¡¥â ¨ ªà¥¤¨â")
return .f.
endif
**************** ‚ëç¨á«ïî áâ®ï騩 ¤¥¡¥â/ªà¥¤¨â *******************
d_pres='obormot->debet'+alltrim(str(month_))
k_pres='obormot->kredit'+alltrim(str(month_))
**************** ‚ëç¨á«ïî १ã«ìâ â á ãç¥â®¬ ¯à®è«®£® ¬¥áïæ *******
debet=debet+&d_last
kredit=kredit+&k_last
**************** ‡ ¯¨áë¢ î áâ®ï騩 ¤¥¡¥â/ªà¥¤¨â ******************
sele 15
seek main->lic_schet
do case
case debet>kredit
if &d_pres#round(debet-kredit,0).and.&k_pres#0
if pcount()<2
Myerror("H¥á®¢¯ ¤¥¨¥ ¤ ëå ¯® áç¥âã "+str(main->lic_schet))
endif
endif
replace &d_pres with round(debet-kredit,0)
replace &k_pres with 0
case debet<kredit
if &k_pres#round(kredit-debet,0).and.&d_pres#0
if pcount()<2
Myerror("H¥á®¢¯ ¤¥¨¥ ¤ ëå ¯® áç¥âã "+str(main->lic_schet))
endif
endif
replace &k_pres with round(kredit-debet,0)
replace &d_pres with 0
case debet=kredit
if &d_pres#0.and.&k_pres#0
if pcount()<2
Myerror("H¥á®¢¯ ¤¥¨¥ ¤ ëå ¯® áç¥âã "+str(main->lic_schet))
endif
endif
replace &d_pres with 0
replace &k_pres with 0
endcase
**************** Š®¥æ ¢á¥¬ à áç¥â ¬, § ¯¨áë¢ î १ã«ìâ â **********
select(sele_old)
set order to buff_old
go numrec
return .t.