|
Introducere
Aplicatia de gestiune a stocurilor GSTOC este realizata pe baza cerintelor formulate de Serviciul Contabilitate ca beneficiar al acesteia.
Operatiunile realizate prin expoatarea aplicatiei pot fi sistematizate astfel:
a) Operatii de culegere si actualizari date:
- preluare date din notele de intrare_receptie furnizate de magazie;
- preluare date din bonuri de consum sau avize de expeditie deasemenea furnizate de magazie;
- stornari diverse ale N.I.R.-urilor si documentelor de iesire;
- modificari limitate (in general antetele documentelor) in baza de date.
b) Generare automata de rapoarte :
- rapoarte in diverse forme pentru intrari si iesiri pe o anumita luna, perioada sau pentru toata perioada de la inceputul anului;
- balanta analitica a materialelor la un moment dat.
Din specificul activitatii de care s-a tinut cont la realizarea aplicatiei, de interes major sunt urmatoarele:
- un material (acelasi cod) poate figura de doua sau mai multe ori pe acelasi N.I.R dar cu preturi diferite;
- la iesiri, utilizatorul va cunoaste exact numele sau codul consumatorului
Rapoarte ce trebuie optinute din exploatare
1. CENTRALIZATORUL IESIRILOR DE MATERIALE
SITUATIA IESIRILOR DE MATERIALE
LA Data:
Denumire
UM
Pret unitar
Cantitate
Valoare
Total Material
2. JURNALUL DE CUMPARARI
JURNAL DE CUMPARARI
La data:
Furnizor
Total factura
TVA
Cu TVA
Fara TVA
TOTAL
DEDUCTIBIL
Total Material
3. SITUATIA STOCURILOR DE MATERIALE
SITUATIA STOCURILOR DE MATERIALE
LA Data:
Denumire
UM
Stoc initial
Cantitate intrata
Cantitate iesita
Stoc final
Total Material
Structure for database: C:FPD26FOXAPPSTOCIESIRI.DBF
Number of data records: 4
Date of last update: 12/08/96
Code Page : 0
Field Field Name Type Width Dec Index Collate
1 MAGAZIA Numeric 3
2 COD_F Character6
3 DEN_F Character 20
4 NR_FACT Numeric 6
5 TIP_DOC Character 10
6 NR_DOCNumeric 4
7 DATA Date 8
8 CONTM_SINNumeric 4
9 CONTM_ANAL Numeric 3
10 U_MCharacter3
11 CANT Numeric 7
12 P_UNumeric 12
13 COD_MAT Character6
14 DEN_MAT Character 20
15 VAL_TOT Numeric 152
** Total **128
INTRARI.DBF
Structure for database: C:FPD26FOXAPPSTOCINTRARI.DBF
Number of data records:11
Date of last update: 12/08/96
Code Page : 0
Field Field Name Type Width Dec Index Collate
1 MAGAZIA Numeric 3
2 COD_F Character6
3 DEN_F Character 20
4 NR_FACT Numeric 6
5 TIP_DOC Character 10
6 NR_DOCNumeric 4
7 DATA Date 8
8 CONTM_SINNumeric 4
9 CONTM_ANAL Numeric 3
10 U_MCharacter3
11 CANT Numeric 7
12 P_UNumeric 12
13 COD_MAT Character6
14 DEN_MAT Character 20
15 VAL_TOT Numeric 152
** Total **128
STOC.DBF
System File Edit Database Record Program Window Run
Structure for database: C:FPD26FOXAPPSTOCSTOC.DBF
Number of data records: 5
Date of last update: 12/08/96
Code Page : 0
Field Field Name Type Width Dec Index Collate
1 COD_MAT Character6
2 DEN_MAT Character 20
3 U_MCharacter3
4 P_UNumeric 122
5 CANT Numeric 72
STOC.PRG
CLEAR
CLOSE ALL
SET TALK OFF
SET CONSOLE OFF
SET SAFETY OFF
SET SYSMENU TO
SET SYSMENU AUTOMATIC
DEFINE PAD _rg70vig0q OF _MSYSMENU PROMPT '<Stocuri'COLOR SCHEME 3
DEFINE PAD _rg70vig1u OF _MSYSMENU PROMPT '<Liste' COLOR SCHEME 3
DEFINE PAD _rg70vig1x OF _MSYSMENU PROMPT '<Ajutor' COLOR SCHEME 3
DEFINE PAD _rg70vig22 OF _MSYSMENU PROMPT '<Iesire' COLOR SCHEME 3
ON PAD _rg70vig0q OF _MSYSMENU ACTIVATE POPUP stocuri
ON PAD _rg70vig1u OF _MSYSMENU ACTIVATE POPUP liste
ON PAD _rg70vig1x OF _MSYSMENU ACTIVATE POPUP ajutor
ON PAD _rg70vig22 OF _MSYSMENU ACTIVATE POPUP iesire
DEFINE POPUP stocuri MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF stocuri PROMPT '<Intrari'
DEFINE BAR 2 OF stocuri PROMPT 'I<esiri'
DEFINE BAR 3 OF stocuri PROMPT '<Stoc'
ON SELECTION BAR 1 OF stocuri DO INTR.PRG
ON BAR 3 OF stocuri ACTIVATE POPUP stoc
DEFINE POPUP stoc MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF stoc PROMPT '<Adaugare'
DEFINE BAR 2 OF stoc PROMPT '<Modificare'
DEFINE BAR 3 OF stoc PROMPT '<Stergere'
ON SELECTION BAR 1 OF stoc DO INT_STOC.PRG
ON SELECTION BAR 2 OF stoc DO MOD_STOC.PRG
ON SELECTION BAR 3 OF stoc DO STERG.PRG
DEFINE POPUP liste MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF liste PROMPT '<Jurnal de cumparari'
DEFINE BAR 2 OF liste PROMPT '<Centralizator'
DEFINE BAR 3 OF liste PROMPT '<Situatie stocuri'
ON BAR 1 OF liste ACTIVATE POPUP jurnaldecu
ON BAR 2 OF liste ACTIVATE POPUP centraliza
ON BAR 3 OF liste ACTIVATE POPUP situatiest
DEFINE POPUP jurnaldecu MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF jurnaldecu PROMPT '<Ecran'
DEFINE BAR 2 OF jurnaldecu PROMPT '<Imprimanta'
ON SELECTION BAR 1 OF jurnaldecu do lisjce.prg
ON SELECTION BAR 2 OF jurnaldecu do lisjci.prg
DEFINE POPUP centraliza MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF centraliza PROMPT '<Ecran'
DEFINE BAR 2 OF centraliza PROMPT '<Imprimanta'
ON SELECTION BAR 1 OF centraliza DO LISECENT.PRG
ON SELECTION BAR 2 OF centraliza DO LISICENT.PRG
DEFINE POPUP situatiest MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF situatiest PROMPT '<Ecran'
DEFINE BAR 2 OF situatiest PROMPT '<Imprimanta'
ON SELECTION BAR 1 OF situatiest DO STOCE.PRG
ON SELECTION BAR 2 OF situatiest DO STOCI.PRG
DEFINE POPUP ajutor MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF ajutor PROMPT '<Ajutor'
DEFINE BAR 2 OF ajutor PROMPT '<Info harh'
ON SELECTION BAR 1 OF ajutor DO HELP.PRG
ON SELECTION BAR 2 OF ajutor DO INFO.PRG
DEFINE POPUP iesire MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF iesire PROMPT '<FoxPro'
DEFINE BAR 2 OF iesire PROMPT '<Ms-Dos'
ON SELECTION BAR 1 OF iesire DO IESFOX.PRG
ON SELECTION BAR 2 OF iesire QUIT
STOCI.PRG
SELECT STOC.*, INTRARI.VAL_TOT, IESIRI.VAL_TOT;
FROM STOC, INTRARI, IESIRI;
WHERE INTRARI.COD_MAT = STOC.COD_MAT;
AND IESIRI.COD_MAT = STOC.COD_MAT;
AND (INTRARI.P_U = STOC.P_U;
AND IESIRI.P_U = STOC.P_U);
ORDER BY STOC.COD_MAT;
INTO CURSOR QUERY
REPORT FORM SIT_STOC.FRX TO PRINTER
CLOSE ALL
CLEAR
STOCE.PRG
SELECT STOC.*, INTRARI.VAL_TOT, IESIRI.VAL_TOT;
FROM STOC, INTRARI, IESIRI;
WHERE INTRARI.COD_MAT = STOC.COD_MAT;
AND IESIRI.COD_MAT = STOC.COD_MAT;
AND (INTRARI.P_U = STOC.P_U;
AND IESIRI.P_U = STOC.P_U);
ORDER BY STOC.COD_MAT;
INTO CURSOR QUERY
REPORT FORM SIT_STOC.FRX PREVIEW
CLOSE ALL
CLEAR
MODSTOC.PRG
#REGION 0
REGIONAL m.currarea, m.talkstat, m.compstat
IF SET('TALK') = 'ON'
SET TALK OFF
m.talkstat = 'ON'
ELSE
m.talkstat = 'OFF'
ENDIF
m.compstat = SET('COMPATIBLE')
SET COMPATIBLE FOXPLUS
m.currarea = SELECT()
IF NOT WEXIST('stoc')
DEFINE WINDOW stoc ;
FROM INT((SROW()-10)/2), INT((SCOL()-54)/2) ;
TO INT((SROW()-10)/2)+9, INT((SCOL()-54)/2)+53 ;
TITLE ' MODIFICARI IN STOC ' ;
FOOTER ' A C T U A L I Z A R ES T O C ' ;
FLOAT ;
NOCLOSE ;
SHADOW ;
MINIMIZE ;
DOUBLE ;
COLOR SCHEME 5
ENDIF
#REGION 1
close all
clear
set talk off
set console off
set safety off
use stoc
store space(6) to m.cod_mat
store space(20) to m.den_mat
store space(3) to m.u_m
store 0 to m.cant, m.p_u
#REGION 1
IF WVISIBLE('stoc')
ACTIVATE WINDOW stoc SAME
ELSE
ACTIVATE WINDOW stoc NOSHOW
ENDIF
@ 2, 28 SAY 'UM'
@ 2, 1 SAY 'COD '
@ 0, 10 SAY 'SC M O L D O P L A S T SA'
@ 1, 0 TO 1, 51 DOUBLE
@ 3, 1 SAY 'MAT.'
@ 4, 0 TO 4, 51 DOUBLE
@ 6, 0 TO 6, 51 DOUBLE
@ 2, 6 TO 5, 6
@ 2, 27 TO 5, 27
@ 2, 31 TO 5, 31
@ 2, 39 TO 5, 39
@ 2, 7 SAY 'D E N U M I R E'
@ 3, 12 SAY 'M A T E R I A L'
@ 2, 33 SAY 'CANT.'
@ 2, 42 SAY 'P R E T'
@ 3, 41 SAY 'U N I T A R'
@ 5, 0 GET m.cod_mat ;
SIZE 1, 6 ;
DEFAULT ' ' ;
PICTURE '@!IK' ;
VALID _rkg0u60ex() ;
ERROR 'COD MATERIAL INEXISTENTRELUATI !!!'
READ
RELEASE WINDOW stoc
SELECT (m.currarea)
#REGION 0
IF m.talkstat = 'ON'
SET TALK ON
ENDIF
IF m.compstat = 'ON'
SET COMPATIBLE ON
ENDIF
#REGION 1
close all
clear
use stoc
delete for p_u=0
pack
close all
FUNCTION _rkg0u60ex && m.cod_mat VALID
#REGION 1
CLOSE ALL
USE STOC
INDEX ON cod_mat TAG STOC
SEEK m.cod_mat
IF FOUND()
SET FILTER TO cod_mat=m.cod_mat
DEFINE POPUP PRETU FROM 5, 7 TO 8, 25 PROMPT FIELD P_U SHADOW TITLE 'PRET UNITAR' FOOTER 'ALEGETI'
ON SELECTION POPUP PRETU DO OPT
ACTIVATE POPUP PRETU
RETURN.T.
ELSE
RETURN.F.
ENDIF
PROCEDURE OPT
@ 5, 7 GET den_mat ;
SIZE 1, 20 ;
DEFAULT ' ' ;
PICTURE '@!IK'
@ 5, 28 GET u_m ;
SIZE 1, 3 ;
DEFAULT ' ' ;
PICTURE '@!IK'
@ 5, 32 GET cant ;
SIZE 1, 7 ;
DEFAULT 0 ;
PICTURE '@K'
@ 5, 40 GET p_u ;
SIZE 1, 12 ;
DEFAULT 0 ;
PICTURE '@K' ;
VALID _rkg0r6jn3() ;
ERROR 'PRODUS EXISTENT CU PRET IDENTICRELUATI !!!'
HIDE POPUP PRETU
READ
FUNCTION _rkg0r6jn3 && m.p_u VALID
#REGION 1
STORE p_u TO m.p_u
use
use stoc
index on cod_mat tag stoc
seek m.cod_mat
if found()
set filter to cod_mat=m.cod_mat
set filter to p_u=m.p_u
count to contor
if contor>1
use
use stoc
set filter to cod_mat=m.cod_mat
return.f.
else
deactivate popup pretu
return.t.
endif
else
return
endif
INTSTOC.PRG
#REGION 0
REGIONAL m.currarea, m.talkstat, m.compstat
IF SET('TALK') = 'ON'
SET TALK OFF
m.talkstat = 'ON'
ELSE
m.talkstat = 'OFF'
ENDIF
m.compstat = SET('COMPATIBLE')
SET COMPATIBLE FOXPLUS
m.currarea = SELECT()
IF NOT WEXIST('stoc')
DEFINE WINDOW stoc ;
FROM INT((SROW()-10)/2), INT((SCOL()-54)/2) ;
TO INT((SROW()-10)/2)+9, INT((SCOL()-54)/2)+53 ;
TITLE 'INTRODUCERE PRODUSE IN STOC' ;
FOOTER ' A C T U A L I Z A R ES T O C ' ;
FLOAT ;
NOCLOSE ;
SHADOW ;
MINIMIZE ;
DOUBLE ;
COLOR SCHEME 5
ENDIF
#REGION 1
close all
clear
set talk off
set console off
set safety off
use stoc
store space(6) to m.cod_mat
store space(20) to m.den_mat
store space(3) to m.u_m
store 0 to m.cant, m.p_u
#REGION 1
IF WVISIBLE('stoc')
ACTIVATE WINDOW stoc SAME
ELSE
ACTIVATE WINDOW stoc NOSHOW
ENDIF
@ 2, 28 SAY 'UM'
@ 2, 1 SAY 'COD '
@ 0, 10 SAY 'SC M O L D O P L A S T SA'
@ 1, 0 TO 1, 51 DOUBLE
@ 3, 1 SAY 'MAT.'
@ 4, 0 TO 4, 51 DOUBLE
@ 6, 0 TO 6, 51 DOUBLE
@ 2, 6 TO 5, 6
@ 2, 27 TO 5, 27
@ 2, 31 TO 5, 31
@ 2, 39 TO 5, 39
@ 2, 7 SAY 'D E N U M I R E'
@ 3, 12 SAY 'M A T E R I A L'
@ 2, 33 SAY 'CANT.'
@ 2, 42 SAY 'P R E T'
@ 3, 41 SAY 'U N I T A R'
DO INTR
PROCEDURE INTR
@ 5, 0 GET m.cod_mat ;
SIZE 1, 6 ;
DEFAULT ' ' ;
PICTURE '@!IK' ;
VALID _rkg0r6i8y()
@ 5, 7 GET m.den_mat ;
SIZE 1, 20 ;
DEFAULT ' ' ;
PICTURE '@!IK'
@ 5, 28 GET m.u_m ;
SIZE 1, 3 ;
DEFAULT ' ' ;
PICTURE '@!IK'
@ 5, 32 GET m.cant ;
SIZE 1, 7 ;
DEFAULT 0 ;
PICTURE '@K'
@ 5, 40 GET m.p_u ;
SIZE 1, 12 ;
DEFAULT 0 ;
PICTURE '@K' ;
VALID _rkg0r6jn3() ;
ERROR 'PRODUS EXISTENT CU PRET IDENTICRELUATI !!!'
READ
RELEASE WINDOW stoc
SELECT (m.currarea)
#REGION 0
IF m.talkstat = 'ON'
SET TALK ON
ENDIF
IF m.compstat = 'ON'
SET COMPATIBLE ON
ENDIF
#REGION 1
close all
clear
use stoc
delete for p_u=0
pack
close all
FUNCTION _rkg0r6i8y && m.cod_mat VALID
#REGION 1
CLOSE ALL
USE STOC
INDEX ON cod_mat TAG STOC
SEEK m.cod_mat
IF FOUND()
STORE den_mat TO m.den_mat
STORE u_m TO m.u_m
ELSE
RETURN
ENDIF
FUNCTION _rkg0r6jn3 && m.p_u VALID
#REGION 1
use
use stoc
index on cod_mat tag stoc
seek m.cod_mat
if found()
set filter to cod_mat=m.cod_mat
index on p_u tag temp
seek m.p_u
if found()
use
return.f.
else
do test
return.t.
endif
else
do test
return
endif
procedure test
if lastkey()=13
close all
use stoc
append blank
replace cod_mat with m.cod_mat
replace den_mat with m.den_mat
replace u_m with m.u_m
replace cant with m.cant
replace p_u with m.p_u
close all
store space(6) to m.cod_mat
store space(20) to m.den_mat
store space(3) to m.u_m
store 0 to m.cant, m.p_u
use
use stoc
do intr
else
close all
use stoc
append blank
replace cod_mat with m.cod_mat
replace den_mat with m.den_mat
replace u_m with m.u_m
replace cant with m.cant
replace p_u with m.p_u
close all
return
endif
STERG.PRG
#REGION 0
REGIONAL m.currarea, m.talkstat, m.compstat
IF SET('TALK') = 'ON'
SET TALK OFF
m.talkstat = 'ON'
ELSE
m.talkstat = 'OFF'
ENDIF
m.compstat = SET('COMPATIBLE')
SET COMPATIBLE FOXPLUS
m.currarea = SELECT()
IF NOT WEXIST('stoc')
DEFINE WINDOW stoc ;
FROM INT((SROW()-10)/2), INT((SCOL()-54)/2) ;
TO INT((SROW()-10)/2)+9, INT((SCOL()-54)/2)+53 ;
TITLE ' STERGERI DIN STOC ' ;
FOOTER ' A C T U A L I Z A R ES T O C ' ;
FLOAT ;
NOCLOSE ;
SHADOW ;
MINIMIZE ;
DOUBLE ;
COLOR SCHEME 5
ENDIF
#REGION 1
close all
clear
set talk off
set console off
set safety off
use stoc
store space(6) to m.cod_mat
store space(20) to m.den_mat
store space(3) to m.u_m
store 0 to m.cant, m.p_u
#REGION 1
IF WVISIBLE('stoc')
ACTIVATE WINDOW stoc SAME
ELSE
ACTIVATE WINDOW stoc NOSHOW
ENDIF
@ 2, 28 SAY 'UM'
@ 2, 1 SAY 'COD '
@ 0, 10 SAY 'SC M O L D O P L A S T SA'
@ 1, 0 TO 1, 51 DOUBLE
@ 3, 1 SAY 'MAT.'
@ 4, 0 TO 4, 51 DOUBLE
@ 6, 0 TO 6, 51 DOUBLE
@ 2, 6 TO 5, 6
@ 2, 27 TO 5, 27
@ 2, 31 TO 5, 31
@ 2, 39 TO 5, 39
@ 2, 7 SAY 'D E N U M I R E'
@ 3, 12 SAY 'M A T E R I A L'
@ 2, 33 SAY 'CANT.'
@ 2, 42 SAY 'P R E T'
@ 3, 41 SAY 'U N I T A R'
@ 5, 0 GET m.cod_mat ;
SIZE 1, 6 ;
DEFAULT ' ' ;
PICTURE '@!IK' ;
VALID _rkg0w5fy4() ;
ERROR 'COD MATERIAL INEXISTENTRELUATI !!!'
READ
RELEASE WINDOW stoc
SELECT (m.currarea)
#REGION 0
IF m.talkstat = 'ON'
SET TALK ON
ENDIF
IF m.compstat = 'ON'
SET COMPATIBLE ON
ENDIF
#REGION 1
close all
clear
FUNCTION _rkg0w5fy4 && m.cod_mat VALID
#REGION 1
CLOSE ALL
USE STOC
INDEX ON cod_mat TAG STOC
SEEK m.cod_mat
IF FOUND()
SET FILTER TO cod_mat=m.cod_mat
DEFINE POPUP PRETU FROM 5, 7 TO 8, 25 PROMPT FIELD P_U SHADOW TITLE 'PRET UNITAR' FOOTER 'ALEGETI'
ON SELECTION POPUP PRETU DO OPT
ACTIVATE POPUP PRETU
RETURN.T.
ELSE
RETURN.F.
ENDIF
PROCEDURE OPT
@ 5, 7 SAY den_mat ;
SIZE 1, 20 ;
PICTURE '@!IK'
@ 5, 28 SAY u_m ;
SIZE 1, 3 ;
PICTURE '@!IK'
@ 5, 32 SAY cant ;
SIZE 1, 7 ;
PICTURE '@K'
@ 5, 40 SAY p_u ;
SIZE 1, 12 ;
PICTURE '@K'
HIDE POPUP PRETU
DO CONFIRM
RETURN
PROCEDURE CONFIRM
store ' ' to rasp
@7, 5 say 'CONFIRMATI STERGEREA (D/N): '
@7, 40 get rasp picture '@I'
read
if rasp='d'.or.rasp='D'
delete
pack
deactivate popup pretu
return.t.
else
deactivate popup pretu
return.t.
endif