#include "ba3100.h"
#include "batbban.h"

TOOLBAR "" 0 18 0 3
#include <toolbar.h>

ENDPAGE

PAGE "Tabella banche" -1 -1 78 18

NUMBER F_CODICEABI 5
BEGIN
  PROMPT 6 1 "Codice ABI "
  FIELD %BAN->CODTAB[1,5]
  FLAGS "Z"
  KEY 1
  USE %BAN KEY 1 SELECT CODTAB ?= "?????"
  INPUT CODTAB F_CODICEABI
  DISPLAY "ABI@5" CODTAB[1,5]
  DISPLAY "Istituto@50" S0
  OUTPUT F_CODICEABI CODTAB[1,5]
  OUTPUT H_DENOMABI S0
  MESSAGE COPY,H_CODICEABI
  CHECKTYPE REQUIRED
END

NUMBER F_CODICECAB 5
BEGIN
  PROMPT 28 1 "Codice CAB "
  FIELD %BAN->CODTAB[6,10]
  FLAGS "Z"
  KEY 1
  USE %BAN
  INPUT CODTAB[1,5] F_CODICEABI
  INPUT CODTAB[6,10] F_CODICECAB
  DISPLAY "ABI@5" CODTAB[1,5]
  DISPLAY "CAB@5" CODTAB[6,10]
  DISPLAY "Dipendenza" I0
  DISPLAY "Denominazione@50" S0
  OUTPUT F_CODICECAB CODTAB[6,10]
  OUTPUT F_DENOM S0
  OUTPUT H_DENOMABI S0
  OUTPUT F_CODICEABI CODTAB[1,5]
  MESSAGE SHOW,F_ISTIT|SHOW,F_CODICEDIP|HIDE,H_DENOMABI|SHOW,F_DENOM
  MESSAGE EMPTY HIDE,F_ISTIT|HIDE,F_CODICEDIP|SHOW,H_DENOMABI|HIDE,F_DENOM
  GROUP GR_SEARCH
  CHECKTYPE NORMAL
END

NUMBER F_CODICEDIP 4
BEGIN
  PROMPT 50 1 "Codice Dipendenza "
  FIELD %BAN->I0
  FLAGS "Z"
END

NUMBER H_CODICEABI 5
BEGIN
  FLAGS "HZ"
  COPY USE F_CODICEABI
  INPUT CODTAB F_CODICEABI
  COPY DISPLAY F_CODICEABI
  OUTPUT F_ISTIT S0
  CHECKTYPE NORMAL
END

STRING F_ISTIT 50
BEGIN
  PROMPT 6 3 "Istituto        "
  FLAGS "D"
END

STRING F_DENOM 50
BEGIN
  PROMPT 6 5 "Denominazione   "
  FIELD %BAN->S0
  USE %BAN KEY 2
  KEY 2
  INPUT S0 F_DENOM
  DISPLAY "Denominazione@50" S0
  DISPLAY "ABI@5" CODTAB[1,5]
  DISPLAY "CAB@5" CODTAB[6,10]
  DISPLAY "Dipendenza" I0
  COPY OUTPUT F_CODICECAB
  MESSAGE K_TAB,F_CODICECAB
  CHECKTYPE REQUIRED
  WARNING "Manca la denominazione"
END

STRING H_DENOMABI 50
BEGIN
  PROMPT 6 3 "Istituto        "
  FIELD %BAN->S0
  KEY 2
  USE %BAN KEY 2
  INPUT S0 H_DENOMABI
  DISPLAY "Istituto@50" S0
  DISPLAY "ABI@5" CODTAB[1,5]
  DISPLAY "CAB@5" CODTAB[6,10]
  DISPLAY "Dipendenza" I0
  COPY OUTPUT F_CODICECAB
  MESSAGE K_TAB,F_CODICECAB
  CHECKTYPE REQUIRED
  WARNING "Manca la denominazione dell'istituto"
END

GROUPBOX DLG_NULL 72 7
BEGIN
  PROMPT 4 8 "Sede"
END

STRING F_INDIRIZZO 35
BEGIN
  PROMPT 6 9 "Indirizzo      "
  FIELD %BAN->S2
END

STRING F_CIV 10
BEGIN
  PROMPT 60 9 "N. "
  FIELD %BAN->S7
END

STRING F_COMUNE 4
BEGIN
  PROMPT 6 11 "Codice comune  "
  FLAGS "U"
  FIELD %BAN->S5
  USE LF_COMUNI
  INPUT STATO ""
  INPUT COM F_COMUNE
#include <comdcod.h>
  OUTPUT F_COMUNE COM
  OUTPUT F_DENCOM DENCOM
  OUTPUT F_PROV PROVCOM
  OUTPUT F_CAP CAPCOM
  CHECKTYPE NORMAL
  WARNING "Comune assente"
  ADD RUN ba4 -0
END

STRING F_DENCOM 50
BEGIN
  PROMPT 6 12 "Comune         "
  USE LF_COMUNI KEY 2
  INPUT DENCOM F_DENCOM
#include <comdden.h>
  COPY OUTPUT F_COMUNE
  CHECKTYPE NORMAL
END

STRING F_PROV 2
BEGIN
  PROMPT 6 13 "Provincia      "
  FLAGS "D"
END

STRING F_CAP 5
BEGIN
  PROMPT 60 13 "C.A.P.  "
  FIELD %BAN->S3
END

ENDPAGE

ENDMASK
