TOOLBAR "" 0 20 60 2

BUTTON DLG_OK 9 2
BEGIN
  PROMPT -13 -1 ""
END

BUTTON DLG_CANCEL 9 2
BEGIN
  PROMPT -23 -1 ""
END

BUTTON DLG_DELREC 9 2
BEGIN
  PROMPT -33 -1 "Elimina"
  MESSAGE EXIT,K_DEL
END

ENDPAGE

PAGE "Righe movimenti" -1 -1 80 23

STRING F_CODART 20
BEGIN
  PROMPT 2 2 "Codice articolo "
	FIELD CODART
	FLAGS "U"
	USE LF_ANAMAG
	INPUT CODART F_CODART
	DISPLAY "Codice@20" CODART
	DISPLAY "Descrizione@50" DESCR
	OUTPUT F_CODART CODART
	OUTPUT F_DESART DESCR
	CHECKTYPE REQUIRED
END

STRING F_DESART 20
BEGIN
  PROMPT 2 3 "Descrizione     "
	FIELD CODART
	FLAGS "U"
	USE LF_ANAMAG KEY 2
	INPUT DESCR F_DESART
	DISPLAY "Descrizione@50" DESCR
	DISPLAY "Codice@20" CODART
	COPY OUTPUT F_CODART
	CHECKTYPE REQUIRED
END

STRING F_CODMAG 3
BEGIN
	PROMPT 2 5 "Magazzino  "
  FLAGS "U"
	FIELD CODMAG[1,3]
  USE MAG SELECT CODTAB[4,5]==""
  INPUT CODTAB F_CODMAG
  DISPLAY "Codice " CODTAB[1,3]
  DISPLAY "Denominazione mag.@50 " S0
  OUTPUT F_CODMAG CODTAB[1,3]
  OUTPUT F_DESMAG S0
  OUTPUT H_DESMAG S0
  OUTPUT H_GESTGIA B0
//  OUTPUT F_CODDEP CODTAB[4,5]
	CHECKTYPE REQUIRED

END

STRING F_CODDEP 2
BEGIN
	PROMPT 2 6 "Deposito   "
  FLAGS "U"
	FIELD CODMAG[4,5]
	USE MAG 
	INPUT CODTAB[1,3] F_CODMAG 
  INPUT CODTAB[4,5] F_CODDEP
  DISPLAY "Cod. magazzino" CODTAB[1,3]
  DISPLAY "Cod. deposito" CODTAB[4,5]
  DISPLAY "Denominazione dep.@50" S0
  OUTPUT F_CODDEP CODTAB[4,5]
  OUTPUT F_DESDEP S0
  OUTPUT F_CODMAG CODTAB[1,3]
	CHECKTYPE NORMAL
  STR_EXPR ((#H_GESTGIA=="X")&&(#F_CODDEP!=""))||(#H_GESTGIA!="X")
//	WARNING "Indicare il deposito"
END

STRING F_DESMAG 50
BEGIN
	PROMPT 22 5 ""
  USE MAG KEY 2 
  INPUT S0 F_DESMAG
  DISPLAY "Denominazione mag.@50" S0
  DISPLAY "Cod. magazzino" CODTAB[1,3]
  DISPLAY "Cod. deposito" CODTAB[4,5]
	OUTPUT F_CODMAG CODTAB[1,3]
	OUTPUT F_CODDEP CODTAB[4,5]
// GUIDO!!!!!!!!!!!!!!!!! in che ordine vengono eseguiti gli output
//					a cascata??? perchč mi ritrovo il coddep cancellato???
END


STRING F_DESDEP 50
BEGIN
	PROMPT 22 6 ""
	FLAGS "H"
	COPY USE F_DESMAG
  INPUT S0 F_DESDEP
	COPY DISPLAY F_DESMAG
  COPY OUTPUT F_DESMAG
//	MESSAGE K_TAB,F_CODDEP
END


STRING H_DESMAG 50
BEGIN
	PROMPT 22 5 ""
	FLAGS "D"
END

//Abilitazione/disabil. dei campi relativi al deposito
BOOLEAN H_GESTGIA
BEGIN
  PROMPT 1 1 ""
  FLAGS "HG"
	MESSAGE TRUE ENABLE,F_CODDEP|CHECK,F_CODDEP|SHOW,F_DESDEP|SHOW,H_DESMAG|HIDE,F_DESMAG
  MESSAGE FALSE RESET,F_CODDEP|RESET,F_DESDEP|DISABLE,F_CODDEP|HIDE,F_DESDEP|HIDE,H_DESMAG|SHOW,F_DESMAG
END

//Livelli giacenza
STRING F_LIV1 10
BEGIN
  PROMPT 2 8 "Livello 1  "
	USE GCG //SELECT CODTAB[1,1]=="1"
	JOIN FCG ALIAS 500 INTO CODTAB==CODTAB[1,1]
	INPUT CODTAB[1,1] "1" 
	INPUT CODTAB[2,11] F_LIV1
	DISPLAY	"Livello@20" 500@->S0
	DISPLAY	"Gruppo@10" CODTAB[2,20]
	DISPLAY	"Descr.@30" S0
	OUTPUT F_LIV1 CODTAB[2,12] 
	CHECKTYPE NORMAL

  MESSAGE EMPTY RESET,F_LIV2|RESET,F_LIV3|RESET,F_LIV4
END

STRING F_LIV2 6
BEGIN
  PROMPT  40 8 "Livello 2  "
	// Non mettere 	FLAGS "D" perchč disabiliterebbe tutta la colonna
	USE GCG //SELECT CODTAB[1,1]=="2"
	JOIN FCG ALIAS 500 INTO CODTAB==CODTAB[1,1]
	INPUT CODTAB[1,1] "2" 
	INPUT CODTAB[2,12] F_LIV2
	COPY DISPLAY F_LIV1
	OUTPUT F_LIV2 CODTAB[2,12] 
	CHECKTYPE NORMAL
  MESSAGE EMPTY RESET,F_LIV3|RESET,F_LIV4
END

STRING F_LIV3 6
BEGIN
  PROMPT 2 9 "Livello 3  "
	USE GCG //SELECT CODTAB[1,1]=="3"
	JOIN FCG ALIAS 500 INTO CODTAB==CODTAB[1,1]
	INPUT CODTAB[1,1] "3" 
	INPUT CODTAB[2,12] F_LIV3
	COPY DISPLAY F_LIV1
	OUTPUT F_LIV3 CODTAB[2,12] 
	CHECKTYPE NORMAL
  MESSAGE EMPTY RESET,F_LIV4
END

STRING F_LIV4 6
BEGIN
  PROMPT 40 9 "Livello 4  "
	USE GCG //SELECT CODTAB[1,1]=="4"
	JOIN FCG ALIAS 500 INTO CODTAB==CODTAB[1,1]
	INPUT CODTAB[1,1] "4" 
	INPUT CODTAB[2,12] F_LIV4
	COPY DISPLAY F_LIV1
	OUTPUT F_LIV4 CODTAB[2,12] 
	CHECKTYPE NORMAL
END

STRING F_UM 2
BEGIN
  PROMPT 2 11 "Unitą di misura  "
	FIELD UM
	USE LF_UMART KEY 2
	INPUT CODART F_CODART SELECT
	INPUT UM F_UM
	DISPLAY "U.M.@10" UM
	DISPLAY "F.C.@10" FC
	OUTPUT F_CODART CODART 
	OUTPUT F_UM UM 
	CHECKTYPE REQUIRED	
END

NUMBER F_QUANT 15 5
BEGIN
  PROMPT 2 13 "Quantitą         "
	FIELD QUANT
	CHECKTYPE REQUIRED	
	WARNING "Indicare la quantitą"
END

NUMBER F_PREZZO 18 3
BEGIN
  PROMPT 2 14 "Prezzo           "
	FIELD PREZZO
	CHECKTYPE REQUIRED	
	WARNING "Indicare il prezzo"
END

ENDPAGE

ENDMASK
