#include "771230a.h"

TOOLBAR "" 0 18 0 4

BUTTON F_GENERA 21 2
BEGIN
  PROMPT -13 -3 "~Generazione"
END

#include <toolbar.h>

ENDPAGE

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

GROUPBOX DLG_NULL 78 3
BEGIN
    PROMPT 1 0 ""
END

NUMBER F_CODDITTA 5
BEGIN
    PROMPT 3 1 "Ditta  "
    FLAGS "FRD"
    KEY 1
    CHECKTYPE REQUIRED             
    USE LF_NDITTE KEY 1
    INPUT CODDITTA F_CODDITTA
    OUTPUT F_RAGDITTA RAGSOC
    FIELD LF_QUAD->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

TEXT DLG_NULL
BEGIN
  PROMPT 1 7 "@bDati percipiente"
END

LIST F_TIPOA 1 12
BEGIN
  PROMPT 1 8 ""    
  ITEM "F|Fisica"
  ITEM "G|Giuridica"
  FLAGS "P"  
  CHECKTYPE REQUIRED
  KEY 1
  FIELD LF_QUAD->TIPOA
END

NUMBER F_CODANAGR 5
BEGIN
  PROMPT 1 8 ""
  FLAGS "H" 
  FIELD LF_QUAD->CODANAGR
  CHECKTYPE REQUIRED    
  KEY 1  
END

NUMBER F_CODANAGRPERC 5
BEGIN
  PROMPT 15 8 "" 
  USE LF_PERC KEY 1 SELECT (CODDITTA=#F_CODDITTA)
  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  
  FLAGS "P"  
  CHECKTYPE REQUIRED
  KEY 1  
//  ADD RUN 775 -0
  GROUP 2
END

/************
NUMBER F_CODANAGRCOM 5
BEGIN
  PROMPT 15 8 "" 
  USE LF_ANAG KEY 1
  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
//  FLAGS "HP" 
//  GROUP 1
END
*********************/

/***************+
STRING F_RAGSOC 50
BEGIN
  PROMPT 25 8 ""
  FLAGS "H"
END            

STRING F_RAGSOCCOM 50
BEGIN
  PROMPT 25 8 ""
  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
  KEY 2  
  FLAGS "P"       
  ADD RUN BA4 -1
  MESSAGE COPY, F_RAGSOC
  GROUP 1
END            

STRING F_RAGSOCPER 50
BEGIN
  PROMPT 25 8 ""
  FLAGS "DP"
  GROUP 2               
  MESSAGE COPY, F_RAGSOC  
END            
*****************************/

NUMBER F_NPROG 4
BEGIN
  PROMPT 1 10 "@bNumero  "  
  USE LF_QUAD
//  JOIN LF_ANAG TO LF_QUAD 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

  INPUT CODDITTA F_CODDITTA 
/***********************  
  INPUT TIPOA    F_TIPOA    
  INPUT CODANAGR F_CODANAGR 
  INPUT NPROG    F_NPROG       
**************/  
  DISPLAY "Tipo"     TIPOA
  DISPLAY "Codice@10"   CODANAGR
//  DISPLAY "Ragione@50" LF_ANAG->RAGSOC
  DISPLAY "N°"      NPROG
/*************************
  OUTPUT F_TIPOA    TIPOA
  OUTPUT F_CODANAGR CODANAGR
  OUTPUT F_NPROG    NPROG
******************************/  
  FIELD LF_QUAD->NPROG  
  CHECKTYPE REQUIRED
  KEY 1                      
END  

ENDPAGE

ENDMASK

