USE 63
JOIN %CA7 TO 63 ALIAS 14 INTO CODTAB==CODCAUS
JOIN 9 INTO CODDITTA=CODDITTA
JOIN  6 TO   9 ALIAS 116 INTO TIPOA=TIPOA CODANAGR=CODANAGR
JOIN  8 TO   6 ALIAS 118 INTO CODANAGR=CODANAGR
JOIN 13 TO   8 ALIAS 113 INTO COM=COMNASC
JOIN 13 TO   6 ALIAS 213 INTO COM=COMRF(COMRES)
JOIN  6 TO  63 ALIAS 216 INTO TIPOA=TIPOA CODANAGR=CODANAGR
JOIN  8 TO 216@ ALIAS 218 INTO CODANAGR=CODANAGR
JOIN 13 TO 218@ ALIAS 313 INTO COM=COMNASC
JOIN 13 TO 216@ ALIAS 413 INTO COM=COMRES
JOIN 13 TO 216@ ALIAS 513 INTO COM=COMRF(COMRES)
JOIN %STA TO 216@ ALIAS 24 INTO CODTAB=STATORES
END

DESCRIPTION
BEGIN
  63->* "Quadro D1 770"
  9->* "Ditte"
  6->* "Anagrafica persone fisiche e giuridiche"
  8->* "Anagrafica persone fisiche"
  113@->* "Comuni"
  213@->* "Comuni"
  216@->* "Anagrafica persone fisiche e giuridiche"
  218@->* "Anagrafica persone giuridiche"
  313@->* "Comuni"
  413@->* "Comuni"
END

GENERAL
BEGIN
  OFFSET 0 0
  FONT "Courier 17cpi"
  SIZE 10
  CA "X"           
  IN 3 2
  FI 131
END

SECTION HEADER FIRST 18

LISTA 9
BEGIN
 KEY "Tipo anagrafica"
 FIELD 116@->TIPOA
 ITEM "F| " MESSAGE ENABLE,1@|DISABLE,2@
 ITEM "G| " MESSAGE ENABLE,2@|DISABLE,1@
END

STRINGA 1 
BEGIN
  KEY "CODICE FISCALE"
  PROMPT 3 1  ""
  FIELD 116@->COFI
END

STRINGA 2
BEGIN
  KEY "RAGIONE SOCIALE"
  PROMPT 39 1  ""
  FIELD 116@->RAGSOC
  GROUP 2
END

STRINGA 3
BEGIN
  KEY "COGNOME"
  PROMPT 39 1 ""
  FIELD 116@->RAGSOC[1,30]
  GROUP 1
END  

STRINGA 4
BEGIN
  KEY "NOME"
  PROMPT 17 3 ""
  FIELD 116@->RAGSOC[31,50]
  GROUP 1
END  

STRINGA 5
BEGIN
  KEY "SESSO"
  PROMPT 58 3 ""
  FIELD 118@->SESSO
  GROUP 1
END  
  
STRINGA 6
BEGIN
  KEY "DATA DI NASCITA"
  PROMPT 63 3 ""
  FIELD 118@->DATANASC
  GROUP 1
END  
  
STRINGA 7
BEGIN
  KEY "COMUNE DI NASCITA"
  PROMPT 84 3 ""
  FIELD 113@->DENCOM
  GROUP 1
END  
  
STRINGA 8
BEGIN
  KEY "PROV. DI NASCITA"
  PROMPT 125 3 ""
  FIELD 113@->PROVCOM
  GROUP 1
END  
  
STRINGA 10
BEGIN
  KEY "COMUNE DI RES.FISCALE"
  PROMPT 17 5 ""
  FIELD 213@->DENCOM
END  
  
STRINGA 11
BEGIN
  KEY "PROV DI RES.FISCALE"
  PROMPT 59 5 ""
  FIELD 213@->PROVCOM
END  
  
STRINGA 12
BEGIN
  KEY "VIA di RES."
  PROMPT 67 5  ""
  FIELD 116@->INDRF
  FIELD 116@->INDRES 
  FLAGS "H"
  MESSAGE COPY,17
END  
  
STRINGA 15
BEGIN
  KEY "NUM. CIVICO di RES."
  PROMPT 103 5 ""
  FIELD 116@->CIVRF 
  FIELD 116@->CIVRES 
  FLAGS "H"
  MESSAGE APPEND,17
END  

STRINGA 17
BEGIN
  KEY "VIA RES. + NUM. RES."
  PROMPT 67 5 ""
END
  
STRINGA 16
BEGIN
  KEY "CAP"
  PROMPT 124 5 ""
  FIELD 116@->CAPRF
  FIELD 116@->CAPRES
END  

STRINGA 13
BEGIN
  KEY "CODICE FISCALE DICHIARANTE"
  PROMPT 105 8  ""
END

NUMERO 14
BEGIN
  KEY "NUM. FOGLIO"
  PROMPT 125 11  ""
END

STRINGA 21
BEGIN
  KEY "Ritenuta d'acconto"
  PROMPT 105 10 ""
END

STRINGA 22
BEGIN
  KEY "Ritenuta d'imposta"
  PROMPT 105 11 ""
END

END

SECTION BODY ODD 6

LISTA 100
BEGIN
 KEY "Tipo anagrafica"
 FIELD 216@->TIPOA
 ITEM "F| " MESSAGE ENABLE,1@|DISABLE,2@
 ITEM "G| " MESSAGE ENABLE,2@|DISABLE,1@
END

STRINGA 1
BEGIN
  KEY "COD.FIS"
  PROMPT 10 1 ""
  FIELD 216@->COFI
END

STRING 2
BEGIN   
  KEY "COGNOME"
  PROMPT 42 1 ""
  FIELD 216@->RAGSOC[1,30]
  GROUP 1
END

STRING 3
BEGIN   
  KEY "NOME"
  PROMPT 80 1 ""
  FIELD 216@->RAGSOC[31,50]
  GROUP 1
END

STRING 101
BEGIN
  KEY "RAGSOC GIURIDICHE"
  PROMPT 54 1 ""
  FIELD 216@->RAGSOC
  GROUP 2
END

STRING 4
BEGIN   
  KEY "DATA NASCITA"
  PROMPT 114 1 ""
  FIELD 218@->DATANASC  
  GROUP 1
END

STRING 5
BEGIN   
  KEY "SESSO"
  PROMPT 128 1 ""
  FIELD 218@->SESSO  
  GROUP 1
END

STRING 6
BEGIN
  KEY "COMUNE DI NASCITA"
  PROMPT 10 3 ""
  FIELD 313@->DENCOM
  GROUP 1
END

STRING 7
BEGIN
  KEY "PROV DI NASCITA"
  PROMPT 48 3 ""
  FIELD 313@->PROVCOM
  GROUP 1
END

STRING 8
BEGIN
  KEY "COMUNE DI RESIDENZA FISICHE"
  PROMPT 53 3 ""
  FIELD 413@->DENCOM
  GROUP 1
END

STRING 9
BEGIN
  KEY "PROV. RESIDENZA FISICHE"
  PROMPT 89 3 ""
  FIELD 413@->PROVCOM  
  GROUP 1
END

STRING 102
BEGIN
  KEY "COMUNE RF/RES. GIURIDICHE"
  PROMPT 10 3 ""
  FIELD 513@->DENCOM
  GROUP 2
END

STRING 103
BEGIN
  KEY "PROVINCIA RF/RES. GIURIDICHE"
  PROMPT 71 3 ""
  FIELD 513@->PROVCOM        
  GROUP 2
END

STRING 105
BEGIN
  KEY "VIA RESIDENZA FISICHE"
  FIELD 216@->INDRES[1,18]
  FLAGS "H"
  MESSAGE COPY,10  
  GROUP 1
END

STRING 106
BEGIN
  KEY "NUMERO CIVICO RES. FISICHE"
  FLAGS "H"
  FIELD 216@->CIVRES
  MESSAGE APPEND,10
  GROUP 1
END

STRING 10
BEGIN
  KEY "VIA + NUMERO CIVICO RESIDENZA FISICHE"
  PROMPT 95 3 ""
  GROUP 1
END

STRING 105
BEGIN
  KEY "VIA RF/RES. GIURIDICHE"    
  FIELD 216@->INDRF[1,18]
  FIELD 216@->INDRES[1,18]
  FLAGS "H"
  MESSAGE COPY,104
  GROUP 2
END

STRING 106
BEGIN
  KEY "NUMERO CIVICO RF/RES. GIURIDICHE"
  FLAGS "H"          
  FIELD 216@->CIVRF
  FIELD 216@->CIVRES
  MESSAGE APPEND,104
  GROUP 2
END

STRING 104
BEGIN
  KEY "VIA + NUMERO CIVICO RF/RES. GIURIDICHE"
  PROMPT 75 3 ""
  GROUP 2
END

STRING 11
BEGIN
  KEY "CAUSALE DEL QUADRO D1"
  PROMPT 13 5 ""
  FIELD 14@->S3
END

NUMERO 12
BEGIN
  KEY "TOTALE"
  PROMPT 23 5 ""
//  FIELD 63->TOTALE
  PICTURE "###.###.###^^^"  
  MESSAGE ADD,FL->12
END

NUMERO 13
BEGIN
  KEY "QUOTA PROVVIGIONI"
  PROMPT 40 5 ""
//  FIELD 63->QUOTAPRO         
  PICTURE "###.###.###^^^"   
  MESSAGE ADD,FL->13  
END

NUMERO 14
BEGIN
  KEY "SPESE ANTICIPATE"
  PROMPT 57 5 ""
//  FIELD 63->SPESEANT    
  PICTURE "###.###.###^^^" 
  MESSAGE ADD,FL->14   
END

NUMERO 15
BEGIN
  KEY "IMPONIBILE"
  PROMPT 75 5 ""
//  FIELD 63->IMPONIBILE
  PICTURE "###.###.###^^^" 
  MESSAGE ADD,FL->15   
END

STRING 16
BEGIN
  KEY "ALIQUOTA"
  PROMPT 90 5 ""
//  FIELD 63->PERC
//  PICTURE "##@,@@"
END

NUMERO 17
BEGIN
  KEY "IMPORTO"
  PROMPT 104 5 ""
//  FIELD 63->IMPORTO       
  PICTURE "###.###.###^^^"  
  MESSAGE ADD,FL->17  
END

NUMERO 18
BEGIN
  KEY "NETTO"
  PROMPT 120 5 ""
//  FIELD 63->NETTO         
  PICTURE "###.###.###^^^" 
  MESSAGE ADD,FL->18   
END

END

SECTION FOOTER LAST 6

NUMERO 12
BEGIN
  KEY "TOTALE TOTALE"
  PROMPT 23 1 ""           
  PICTURE "###.###.###^^^"   
END

NUMERO 13
BEGIN
  KEY "TOTALE QUOTA PROVVIGIONI"
  PROMPT 40 1 ""           
  PICTURE "###.###.###^^^"   
END

NUMERO 14
BEGIN
  KEY "TOTALE SPESE ANTICIPATE"
  PROMPT 57 1 ""           
  PICTURE "###.###.###^^^"   
END

NUMERO 15
BEGIN
  KEY "TOTALE IMPONIBILE"
  PROMPT 75 1 ""           
  PICTURE "###.###.###^^^"   
END

NUMERO 17
BEGIN
  KEY "TOTALE IMPORTO"
  PROMPT 104 1 ""          
  PICTURE "###.###.###^^^"   
END

NUMERO 18
BEGIN
  KEY "TOTALE NETTO"
  PROMPT 120 1 ""          
  PICTURE "###.###.###^^^"   
END

STRINGA 2
BEGIN
 KEY "FIRMA"
 PROMPT 83 6 ""
 FIELD 116@->RAGSOC        
END

END
