Aggiunta stampa allegato quadro G aggiuntivo

git-svn-id: svn://10.65.10.50/trunk@3827 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1996-10-25 15:02:11 +00:00
parent cc65f7c63d
commit 733c9f2359
4 changed files with 745 additions and 0 deletions

497
m770/77qga.frm Executable file
View File

@ -0,0 +1,497 @@
USE 70
JOIN 9 INTO CODDITTA=CODDITTA
JOIN 6 TO 9 ALIAS 116 INTO TIPOA=TIPOA CODANAGR=CODANAGR
JOIN 7 TO 6 ALIAS 117 INTO CODANAGR=CODANAGR
JOIN 8 TO 6 ALIAS 118 INTO CODANAGR=CODANAGR
JOIN 13 TO 6 ALIAS 113 INTO STATO=""(STATORES) COM=COMRF(COMRES)
END
DESCRIPTION
BEGIN
70->* "Quadro G 770"
9->* "Ditte"
6->* "Anagrafica persone fisiche e giuridiche"
116->* "Anagrafica persone fisiche e giuridiche"
7->* "Anagrafica persone giuridiche"
117->* "Anagrafica persone giuridiche"
8->* "Anagrafica persone fisiche"
118->* "Anagrafica persone fisiche"
13->* "Comuni"
113->* "Comuni"
END
GENERAL
BEGIN
OFFSET 0 0
FONT "Courier New"
SIZE 11
CARATTERE "X"
INIZIO_POS 1 1
FINE_POS 131
GRID "+++++++++-|"
END
SECTION BODY ODD 30
STRINGA 1
BEGIN
KEY "INTESTAZIONE 1"
PROMPT 1 1 "MOD.770/96 DICHIARAZIONE DEL SOSTITUTO D'IMPOSTA"
END
STRINGA 2
BEGIN
KEY "CODICE FISCALE"
PROMPT 1 3 "Codice fiscale "
FIELD 116@->COFI
END
STRINGA 3
BEGIN
KEY "RAGIONE SOCIALE"
PROMPT 35 3 "Denominazione "
//FIELD 116@->RAGSOC
FIELD 9->RAGSOC
END
STRINGA 4
BEGIN
KEY "COMUNE"
PROMPT 1 4 "Domicilio fiscale Comune "
FIELD 113@->DENCOM[1,30]
END
STRINGA 5
BEGIN
KEY "PROV."
PROMPT 58 4 "Prov. "
FIELD 113@->PROVCOM
END
STRINGA 6
BEGIN
KEY "VIA RF"
PROMPT 70 4 ""
FIELD 116@->INDRF
MESSAGE ENABLE,1@|SHOW,1@|DISABLE,2@|HIDE,2@
MESSAGE EMPTY ENABLE,2@|SHOW,2@|DISABLE,1@|HIDE,1@
END
STRINGA 7
BEGIN
KEY "CIVICO RF"
PROMPT 105 4 ""
FIELD 116@->CIVRF
GROUP 1
END
STRINGA 8
BEGIN
KEY "CAP RF"
PROMPT 116 4 "C.A.P. "
FIELD 116@->CAPRF
GROUP 1
END
STRINGA 9
BEGIN
KEY "VIA RES"
PROMPT 70 4 ""
FIELD 116@->INDRES
GROUP 2
END
STRINGA 10
BEGIN
KEY "CIVICO RES"
PROMPT 105 4 ""
FIELD 116@->CIVRES
GROUP 2
END
STRINGA 11
BEGIN
KEY "CAP RES"
PROMPT 116 4 "C.A.P. "
FIELD 116@->CAPRES
GROUP 2
END
STRINGA 12
BEGIN
KEY "CODICE FISCALE DICHIARANTE"
PROMPT 1 5 "Codice fiscale del soggetto dichiarante"
END
STRINGA 13
BEGIN
KEY "INTESTAZIONE 2"
PROMPT 1 8 "MOD 770/G Utili pagati con aliquote diverse da quelle indicate nel prospetto N.3 (Prospetto delle ritenute)"
END
STRINGA 14
BEGIN
KEY "INTESTAZIONE 3"
PROMPT 1 9 "-----------------------------------------------------------------------------------------------------------------------------------"
END
STRINGA 15
BEGIN
KEY "INTESTAZIONE 4"
PROMPT 1 10 " UTILI ASSOGGETTATI A RITENUTA"
END
STRINGA 16
BEGIN
KEY "INTESTAZIONE 5"
PROMPT 1 11 "DELIBERA Utili corrisposti Ritenuta Utili non assogget."
END
STRINGA 17
BEGIN
KEY "INTESTAZIONE 6"
PROMPT 1 12 " nell'anno 1995 Importo Aliq. % di acconto di imposta a ritenuta"
END
STRINGA 18
BEGIN
KEY "TITOLO RIPORTO"
PROMPT 1 13 "Riporto da prospetto N.3"
END
NUMERO 19
BEGIN
KEY "RIPORTO UTILI CORRISPOSTI"
PROMPT 26 13 ""
PICTURE "###.###.###.###"
END
NUMERO 20
BEGIN
KEY "RIPORTO UTILI ASSOGGETTATI"
PROMPT 45 13 ""
PICTURE "###.###.###.###"
END
NUMERO 21
BEGIN
KEY "RIPORTO RITENUTA DI ACCONTO"
PROMPT 72 13 ""
PICTURE "###.###.###.###"
END
NUMERO 22
BEGIN
KEY "RIPORTO RITENUTA DI IMPOSTA"
PROMPT 88 13 ""
PICTURE "###.###.###.###"
END
NUMERO 23
BEGIN
KEY "RIPORTO UTILI NON ASS."
PROMPT 110 13 ""
PICTURE "###.###.###.###"
END
// 1° PERIODO
STRINGA 24
BEGIN
KEY "TITOLO 1° PERIODO"
PROMPT 1 14 "01-01-1976/31-12-1995"
END
NUMERO 25
BEGIN
KEY "IMPORTO 1° UTILI CORRISPOSTI"
PROMPT 26 14 ""
PICTURE "###.###.###.###"
END
NUMERO 26
BEGIN
KEY "IMPORTO 1° UTILI ASSOGGETTATI"
PROMPT 45 14 ""
PICTURE "###.###.###.###"
END
NUMERO 27
BEGIN
KEY "PERCENTUALE 1°"
PROMPT 62 14 ""
PICTURE "##,###"
END
NUMERO 28
BEGIN
KEY "IMPORTO 1° RITENUTA DI ACCONTO"
PROMPT 72 14 ""
PICTURE "###.###.###.###"
END
NUMERO 29
BEGIN
KEY "IMPORTO 1° RITENUTA DI IMPOSTA"
PROMPT 88 14 ""
PICTURE "###.###.###.###"
END
NUMERO 30
BEGIN
KEY "IMPORTO 1° UTILI NON ASS."
PROMPT 110 14 ""
PICTURE "###.###.###.###"
END
// 2° PERIODO
STRINGA 31
BEGIN
KEY "TITOLO 2° PERIODO"
PROMPT 1 15 "09-04-1974/01-12-1975"
END
NUMERO 32
BEGIN
KEY "IMPORTO 2° UTILI CORRISPOSTI"
PROMPT 26 15 ""
PICTURE "###.###.###.###"
END
NUMERO 33
BEGIN
KEY "IMPORTO 2° UTILI ASSOGGETTATI"
PROMPT 45 15 ""
PICTURE "###.###.###.###"
END
NUMERO 34
BEGIN
KEY "PERCENTUALE 2°"
PROMPT 62 15 ""
PICTURE "##,###"
END
NUMERO 35
BEGIN
KEY "IMPORTO 2° RITENUTA DI ACCONTO"
PROMPT 72 15 ""
PICTURE "###.###.###.###"
END
NUMERO 36
BEGIN
KEY "IMPORTO 2° RITENUTA DI IMPOSTA"
PROMPT 88 15 ""
PICTURE "###.###.###.###"
END
NUMERO 37
BEGIN
KEY "IMPORTO 2° UTILI NON ASS."
PROMPT 110 15 ""
PICTURE "###.###.###.###"
END
// 3° PERIODO
STRINGA 38
BEGIN
KEY "TITOLO 3° PERIODO"
PROMPT 1 16 "01-01-1974/08-04-1974"
END
NUMERO 39
BEGIN
KEY "IMPORTO 3° UTILI CORRISPOSTI"
PROMPT 26 16 ""
PICTURE "###.###.###.###"
END
NUMERO 40
BEGIN
KEY "IMPORTO 3° UTILI ASSOGGETTATI"
PROMPT 45 16 ""
PICTURE "###.###.###.###"
END
NUMERO 41
BEGIN
KEY "PERCENTUALE 3°"
PROMPT 62 16 ""
PICTURE "##,###"
END
NUMERO 42
BEGIN
KEY "IMPORTO 3° RITENUTA DI ACCONTO"
PROMPT 72 16 ""
PICTURE "###.###.###.###"
END
NUMERO 43
BEGIN
KEY "IMPORTO 3° RITENUTA DI IMPOSTA"
PROMPT 88 16 ""
PICTURE "###.###.###.###"
END
NUMERO 44
BEGIN
KEY "IMPORTO 3° UTILI NON ASS."
PROMPT 110 16 ""
PICTURE "###.###.###.###"
END
// 4° PERIODO
STRINGA 45
BEGIN
KEY "TITOLO 4° PERIODO"
PROMPT 1 17 "24-02-1964/31-12-1973"
END
NUMERO 46
BEGIN
KEY "IMPORTO 4° UTILI CORRISPOSTI"
PROMPT 26 17 ""
PICTURE "###.###.###.###"
END
NUMERO 47
BEGIN
KEY "IMPORTO 4° UTILI ASSOGGETTATI"
PROMPT 45 17 ""
PICTURE "###.###.###.###"
END
NUMERO 48
BEGIN
KEY "PERCENTUALE 4°"
PROMPT 62 17 ""
PICTURE "##,###"
END
NUMERO 49
BEGIN
KEY "IMPORTO 4° RITENUTA DI ACCONTO"
PROMPT 72 17 ""
PICTURE "###.###.###.###"
END
NUMERO 50
BEGIN
KEY "IMPORTO 4° RITENUTA DI IMPOSTA"
PROMPT 88 17 ""
PICTURE "###.###.###.###"
END
NUMERO 51
BEGIN
KEY "IMPORTO 4° UTILI NON ASS."
PROMPT 110 17 ""
PICTURE "###.###.###.###"
END
// 5° PERIODO
STRINGA 52
BEGIN
KEY "TITOLO 5° PERIODO"
PROMPT 1 18 "01-01-1963/23-02-1963"
END
NUMERO 53
BEGIN
KEY "IMPORTO 5° UTILI CORRISPOSTI"
PROMPT 26 18 ""
PICTURE "###.###.###.###"
END
NUMERO 54
BEGIN
KEY "IMPORTO 5° UTILI ASSOGGETTATI"
PROMPT 45 18 ""
PICTURE "###.###.###.###"
END
NUMERO 55
BEGIN
KEY "PERCENTUALE 5°"
PROMPT 62 18 ""
PICTURE "##,###"
END
NUMERO 56
BEGIN
KEY "IMPORTO 5° RITENUTA DI ACCONTO"
PROMPT 72 18 ""
PICTURE "###.###.###.###"
END
NUMERO 57
BEGIN
KEY "IMPORTO 5° RITENUTA DI IMPOSTA"
PROMPT 88 18 ""
PICTURE "###.###.###.###"
END
NUMERO 58
BEGIN
KEY "IMPORTO 5° UTILI NON ASS."
PROMPT 110 18 ""
PICTURE "###.###.###.###"
END
STRINGA 59
BEGIN
KEY "PIEDE"
PROMPT 1 19 "-----------------------------------------------------------------------------------------------------------------------------------"
END
STRINGA 60
BEGIN
KEY "TOTALI"
PROMPT 1 20 "TOTALI"
END
NUMERO 61
BEGIN
KEY "TOTALE UTILI CORRISPOSTI"
PROMPT 26 20 ""
PICTURE "###.###.###.###"
END
NUMERO 62
BEGIN
KEY "TOTALE UTILI ASSOGGETTATI"
PROMPT 45 20 ""
PICTURE "###.###.###.###"
END
NUMERO 63
BEGIN
KEY "TOTALE RITENUTA DI ACCONTO"
PROMPT 72 20 ""
PICTURE "###.###.###.###"
END
NUMERO 64
BEGIN
KEY "TOTALE RITENUTA DI IMPOSTA"
PROMPT 88 20 ""
PICTURE "###.###.###.###"
END
NUMERO 65
BEGIN
KEY "TOTALE UTILI NON ASS."
PROMPT 110 20 ""
PICTURE "###.###.###.###"
END
STRINGA 66
BEGIN
KEY "PIEDE"
PROMPT 1 30 "ATTENZIONE: GLI IMPORTI SONO ESPOSTI IN MIGLIAIA DI LIRE MEDIANTE TRONCAMENTO DELLE ULTIME TRE CIFRE"
END
END
END

View File

@ -366,4 +366,35 @@ class TStampaAlleSoci : public TStampaQuadro
virtual ~TStampaAlleSoci() { }
};
class TQuadroGAgg : public TDicForm
{
long _codditta;
public:
virtual bool print(const long codditta, const long NumFis = 0, const long NumNoFis = 0);
TQuadroGAgg(const char* sNomeForm, const char* quadro) : TDicForm(sNomeForm, quadro) {}
virtual ~TQuadroGAgg() {}
};
class TStampaQuadroGAgg : public TStampaQuadro
{
private:
TQuadroGAgg* _form;
TRelation* _rel;
TCursor* _cur;
protected:
virtual bool conta_tipi_per() const { return FALSE; }
virtual TDicForm* get_form() const { return _form; }
virtual TCursor* get_cursor() const { return _cur; }
virtual bool user_create();
virtual bool user_destroy();
public:
TStampaQuadroGAgg(const char* quadro, char liv):TStampaQuadro(quadro, liv) {}
virtual ~TStampaQuadroGAgg() { }
};
#endif

View File

@ -3991,6 +3991,10 @@ int stampa_quadro(int argc, char* argv[])
{
app = new TStampaQuadroG1(livello);
}
else if (quadro == "J")
{
app = new TStampaQuadroGAgg("G aggiuntivo", livello);
}
else if (quadro == "Base")
{
app = new TStampaBase(livello);

213
m770/77stqga.cpp Executable file
View File

@ -0,0 +1,213 @@
// stampa quadro G aggiuntivo
#include "77stba.h"
// ATTENZIONE! cambiare se nel form 77qga.frm
// cambia il numero identificativo del primo importo
const int PRIMO_IMPORTO = 24;
const int PRIMA_ALIQUOTA = 49;
bool TQuadroGAgg::print(const long codditta, const long NumFis, const long NumNoFis)
{
TCursor* cur = cursor();
TPrinter& pr = printer();
// MA SERVE???
(*cur)=0L;
TRectype& rec = cur->curr();
TToken_string p33a(rec.get("P33A"));
TToken_string p33b(rec.get("P33B"));
TToken_string p35a(rec.get("P35A"));
TToken_string p35b(rec.get("P35B"));
TToken_string p36a(rec.get("P36A"));
TToken_string p36b(rec.get("P36B"));
bool bAggiuntivo = FALSE;
TArray importi;
TArray aliquote;
real rip_p33a, rip_p33b, rip_p35b, rip_p36a, rip_p36b;
real tot_p33a, tot_p33b, tot_p35b, tot_p36a, tot_p36b;
rip_p33a = ZERO;
rip_p33b = ZERO;
rip_p35b = ZERO;
rip_p36a = ZERO;
rip_p36b = ZERO;
tot_p33a = ZERO;
tot_p33b = ZERO;
tot_p35b = ZERO;
tot_p36a = ZERO;
tot_p36b = ZERO;
for (int i=0; i<20; i++)
{
if (i == 6 || i == 10 || i == 13 || i == 16 || i == 19)
{
TString aliquota = p35a.get(i);
bAggiuntivo = bAggiuntivo || !aliquota.blank();
real aliq = p35a.get(i);
aliquote.add(aliq);
real imp = ZERO;
if (aliquota.blank())
{
importi.add(imp);
importi.add(imp);
importi.add(imp);
importi.add(imp);
importi.add(imp);
}
else
{
imp = p33a.get(i);
importi.add(imp);
tot_p33a += imp;
imp = p33b.get(i);
importi.add(imp);
tot_p33b += imp;
imp = p35b.get(i);
importi.add(imp);
tot_p35b += imp;
imp = p36a.get(i);
importi.add(imp);
tot_p36a += imp;
imp = p36b.get(i);
importi.add(imp);
tot_p36b += imp;
}
}
else
{
rip_p33a += p33a.get(i);
rip_p33b += p33b.get(i);
rip_p35b += p35b.get(i);
rip_p36a += p36a.get(i);
rip_p36b += p36b.get(i);
}
}
_RigaCorr=0;
if (bAggiuntivo)
{
TPrint_section& body = section('B', odd_page);
// calcolo totali finali (tot+rip)
tot_p33a += rip_p33a;
tot_p33b += rip_p33b;
tot_p35b += rip_p35b;
tot_p36a += rip_p36a;
tot_p36b += rip_p36b;
TForm_item& item_tot_p33a = body.find_field(61);
tot_p33a = tot_p33a / 1000.00;
tot_p33a.trunc();
TString stot_p33a (tot_p33a.string());
item_tot_p33a.set(stot_p33a);
TForm_item& item_tot_p33b = body.find_field(62);
tot_p33b = tot_p33b / 1000.00;
tot_p33b.trunc();
TString stot_p33b (tot_p33b.string());
item_tot_p33b.set(stot_p33b);
TForm_item& item_tot_p35b = body.find_field(63);
tot_p35b = tot_p35b / 1000.00;
tot_p35b.trunc();
TString stot_p35b (tot_p35b.string());
item_tot_p35b.set(stot_p35b);
TForm_item& item_tot_p36a = body.find_field(64);
tot_p36a = tot_p36a / 1000.00;
tot_p36a.trunc();
TString stot_p36a (tot_p36a.string());
item_tot_p36a.set(stot_p36a);
TForm_item& item_tot_p36b = body.find_field(65);
tot_p36b = tot_p36b / 1000.00;
tot_p36b.trunc();
TString stot_p36b (tot_p36b.string());
item_tot_p36b.set(stot_p36b);
// riporti
TForm_item& item_rip_p33a = body.find_field(19);
rip_p33a = rip_p33a / 1000.00;
rip_p33a.trunc();
TString srip_p33a (rip_p33a.string());
item_rip_p33a.set(srip_p33a);
TForm_item& item_rip_p33b = body.find_field(20);
rip_p33b = rip_p33b / 1000.00;
rip_p33b.trunc();
TString srip_p33b (rip_p33b.string());
item_rip_p33b.set(srip_p33b);
TForm_item& item_rip_p35b = body.find_field(21);
rip_p35b = rip_p35b / 1000.00;
rip_p35b.trunc();
TString srip_p35b (rip_p35b.string());
item_rip_p35b.set(srip_p35b);
TForm_item& item_rip_p36a = body.find_field(22);
rip_p36a = rip_p36a / 1000.00;
rip_p36a.trunc();
TString srip_p36a (rip_p36a.string());
item_rip_p36a.set(srip_p36a);
TForm_item& item_rip_p36b = body.find_field(23);
rip_p36b = rip_p36b / 1000.00;
rip_p36b.trunc();
TString srip_p36b (rip_p36b.string());
item_rip_p36b.set(srip_p36b);
for (int j = 0; j < importi.items(); j++)
{
TForm_item& item_imp = body.find_field(PRIMO_IMPORTO + j);
real imp = (real&) importi[j];
imp = imp / 1000.00;
imp.trunc();
TString simp (imp.string());
item_imp.set(simp);
}
for (j = 0; j < aliquote.items(); j++)
{
TForm_item& item_aliq = body.find_field(PRIMA_ALIQUOTA + j);
real aliq = (real&) aliquote[j];
TString saliq (aliq.string());
item_aliq.set(saliq);
}
body.update();
const int body_righe = body.height();
for (int i = 0; i < body_righe; i++)
{
pr.print(body.row(i));
_RigaCorr++;
}
}
pr.formfeed();
close_print();
return TRUE;
}
bool TStampaQuadroGAgg::user_create()
{
_form = new TQuadroGAgg("77QGA", quadro());
_form->set_cursor(_form->TForm::cursor());
_cur = _form->cursor();
_rel = _form->relation();
return TRUE;
}
bool TStampaQuadroGAgg::user_destroy()
{
delete _form;
return TRUE;
}