luni, 1 iulie 2013

FoxProW pentru incepatori Cap. 10 p.1-a

Cap 10. Programe tip 

În cadrul acestui capitol vom studia şi vom discuta câteva programe performante, pe care le recomandăm în lucrărite pe care le veţi proiecta deoarece !e considerăm necesare şi eficiente.
Aceste programe vor fi mai întâi prezentate, iar apoi vom discuta relativ la ele. Pentru ca să discutăm despre programe este necesar să discutăm despre bazele de date necesare. Bazele de date necesare sunt prezentate în tabelul următor;
           System: Evidenta situatiilor financiar-contabile Author: Emil Pfeiffer
           08/21/98 10:49:45 
           Database Structure Summary
           **********************************
           13 databases in the system
           NOM.DBF STOC.DBF
           MiSC.DBF
           FACT.DBF
           TMP.DBF
           MISC3.DBF
           INCAS.DBF
           FUR.DBF
           TYPE.DBP
           FISTMP.DBF
           FTMP.DBP
           FUR1.DBF
           MTOT.DBF
           **********************************
           Structure for database: NOM.DBF
           Number of records: 15

           Last updated: 08/29/96 at 11:35
Field
Field name
Type
Width
Dec
Start
End
1
CODMATER Numeric
10

1
10
2 CODGRUPA Numeric 3
11 13
3 CODGRAPR Numeric 6
14 19
4 CONT Character 12
20 31
5 SURSA Numeric 1
32 32
6 DENUMIRE Character 40
33 72
7
UNITMAS
Character
3

73
75
8
PRETUNITAR
Numeric
12
3
76 87
9
PRETMEDIU
Numeric
12
3
88
99
10
ACT
Character
1

100
100
11
DATA_ACT
Date
8

101
108
12
COEF_ECH
Numeric
5
2
109 113

** Total

114




This database appears to be associated with index file(s):
:C:\CURS\PROGT\INDNOM.IDX (STR(CODMATER,8)) : :C:\CURS\PROGT\INDNOMA.IDX (DENUMIRE)
     This database appears to be associated with report form(s):
:REPM1.FRX
Used by: INDEX.PRG
CORSTOC.PRG
ACTMENU.PRG
BC.PRG
FIS.PRG
ECRBAL.PRG
BRNOM.PRG
CORBC.PRG

Structure for database: STOC.DBF
Number of data records: 2
Last updated : 08/21/98 at 6:08
*************************************
Field Field name Type Width Dec Start End

1 CODMAG Numeric 2 1 2
2 CODMATER Numeric
3 CANTITATE Numeric
4 I Numeric
5 Pl Numeric
6 O Numeric
7 PO Numeric
** Total ** 73
This database appears to be associated with index file(s);
INDSTOC.IDX (STR(CODMAG,2)+STR(CODMATER,8))
FoxDoc did not find any associated report forms
Used by: INDEX.PRG :
CORSTOC.PRG
ACTMENU.PRG
FIS.PRG
ECRBAL.PRG
ADDSTOC.PRG
SUBSTOC.PRG
Structure for database: MISC.DBF
Number of data records: 12
Last updated : 08/29/98 at 10:57
*************************************
Field
Field name
Type
Width
Dec
Start
End
1
TYPE Numeric
2

1
2
2 NRDOC Numeric 6
3 8
3 DATA Date 8
9 16
4 MAG Numeric 2
17 18
5 MAGP Numeric 2
19 20
6 FURN Numeric 6
21 26
7
CONT
Character
12

27
38
8
SEC
Numeric
2

39 40
9
FORM
Numeric
2

41
42
10
MARK
Numeric
5

43
47
11
COD
Numeric
10

48
57
12
PRET
Numeric
10
3
58 67
13
CANT
Numeric
12
3
68
79
14
VALOARE
Numeric
14
2
80
93
15
CODIES
Numeric
8

94
101
16
IMP
Character
1

102
102

** Total

103




This database appears to be associated with index file(s);
FISMISC.IDX (STR(COD,8))
INDMISC.IDX (STR(TYPE,2)+STR(NRDOC,6))
FoxDoc did not find any associated report forms
Used by: INDEX.PRG :
CORSTOC.PRG
ACTMENU.PRG
BC.PRG
FIS.PRG
CORBC.PRG
********************************************
Structure for database: FACT.DBF
Number of data records: 6
Last updated : 08/21/98 at 6:35
*************************************
Field
Field name
Type
Width
Dec
Start
End
1
TYPE Numeric
2

1
2
2 NRDOC Numeric 6
3 8
3 DATA Date 8
9 16
4 FURN Numeric 6
17 22
5 MATE Numeric 14 2 23 36
6 FINE Numeric 14 2 37 50
7
TVAE
Numeric
14
2
51
64
8
AMBE
Numeric
14
2
65 78
9
ICME
Numeric
14
2
79 92
9
TRANE
Numeric
14
2
93
106
10
BONE
Numeric
14
2
107
120
11
ICME
Numeric
14
2
121 134
12
MATI
Numeric
14
2
135
148
13
FINI
Numeric
14
2
149
162
14
TVAI
Numeric
14
2
163
176
15
AMBI
Numeric
14
2
177
190
16
TRANI
Numeric
14
2
191
204
17
BONI
Numeric
14
2
205
218
18
NRFACT
Numeric
8

219
226
19
FISC
Numeric
10

227
236
20
SCD
Date
8

219
244

** Total

245




This database appears to be associated with index file(s);
NRFACT.ind (NRDOC)
FACF.IDX (STR(FURN,6))
DAT.IDX (DATA)
IFUR.IDX (FURN)
This database appears to be associated report form(s):
JURNAL1.FRX
Used by: INDEX.PRG
CORSTOC.PRG
JURNAL.PRG
VBAL.PRG

Structure for database: TMP.DBF
Number of data records: 12
Last updated : 08/29/96 at 10:35
*************************************

Field
Field name
Type
Width
Dec
Start
End
1
TYPE Numeric
2

1
2
2 NRDOC Numeric 6
3 8
3 DATA Date 8
9 16
4 MAG Numeric 2
17 18
5 MAGP Numeric 2
19 20
6 FURN Numeric 6
21 26
7
CONT
Character
12

27
38
8
SEC
Numeric
2

39 40
9
FORM
Numeric
2

41
42
10
MARK
Numeric
5

43
47
11
COD
Numeric
10

48
57
12
PRET
Numeric
10
3
58 67
13
CANT
Numeric
12
3
68
79
14
VALOARE
Numeric
14
2
80
93
15
CODIES
Numeric
8

94
101
16
IMP
Character
1

102
102

** Total

103



FoxDoc did not find any associated index files
FoxDoc did not find any associated report forms
Use by: CORSTOC.PRG
BC.PRG
GET_ITEMS (procedure in c:\curs\progt\bc.prg)
*********************************************
Structure for database: TMP.DBF
Number of data records: 12
Last updated : 08/20/98 at 10:57

Field
Field name
Type
Width
Dec
Start
End
1
COD Numeric
10

1
10
2 MAG Numeric 2
11 12
3 EC3 Date 12 2 13 24
4 EC2 Numeric 12 2 25 36
5 EC1 Numeric 12 2 37 48
6 ECCR Numeric 12 2 49 60
7
ET3
Character
12
2
61
72
8
ET2
Numeric
12
2
73 84
9
ET1
Numeric
12
2
85
96
10
ETCR
Numeric
12
2
97
108
11
DATA
Date
8

109
116

** Total **

117




This database appears to be associated with index file(s);
MISC3.IDX (STR(MAG,2)+STR(COD,10))
Foxdoc did not find any associated reports forms
Used by: CORSTOC.PRG
ADDSTOC.PRG
SUBSTOC.PRG

Structure for database: INCAS.DBF
Number of data records: 0
Last updated : 05/16/97 at 7:40
*******************************************
Field
Field name
Type
Width
Dec
Start
End
1
TYPE
Numeric
2

1
2
2
NRDOC
Numeric
6

3
8
3
NRFACT
Numeric
6

9
14
4
NRDP
Numeric
6

15
20
5
DATI
Date
8

21
28
6
MATI
Numeric
14
2
29
42
7
FINI
Numeric
14
2
43
56
8
TVAI
Numeric
14
2
57
70
9
AMBl
Numeric
14
2
71
84
10
ICMI
Numeric
14
2
85
98
11
TRANl
Numeric
14
2
99
112
12
BONI
Numeric
14
2
13
126
13
INC
Numeric
10

127
136

** Total **
137




This database appears to be associated with index file(s):
: INCAS.IDX (STR(NRDOC,6)+STR(NRDP,6))
FoxDoc did not find any associated report forms Used by:
CORSTOC.PRG
VBAL.PRG

Structure for database: FUR.DBF
Number of data records: 1
Last updated : 02/04/92 at 9:32

Field
Field name
Type
Width
Dec
Start
End
1
COD
Numeric
8

1
8
2
DEN
Character
60

9
68
3
CONT
Character
13

69
81
4
BANCA
Character
40

82
121

** Total **

122




This database appears to be associated with index file(s):
: INDFUR.IDX (STR(COD,8))
FoxDoc did not find any associated report forms
Used by: JURNAL.PRG
ACTFUR.PRG
CORBC.PRG
Structure for database: TYPE.DBF
Number of data records: 12
Last updated : 05/15/97 at 14:52

Field
Field name
Type
Width
Dec
Start
End
1
TYPE
Numeric
2

1
2
2
DEN
Character
20

3
22
3
SHORT
Character
3

23
25

** Total **

122




This database appears to be associated with index file(s):
: TYPE.IDX (STR(TYPE,2))
FoxDoc did not find any associated report forms
Used by: FIS.PRG
***************************************************
Structure for database: FISTMP.DBF
Number of data records: 1
Last updated : 08/21/98 at 6:09
Field
Field name
Type
Width
Dec
Start
End
1
TYPE
Numeric
2

1
2
2
NRDOC
Numeric
6

3
8
3
DATA
Date
8

9
16
4
COD
Numeric
8

17
24
5
CANT
Numeric
12

25
36

** Toatal **

37



FoxDoc did not find any associated index files
FoxDoc did not find any associated report forms
Use by: FIS.PRG
**************************************************
Structure for database: FTMP.DBF
Number of data records: 1
Last updated : 08/21/98 at 6:09

Field
Field name
Type
Width
Dec
Start
End
1
TYPE Numeric
2

1
2
2 NRDOC Numeric 6

3 8
3 DATA Date 8

9 16
4 MAG Numeric 2

17 18
5 MAGP Numeric 2

19 20
6 FURN Numeric 6

21 26
7
CONT
Character
12

27
38
8
SEC
Numeric
2

39 40
9
FORM
Numeric
2

41
42
10
MARK
Numeric
5

43
47
11
COD
Numeric
10

48
57
12
PRET
Numeric
10
3
58 67
13
CANT
Numeric
12
3
68
79
14
VALOARE
Numeric
14
2
80
93
15
CODIES
Numeric
8

94
101
16
IMP
Character
1

102
102


** Total

103





        This database appears to be associated with index file(s):
FoxDoc did not find any associated report forms
Use by: ADDSTOC.PRG
SUBSTOC.PRG
**************************************************
        Aceste baze de date (ca şi indexii asociaţi) sunt neapărat necesare pentru a se putea execuîa programele respective.
Bazele de date cu explicaţiile necesarte despre conţinutul lor sunt urmatoarele: NOM.DBF - nomenclatorul de materiale / produse finite;
STOC.DBF - fişierul de stocuri;
MISC.DBF - fişierul de mişcări. Conţine documentele ce se operează in STOC;
FACT.DBF - fişierul de facturi. Conţine facturiie emise şi încasările la facturi;
MISC3.DBF - este un fişier cu mişcările cumulate din ultimele trei luni pentru situaţia materialelor/produselor cu mişcare lentă şi fără mişcare;
INCAS.DBF - este un fişier conţinând încasările la facturi;
FUR.DBF - este fişierul de beneficiari / furnizori;
TYPE.DBF - este un fişier ce conţine tipul documentelor aşa cum sunt ele codificate în lucrare şi cu conturile respective pe fiecare tip de document;
F!STMP, FTMP, TMP, FUR1 şi MTOT sunt fişiere temporare utilizate ca manevră de către lucrare.

Indexii fişierelor sunt prezentaţi în tabelu! care urmează:
System: Evidenta situatiilor financiar-contabile
Author: Emil Pfeiffer
08/21/98 10:49:44
Index Parameter Summary
15 index files in the system
NOM INDNOM.IDX
INDNOMA.IDX
STOC INDSTOC.IDX
MISC FISMISC.IDX
INDMISC.IDX
FACT NRFACT.IDX
FACF.IDX
FACT DAT.IDX
IFUR.IDX
MISC3 MISC3.IDX
INCAS INCAS.IDX
FUR INDFUR.IDX
TYPE TYPE.IDX
IFISTMP IFISTMP.IDX
MTOT MTOT.IDX

INDNOM.IDX- Indexed STR(CODMATER,8)
This index file appears to be associated with database(s);
: NOM.DBF
Used by: INDEX.PRG
:CORSTOC.PRG
:ACTMENU.PRG
:BC.PRG
:FIS.PRG
ECRBAL.PRG
BRNOM.PRG
CORBC.PRG
********************************
INDOMA.IDX. Indexed on: DENUMIRE
This index file appears to be associated with database(s):
NOM.DBF
Used by:INDEX.PRG
CORSTOC.PRG :
ACTMENU.PRG
BRNOM.PRG
********************************
INDSTOC.IDX - Indexed on: STR(CODMAG,2)+STR(CODMATER,8)
This index file appears to be associated with database(s):
STOC.DBF
Used by : INDEX.PRG
CORSTOC.PRG
ACTMENU.PRG
FIS.PRG ECRBAL.PRG
ADDSTOC.PRG
SUBSTOC.PRG
FISMISC.IDX - Indexed on: STR(COD,8)
This index file appears to be associated with database(s);
MISC.DBF
Used by: INDEX.PRG
CORSTOC.PRG
ACTMENU.PRG
BC.PRG
FIS.PRG
CORBC.PRG
INDMISC.IDX- Indexed on: STR(TYPE,2)+STR(NRDOC,6)
This index file appears to be associated with database(s):
: MISC.DBF
Used by: INDEX.PRG
: CORSTOC.PRG
:ACTMENU.PRG
: BC.PRG
: CORBC.PRG
NRFACT.IDX - Indexed on: NRDOC
This index file appears to be associated with database(s):
: FACT.DBF
Used by: INDEX.PRG
: CORSTOC.PRG
:JURNAL.PRG
: VBAL.RG

FACF.IDX - Indexed on: STR(FURN,6)
This index file appears to be associated with database(s):
: FACT.DBF
Used by: INDEX.PRG
JURNAL.PRG
DAT.IDX – indexed on: DATA
This index file appears to be associated with database(s):
FACT.DBF
.Used by: |NDEX.PRG
:JURNAL.PRG

IFUR.lDX – lndexed on FURN
This index file appears to be associated with database(s):
FACT.DBF
Used by:INDEX.PRG
JURNAL,PRG
MISC3.IDX - Indexed on: STR(MAG,2)+STR(COD,10)
This index file appears to be associated with database(s):
:MISC3.DBF
Used by;CORSTOC.PRG
:ADDSTOC.PRG
:SUBSTOC,PRG
INCAS.IDX - Indexed on: STR(NRDOC,6)+STR(NRDP,6)
This file appears to be associated with database(s):
INCAS.DBF
Used by: CORSTOC.PRG
VBAL.PRG

INDFUR.IDX - Indexed on: STR(COD,8)
This index file appears to be associated with database(s):
FUR.DBF
Used by:.JURNAL.PRG
ACTFUR.PRG
CORBC.PRG

TYPE.IDX – Indexed on: STR(TYPE,2)
This index file appears to be associated with database(s):
TYPE.DBF
Used by: FIS.PRG

IFISTIP.IDX – Idexed on: STR(TYPE,2)+DTOC(DATA,1)
FoxDoc could not find an associeted database
Used by: FIS.PRG
This index fite appears to be associated with database(s):
MTOT.DBF
Used by: ADDSTOC.PRG
:SUBSTOC.PRG
În tabel sunt prezentaţi indexii cu denumirea lor, fişierele la care se referă (care trebuie indexate), cheile de indexare, precum şi programele care apelează aceşti indexi. Aceste elemente sunt suficiente pentru a putea realiza indexarea care este neapărat necesară.
În continuare se prezintă programele amintite:
1*.***********************************************
2
  1. Program: C:\CURS\PROGT\MENU,PRG
  2. System: Evidenta situatiilor financiar-contabile
  3. Author: Emi! Pfeiffer
  4. Copyright (c) 1998, Emil Pfeiffer
  5. Lastmodified: 08/14/98 9:49
  6. Calls: SALAR.PRG :
  7. M!JLF!X,PRG :
  8. FIN.PRG :
  9. MENFACT.PRG :
  10. EMITF.PRG :
  11. MENUSP.PRG
  12. Memory Files: TERM.MEM
  13. Documented 08/14/98 at 10:19 FoxDoc
  14. **************************************
22 * DEFINING THE MAIN MENU AND POP-UP'S *
23
24 clea
25 close data
26 set safety off
27 set date brit
28 set talk off
29 set confirm on
30 set dele on
31 rest from term additive
32 if term#.t.
33 @ 2,18 to 6,62 double 

34 @ 3,23 say 'RULAREAANTERIOARA SFIRSIT ANORMAL! '

35 @ 4,23 say 'Se refac fisierele si indexii pentru:'
36 @ 5,23 say 'fisierul ARTIC Sl FSTRU ............'
37 clea
38 endif
39 term=.f.
40 save to term all like term
41 @ 2,2 to 20,78 double
42 @ 4,6 to 18,74
43 @ 6,10 to 16,70
44 @ 8,14 to 14,66
45 @ 10,25 to12,55 double
46 @ 11,26 say 'CONTABILITATEA INTREPRINDERII'
47 @ 21,10 say ' '
48 wait ' '
49 clea
50 define menu mainme
51 define pad eee of mainme prompt;
"CONTABILITATEA INTREPRINDERII' at 2,22
52 define pad salar of mainme prompt 'SALARII' at 6,20 message;
53 ' Selectia acestei functii este invalida!!! Selectati alta'
54 define pad mijlf of mainme prompt 'MIJLOACE FIXE' at 6,40 message;
55 ' Selectia acestei functii este invalida !!! Selectati alta'
56 define pad matpf of mainme prompt 'MATERIALE Sl PROD.FIN' at 10,10

message;

57 'Realizeaza evidenta materialelor si a produselor finite'
58 define pad evidf of mainme prompt 'EVIDENTA FACTURI' at 10,35 message ;
59 'Realizeaza evidenta facturilor si toate situatiile necesare'
60 define pad factu of mainme prompt 'FACTURARE' at 10,58 message;
61 ' Selectia acestei functii este invalida!!! Selectati alta'
62 define pad conta of mainme prompt 'CONTABILITATE GENERALA' at 14,29 message;
63 ' Selectia acestei functii este invalida!!! Selectati alta'
64 define pad sfirs of mainme prompt 'SFIRSIT' at 18,37 message;
65 'Realizeaza iesirea din lucrare'
66
  1. on pad eee of mainme acti popup nome
  2. on pad salar of mainme acti popup nome
  3. on pad mijlf of mainme acti popup mf
  4. on pad matpf of mainme acti popup pf
  5. on pad evidf of mainme acti popup ef
  6. on pad factu of mainme acti popup fa
  7. on pad conta of mainme acti popup co
  8. on pad sfirs of mainme acti popup sf
  9. defi popup nome from 5,20 shadow
  10. defi popup mf from 5,40 shadow
  11. defi popup pf from 9,10 shadow
  12. defi popup ef from 9,35shadow
  13. defi popup fa from 9,58 shadow
  14. defi popup co from 13,29 shadow
  15. defi popup sf from 17,37 shadow
  16. defi bar 1 of nome prompt '\SALARIl'
  17. defi bar 1 of mf prompt '\<MIJLOACE FIXE'
  18. defi bar 1 of pf prompt '\<MATERIALE Sl \<PROD.FIN'
  19. defi bar 1 of ef prompt '\<EVlDENTA FACTURI'
  20. defi bar 1 of fa prompt '\<FACTURARE'
  21. defi bar 1 of co prompt '\<CONTAB!LITATE 'GENERALA'
  22. defi bar 1 of sf prompt 'SFIRSI\<T'
  23. on sele popup nome do salar
  24. on sele popup mf do mijlfix
  25. on sele popup pf do fin
  26. on sele popup ef do menfact
  27. on sele popup fa do emitf
  28. on sele popup co do menusp
  29. on sele popup sf retu
100 acti menu mainme
101
102 *: EOF: MENU.ACT
Acest program (MENU.PRG) este meniul principal al lucrării pe care am numit-o "Evidenţa situaţilor financiar-contabile'. Ea conţine de fapt mai multe lucrări şi anume: Evidenţa şi calculul saiariilor, Evidenţa mijloacelor fixe, Evidenţa contabilă a materiilor prime şi a materialelor, precum şi a produseior fmite, Evidenţa facturilor, Emiterea facturilor şi o lucrare pentru evidenţierea situaţiilor centralizatoare contabile ce rezultă din lucrările mai sus amintite în contabilitatea generală.
Programu! listat rnai sus (ca şi cele ce vor fi listate în continuare) este obţinut prin Foxdoc, deci pentru a putea fi rulat, vor trebui şterse cifrele ce numerotează liniile (altfel la încercarea lor programele vor da eroare). De asemenea precizăm că numărul programelor acestor lucrări este mult mai mare (aici prezentăm doar câteva programe pe care le considerăm programe tip şi unele programe necesare pentru a face aplicaţia să fie explicită şi să funcţioneze).
O serie de funcţii ale acestei lucrări nu sunt valide (fapt ce este semnalat de mesajele din subsoiul ecranului) deoarece ar fi mărit enorm această lucrare de prezentare.
Vom prezenta în continuare toate aceste programe tip, urmând ca apoi să le discutăm pe fiecare în parte.
  1. ************************************************
  2. Procedure file: C;\CURS\PROGT\FIN.PRG
  3. System: Evidenta situatiilor financiar-contabile
  4. Author: Emii Pfeiffer
  5. Copyright (c) 1998, Emil Pfeiffer
  6. Lastmodified: 08/21/98 10:39
  7. *: Procs & Fncts: BELL
  8. :CCONTROL
  9. : ED!T .RECORD
  10. Set by:MENU.PRG
  11. Cal!s:SET() (function in?)
  12. SIGNON.PRG
  13. INDEX.PRG
  14. CORSTOC.PRG
  15. MENUS.PRG
  16. Memory Files:FiNOK.MEM
  17. :ANTET1.MEM :
  18. ANTET2.MEM
  19. Documented 08/21/98 at 10:47 FoxDoc
  20. **************************************************
  21. Create view priorvue
  22. cloose all
  23. set talk off
  24. set date british
  25. set notify off
  26. set intensity on
  27. set safety off
  28. set deleted on
  29. set confirm on
  30. set decimals to 3
  31. hide menu mainme
  32. hide popup of
  33. * set printer to liste.prg
  34. xstat = set('status')
  35. if xstat='ON'
  36. set status off
  37. endif
  38. public mainscreen
  39. deactivate windows atl
  40. flpmed=.f.
  41. store .f. to indexing, fldelm1
  42. define window adaugmat from 2, 5 to 14,75 title;
[ADAUGARE IN FISIERUL PRODUSE
50 define window modifmat from 2,5 to 14,75 title;
[ MODSFiCARE IN FiSIERUL PRODUSE ]
51 define window stergmat from 2,5 to 14,75 titie;
[ STERGERE DIN FISIERUL PRODUSE ]
52 define window errwind from 1,40 to 4,79 double
53 define window errwind2 from 1,40 to 4,79 double
54 define window confirma from 17,33 to 21,65 double
55 define window wstoc from 16,40 to 21,70
56 define window wlst from 3,0 to 22,79 none
57 clear program
58 par=' '
59 do signon
60 if par='FIN'
61 rest from finok additive
62 if .not. finok
63 acti wind errwind2
64 clear
65 @ 0,0 say 'Asteptati un moment sa refac fisierele'
66 @ 1,0 say 'Ultima rulare terminata anormal'
67 do index
68 do corstoc
69 deac wind errwind2
70 endif
71 else
72 retu
73 endi
74 rest from antet1 addi
75 rest from antet2 addi
76 finok=.f.
77 save to finok all like finok
78 save screen to mainscreen
79 set message to 23 left
80 do menus
81 acti menus mainmenu
82 term = .f.
83 do while term = .T.
84 clear
85 activate menu mainmenu
86 if term
87 release all
88 release menus mainmenu
89 release popus actpop
90 endif
91 enddo
92 finok=.t.
93 save to finok all like finok
94 if term#.t.
95 if xstat='ON'
96 set status on
97 endif
98 endif
99 clear
100 on escape
101 if term=.T.
102 ? FIN TERMINAT ************
103 deac menu mainmenu
104 release popup actpop
105 show menu mainme
106 show popup pf
107 endif
108 return
109
  1. ********************
  2. Procedure; BELL
  3. .
  4. Calls: CHR() (function in?)
  5. .
  6. ******************************

117 function bell
118 ?? chr{7)
119 return
120
121

134 *!*******************************
135 *!
136 *! Procedure: CCONTROL
137
138 Called by: ACTMENU.PRG
139: FIS.PRG
140: GET_LINE (procedure in BC.PRG)
141 *!
142 *! Calls: INT() : CHR() (function in ?)
143 *! : CHR() (function in?)
144 *!
145 *!**********************************
134 function ccontrol
135 parameter x
136 xx=int(x/10)
137 dimens i(7)
138 y=xx
139 j=7
140 q=int(xx/10)
141 i=0
142 do while .not.j<=0
143 i(j)=y-q*10
144 y=q
145 q=int(q/10)
146 j=j-1
147 enddo
148 q=i(7)*2+i(6)*3+i(5)*5+i(4)*7+i(3)*13+i(2)*17+i(1)*19
149 y=int(q/11)
150 cc=q-y*11
151 if cc=10
152 cc=0
153 endif
154 n=xx*10+cc
155 if n=x
156 hide window errwind
157 return .t.
158 else
159 activate window errwind
160 @ 0,1 saz Eroare cifra de control]
161 ??chr(7)
162 return .f.
163 endif
164
175 *| *************************************
176 *!
177 *! Procedure: EDIT_RECORD
178 *!
179 Calledby:ACTMENU.PRG
180 *!
181 *! Calls: REPLICATE() (function in ?) :
182 IIF() (function in ?)
183
184 *l**************************************
175 procedure edit_record
176 vsur=replicate( ,7)
177 @ 3,1 say [Denumire :] get denumire function [@!]
178 @ 4,1 say [Cod grupa :] get codgrupa picture [999]
179 @ 5,1 say [Cont :] get cont
180 @ 6,1 say [Unitate de masura:] get unitmas function [@!]
181 @ 7,1 say [Pret unitar :] get Pretunitar picture [9999999.99]
182 @ 8,1 say [Sursa material :] get vsur picture @M Indigen, Import]
183 read
184 replace sursa with iif(vsur='fndigen', 0,1)
185 replace pretmediu with pretunitar
186 return
188 * EOF: FIN.ACT

Acest program (FIN.PRG), este programul ce lansează lucrarea de evidenţă contabilă a produselor finite. La selectarea acestei opţiuni, va apărea pe ecran lucrarea de produse finite cu toate opţiunile sale. Numai o parte din aceste opţiuni vor fi valide lucru care va fi semnalat printr-un mesaj în subsolul ecranului. Dacă se va încerca activarea unei astfel de optiuni, programul va semnaliza eroare.

1 *| *************************************
2 *!
3 *! Program C:\CURS\PROGT\SIGNON.PRG
4 *
5 * System: Evidenţa situaţiilor financiar-contabile
6 * Author: Emil Pfeiffer
7 * Copyright (c) 1998, Emil Pfeiffer
8 * Last modified: 10/21/96 9.00
9 *
10 Called by:FIN.PRG
11 *
12 * Calls: INT() (function in ?) :
13 SUBSTR() (function in ?)
14 SECONDS() (function in ?)
15 UPPER() (function in ?)
16
17 Documented 08/14/98 at 10.19
18 *l**************************************
19 set talk off
20 define window demo from 14,02 to 16,17 double
21 clear
22 @ 07,00

39
40
41 activate screen bottom
42 @ 06,00 to 20,79 double
43 store ' PRODUSE FINITE * PRODUSE FIITE * PRODUSE FINITE *;
PRODUSE FINITE * PRODUSE FINITE * PRODUSE FINITE * '
44 signon
45 store 0 to line
46 for line=0 to5
47 if line/2=int(line/2)
48 @ line,00 say substr(signon,1,80) color scheme 1 && B/n
49 else
50 @ line,00 say substr(signon,5,80) colorscheme 1 && B/n
51 endif
52 endfor
53 for line = 21 to 23
54 if line/2=int(line/2)
55 @ line,00 say substr(signon,1,80) color scheme 1 && B/n
56 else
57 @ !ine,00 say substr(signon,5,80) color scheme 1 && B/n
58 endif
59 endfor
60 @ 24,00 say substr(signon,1,79) color scheme 1 && B/n
61 @ 07,01 fill to 19,36 color scheme 1 && W+/B
62 @ 07,37 fill to 19,78 color scheme 1 && W+/B
63 activate window demo
] 64 @ 00,00 say ' PROD-FIN ' color scheme 7 &&br+/B
65 for mcol=03 to 52
66 move window demo to14,mcol
67 store seconds() to stime
68 do while seconds() <= stime + .015
69 enddo
70 endfor
71 activate screen bottom
72 @ 07,01 fill to 19,36 color scheme 1 && n/B
73 @ 0,0 clea to 5,79
74 @ 24,1 clea to 28,79
75 @ 3,10 say 'PAROLA:'
76 set colo to x,x,w,gr
77 @ 3,19 say 'PAROLA:' get par pict 'XXXXXX'
78 read
79 set color to
80 par=upper(par)
81 deac wind all
82 retum
83 *EOF
85 *: EOF: SIGNON.ACT

1 *
************************************************
2*

3*
Program; C:\CURS\PROGT\INDEX.PRG
4*

5*
System: Evidenta situatiilor financiar-contabile
6*
Author: Emil Pfeiffer
7*
Copyright (c) 1998, Emil Pfeiffer
8*
Lastmodified: 08/14/98 8:
9 *

10 *
Called by: FIN.PRG
11 *

12 *
Ca!ls: STR() (function in ?)
13 *

14 *
Uses: NOM.DBF
15 *

STOC.DBF
16 *

MISC.DBF
17 *

FACT.DBF
18 *

19 *
Indexes: INDNOM.IDX
20 *

INDNOMA.IDX
21 *

INDSTOC.IDX
22 *

FISMISC.IDX
23 *

INDMISC.IDX
24 *

NRFACT.IDX
25 *

FACF.IDX
26 *

DAT.IDX
27 *

IFUR.IDX
28 *

29 *
Documented 08/14/98 at 10:19 FoxDat
30 *
*************************
31 Set talk on
32 close all
33 use nom
34 jnde on str(codmater,8) to indnom comp
35 inde on denumire to indnoma comp
36 use stoc
37 inde on str(codmag,2)+str(codmater,8) to indstoc comp
38 use misc
39 inde on str(cod,8) to fismisc comp
40 inde on str(type,2)+str(nrdoc,6) to indmisc comp
41 use fact
42 inde on nrdoc to nrfact
43 inde on str(fum,6) to facf
44 inde on data to dat
45 inde on fum to ifur
46 close all
47 set talk off
48 retu
49 *: EOF: INDEX.ACT

INDEX.PRG este un program care pregăteşte fişierele pentru a face posibil lucrul privind contabilitatea produselor finite şi a materialelor. (De fapt face indexarea acestor fişiere în cazul în care programul lansat anterior nu s-a terminat normal - intreruperi de curent de exempiu sau a!te cauze - fapt ce poate face ca anumite fişiere să-şi piardă indexii).

1 ****************************************************
2 *
3 *Program: C:\CURS\PROGT\CORSTOC.PRG
4 *
5 System: Evidenta situatiilor financiar-contabile
6 Author: Emil Pfeiffer
7 Copyrigt (c) Emil Pfeiffer
8 Last modified: 08/02/93 17:02
9 *
10 Called by: FIN.PRG
11 *
12 Calls: STR() (function in ?)
13 FOUND() (function in ?)
14 RECN() (function in ?)
15 EOF() (function in ?)
16 DATE() (function in ?)
17 *
18
Uses: MISC.DBF

19

TMP.DBF

20 

STOC.DBF

21 

NOM.DBF

22 

MISC3.DBF

23 

FACT.DBF

24 

INCAS.DBF

25 


26 
Indexes: FISMISC.IDX

27 

INDMISC.IDX

28 

INDSTOC.IDX

29 

INDNOM.IDX

30 

INDNOMA.IDX

31 

MISC3.IDX

32 

NRFACT.IDX

33 

DAT.IDX

34 

INCAS.IDX

35 


36 
Documented 08/21/98 at 06:11 FoxDoc

37
*************************

38 set talk off
39 set deleted on
40 set decimals to 3
41 priv Imag, lcod, xx
42 close databases
43 copy filemisc.dbf to tmp.dbf
44 sele 8
45 use misc inde fismisc, indmisc
46 rein
47 *total on str(cod,8) to svals fields valoare for type=9
48 sele 7
49 use stoc inde indstoc
50 rein
51 repl all i with 0, o with 0, pi with 0, po with 0
52 sele 2
53 use tmp
54 sele 4
55 use nom inde indnom, indnoma
56 rein
57 select 5
58 use misc3 inde misc3
59 repl all etcr with 0,eccr with 0
74 select tmp
75 scan all
76 doc=type
77 pmag=mag
78 if doc=9.and.cont='206'
79 lmag=0
80 lcod=codies
81 else
82 lmag=pmag
83 lcod=cod
84 endif
85 vind = str(lmag,2)+str(lcod,8)
86 vind1=str(icod,8)
87 select stoc
88 seek vind
89 if.not.found()
90 append blank
91 repl codmater with lcod,codmag with lmag, cantitate with 0,;
92 I withy 0, pi with 0, o with 0, po wilh 0
93 endif
94 if doc > 10
95 if doc=16.and.tmp.cont = 206
96 reccr=recno()
97 seek  0 +vind1
98 if .not.found()
99 append blank
100 repl codmater with lcod, codmag with 0, o with 0, po with 0
101 endif
102 repl i with i+tmp.cant, pi with pi+tmp.valoare
103 go reccr
104 endif
105 repl o with o+tmp.cant, po with po + tmp.valoare
106 else
107 if doc#9
108 replace i with i tmp.cant
109 replace pi with pi tmp.valoare
110 else
111 if tmp.cont = 206
112 reccr=recno()
113 seek  0+vind1
114 replace po with po+tmp->valoare
115 replaceo with o+tmp->cant
116 goreccr
117 else
118 replacei with i+tmp->cant
119 selenom
120 seek str(tmp->cod,8)
121 selestoc
122 replace pi with pi + tmp->cant*nom->pretunitar
123 endif
124 endif
125 endif
126 endscan
127 select misc
128 gotop
129 do while .not eof()
130 w=str(mag,2)+sfr(cod,8)
131 selemisc3
132 seekvv
133 iffoundO
134 ifm'sc.type=16
135 repl eccr with eccr+misc.cant.data with misc.data
136 else
137 ifmisc.type<10
138 repl etcr with etcr+misc.cant
139 endif
140 endif
141 endif
142 sele misc
143 skip
144 enddo
145 sele misc3
146 repl data with date()-15 for data = {/ /}
147 use fact inde nrfact.dat
148 rein
149 use incas inde incas
150 rein
151 return
153 *: EOF; CORSTOC.ACT

         CORSTOC.PRG este un program care este lansat automat în cazul în care area anterioară a lucrării a dus la terminarea anormală a programului (fapt ce este lan glgt de către variabila FINOK (variabilă de memorie care este salvată şi este citită rînceputul lucrufui) care în cazul că este .F. înseamnă că sfârşitul este anormal, iar a g gs(e J. înseamnă sfârşit normal. Programul reface fişierul de stoc din fişierul de iiscări (prin operarea fiecărei mişcări în stoc).

Niciun comentariu:

Trimiteți un comentariu