// Distinta quadro G
#include "77qgd.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE

//
// Lista modifiche
// 9.4.96	Aggiunto campo ROPESPET
//

#define	LF_QUAGD	101

PAGE "MODULO 770 - QUADRO G" -1 -1 78 18

GROUPBOX DLG_NULL 78 3
BEGIN
    PROMPT 1 0 ""
END

NUMBER F_CODDITTA 5
BEGIN
    PROMPT 3 1 "Ditta  "
    FLAGS "GRD"
    KEY 1
    CHECKTYPE REQUIRED             
    USE LF_NDITTE KEY 1
    INPUT CODDITTA F_CODDITTA
    OUTPUT F_RAGDITTA RAGSOC
    FIELD LF_QUAGD->CODDITTA
END

STRING F_RAGDITTA 50
BEGIN
    PROMPT 17 1 "Ragione "
    FLAGS "D"
END

NUMBER F_ANNODIC 4
BEGIN
    PROMPT 52 4 "Anno dichiarazione "
    FLAGS "DR"
END

GROUPBOX DLG_NULL 78 6
BEGIN
    PROMPT 1 5 ""
END

TEXT DLG_NULL
BEGIN
  PROMPT 2 6 "@bDati percipiente "
END

LIST F_TIPOA 1 12
BEGIN
  PROMPT 2 7 ""    
  ITEM "F|Fisica"
  MESSAGE COPY,F_TIPOAF
  ITEM "G|Giuridica"   
  MESSAGE COPY,F_TIPOAF  
  FIELD LF_QUAGD->TIPOA
  CHECKTYPE REQUIRED
  KEY 1
END

LIST F_TIPOAF 1 12
BEGIN
  PROMPT  7 ""    
  ITEM "F|Fisica"
  ITEM "G|Giuridica"  
  FLAGS "H"
END

NUMBER F_CODANAGR 5
BEGIN
  PROMPT 80 80 ""
  FLAGS "D" 
  FIELD LF_QUAGD->CODANAGR
  CHECKTYPE REQUIRED    
  KEY 1  
END

NUMBER F_CODANAGRPERC 5
BEGIN
  PROMPT 15 7 "" 
  USE LF_PERC KEY 1 SELECT ((CODDITTA=#F_CODDITTA)&&(TIPOA=#F_TIPOA))
  JOIN LF_ANAG TO LF_PERC KEY 1 INTO TIPOA=TIPOA CODANAGR=CODANAGR  
  INPUT CODDITTA	F_CODDITTA
  INPUT TIPOA		F_TIPOA
  INPUT CODANAGR	F_CODANAGRPERC
  DISPLAY "Tipo "	TIPOA
  DISPLAY "Codice " CODANAGR
  DISPLAY "Cognome - Nome o Ragione sociale@50" LF_ANAG->RAGSOC
  OUTPUT F_TIPOA TIPOA
  OUTPUT F_CODANAGRPERC CODANAGR
  OUTPUT F_RAGSOCPER LF_ANAG->RAGSOC
  MESSAGE COPY, F_CODANAGR|COPY,F_CODANAGRCOM
  ADD RUN 775 -0
  GROUP 2
  KEY 1
END

NUMBER F_CODANAGRCOM 5
BEGIN
  PROMPT 15 7 "" 
  USE LF_ANAG KEY 1 SELECT (TIPOA=#F_TIPOA)
  INPUT TIPOA F_TIPOA 
  INPUT CODANAGR F_CODANAGRCOM
  DISPLAY "Tipo " TIPOA
  DISPLAY "Codice " CODANAGR
  DISPLAY "Cognome - Nome o Ragione sociale@50" RAGSOC
  OUTPUT F_TIPOA TIPOA
  OUTPUT F_CODANAGRCOM CODANAGR
  OUTPUT F_RAGSOCCOM RAGSOC
  MESSAGE COPY, F_CODANAGR  
  ADD RUN BA4 -1
  KEY 1
  GROUP 1
END

STRING F_RAGSOC 50
BEGIN
  PROMPT 25 7 ""
  FLAGS "H"
END            

STRING F_RAGSOCCOM 50
BEGIN
  PROMPT 25 7 ""
  USE LF_ANAG KEY 2 
  INPUT RAGSOC F_RAGSOCCOM
  DISPLAY "Cognome - Nome o Ragione sociale@50" RAGSOC
  DISPLAY "Tipo" TIPOA
  DISPLAY "Codice" CODANAGR
  OUTPUT F_RAGSOCCOM RAGSOC
  OUTPUT F_CODANAGRCOM CODANAGR
  OUTPUT F_TIPOA TIPOA
  ADD RUN BA4 -1
  KEY 1
  MESSAGE COPY, F_RAGSOC
  GROUP 1
END            

STRING F_RAGSOCPER 50
BEGIN
  PROMPT 25 7 ""
  FLAGS "D"
  GROUP 2               
  MESSAGE COPY, F_RAGSOC  
END            

NUMBER F_NPROG 4
BEGIN
  PROMPT 2 9 "@bNumero  "  
  FIELD LF_QUAGD->NPROG  
  USE LF_QUAGD 
  JOIN LF_ANAG TO LF_QUAGD KEY 1 INTO TIPOA=TIPOA CODANAGR=CODANAGR    
  INPUT CODDITTA F_CODDITTA SELECT
  INPUT TIPOA    F_TIPOA SELECT   
  INPUT CODANAGR F_CODANAGR SELECT    
  INPUT NPROG    F_NPROG 
  DISPLAY "N°"					NPROG
  DISPLAY "Tipo"				TIPOA
  DISPLAY "Codice@10"			CODANAGR
  DISPLAY "Utili spettanti@15"	UTSPETT
  DISPLAY "Utili pagati@15" 	UTPAG
  DISPLAY "Ritenute su utili pagati"			ROPE
  DISPLAY "Ritenute su utili spettanti"			ROPESPET
  OUTPUT F_TIPOA    TIPOA
  OUTPUT F_CODANAGR CODANAGR
  OUTPUT F_NPROG    NPROG
  CHECKTYPE REQUIRED
  KEY 1                      
END  

NUMBER F_NUMQUOTE 15
BEGIN
  PROMPT 2 12 "Numero quote     "
  FIELD LF_QUAGD->NUMQUOTE      
  PICTURE ".2"  
  FLAGS "R"
END

NUMBER F_UTSPETT 15
BEGIN
  PROMPT 2 14 "Utili spettanti  "
  FIELD LF_QUAGD->UTSPETT
  PICTURE "."  
  FLAGS "R" 
END

NUMBER F_ROPESPET 15
BEGIN
  PROMPT 40 14 "Rit.ut. spettanti "
  FIELD LF_QUAGD->ROPESPET
  PICTURE "."
  FLAGS "R"                            
END

NUMBER F_UTPAG 15
BEGIN
  PROMPT 2 16 "Utili pagati     "
  FIELD LF_QUAGD->UTPAG
  PICTURE "."  
  FLAGS "R" 
END

NUMBER F_ROPE 15
BEGIN
  PROMPT 40 16 "Rit. utili pagati "
  FIELD LF_QUAGD->ROPE
  PICTURE "."
  FLAGS "R"                            
END

ENDPAGE

ENDMASK

