Files correlati : cg7.exe cg7700b.rep cg7700a.rep cg7400a.msk cg7400c.png Commento : Modelli IVA 2021 Aggiunto flag esenzione per COVID
121 lines
3.7 KiB
C++
121 lines
3.7 KiB
C++
// Programma per la stampa del quadro VC
|
|
#include <tabutil.h>
|
|
#include <recarray.h>
|
|
|
|
#include <nditte.h>
|
|
#include <anagr.h>
|
|
#include <anafis.h>
|
|
#include <anagiu.h>
|
|
#include <comuni.h>
|
|
|
|
#include "cg7401.h"
|
|
|
|
#include "cg7400a.h"
|
|
|
|
class TQuadro_VIAB_recordset : public TQuadro_IVA_recordset
|
|
{
|
|
protected:
|
|
virtual void load();
|
|
|
|
public:
|
|
TQuadro_VIAB_recordset(TQuadro_IVA_mask * mask, const char* use, const int year) : TQuadro_IVA_recordset(mask, use, year) { load(); }
|
|
virtual ~TQuadro_VIAB_recordset() {}
|
|
};
|
|
|
|
void TQuadro_VIAB_recordset::load()
|
|
{
|
|
const TRectype & ditta = cache().get(LF_NDITTE, app().get_firm());
|
|
const TString4 tipoa(ditta.get(NDT_TIPOA));
|
|
const long codanagr = ditta.get_long(NDT_CODANAGR);
|
|
TToken_string key(tipoa); key.add(codanagr);
|
|
const TRectype & anagr = cache().get(LF_ANAG, key);
|
|
|
|
set_bool("VI1.1", mask().get(F_TIPODICH) == "I");
|
|
set_bool("VI1.2", mask().get(F_TIPODICH) == "C");
|
|
|
|
set("VI2", anagr.get(ANA_PAIV));
|
|
set_bool("VI2.1", ditta.get_bool(NDT_ARTIG));
|
|
// set_bool("VI2.2", ditta.get_bool(NDT_CONC)); aggiungere
|
|
set("VI2.3", ditta.get(NDT_MAIL));
|
|
set("VI2.4", ditta.get(NDT_PTEL));
|
|
set("VI2.5", ditta.get(NDT_TEL));
|
|
set("VI2.6", ditta.get(NDT_PFAX));
|
|
set("VI2.7", ditta.get(NDT_FAX));
|
|
|
|
if (tipoa == "F")
|
|
{
|
|
const TRectype & anafis = cache().get(LF_ANAGFIS, codanagr);
|
|
const TString16 datanasc = anafis.get(ANF_DATANASC);
|
|
const TRectype & comuni = cache().get(LF_COMUNI, anafis.get(ANF_COMNASC));
|
|
|
|
set("VI3.1", anagr.get(ANA_RAGSOC).left(30));
|
|
set("VI3.2", anagr.get(ANA_RAGSOC).mid(30));
|
|
set_bool("VI3.3",anafis.get(ANF_SESSO) == "M");
|
|
set_bool("VI3.4", anafis.get(ANF_SESSO) == "F");
|
|
set("VI3.5", datanasc.left(2));
|
|
set("VI3.6", datanasc.mid(3));
|
|
set("VI3.7", datanasc.right(4));
|
|
set("VI3.8", comuni.get(COM_DENCOM));
|
|
set("VI3.9", comuni.get(COM_PROVCOM));
|
|
}
|
|
else
|
|
{
|
|
const TRectype & anagiu = cache().get(LF_ANAGGIU, codanagr);
|
|
|
|
set("VI3.10", anagr.get(ANA_RAGSOC));
|
|
set("VI3.11", anagiu.get(ANG_NATGIU));
|
|
}
|
|
|
|
if (ditta.get(NDT_DICHP).full())
|
|
{
|
|
const TRectype & anaint = cache().get(LF_ANAG, ditta.get(NDT_FIRMAT));
|
|
const TRectype & anafis = cache().get(LF_ANAGFIS, ditta.get(NDT_FIRMAT));
|
|
const TString16 datanasc = anafis.get(ANF_DATANASC);
|
|
const TString16 dataint = ditta.get(NDT_DECCARINT);
|
|
const TRectype & comuni = cache().get(LF_COMUNI, anafis.get(ANF_COMNASC));
|
|
|
|
set("VI4.1", anaint.get(ANA_COFI));
|
|
// set("VI4.2", ditta.get(NDT_CARINT)); aggiungere carica intermediario
|
|
set("VI4.3", anagr.get(ANA_PAIV));
|
|
set("VI4.4", anaint.get(ANA_RAGSOC).left(30));
|
|
set("VI4.5", anaint.get(ANA_RAGSOC).mid(30));
|
|
set_bool("VI4.6", anaint.get(ANF_SESSO) == "M");
|
|
set_bool("VI4.7", anaint.get(ANF_SESSO) == "F");
|
|
set("VI4.8", datanasc.left(2));
|
|
set("VI4.9", datanasc.mid(3));
|
|
set("VI4.10", datanasc.right(4));
|
|
set("VI4.11", comuni.get(COM_DENCOM));
|
|
set("VI4.12", comuni.get(COM_PROVCOM));
|
|
set("VI8.1", anaint.get(ANA_COFI));
|
|
set("VI8.1", anaint.get(ANA_COFI));
|
|
set("VI8.5", dataint.left(2));
|
|
set("VI8.6", dataint.mid(3));
|
|
set("VI8.7", dataint.right(4));
|
|
}
|
|
|
|
set("VA2.1", ditta.get(NDT_CODATTPREV));
|
|
set("VA10.1", anagr.get(ANA_EVECC));
|
|
}
|
|
|
|
class TQuadro_VIAB_app : public TQuadro_IVA_app
|
|
{
|
|
virtual char last_quadro_report() const { return 'c'; }
|
|
|
|
public:
|
|
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year) { return new TQuadro_VIAB_recordset(mask(), use, year); }
|
|
void load_sheet(TSheet_field & sf);
|
|
|
|
TQuadro_VIAB_app() : TQuadro_IVA_app("Stampa Quadro VC", "cg7400a") {}
|
|
virtual ~TQuadro_VIAB_app() {}
|
|
};
|
|
|
|
void TQuadro_VIAB_app::load_sheet(TSheet_field & sf)
|
|
{
|
|
}
|
|
|
|
int cg7400(int argc, char* argv[])
|
|
{
|
|
TQuadro_VIAB_app a;
|
|
a.run(argc, argv, TR("Quadro VC"));
|
|
return 0;
|
|
} |