#include "batbcau.h"

TOOLBAR "" 0 20 60 2
#include <toolbar.h>
ENDPAGE

PAGE "Gestione causali" 11 60 14

GROUPBOX DLG_NULL 75 5
BEGIN
 PROMPT 1 0 ""
 FLAGS "R"
END


STRING F_CODICE  4
BEGIN 
  PROMPT 2 	1 "Codice causale "
  FIELD CODTAB
  KEY 1
  USE CAU
  FLAGS "U"
  INPUT CODTAB  F_CODICE
  DISPLAY "Codice " CODTAB
  DISPLAY "Descrizione@50 " S0
  OUTPUT F_CODICE CODTAB
  OUTPUT F_DESCAU S0
  CHECKTYPE REQUIRED
END

STRING F_DESCAU	50
BEGIN 
  PROMPT 2 3 "Descrizione    "
  FIELD S0
  USE CAU KEY 2
  KEY 2
  INPUT S0 F_DESCAU
	COPY DISPLAY F_CODICE  
	COPY OUTPUT  F_CODICE  
  CHECKTYPE REQUIRED
  WARNING "Manca la descrizione"
END

STRING F_RAGGF 4		
BEGIN 
  PROMPT 2 5 "Raggrupp. fiscale   "
	FIELD S8
	FLAGS "U"
    USE RFC
    INPUT CODTAB F_RAGGF
    DISPLAY "Codice " CODTAB
    DISPLAY "Descrizione@40" S0
    OUTPUT F_RAGGF CODTAB
    OUTPUT F_RAGGFD S0
    OUTPUT F_TIPOMOV S6
    CHECKTYPE NORMAL
    GROUP 23
	MESSAGE DISABLE,F_TIPOMOV
	MESSAGE EMPTY ENABLE,F_TIPOMOV|RESET,F_RAGGFD
END

STRING F_RAGGFD	50
BEGIN 
  PROMPT 30 5 ""
	FLAGS "D"
END

//STRING H_RAGGFD	50
//BEGIN 
//  PROMPT 30  5 ""
//	FLAGS "HD"
//END

LISTBOX F_TIPOMOV	16
BEGIN 
  PROMPT 2 7 "Tipo movimento      "
	FIELD S7
	ITEM "C|carico"
	ITEM "S|scarico"
	ITEM "V|varie"		
END

LISTBOX F_TIPOPR	16
BEGIN 
  PROMPT 42 7 "Tipo prezzo         "
	FIELD S6
	ITEM "P|Prezzo"
	ITEM "C|Costo"
	ITEM "L|Libero"		
END

LISTBOX F_SGNGIAC	1
BEGIN 
  PROMPT 2 9 "Movimentazione giacenza   "
	FIELD I0
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNRIM	1
BEGIN 
  PROMPT 2 10 "    ''    ''   rim.iniz.  "
	FIELD I11
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNACQ	1
BEGIN 
    PROMPT 2 11 "    ''    ''   acquistato "
	FIELD I1
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNENTR	1
BEGIN 
    PROMPT 42 11 "Movimentazione entrato    "
	FIELD I2
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNVEN	1
BEGIN 
    PROMPT 2 12 "    ''    ''   venduto    "
	FIELD I3
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNUSC	1 
BEGIN 
    PROMPT 42 12 "    ''    ''   uscito     "
	FIELD I4
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNORDF	1
BEGIN 
    PROMPT 2 13 "    ''    ''   ord. forn. "
	FIELD I6
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNORDC	1
BEGIN 
    PROMPT 42 13 "    ''    ''   ord. cli.  "
	FIELD I5
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNSCAR	1
BEGIN 
    PROMPT 2 14 "    ''    ''   scarti     "
	FIELD I12
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNPRODF 1
BEGIN 
    PROMPT 2 15 "    ''    ''   prod. fin. "
	FIELD I10
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNPRODC	1
BEGIN 
  PROMPT 42 15 "    ''    ''   prod.comp. "
	FIELD I9
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNACL	1
BEGIN 
    PROMPT 2 16 "    ''    ''   a conto l. "
	FIELD I8
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNINCL	1
BEGIN 
    PROMPT 42 16 "    ''    ''   in conto l."
	FIELD I7
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

LISTBOX F_SGNLABEL  1
BEGIN 
  PROMPT 2 17 "    ''    ''   etichette  "
	FIELD I13
	ITEM "0| "
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "1|+"
	MESSAGE K_TAB,F_SUMSIGN
	ITEM "-1|-"
	MESSAGE K_TAB,F_SUMSIGN
	GROUP G_SGN
END

NUMBER F_SUMSIGN	4 0
BEGIN 
  PROMPT 2 18 "Somma segni               "
	FLAGS "DG"
	NUM_CALC ((#F_SGNGIAC-#F_SGNRIM)-(#F_SGNACQ+#F_SGNENTR)+(#F_SGNVEN+#F_SGNUSC)+(#F_SGNACL-#F_SGNINCL)+(#F_SGNPRODF-#F_SGNPRODC))
	MESSAGE COPY,F_CHECKER
END

NUMBER F_CHECKER	4 0
BEGIN 
  PROMPT 0 0 "Checker "
	FLAGS "HG"
	NUM_EXPR #F_SUMSIGN=="0"
	WARNING "Deve essere soddisfatta l'equazione: ((GIAC-RIM)-(ACQ+ENTR)+(VEN+USC)+(ACL-INCL)+(PRODF-PRODC))=0"
END

/*
L'item "0" deve essere il primo item dei listbox;
la presenza del blank (==0) riporta la listbox al primo
item
STRING F_ERASER	1
BEGIN 
  PROMPT 0 0 ""
	FLAGS "HG"
	MESSAGE EMPTY "X",F_ERASER|"0",G_SGN@
END*/


ENDPAGE
