#ifdef FULL_SCREEN
TOOLBAR "" 0 20 0 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
#endif

#ifndef MASK_WIDTH
#define MASK_WIDTH 74
#endif

#ifndef MASK_HEIGHT
#define MASK_HEIGHT 19
#endif

#ifndef MASK_TITLE1
#define MASK_TITLE1 ""
#endif

PAGE MASK_TITLE1 -1 -1 MASK_WIDTH MASK_HEIGHT

STRING FR_STATORIGA 2
BEGIN
  PROMPT 2 1 "Stato riga  "
  FLAGS "DG"
  FIELD STATORIGA
END

STRING FR_TIPORIGA 2
BEGIN
  PROMPT 2 2 "Tipo riga   "
  USE %TRI
  IN CODTAB FR_TIPORIGA
  OU FR_DESTIPORIGA S0
  CHECKTYPE REQUIRED
  FLAGS "DG"
  FIELD TIPORIGA
END

#ifdef FULL_SCREEN
STRING FR_DESTIPORIGA 50
#else
STRING FR_DESTIPORIGA 25
#endif
BEGIN
  PROMPT 22 2 ""
  FLAGS "D"
END

IFDEF(F_CODMAG)
STRING FR_CODMAG 3
BEGIN
IFDEF(X_CODMAG)
  PROMPT X_CODMAG Y_CODMAG PR_CODMAG
ELSEIF
  PROMPT 2 3 "Magazzino   "
ENDIF
  USE MAG SELECT CODTAB ? "???"
  INPUT CODTAB FR_CODMAG
  DISPLAY "Codice" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT FR_CODMAG CODTAB
  OUTPUT FR_DESMAG S0
  WARNING "Magazzino assente"
  FLAGS "U"
IFDEF(FL_CODMAG)
  FLAGS FL_CODMAG
ENDIF
  KEY 1
IFDEF(CH_CODMAG)
  CHECKTYPE CH_CODMAG
ELSEIF
  CHECKTYPE NORMAL
ENDIF
  FIELD CODMAG[1,3]
END

IFDEF(F_DESMAG)
STRING FR_DESMAG 50
BEGIN
IFDEF(X_DESMAG)
  PROMPT X_DESMAG Y_DESMAG PR_DESMAG
ELSEIF
  PROMPT 22 3 ""
ENDIF
IFDEF(FL_DESMAG)
  FLAGS FL_DESMAG
ENDIF
  FLAGS "D"
END
ENDIF
ENDIF

IFDEF(F_CODDEP)
STRING FR_CODDEP 2
BEGIN
IFDEF(X_CODDEP)
  PROMPT X_DESMAG Y_DESMAG PR_DESMAG
ELSEIF
  PROMPT 2 4 "Deposito    "
ENDIF
  USE MAG SELECT (CODTAB[1,3]==#FR_CODMAG) && (CODTAB ? "?????")
  INPUT CODTAB[1,3] FR_CODMAG
  INPUT CODTAB[4,5] FR_CODDEP
  DISPLAY "Codice mag." CODTAB[1,3]
  DISPLAY "Codice dep." CODTAB[4,5]
  DISPLAY "Descrizione@50" S0
  OUTPUT FR_CODMAG CODTAB[1,3]
  OUTPUT FR_CODDEP CODTAB[4,5]
  OUTPUT FR_DESDEP S0
  MESSAGE DIRTY,FR_CODMAG|K_TAB,FR_CODMAG
IFDEF(CH_CODDEP)
  CHECKTYPE CH_CODDEP
ELSEIF
  CHECKTYPE NORMAL
ENDIF
  WARNING "Deposito assente"
IFDEF(FL_CODDEP)
  FLAGS FL_CODDEP
ENDIF
  FLAGS "U"
  KEY 1
  FIELD CODMAG[4,5]
END

IFDEF(F_DESDEP)
STRING FR_DESDEP 50
BEGIN
IFDEF(X_DESDEP)
  PROMPT X_DESDEP Y_DESDEP PR_DESDEP
ELSEIF
  PROMPT 22 4 ""
ENDIF
  FLAGS "D"
END
ENDIF
ENDIF

IFDEF(F_CODART)
ST FR_CODART 20
BEGIN
IFDEF(X_CODART)
  PROMPT X_CODART Y_CODART PR_CODART
ELSEIF
  PROMPT 2 6 "Articolo    "
ENDIF
  USE LF_ANAMAG KEY 1
  INPUT CODART FR_CODART
  DISPLAY "Codice@20" CODART
  DISPLAY "Descrizione@50" DESCR
  OUTPUT  FR_CODART CODART
  WARNING "Articolo assente"
IFDEF(CH_CODART)
  CHECKTYPE CH_CODART
ENDIF
IFDEF(FL_CODART)
  FLAGS FL_CODART
ENDIF
  FIELD CODART
  ADD RUN ve2 -3
END
ENDIF

IFDEF(F_CODSPV)
STRING FR_CODSPV 8
BEGIN
IFDEF(X_CODSPV)
  PROMPT X_CODSPV Y_CODSPV PR_CODSPV
ELSEIF
  PROMPT 2 6 "Spesa       "
ENDIF
  USE SPP SELECT S6=="V"
  INPUT CODTAB FR_CODSPV
  DISPLAY "Codice spesa" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT FR_CODSPV CODTAB
  OUTPUT FR_DESCRSPV S0
  OUTPUT FR_VALORE R0
  OUTPUT FR_UMQTASP S7
  OUTPUT FR_CODIVA S3
  MESSAGE DIRTY,FR_CODIVA|K_TAB,FR_CODIVA|DISABLE,FR_QTA
  FIELD CODART
  FLAGS "U"
IFDEF(CH_CODSPV)
  CHECKTYPE CH_CODSPV
ELSEIF
  CHECKTYPE REQUIRED
ENDIF
END
ENDIF

IFDEF(F_CODSPQ)
STRING FR_CODSPQ 8
BEGIN
IFDEF(X_CODSPQ)
  PROMPT X_CODSPQ Y_CODSPQ PR_CODSPQ
ELSEIF
  PROMPT 2 6 "Spesa       "
ENDIF
  USE SPP SELECT S6=="Q"
  INPUT CODTAB FR_CODSPQ
  DISPLAY "Codice spesa" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT FR_CODSPQ CODTAB
  OUTPUT FR_DESCRSPQ S0
  OUTPUT FR_QTA R1
  OUTPUT FR_PREZZO R0
  OUTPUT FR_UMQTASP S7
  OUTPUT FR_CODIVA S3
  MESSAGE DIRTY,FR_CODIVA|K_TAB,FR_CODIVA
  FIELD CODART
  FLAGS "U"
IFDEF(CH_CODSPQ)
  CHECKTYPE CH_CODSPQ
ELSEIF
  CHECKTYPE REQUIRED
ENDIF
END
ENDIF

IFDEF(F_CODSPP)
STRING FR_CODSPP 8
BEGIN
IFDEF(X_CODSPP)
  PROMPT X_CODSPP Y_CODSPP PR_CODSPP
ELSEIF
  PROMPT 2 6 "Spesa       "
ENDIF
  USE SPP SELECT S6=="P"
  INPUT CODTAB FR_CODSPP
  DISPLAY "Codice spesa" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT FR_CODSPP CODTAB
  OUTPUT FR_DESCRSPP S0
  OUTPUT FR_PERCSP R2
  OUTPUT FR_CODIVA S3
  FIELD CODART
  FLAGS "U"
  MESSAGE DIRTY,FR_CODIVA|K_TAB,FR_CODIVA
IFDEF(CH_CODSPP)
  CHECKTYPE CH_CODSPP
ELSEIF
  CHECKTYPE REQUIRED
ENDIF
END
ENDIF

IFDEF(F_CODPRS)
STRING FR_CODPRS 8
BEGIN
IFDEF(X_CODPRS)
  PROMPT X_CODPRS Y_CODPRS PR_CODPRS
ELSEIF
  PROMPT 2 6 "Prestazione "
ENDIF
  USE PRS
  INPUT CODTAB FR_CODPRS
  DISPLAY "Codice prestazione" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT FR_CODPRS CODTAB
  OUTPUT FR_DESCRPRS S0
  OUTPUT FR_PREZZO R0
  OUTPUT FR_QTA R1
  OUTPUT FR_UMQTASP S7
  OUTPUT FR_CODIVA S3
  MESSAGE DIRTY,FR_CODIVA|K_TAB,FR_CODIVA
  FIELD CODART
  FLAGS "U"
IFDEF(CH_CODPRS)
  CHECKTYPE CH_CODPRS
ELSEIF
  CHECKTYPE REQUIRED
ENDIF
END
ENDIF

IFDEF(F_DESCR)
ZOOM FR_DESCR 50
BEGIN
IFDEF(X_DESCR)
  PROMPT X_DESCR Y_DESCR PR_DESCR
ELSEIF
  PROMPT 2 7 "Descrizione "
ENDIF
  FIELD DESCR
END
ENDIF

IFDEF(F_DESCRART)
ZOOM FR_DESCRART 50
BEGIN
IFDEF(X_DESCRART)
  PROMPT X_DESCRART Y_DESCRART PR_DESCRART
ELSEIF
  PROMPT 2 7 "Descrizione "
ENDIF
  USE LF_ANAMAG KEY 2
  INPUT DESCR FR_DESCRART
  DISPLAY "Descrizione@50" DESCR
  DISPLAY "Codice@20" CODART
  OUTPUT  FR_DESCRART DESCR
  ADD RUN ve2 -3
  FIELD DESCR
END
ENDIF

IFDEF(F_DESCRSPV)
ZOOM FR_DESCRSPV 50
BEGIN
IFDEF(X_DESCRSPV)
  PROMPT X_DESCRSPV Y_DESCRSPV PR_DESCRSPV
ELSEIF
  PROMPT 2 7 "Descrizione "
ENDIF
  USE SPP KEY 2 SELECT S6=="V"
  INPUT S0 FR_DESCRSPV
  DISPLAY "Descrizione@50" S0
  DISPLAY "Codice spesa" CODTAB
  COPY OUTPUT FR_CODSPV
  FIELD DESCR
END
ENDIF

IFDEF(F_DESCRSPQ)
ZOOM FR_DESCRSPQ 50
BEGIN
IFDEF(X_DESCRSPV)
  PROMPT X_DESCRSPQ Y_DESCRSPQ PR_DESCRSPQ
ELSEIF
  PROMPT 2 7 "Descrizione "
ENDIF
  USE SPP KEY 2 SELECT S6=="Q"
  INPUT S0 FR_DESCRSPQ
  DISPLAY "Descrizione@50" S0
  DISPLAY "Codice spesa" CODTAB
  COPY OUTPUT FR_CODSPQ
  FIELD DESCR
END
ENDIF

IFDEF(F_DESCRSPP)
ZOOM FR_DESCRSPP 50
BEGIN
IFDEF(X_DESCRSPP)
  PROMPT X_DESCRSPP Y_DESCRSP PR_DESCRSPP
ELSEIF
  PROMPT 2 7 "Descrizione "
ENDIF
  USE SPP KEY 2 SELECT S6=="P"
  INPUT S0 FR_DESCRSPP
  DISPLAY "Descrizione@50" S0
  DISPLAY "Codice spesa" CODTAB
  COPY OUTPUT FR_CODSPP
  FIELD DESCR
END
ENDIF

IFDEF(F_DESCRPRS)
ZOOM FR_DESCRPRS 50
BEGIN
IFDEF(X_DESCRPRS)
  PROMPT X_DESCRPRS Y_DESCRPRS PR_DESCRPRS
ELSEIF
  PROMPT 2 7 "Descrizione "
ENDIF
  USE PRS KEY 2
  INPUT S0 FR_DESCRPRS
  DISPLAY "Descrizione@50" S0
  DISPLAY "Codice prestazione" CODTAB
  COPY OUTPUT FR_CODPRS
  FIELD DESCR
END
ENDIF

IFDEF(F_UMQTA)
STRING FR_UMQTA 2
BEGIN
IFDEF(X_UMQTA)
  PROMPT X_UMQTA Y_UMQTA PR_UMQTA
ELSEIF
  PROMPT 2 9 "U.M.        "
ENDIF
  USE LF_UMART KEY 2
  JOIN %UMS INTO CODTAB=UM
  INPUT CODART FR_CODART SE
  INPUT UM FR_UMQTA
  DISPLAY "Codice@20" UM
  DISPLAY "Descrizione@50" %UMS->S0
  OUTPUT  FR_UMQTA UM
  FIELD UMQTA
  FLAG "U"
IFDEF(CH_UMQTA)
  CHECKTYPE CH_UMQTA
ELSEIF
  CHECKTYPE NORMAL
ENDIF
END
ENDIF

IFDEF(F_UMQTASP)
STRING FR_UMQTASP 2
BEGIN
IFDEF(X_UMQTASP)
  PROMPT X_UMQTASP Y_UMQTASP PR_UMQTASP
ELSEIF
  PROMPT 2 9 "U.M.        "
ENDIF
  USE %UMS
  INPUT CODTAB FR_UMQTASP
  DISPLAY "Codice" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT  FR_UMQTASP CODTAB
  FIELD UMQTA
  FLAG "U"
IFDEF(CH_UMQTASP)
  CHECKTYPE CH_UMQTASP
ELSEIF
  CHECKTYPE NORMAL
ENDIF
END
ENDIF

IFDEF(F_QTA)
NUMBER FR_QTA 13 5
BEGIN
IFDEF(X_QTA)
  PROMPT X_QTA Y_QTA PR_QTA
ELSEIF
  PROMPT 21 9 "Qta' "
ENDIF
  FIELD QTA
END
ENDIF

IFDEF(F_PERCSP)
NUMBER FR_QTA 6 2
BEGIN
IFDEF(X_PERCSP)
  PROMPT X_PERCSP Y_PERCSP PR_PERCSP
ELSEIF
  PROMPT 2 9 "Spesa %     "
ENDIF
  FIELD PSPESA
END
ENDIF

IFDEF(F_PREZZO)
NUMBER FR_PREZZO 15 3
BEGIN
IFDEF(X_PREZZO)
  PROMPT X_PREZZO Y_PREZZO PR_PREZZO
ELSEIF
  PROMPT 42 9 "Prezzo "
ENDIF
  FIELD PREZZO
END
ENDIF

IFDEF(F_VALORE)
NUMBER FR_VALORE 15 3
BEGIN
IFDEF(X_VALORE)
  PROMPT X_VALORE Y_VALORE PR_VALORE
ELSEIF
  PROMPT 42 9 "Valore  "
ENDIF
  FIELD PREZZO
END
ENDIF

IFDEF(F_QTAEVASA)
NUMBER FR_QTAEVASA 11 3
BEGIN
IFDEF(X_QTAEVASA)
  PROMPT X_QTAEVASA Y_QTAEVASA PR_QTAEVASA
ELSEIF
  PROMPT 17 10 "Q.ta evasa "
ENDIF
  FIELD QTAEVASA
END
ENDIF

IFDEF(F_RIGAEVASA)
BOOLEAN FR_RIGAEVASA
BEGIN
IFDEF(X_RIGAEVASA)
  PROMPT X_RIGAEVASA Y_RIGAEVASA PR_RIGAEVASA
ELSEIF
  PROMPT 42 10 "Saldata "
ENDIF
  FIELD RIGAEVASA
END
ENDIF

IFDEF(F_TARA)
NUMBER FR_TARA 15 2
BEGIN
IFDEF(X_TARA)
  PROMPT X_TARA Y_TARA PR_TARA
ELSEIF
  PROMPT 2 11 "Tara   "
ENDIF
  FIELD TARA
END
ENDIF

IFDEF(F_PNETTO)
NUMBER FR_PNETTO 15 2
BEGIN
IFDEF(X_PNETTO)
  PROMPT X_PNETTO Y_PNETTO PR_PNETTO
ELSEIF
  PROMPT 30 11 "Peso netto "
ENDIF
  FIELD PNETTO
END
ENDIF

IFDEF(F_NCOLLI)
NUMBER FR_NCOLLI 7
BEGIN
IFDEF(X_NCOLLI)
  PROMPT X_NCOLLI Y_NCOLLI PR_NCOLLI
ELSEIF
  PROMPT 2 12 "N.Colli "
ENDIF
  FIELD NCOLLI
END
ENDIF

IFDEF(F_DAEVADERE)
BOOLEAN FR_DAEVADERE
BEGIN
IFDEF(X_DAEVADERE)
  PROMPT X_DAEVADERE Y_DAEVADERE PR_DAEVADERE
ELSEIF
  PROMPT 22 12 "Da evadere "
ENDIF
  FIELD DAEVADERE
END
ENDIF

IFDEF(F_SCONTO)
STRING FR_SCONTO 25
BEGIN
IFDEF(X_SCONTO)
  PROMPT X_SCONTO Y_SCONTO PR_SCONTO
ELSEIF
  PROMPT 2 13 "Sconto      "
ENDIF
  FIELD SCONTO
END
ENDIF

IFDEF(F_PERCPROV)
NUMBER FR_PERCPROV 5 2
BEGIN
IFDEF(X_PERCPROV)
  PROMPT X_PERCPROV Y_PERCPROV PR_PERCPROV
ELSEIF
  PROMPT 42 13 "Perc.Provv. "
ENDIF
  FIELD PERCPROV
END
ENDIF

IFDEF(F_IMPFISUN)
BOOLEAN FR_IMPFISUN
BEGIN
IFDEF(X_IMPFISUN)
  PROMPT X_IMPFISUN Y_IMPFISUN PR_IMPFISUN
ELSEIF
  PROMPT 2 14 "Importo provv.unitario"
ENDIF
  FIELD IMPFISUN
END
ENDIF


IFDEF(F_IMPFISSO)
NUMBER FR_IMPFISSO 18 2
BEGIN
IFDEF(X_IMPFISSO)
  PROMPT X_IMPFISSO Y_IMPFISSO PR_IMPFISSO
ELSEIF
  PROMPT 42 14 "Imp.Provv.  "
ENDIF
  FIELD IMPFISSO
END
ENDIF

IFDEF(F_CODIVA)
STRING FR_CODIVA 4
BEGIN
IFDEF(X_CODIVA)
  PROMPT X_CODIVA Y_CODIVA PR_CODIVA
ELSEIF
  PROMPT 2 15 "Cod. IVA    "
ENDIF
  USE %IVA
  INPUT CODTAB FR_CODIVA
  DISPLAY "Codice@20" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT  FR_CODIVA CODTAB
  OUTPUT  FR_DESIVA S0
  FLAGS "U"
  VALIDATE ZEROFILL_FUNC 2
IFDEF(CH_CODIVA)
  CHECKTYPE CH_CODIVA
ELSEIF
  CHECKTYPE NORMAL
ENDIF
  FIELD CODIVA
END

IFDEF(F_DESIVA)
STRING FR_DESIVA 50
BEGIN
IFDEF(X_DESIVA)
  PROMPT X_DESIVA Y_DESIVA PR_DESIVA
ELSEIF
  PROMPT 22 15 ""
ENDIF
  USE %IVA KEY 2
  INPUT S0 FR_DESIVA
  DISPLAY "Descrizione@50" S0
  DISPLAY "Codice@20" CODTAB
  OUTPUT  FR_CODIVA CODTAB
  OUTPUT  FR_DESIVA S0
END
ENDIF
ENDIF

IFDEF(F_ADDIVA)
BOOLEAN FR_ADDIVA
BEGIN
IFDEF(X_ADDIVA)
  PROMPT X_ADDIVA Y_ADDIVA PR_ADDIVA
ELSEIF
  PROMPT 2 16 "Addebito IVA"
ENDIF
  FIELD ADDIVA
END
ENDIF

IFDEF(F_ASPBENI)
STRING FR_ASPBENI 2
BEGIN
IFDEF(X_ASPBENI)
  PROMPT X_ASPBENI Y_ASPBENI PR_ASPBENI
ELSEIF
  PROMPT 2 17 "Aspetto Beni "
ENDIF
  USE %ABE
  INPUT CODTAB FR_ASPBENI
  DISPLAY "Codice@20" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT  FR_ASPBENI CODTAB
  OUTPUT  FR_DESASP S0
  FLAGS "UZ"
IFDEF(CH_ASPBENI)
  CHECKTYPE CH_ASPBENI
ELSEIF
  CHECKTYPE NORMAL
ENDIF
  FIELD ASPBENI
END

IFDEF(F_DESASP)
STRING FR_DESASP 50
BEGIN
IFDEF(X_DESASP)
  PROMPT X_DESASP Y_DESASP PR_DESASP
ELSEIF
  PROMPT 22 17 ""
ENDIF
  FLAGS "D"
END
ENDIF
ENDIF

#ifndef FULL_SCREEN
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
#endif

ENDPAGE

ENDMASK
