Patch level : 12.00 1258

Files correlati     : cg7.exe cg7l00a.png cg7400a.png cg7400b.png cg7400c.png
                      cg7500a.png cg7600a.png cg7600a.rep cg7700a.png
                      cg7700a.rep cg7700b.png cg7700b.rep cg7800a.png cg7900a.png
                      cg7900b.png cg7a00a.png cg7b00a.png cg7c00a.png
                      cg7d00a.png cg7d00b.png cg7e00a.png cg7f00a.png
                      cg7f00b.png cg7g00a.png cg7g00b.png cg7h00a.png

Commento            :
Aggiunto campo sposta data a fine mese
Quadri dichiarazione IVA
This commit is contained in:
Alessandro Bonazzi 2023-04-26 01:30:40 +02:00
parent 11f0352507
commit 61c45476c4
37 changed files with 516 additions and 411 deletions

BIN
src/cg/IVA_2023_istr.pdf Normal file

Binary file not shown.

BIN
src/cg/IVA_2023_mod.pdf Normal file

Binary file not shown.

View File

@ -14,15 +14,16 @@
class TQuadro_VIAB_recordset : public TQuadro_IVA_recordset class TQuadro_VIAB_recordset : public TQuadro_IVA_recordset
{ {
protected: protected:
virtual void load(); virtual void load(const char repid);
public: public:
TQuadro_VIAB_recordset(TQuadro_IVA_mask * mask, const char* use, const int year) : TQuadro_IVA_recordset(mask, use, year) { load(); } TQuadro_VIAB_recordset(TQuadro_IVA_mask * mask, const char* use, const int year, const char repid) : TQuadro_IVA_recordset(mask, use, year, repid) { load(repid); }
virtual ~TQuadro_VIAB_recordset() {} virtual ~TQuadro_VIAB_recordset() {}
}; };
void TQuadro_VIAB_recordset::load() void TQuadro_VIAB_recordset::load(const char repid)
{ {
const TRectype & ditta = cache().get(LF_NDITTE, app().get_firm()); const TRectype & ditta = cache().get(LF_NDITTE, app().get_firm());
const TString4 tipoa(ditta.get(NDT_TIPOA)); const TString4 tipoa(ditta.get(NDT_TIPOA));
@ -102,7 +103,7 @@ class TQuadro_VIAB_app : public TQuadro_IVA_app
virtual char last_quadro_report() const { return 'c'; } virtual char last_quadro_report() const { return 'c'; }
public: public:
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year) { return new TQuadro_VIAB_recordset(mask(), use, year); } virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) { return new TQuadro_VIAB_recordset(mask(), use, year, repid); }
void load_sheet(TSheet_field & sf); void load_sheet(TSheet_field & sf);
TQuadro_VIAB_app() : TQuadro_IVA_app("Stampa Quadro VC", "cg7400a") {} TQuadro_VIAB_app() : TQuadro_IVA_app("Stampa Quadro VC", "cg7400a") {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 KiB

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

@ -171,16 +171,19 @@ TISAM_recordset & TQuadro_IVA_recordset::get_recordset(const int code, const int
return *set; return *set;
} }
const real TQuadro_IVA_recordset::evaluate_recordset(const int code, const int year, const char * field, const char * expr) const real TQuadro_IVA_recordset::evaluate_recordset(const int code, const int year, const char * field, const char * expr, long codditta)
{ {
real val; real val;
TProgram_report & rep = _mask->get_report(code - 1); TProgram_report & rep = _mask->get_report(code - 1);
TISAM_recordset * set = (TISAM_recordset *) rep.recordset(); TISAM_recordset * set = (TISAM_recordset *) rep.recordset();
TExpression e(expr == NULL ? "\"X\"" : expr); TExpression e(expr == NULL ? "\"X\"" : expr);
if (set != NULL) if (set != nullptr)
{ {
if (codditta < 0)
codditta = prefix().get_codditta();
set->set_var("#ANNO", format("%d", year)); set->set_var("#ANNO", format("%d", year));
set->set_var("#DITTA", codditta);
if (set->items() > 0) if (set->items() > 0)
for (set->move_first(); !set->eof(); set->move_next()) for (set->move_first(); !set->eof(); set->move_next())
@ -252,9 +255,28 @@ void TQuadro_IVA_recordset::add_value(const char *s, const real value)
_types.add(key, TString("real")); _types.add(key, TString("real"));
} }
*val += value; *val += value;
#ifdef DBG
double t = val->ld();
double v = value.ld();
static const char * codici[] = { "VE23.1", "VE23.2", "VE40.1" , "VF13.1", "VF13.2", nullptr };
for (int i = 0; codici[i] != nullptr; i++)
if (strcmp(s, codici[i]) == 0)
int z = 1;
#endif
} }
} }
real TQuadro_IVA_recordset::get_real_value(const char *s)
{
const TString * t = (const TString *)_types.objptr(s);
if (t != nullptr && *t == "real")
return *((real *) _values.objptr(s));
else
return ZERO;
}
void TQuadro_IVA_recordset::set_bool(const char *s, bool on) void TQuadro_IVA_recordset::set_bool(const char *s, bool on)
{ {
TString * val = (TString *)_values.objptr(s); TString * val = (TString *)_values.objptr(s);
@ -262,7 +284,9 @@ void TQuadro_IVA_recordset::set_bool(const char *s, bool on)
if (val == nullptr) if (val == nullptr)
{ {
const TString8 key(s); const TString8 key(s);
_values.add(key, val = new TString4); _values.add(key, val = new TString4);
_types.add(key, TString("bool"));
} }
*val = on ? "X" : ""; *val = on ? "X" : "";
} }
@ -274,7 +298,9 @@ void TQuadro_IVA_recordset::set(const char *s, const char * value)
if (val == nullptr) if (val == nullptr)
{ {
const TString8 key(s); const TString8 key(s);
_values.add(key, val = new TString); _values.add(key, val = new TString);
_types.add(key, TString("string"));
} }
*val = value; *val = value;
} }
@ -314,7 +340,7 @@ void TQuadro_IVA_app::print()
TQuadro_IVA_report rep(repname); TQuadro_IVA_report rep(repname);
TRecordset * set = rep.recordset(); TRecordset * set = rep.recordset();
rep.set_recordset(app_recordset(set->query_text(), atoi(year))); rep.set_recordset(app_recordset(set->query_text(), atoi(year), c));
set = rep.recordset(); set = rep.recordset();
TReport_section * sec = rep.find_section('B', 1); TReport_section * sec = rep.find_section('B', 1);
TReport_field * fld = sec->find_field(100); TReport_field * fld = sec->find_field(100);
@ -326,6 +352,7 @@ void TQuadro_IVA_app::print()
book.add(rep); book.add(rep);
} }
} }
_mask->restart_reports(); _mask->restart_reports();
TProgram_report * rep = _mask->get_report(); TProgram_report * rep = _mask->get_report();
TFilename repname = rep->filename(); TFilename repname = rep->filename();

View File

@ -40,23 +40,25 @@ class TQuadro_IVA_recordset : public TISAM_recordset
TAssoc_array _types; TAssoc_array _types;
TQuadro_IVA_mask * _mask; TQuadro_IVA_mask * _mask;
int _year; int _year;
char _repid;
protected: protected:
const TMask & mask() { return *_mask; } const TMask & mask() { return *_mask; }
void add_value(const char *s, const real value); void add_value(const char *s, const real value);
void sub_value(const char *s, const real value) { add_value(s, -value); } void sub_value(const char *s, const real value) { add_value(s, -value); }
void set_bool(const char *s, bool on = false); void set_bool(const char *s, bool on = false);
real get_real_value(const char *s);
void set(const char *s,const char * value); void set(const char *s,const char * value);
virtual void load() pure; virtual void load(const char repid) pure;
virtual const TVariant& get(const char* column_name) const; virtual const TVariant& get(const char* column_name) const;
void clear() { _values.destroy(); _types.destroy(); } void clear() { _values.destroy(); _types.destroy(); }
TISAM_recordset & get_recordset(const int code, const int year = 0); TISAM_recordset & get_recordset(const int code, const int year = 0);
const real evaluate_recordset(const int code, const int year, const char * field, const char * expr = nullptr); const real evaluate_recordset(const int code, const int year, const char * field, const char * expr = nullptr, long codditta = -1);
const real evaluate_recordset_imponibile(const int code, const int year, const char * expr = nullptr) { return evaluate_recordset(code, year, RMI_IMPONIBILE, expr); } const real evaluate_recordset_imponibile(const int code, const int year, const char * expr = nullptr) { return evaluate_recordset(code, year, RMI_IMPONIBILE, expr); }
const real evaluate_recordset_imposta(const int code, const int year, const char * expr = nullptr) { return evaluate_recordset(code, year, RMI_IMPOSTA, expr); } const real evaluate_recordset_imposta(const int code, const int year, const char * expr = nullptr) { return evaluate_recordset(code, year, RMI_IMPOSTA, expr); }
public: public:
TQuadro_IVA_recordset(TQuadro_IVA_mask * mask, const char* use, const int year) : TISAM_recordset(use), _mask(mask), _year(year) { } TQuadro_IVA_recordset(TQuadro_IVA_mask * mask, const char* use, const int year, const char repid) : TISAM_recordset(use), _mask(mask), _year(year), _repid(repid) { }
TQuadro_IVA_recordset(const TQuadro_IVA_recordset * recset); TQuadro_IVA_recordset(const TQuadro_IVA_recordset * recset);
TQuadro_IVA_recordset(const TQuadro_IVA_recordset & recset); TQuadro_IVA_recordset(const TQuadro_IVA_recordset & recset);
int year() { return _year; } int year() { return _year; }
@ -84,7 +86,7 @@ protected:
virtual char last_quadro_report() const { return 'a';} virtual char last_quadro_report() const { return 'a';}
public: public:
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year) pure; virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) pure;
virtual void load_sheet(TSheet_field & sf) {} virtual void load_sheet(TSheet_field & sf) {}
virtual bool firm_change_enabled() const { return false; } virtual bool firm_change_enabled() const { return false; }
TQuadro_IVA_mask * mask() const { return _mask; } TQuadro_IVA_mask * mask() const { return _mask; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 190 KiB

View File

@ -27,14 +27,14 @@
class TQuadro_VE_recordset : public TQuadro_IVA_recordset class TQuadro_VE_recordset : public TQuadro_IVA_recordset
{ {
protected: protected:
virtual void load(); virtual void load(const char repid);
public: public:
TQuadro_VE_recordset(TQuadro_IVA_mask * mask, const char* use, const int year) : TQuadro_IVA_recordset(mask, use, year) { load(); } TQuadro_VE_recordset(TQuadro_IVA_mask * mask, const char* use, const int year, const char repid) : TQuadro_IVA_recordset(mask, use, year, repid) { load(repid); }
virtual ~TQuadro_VE_recordset() {} virtual ~TQuadro_VE_recordset() {}
}; };
void TQuadro_VE_recordset::load() void TQuadro_VE_recordset::load(const char repid)
{ {
clear(); clear();
@ -47,26 +47,24 @@ void TQuadro_VE_recordset::load()
imposta_agricola.add("2.00", TString8("VE01.2")); imposta_agricola.add("2.00", TString8("VE01.2"));
imponibile_agricolo.add("4.00", TString8("VE02.2")); imponibile_agricolo.add("4.00", TString8("VE02.2"));
imposta_agricola.add("4.00", TString8("VE02.2")); imposta_agricola.add("4.00", TString8("VE02.2"));
imponibile_agricolo.add("6.00", TString8("V03.1")); imponibile_agricolo.add("6.40", TString8("V03.1"));
imposta_agricola.add("6.00", TString8("VE03.2")); imposta_agricola.add("6.40", TString8("VE03.2"));
imponibile_agricolo.add("7.30", TString8("V04.1")); imponibile_agricolo.add("7.30", TString8("V04.1"));
imposta_agricola.add("7.30", TString8("VE04.2")); imposta_agricola.add("7.30", TString8("VE04.2"));
imponibile_agricolo.add("7.50", TString8("VE05.1")); imponibile_agricolo.add("7.50", TString8("VE05.1"));
imposta_agricola.add("7.50", TString8("VE05.2")); imposta_agricola.add("7.50", TString8("VE05.2"));
imponibile_agricolo.add("7.65", TString8("VE06.1")); imponibile_agricolo.add("8.30", TString8("VE06.1"));
imposta_agricola.add("7.65", TString8("VE06.2")); imposta_agricola.add("8.30", TString8("VE06.2"));
imponibile_agricolo.add("7.95", TString8("VE07.1")); imponibile_agricolo.add("8.50", TString8("VE07.1"));
imposta_agricola.add("7.65", TString8("VE07.2")); imposta_agricola.add("8.50", TString8("VE07.2"));
imponibile_agricolo.add("8.30", TString8("VE08.1")); imponibile_agricolo.add("8.80", TString8("VE08.1"));
imposta_agricola.add("8.30", TString8("VE08.2")); imposta_agricola.add("8.80", TString8("VE08.2"));
imponibile_agricolo.add("8,50", TString8("VE09.1")); imponibile_agricolo.add("9,50", TString8("VE09.1"));
imposta_agricola.add("8,50", TString8("VE09.2")); imposta_agricola.add("9,50", TString8("VE09.2"));
imponibile_agricolo.add("8.80", TString8("VE10.1")); imponibile_agricolo.add("10.00", TString8("VE10.1"));
imposta_agricola.add("8.80", TString8("VE10.2")); imposta_agricola.add("10.00", TString8("VE10.2"));
imponibile_agricolo.add("10.00", TString8("VE11.1")); imponibile_agricolo.add("12.30", TString8("VE11.1"));
imposta_agricola.add("10.00", TString8("VE11.2")); imposta_agricola.add("12.30", TString8("VE11.2"));
imponibile_agricolo.add("12.30", TString8("VE12.1"));
imposta_agricola.add("12.30", TString8("VE12.2"));
imponibile.add("4.00", TString8("VE20.1")); imponibile.add("4.00", TString8("VE20.1"));
imposta.add("4.00", TString8("VE20.2")); imposta.add("4.00", TString8("VE20.2"));
@ -75,17 +73,19 @@ void TQuadro_VE_recordset::load()
imponibile.add("10.00",TString8("VE22.1")); imponibile.add("10.00",TString8("VE22.1"));
imposta.add("10.00",TString8("VE22.2")); imposta.add("10.00",TString8("VE22.2"));
imponibile.add("4.00", TString8("VE20.1")); /* imponibile.add("4.00", TString8("VE20.1"));
imposta.add("4.00", TString8("VE20.2")); imposta.add("4.00", TString8("VE20.2"));
imponibile.add("5.00", TString8("VE21.1")); imponibile.add("5.00", TString8("VE21.1"));
imposta.add("5.00", TString8("VE21.2")); imposta.add("5.00", TString8("VE21.2"));
imponibile.add("10.00", TString8("VE22.1")); imponibile.add("10.00", TString8("VE22.1"));
imposta.add("10.00", TString8("VE22.2")); imposta.add("10.00", TString8("VE22.2")); */
// le imposte che non esisto più le mette nella più vicina // le imposte che non esisto più le mette nella più vicina
imponibile.add("20.00", TString8("VE23.1")); imponibile.add("19.00", TString8("VE23.1"));
imposta.add("20.00", TString8("VE23.2")); imposta.add("19.00", TString8("VE23.2"));
imponibile.add("20.00", TString8("VE23.1"));
imposta.add("20.00", TString8("VE23.2"));
imponibile.add("21.00", TString8("VE23.1")); imponibile.add("21.00", TString8("VE23.1"));
imposta.add("21.00", TString8("VE23.2")); imposta.add("21.00", TString8("VE23.2"));
@ -97,7 +97,6 @@ void TQuadro_VE_recordset::load()
query << year() << "\nTO CODTAB=" << year(); query << year() << "\nTO CODTAB=" << year();
TISAM_recordset pim(query); TISAM_recordset pim(query);
bool good = false;
for (pim.move_first(); !pim.eof(); pim.move_next()) for (pim.move_first(); !pim.eof(); pim.move_next())
{ {
@ -127,17 +126,21 @@ void TQuadro_VE_recordset::load()
codatt.add(codtab.mid(4, 5)); codatt.add(codtab.mid(4, 5));
const TRectype& attiv = cache().get(LF_ATTIV, codatt); const TRectype& attiv = cache().get(LF_ATTIV, codatt);
const bool attivita_commerciale = !attiv.get_bool(ATT_ATTNONCOM); const bool attivita_commerciale = !attiv.get_bool(ATT_ATTNONCOM);
TArray imponibili;
TArray imposte;
tiporec tipo; classify_pim_array(pimr, imponibili, imposte, true, true);
real imp; FOR_EACH_ARRAY_ITEM(imponibili, t, obj)
real iva;
int last_tiporec= -1;
if (classify_pim(pimr, imp, iva, tipo, true, last_tiporec, true))
{ {
good = true; tiporec tipo = (tiporec) t;
switch (tipo)
if (obj != nullptr)
{ {
real & imp = (real &)*obj;
real & iva = (real &)imposte[t];
switch (tipo)
{
case acq_norm: // acquisti normali case acq_norm: // acquisti normali
break; break;
case vend_norm: // vendite normali case vend_norm: // vendite normali
@ -148,34 +151,29 @@ void TQuadro_VE_recordset::load()
if (agricolo) if (agricolo)
{ {
add_value(*(TString *)imponibile_agricolo.objptr(aliquota), imp); add_value(STRING_TOKEN(imponibile_agricolo.objptr(aliquota)), imp);
add_value(*(TString *)imposta_agricola.objptr(aliquota), iva); add_value(STRING_TOKEN(imposta_agricola.objptr(aliquota)), iva);
} }
else else
{ {
if (aliquota == "20.00" || aliquota == "21.00") if (aliquota == "22.00")
{ int q = 1;
real imposta_corretta = imp; if (aliquota == "19.00" || aliquota == "20.00" || aliquota == "21.00")
{
real imposta_corretta = imp;
imposta_corretta *= 0.22; imposta_corretta *= 0.22;
imposta_corretta.round(0); imposta_corretta.round(0);
add_value("VE25.2", iva - imposta_corretta); add_value("VE25.2", iva - imposta_corretta);
iva = imposta_corretta; iva = imposta_corretta;
} }
if (aliquota == "22.00")
int q = 1;
add_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp); add_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp);
add_value(STRING_TOKEN(imposta.objptr(aliquota)), iva); add_value(STRING_TOKEN(imposta.objptr(aliquota)), iva);
} }
} }
else
{
const int tipocr = atoi(codtab.mid(15, 1)); // tipo costo_ricavo
if (tipocr == 4)
{
if (reverse || int_tipo_iva11_ven == acq_ind_pass_int || int_tipo_iva11_ven == cess_amm)
add_value("VE40.1", imp);
}
}
break; break;
case acq_simp: case acq_simp:
break; break;
@ -183,47 +181,46 @@ void TQuadro_VE_recordset::load()
break; break;
case bolle_doganali: // bolle doganali (acquisti) case bolle_doganali: // bolle doganali (acquisti)
break; break;
case acq_beni_riv : // acq. beni per rivendita case acq_beni_riv: // acq. beni per rivendita
break; break;
case base_ventilazione: // base calcolo per ventil. case base_ventilazione: // base calcolo per ventil.
break; break;
case corr_simp: // corrispettivi n. e s. imp. case corr_simp: // corrispettivi n. e s. imp.
break; break;
case acq_beni_ammort: // acq. beni ammortizz. detr. case acq_beni_ammort: // acq. beni ammortizz. detr.
break; break;
case acq_beni_ammort_nd: // beni ammort. non detraibili case acq_beni_ammort_nd: // beni ammort. non detraibili
break; break;
case acq_beni_leasing: // beni strum. acq in leasing case acq_beni_leasing: // beni strum. acq in leasing
break; break;
case acq_amm_ultdetr: // beni amm. ult. detr 6% case acq_amm_ultdetr: // beni amm. ult. detr 6%
break; break;
case acq_ind_op_es: // acq. indetr. su op.es. case acq_ind_op_es: // acq. indetr. su op.es.
break; break;
case acq_ind_pass_int: // passaggi interni case acq_ind_pass_int: // passaggi interni
if (vendite) // add_value("VE40.1", imp);
add_value("VE40.1", imp);
break; break;
case acq_ind_art_19: // indetr. art. 19 case acq_ind_art_19: // indetr. art. 19
break; break;
case cess_amm: // cessioni amministrative case cess_amm: // cessioni beni ammortizzabili
add_value("VE40.1", imp); // add_value("VE40.1", imp);
break; break;
case vend_rimborso: // vendite valide per rimborso case vend_rimborso: // vendite valide per rimborso
break; break;
case acq_rimborso: // acq. validi per rimborso case acq_rimborso: // acq. validi per rimborso
break; break;
case acq_bd_ind_art_19: // acq. con tipo documento BD e tipo detr 9 case acq_bd_ind_art_19: // acq. con tipo documento BD e tipo detr 9
break; break;
default: default:
break; break;
}; };
} }
else
{
imp = pimr.get_real("R0");
iva = pimr.get_real("R1");
} }
const real imp = pimr.get_real("R0");
const real iva = pimr.get_real("R1");
if (non_imponibile) if (non_imponibile)
{ {
if (int_tipo_iva11_ven == 21) if (int_tipo_iva11_ven == 21)
@ -267,40 +264,11 @@ void TQuadro_VE_recordset::load()
} }
} }
TISAM_recordset exp = get_recordset(REP_PAART17);
query = exp.query_text();
int pos = query.find("BY") - 1;
query.insert("&&(ATTIV.ATTNONCOM != \"X\")", pos);
exp.set(query);
exp.requery();
exp.set_var("#DITTA", prefix().get_codditta());
exp.set_var("#ANNO", format("%d", year()));
for (exp.move_first(); !exp.eof(); exp.move_next())
{
TString8 cod(exp.get(FIELD_NAME(LF_RMOVIVA, RMI_CODIVA)).as_string());
const TCodiceIVA & codiva = cached_codIVA(cod);
const TString & aliquota = codiva.aliquota();
const TRectype & mov = cache().get(LF_MOV, exp.get(FIELD_NAME(LF_RMOVIVA, RMI_NUMREG)).as_int());
if (aliquota.full())
{
const real imp = exp.get(FIELD_NAME(LF_RMOVIVA, RMI_IMPONIBILE)).as_real();
real iva = exp.get(FIELD_NAME(LF_RMOVIVA, RMI_IMPOSTA)).as_real();
if (codiva.is_agricola())
sub_value(STRING_TOKEN(imponibile_agricolo.objptr(aliquota)), imp);
else
sub_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp);
}
}
TISAM_recordset reg = get_recordset(REP_REGOLARIZ); TISAM_recordset reg = get_recordset(REP_REGOLARIZ);
query = reg.query_text(); query = reg.query_text();
pos = query.find("JOIN") - 1; int pos = query.find("JOIN") - 1;
query.insert("&&(ATTIV.ATTNONCOM != \"X\")", pos); query.insert("&&(ATTIV.ATTNONCOM != \"X\")", pos);
reg.set(query); reg.set(query);
reg.requery(); reg.requery();
@ -333,6 +301,8 @@ void TQuadro_VE_recordset::load()
sub_value("VE25.2", imposta_corretta - iva); sub_value("VE25.2", imposta_corretta - iva);
iva = imposta_corretta; iva = imposta_corretta;
} }
if (aliquota == "22.00" && iva != (imp * real(0.22)).round(2))
int q = 1;
sub_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp); sub_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp);
sub_value(STRING_TOKEN(imposta.objptr(aliquota)), iva); sub_value(STRING_TOKEN(imposta.objptr(aliquota)), iva);
} }
@ -343,7 +313,6 @@ void TQuadro_VE_recordset::load()
query << year() << "13\nTO CODTAB==" << year() << "13"; query << year() << "13\nTO CODTAB==" << year() << "13";
TISAM_recordset lim(query); TISAM_recordset lim(query);
good |= lim.items() > 0;
for (lim.move_first(); !lim.eof(); lim.move_next()) for (lim.move_first(); !lim.eof(); lim.move_next())
{ {
@ -390,34 +359,38 @@ void TQuadro_VE_recordset::load()
TISAM_recordset id(query); TISAM_recordset id(query);
TString8 tipo_aliquota, codiva; TString8 cod;
TImporto imp371, imp372; TImporto imp371, imp372;
for (bool ok = id.move_first(); ok; ok = id.move_next()) for (bool ok = id.move_first(); ok; ok = id.move_next())
{ {
const long numreg = id.get(RMI_NUMREG).as_int(); const long numreg = id.get_long(RMI_NUMREG);
const int tipoiva = id.get(ID_TIPOIVA).as_int(); const int tipoiva = id.get_int(ID_TIPOIVA);
const int tipodiff = id.get(ID_TIPODIFF).as_int();
const TRectype & mov = cache().get(LF_MOV, numreg);
const char sezione = id.get(ID_SEZIONE).as_string()[0];
const int tipomov = id.get(ID_TIPOMOV).as_int();
const TImporto imp(sezione, id.get(RMI_IMPONIBILE).as_real());
const int annoliq = id.get(ID_ANNOLIQ).as_int();
const TDate datapag = id.get(ID_DATAREGP).as_date();
key.cut(0); if (tipoiva == 1) // Vendite
key.add(numreg); {
key.add(id.get(ID_NUMRIG).as_string()); const int tipodiff = id.get_int(ID_TIPODIFF);
codiva = cache().get(LF_RMOVIVA, key, RMI_CODIVA); const TRectype & mov = cache().get(LF_MOV, numreg);
key = codiva; const char sezione = id.get_string(ID_SEZIONE)[0];
tipo_aliquota = cache().get("%IVA", key, "S1"); const int tipomov = id.get_int(ID_TIPOMOV);
const TImporto imp(sezione, id.get_real(RMI_IMPONIBILE));
const int annoliq = id.get_int(ID_ANNOLIQ);
const TDate datapag = id.get_date(ID_DATAREGP);
if (tipo_aliquota.blank() && datapag <= a_datareg && tipoiva == 1) // Vendite key.cut(0);
{ key.add(numreg);
imp371 += imp; key.add(id.get_string(ID_NUMRIG));
if (tipodiff == 2) cod = cache().get(LF_RMOVIVA, key, RMI_CODIVA);
imp372 += imp;
} const TCodiceIVA & codiva = cached_codIVA(cod);
if (codiva.iva_imponibile() && datapag <= a_datareg)
{
imp371 += imp;
if (tipodiff == 2)
imp372 += imp;
}
}
} }
imp371.normalize('D'); imp371.normalize('D');
add_value("VE37.1", imp371.valore()); // VE37.1 2 iva sospensione da incassare add_value("VE37.1", imp371.valore()); // VE37.1 2 iva sospensione da incassare
@ -435,31 +408,56 @@ void TQuadro_VE_recordset::load()
for (bool ok = idp.move_first(); ok; ok = idp.move_next()) for (bool ok = idp.move_first(); ok; ok = idp.move_next())
{ {
const long numreg = idp.get(RMI_NUMREG).as_int(); const long numreg = idp.get_long(RMI_NUMREG);
const int tipoiva = idp.get(ID_TIPOIVA).as_int(); const int tipoiva = idp.get_int(ID_TIPOIVA);
const TRectype & mov = cache().get(LF_MOV, numreg);
const char sezione = idp.get(ID_SEZIONE).as_string()[0]; if (tipoiva == 1) // Vendite
const int tipomov = idp.get(ID_TIPOMOV).as_int();
const TImporto imp(sezione, idp.get(RMI_IMPONIBILE).as_real());
const int annoliq = idp.get(ID_DATAREG).as_date().year();
const int annopag = idp.get(ID_DATAREGP).as_date().year();
key.cut(0);
key.add(numreg);
key.add(idp.get(ID_NUMRIG).as_string());
codiva = cache().get(LF_RMOVIVA, key, RMI_CODIVA);
key = codiva;
tipo_aliquota = cache().get("%IVA", key, "S1");
if (tipo_aliquota.blank() && tipoiva == 1) // Vendite
{ {
if (annoliq < year() && tipomov == 3) const int tipodiff = idp.get_int(ID_TIPODIFF);
const TRectype & mov = cache().get(LF_MOV, numreg);
const char sezione = idp.get_string(ID_SEZIONE)[0];
const int tipomov = idp.get_int(ID_TIPOMOV);
const TImporto imp(sezione, idp.get_real(RMI_IMPONIBILE));
const int annoliq = idp.get_date(ID_DATAREG).year();
const int annopag = idp.get_date(ID_DATAREGP).year();
key.cut(0);
key.add(numreg);
key.add(idp.get(ID_NUMRIG).as_string());
cod = cache().get(LF_RMOVIVA, key, RMI_CODIVA);
const TCodiceIVA & codiva = cached_codIVA(cod);
if (annoliq < year() && tipomov == 3 && codiva.iva_imponibile())
imp391 += imp; imp391 += imp;
} }
} }
imp391.normalize('A'); imp391.normalize('A');
add_value("VE39.1", imp391.valore()); // VE39.1 iva differita incassi di anni precedenti add_value("VE39.1", imp391.valore()); // VE39.1 iva differita incassi di anni precedenti
query.zap();
query << "USE RMOVIVA SELECT BETWEEN(" << FIELD_NAME(LF_MOV, MOV_DATAREG) << ",\""<< da_datareg.date2ansi() << "\",\"" << a_datareg.date2ansi() << "\")&&((" << RMI_TIPOCR << "== 1" << ")||(" << RMI_TIPOCR << "== 4))";
query << "\nJOIN " << LF_MOV << " INTO " << MOV_NUMREG << "=" << RMV_NUMREG;
TISAM_recordset movces(query);
real imp401;
for (bool ok = movces.move_first(); ok; ok = movces.move_next())
{
const long numreg = movces.get_long(RMI_NUMREG);
const TRectype & mov = cache().get(LF_MOV, numreg);
const bool ivaxcassa = mov.get_bool(MOV_IVAXCASSA);
if (ivaxcassa)
{
const real imp = movces.get_real(RMI_IMPONIBILE);
imp401 += imp;
}
}
add_value("VE40.1", imp401); // VE40.1 vendita cespiti
} }
@ -467,7 +465,7 @@ class TQuadro_VE_app : public TQuadro_IVA_app
{ {
public: public:
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year) { return new TQuadro_VE_recordset(mask(), use, year); } virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) { return new TQuadro_VE_recordset(mask(), use, year, repid); }
virtual void load_sheet(TSheet_field & sf); virtual void load_sheet(TSheet_field & sf);
TQuadro_VE_app() : TQuadro_IVA_app("Stampa Quadro VE", "cg7600a") {} TQuadro_VE_app() : TQuadro_IVA_app("Stampa Quadro VE", "cg7600a") {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View File

@ -26,8 +26,7 @@
<font face="Courier New" size="11" /> <font face="Courier New" size="11" />
<source>#SYSTEM.CFPI_SPACED</source> <source>#SYSTEM.CFPI_SPACED</source>
</field> </field>
<field x="4" y="5.5" deactivated="" type="Testo" hidden="" link="" txt_color="#8F8F8F" dynamic_height="" shade_offset="" width="27" codval="" height="4" id="" pattern="1" hide_zero="" text="FAC-SIMILE <field x="4" y="5.5" deactivated="" type="Testo" hidden="" link="" txt_color="#8F8F8F" dynamic_height="" shade_offset="" width="30" codval="" height="4" id="" pattern="1" hide_zero="" text="FAC-SIMILE generato da Campo">
generato da Campo">
<font face="Courier New" bold="1" size="14" /> <font face="Courier New" bold="1" size="14" />
</field> </field>
<field x="63.75" y="9.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="0 1" /> <field x="63.75" y="9.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="0 1" />
@ -97,12 +96,6 @@ generato da Campo">
<field x="65" y="23.1" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1102" pattern="1" hide_zero="" text="###.###.###"> <field x="65" y="23.1" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1102" pattern="1" hide_zero="" text="###.###.###">
<source>VE11.2</source> <source>VE11.2</source>
</field> </field>
<field x="51" y="23.95" deactivated="" type="Numero" hidden="1" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1201" pattern="1" hide_zero="" text="###.###.###">
<source>VE12.1</source>
</field>
<field x="65" y="23.95" deactivated="" type="Numero" hidden="1" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1202" pattern="1" hide_zero="" text="###.###.###">
<source>VE12.2</source>
</field>
<field x="51" y="25.15" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2001" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="25.15" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2001" pattern="1" hide_zero="" text="###.###.###">
<source>VE20.1</source> <source>VE20.1</source>
</field> </field>
@ -131,7 +124,7 @@ generato da Campo">
<source>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#2001+#2101+#2201+#2301</source> <source>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#2001+#2101+#2201+#2301</source>
</field> </field>
<field x="65" y="29.35" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2402" pattern="1" hide_zero="" text="###.###.###"> <field x="65" y="29.35" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2402" pattern="1" hide_zero="" text="###.###.###">
<source>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#1202+#2002+#2102+#2202+#2302</source> <source>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#2002+#2102+#2202+#2302</source>
</field> </field>
<field x="65" y="30.4" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2502" pattern="1" hide_zero="" text="###.###.###"> <field x="65" y="30.4" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2502" pattern="1" hide_zero="" text="###.###.###">
<source>VE25.2</source> <source>VE25.2</source>

View File

@ -22,14 +22,14 @@ class TQuadro_VF_recordset : public TQuadro_IVA_recordset
TQuadro_IVA_mask * _mask; TQuadro_IVA_mask * _mask;
protected: protected:
virtual void load(); virtual void load(char repid);
public: public:
TQuadro_VF_recordset(TQuadro_IVA_mask * mask, const char* use, const int year) : TQuadro_IVA_recordset(mask, use, year) { load(); } TQuadro_VF_recordset(TQuadro_IVA_mask * mask, const char* use, const int year, char repid = 'a') : TQuadro_IVA_recordset(mask, use, year, repid) { load(repid); }
virtual ~TQuadro_VF_recordset() {} virtual ~TQuadro_VF_recordset() {}
}; };
void TQuadro_VF_recordset::load() void TQuadro_VF_recordset::load(char repid)
{ {
clear(); clear();
@ -44,31 +44,29 @@ void TQuadro_VF_recordset::load()
imposta.add("4.00", TString8("VF02.2")); imposta.add("4.00", TString8("VF02.2"));
imponibile.add("5.00", TString8("VF03.1")); imponibile.add("5.00", TString8("VF03.1"));
imposta.add("5.00", TString8("VF03.2")); imposta.add("5.00", TString8("VF03.2"));
imponibile.add("6.00", TString8("VF04.1")); imponibile.add("6.40", TString8("VF04.1"));
imposta.add("6.00", TString8("VF04.2")); imposta.add("6.40", TString8("VF04.2"));
imponibile.add("7.30", TString8("VF05.1")); imponibile.add("7.30", TString8("VF05.1"));
imposta.add("7.30", TString8("VF05.2")); imposta.add("7.30", TString8("VF05.2"));
imponibile.add("7.50", TString8("VF06.1")); imponibile.add("7.50", TString8("VF06.1"));
imposta.add("7.50", TString8("VF06.2")); imposta.add("7.50", TString8("VF06.2"));
imponibile.add("7.65", TString8("VF07.1")); imponibile.add("8.30", TString8("VF07.1"));
imposta.add("7.65", TString8("VF07.2")); imposta.add("8.30", TString8("VF07.2"));
imponibile.add("7.95", TString8("VF08.1")); imponibile.add("8.50", TString8("VF08.1"));
imposta.add("7.95", TString8("VF08.2")); imposta.add("8.50", TString8("VF08.2"));
imponibile.add("8.30", TString8("VF09.1")); imponibile.add("8.80", TString8("VF09.1"));
imposta.add("8.30", TString8("VF09.2")); imposta.add("8.80", TString8("VF09.2"));
imponibile.add("8,50", TString8("VF10.1")); imponibile.add("9,50", TString8("VF10.1"));
imposta.add("8,50", TString8("VF10.2")); imposta.add("9,50", TString8("VF10.2"));
imponibile.add("8.80", TString8("VF11.1")); imponibile.add("10.00", TString8("VF11.1"));
imposta.add("8.80", TString8("VF11.2")); imposta.add("10.00", TString8("VF11.2"));
imponibile.add("10.00",TString8("VF12.1")); imponibile.add("12.30", TString8("VF12.1"));
imposta.add("10.00",TString8("VF12.2")); imposta.add("12.30", TString8("VF12.2"));
imponibile.add("12.30", TString8("VF13.1")); imponibile.add("22.00", TString8("VF13.1"));
imposta.add("12.30", TString8("VF13.2")); imposta.add("22.00", TString8("VF13.2"));
imponibile.add("22.00", TString8("VF14.1"));
imposta.add("22.00", TString8("VF14.2"));
// VF30.1-8 METODO UTILIZZATO PER LA DETERMINAZIONE DELLIVA AMMESSA IN DETRAZIONE // VF30.1-8 METODO UTILIZZATO PER LA DETERMINAZIONE DELLIVA AMMESSA IN DETRAZIONE
TString query; query << "USE ATTIV\nFROM CODDITTA=#F\nTO CODDITTA=#F"; TString query; query << "USE ATTIV\nFROM CODDITTA=#F\nTO CODDITTA=#F";
TISAM_recordset at(query); TISAM_recordset at(query);
bool agenziaviaggio = false; bool agenziaviaggio = false;
bool minori = false; bool minori = false;
@ -94,7 +92,7 @@ void TQuadro_VF_recordset::load()
{ {
const TString16 key = format("%4d%5s%1d13", year(), (const char *)codatt, t); const TString16 key = format("%4d%5s%1d13", year(), (const char *)codatt, t);
const TRectype & plm = cache().get("PLM", key); const TRectype & plm = cache().get("PLM", key);
if (plm.full()) if (plm.full())
{ {
prorataprev |= plm.get_real("R2") > real(50.0); prorataprev |= plm.get_real("R2") > real(50.0);
@ -105,68 +103,66 @@ void TQuadro_VF_recordset::load()
} }
if (!agricolo) if (!agricolo)
agricolo_misto = false; agricolo_misto = false;
if (repid == 'b')
set_bool("VF30.1", agenziaviaggio); {
set_bool("VF30.2"); set_bool("VF30.1", agenziaviaggio);
set_bool("VF30.3", prorataprev); set_bool("VF30.2");
set_bool("VF30.4"); set_bool("VF30.3", prorataprev);
set_bool("VF30.5"); set_bool("VF30.4");
set_bool("VF30.6", minori); set_bool("VF30.5");
set_bool("VF30.7", agricolo_misto); set_bool("VF30.6", minori);
set_bool("VF30.8", agricolo); set_bool("VF30.7", agricolo_misto);
set_bool("VF30.9"); set_bool("VF30.8", agricolo);
set_bool("VF30.10"); set_bool("VF30.9");
set_bool("VF30.10");
}
imponibile_agricolo.add("2.00", TString8("V39.1")); imponibile_agricolo.add("2.00", TString8("V39.1"));
imposta_agricola.add("2.00", TString8("VF39.2")); imposta_agricola.add("2.00", TString8("VF39.2"));
imponibile_agricolo.add("4.00", TString8("VF40.2")); imponibile_agricolo.add("4.00", TString8("VF40.2"));
imposta_agricola.add("4.00", TString8("VF40.2")); imposta_agricola.add("4.00", TString8("VF40.2"));
imponibile_agricolo.add("6.00", TString8("VF41.1")); imponibile_agricolo.add("6.40", TString8("VF41.1"));
imposta_agricola.add("6.00", TString8("VF41.2")); imposta_agricola.add("6.40", TString8("VF41.2"));
imponibile_agricolo.add("7.30", TString8("VF42.1")); imponibile_agricolo.add("7.30", TString8("VF42.1"));
imposta_agricola.add("7.30", TString8("VF42.2")); imposta_agricola.add("7.30", TString8("VF42.2"));
imponibile_agricolo.add("7.50", TString8("VF43.1")); imponibile_agricolo.add("7.50", TString8("VF43.1"));
imposta_agricola.add("7.50", TString8("VF43.2")); imposta_agricola.add("7.50", TString8("VF43.2"));
imponibile_agricolo.add("7.65", TString8("VF44.1")); imponibile_agricolo.add("8.30", TString8("VF44.1"));
imposta_agricola.add("7.65", TString8("VF44.2")); imposta_agricola.add("8.30", TString8("VF44.2"));
imponibile_agricolo.add("7.95", TString8("VF45.1")); imponibile_agricolo.add("8.50", TString8("VF45.1"));
imposta_agricola.add("7.95", TString8("VF45.2")); imposta_agricola.add("8.50", TString8("VF45.2"));
imponibile_agricolo.add("8.30", TString8("VF46.1")); imponibile_agricolo.add("8.80", TString8("VF46.1"));
imposta_agricola.add("8.30", TString8("VF46.2")); imposta_agricola.add("8.80", TString8("VF46.2"));
imponibile_agricolo.add("8,50", TString8("VF47.1")); imponibile_agricolo.add("9.50", TString8("VF47.1"));
imposta_agricola.add("8,50", TString8("VF47.2")); imposta_agricola.add("9.50", TString8("VF47.2"));
imponibile_agricolo.add("8.80", TString8("VF48.1")); imponibile_agricolo.add("10.00", TString8("VF48.1"));
imposta_agricola.add("8.80", TString8("VF48.2")); imposta_agricola.add("10.00", TString8("VF48.2"));
imponibile_agricolo.add("10.00",TString8("VF49.1")); imponibile_agricolo.add("12.30", TString8("VF49.1"));
imposta_agricola.add("10.00",TString8("VF49.2")); imposta_agricola.add("12.30", TString8("VF49.2"));
imponibile_agricolo.add("12.30", TString8("VF50.1"));
imposta_agricola.add("12.30", TString8("VF50.2"));
query = "USE PIM\nFROM CODTAB="; query = "USE PIM\nFROM CODTAB=";
query << year() << "\nTO CODTAB=" << year(); query << year() << "\nTO CODTAB=" << year();
TISAM_recordset pim(query); TISAM_recordset pim(query);
bool good = false;
for (pim.move_first(); !pim.eof(); pim.move_next()) for (pim.move_first(); !pim.eof(); pim.move_next())
{ {
const TString80 codtab = pim.get("CODTAB").as_string(); const TString80 codtab = pim.get("CODTAB").as_string();
const TString8 codreg(format("%d%-3s",year(), (const char*)codtab.mid(10,3))); const TString8 codreg(format("%d%-3s", year(), (const char*)codtab.mid(10, 3)));
const TRectype & reg = cache().get("REG", codreg); const TRectype & reg = cache().get("REG", codreg);
const tiporec tipo = (tiporec) reg.get_int("I9"); const tiporec tipo = (tiporec)reg.get_int("I9");
const bool acquisti = reg.get_int("I0") == 2; const bool acquisti = reg.get_int("I0") == 2;
const int month = atoi(codtab.mid(13,2)); const int month = atoi(codtab.mid(13, 2));
if (acquisti && tipo != liquidazione && month == 13) if (acquisti && tipo != liquidazione && month == 13)
{ {
const TRectype & pimr = pim.cursor()->curr(); const TRectype & pimr = pim.cursor()->curr();
TString8 codiva(codtab.mid(16,4)); codiva.trim(); TString8 codiva(codtab.mid(16, 4)); codiva.trim();
const TRectype & ivar = cache().get("%IVA", codiva); const TRectype & ivar = cache().get("%IVA", codiva);
const TString8 aliquota = ivar.get("R0"); const TString8 aliquota = ivar.get("R0");
const int tipocr = atoi(codtab.mid(15,1)); // tipo costo_ricavo const int tipocr = atoi(codtab.mid(15, 1)); // tipo costo_ricavo
tiporec tipo;
const TString4 tipo_aliquota = ivar.get("S1"); const TString4 tipo_aliquota = ivar.get("S1");
const TString4 tipo_iva11_acq = ivar.get("S9"); const TString4 tipo_iva11_acq = ivar.get("S9");
const int int_tipo_iva11_acq = atoi(tipo_iva11_acq); const int int_tipo_iva11_acq = atoi(tipo_iva11_acq);
@ -174,21 +170,27 @@ void TQuadro_VF_recordset::load()
const bool esente = (tipo_aliquota == "ES"); const bool esente = (tipo_aliquota == "ES");
const bool non_soggetto = (tipo_aliquota == "NS"); const bool non_soggetto = (tipo_aliquota == "NS");
const bool terremotati = int_tipo_iva11_acq == 16; const bool terremotati = int_tipo_iva11_acq == 16;
real imp; TArray imponibili;
real iva; TArray imposte;
int last_tiporec = -1;
if (classify_pim(pimr, imp, iva, tipo, true, last_tiporec, true)) classify_pim_array(pimr, imponibili, imposte, true, true);
FOR_EACH_ARRAY_ITEM(imponibili, t, obj)
{ {
good = true; tiporec tipo = (tiporec)t;
switch (tipo)
if (obj != nullptr)
{ {
real & imp = (real &)*obj;
real & iva = (real &)imposte[t];
switch (tipo)
{
case acq_norm: // acquisti normali case acq_norm: // acquisti normali
if (prorata100) if (prorata100)
{ {
if (aliquota.full()) if (aliquota.full())
add_value("VF20.1", imp); add_value("VF22.1", imp);
} }
else else
{ {
if (atoi(aliquota) != 0) if (atoi(aliquota) != 0)
@ -197,8 +199,16 @@ void TQuadro_VF_recordset::load()
if (agricolo) if (agricolo)
{ {
add_value(STRING_TOKEN(imponibile_agricolo.objptr(aliquota)), imp); // VF39.1 VF48.1 Imprese agricole impobnibil e imposte if (imponibile_agricolo.objptr(aliquota) == nullptr)
add_value(STRING_TOKEN(imposta_agricola.objptr(aliquota)), iva); // VF39.2 VF48.2 Imprese agricole impobnibil e imposte {
add_value("VF38.1", imp); // VF39.1 VF48.1 Imprese agricole impobnibil e imposte
add_value("VF38.2", iva); // VF39.2 VF48.2 Imprese agricole impobnibil e imposte
}
else
{
add_value(STRING_TOKEN(imponibile_agricolo.objptr(aliquota)), imp); // VF39.1 VF48.1 Imprese agricole impobnibil e imposte
add_value(STRING_TOKEN(imposta_agricola.objptr(aliquota)), iva); // VF39.2 VF48.2 Imprese agricole impobnibil e imposte
}
} }
else else
@ -207,7 +217,7 @@ void TQuadro_VF_recordset::load()
add_value("VF38.1", imp); // VF38.1 2 Riservato alle imprese agricole miste - Totale operazioni imponibili diverse add_value("VF38.1", imp); // VF38.1 2 Riservato alle imprese agricole miste - Totale operazioni imponibili diverse
add_value("VF38.2", iva); add_value("VF38.2", iva);
} }
add_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp); add_value(STRING_TOKEN(imponibile.objptr(aliquota)), imp);
add_value(STRING_TOKEN(imposta.objptr(aliquota)), iva); add_value(STRING_TOKEN(imposta.objptr(aliquota)), iva);
if (prorataprev) if (prorataprev)
{ {
@ -226,75 +236,78 @@ void TQuadro_VF_recordset::load()
break; break;
case bolle_doganali: // bolle doganali (acquisti) case bolle_doganali: // bolle doganali (acquisti)
break; break;
case acq_beni_riv : // acq. beni per riVFndita case acq_beni_riv: // acq. beni per riVFndita
break; break;
case base_ventilazione: // base calcolo per ventil. case base_ventilazione: // base calcolo per ventil.
break; break;
case corr_simp: // corrispettivi n. e s. imp. case corr_simp: // corrispettivi n. e s. imp.
break; break;
case acq_beni_ammort: // acq. beni ammortizz. detr. case acq_beni_ammort: // acq. beni ammortizz. detr.
break; break;
case acq_beni_ammort_nd: // beni ammort. non detraibili case acq_beni_ammort_nd: // beni ammort. non detraibili
break; break;
case acq_beni_leasing: // beni strum. acq in leasing case acq_beni_leasing: // beni strum. acq in leasing
break; break;
case acq_amm_ultdetr: // beni amm. ult. detr 6% case acq_amm_ultdetr: // beni amm. ult. detr 6%
break; break;
case acq_ind_op_es: // acq. indetr. su op.es. case acq_ind_op_es: // acq. indetr. su op.es.
break; break;
case acq_ind_pass_int: // passaggi interni case acq_ind_pass_int: // passaggi interni
break; break;
case acq_ind_art_19: // indetr. art. 19 case acq_ind_art_19: // indetr. art. 19
add_value("VF19.1", imp); add_value("VF21.1", imp);
break; break;
case cess_amm: // cessioni amministrative case cess_amm: // cessioni amministrative
case vend_rimborso: // vendite valide per rimborso case vend_rimborso: // vendite valide per rimborso
break; break;
case acq_rimborso: // acq. validi per rimborso case acq_rimborso: // acq. validi per rimborso
break; break;
case acq_bd_ind_art_19: // acq. con tipo documento BD e tipo detr 9 case acq_bd_ind_art_19: // acq. con tipo documento BD e tipo detr 9
add_value("VF20.1", imp); // *** verificare !!!!! add_value("VF22.1", imp); // *** verificare !!!!!
break; break;
default: default:
break; break;
}; };
}
} }
else
{ const real imp = pimr.get_real("R0") - pimr.get_real("R9");
imp = pimr.get_real("R0") - pimr.get_real("R9"); const real iva = pimr.get_real("R1") - pimr.get_real("R10");
iva = pimr.get_real("R1") - pimr.get_real("R10");
} // if (non_imponibile)
if (non_imponibile)
{ {
if (int_tipo_iva11_acq == 12) if (int_tipo_iva11_acq == 12)
{ {
add_value("VF14.1", imp); add_value("VF17.1", imp);
add_value("VF35.2", iva); // VF35.1 IVA non assolta sugli acquisti e importazioni indicati al rigo VF14 add_value("VF35.2", iva); // VF35.1 IVA non assolta sugli acquisti e importazioni indicati al rigo VF14
} }
else else
if (int_tipo_iva11_acq == 13) if (int_tipo_iva11_acq == 13)
add_value("VF15.1", imp); {
add_value("VF17.1", imp);
add_value("VF35.2", iva); // VF35.1 IVA non assolta sugli acquisti e importazioni indicati al rigo VF14
}
} }
if (esente) // if (esente)
{ {
if (tipo_iva11_acq == "14A") if (tipo_iva11_acq == "14A")
add_value("VF16.2", imp); add_value("VF18.1", imp);
else else
if (int_tipo_iva11_acq == 14) if (int_tipo_iva11_acq == 14)
add_value("VF16.1", imp); add_value("VF18.2", imp);
} }
if (non_soggetto) // if (non_soggetto)
{ {
if (int_tipo_iva11_acq == 15) if (int_tipo_iva11_acq == 15)
{ {
if (tipo_iva11_acq == "15B") if (tipo_iva11_acq == "15B")
add_value("VF17.2", imp); add_value("VF19.2", imp);
add_value("VF17.1", imp); add_value("VF19.1", imp);
} }
} }
if (terremotati) if (terremotati)
add_value("VF18.1", imp); add_value("VF20.1", imp);
} }
} }
@ -358,9 +371,10 @@ void TQuadro_VF_recordset::load()
} }
} }
imp211.normalize('A'); imp211.normalize('A');
add_value("VF21.1", imp211.valore()); // VE37.1 2 iva sospensione da pagare add_value("VF23.1", imp211.valore());
add_value("VF37.1", imp211.valore()); // VF37.1 2 iva sospensione da pagare
imp212.normalize('A'); imp212.normalize('A');
add_value("VF21.2", imp212.valore()); // VE37.2 iva per cassa da pagare add_value("VF23.2", imp212.valore());
query.zap(); query.zap();
@ -396,7 +410,7 @@ void TQuadro_VF_recordset::load()
} }
} }
imp221.normalize('D'); imp221.normalize('D');
add_value("VF22.1", imp221.valore()); // VE22.1 iva differita pagamenti di anni precedenti add_value("VF24.1", imp221.valore()); // VE22.1 iva differita pagamenti di anni precedenti
// V24.2 Variazioni e arrotondamenti dimposta (indicare con il segno +/) // V24.2 Variazioni e arrotondamenti dimposta (indicare con il segno +/)
// V50.2 Variazioni e arrotondamenti dimposta (indicare con il segno +/) // V50.2 Variazioni e arrotondamenti dimposta (indicare con il segno +/)
@ -406,7 +420,6 @@ void TQuadro_VF_recordset::load()
query << year() << "13\nTO CODTAB==" << year() << "13"; query << year() << "13\nTO CODTAB==" << year() << "13";
TISAM_recordset lim(query); TISAM_recordset lim(query);
good |= lim.items() > 0;
for (lim.move_first(); !lim.eof(); lim.move_next()) for (lim.move_first(); !lim.eof(); lim.move_next())
{ {
@ -414,49 +427,58 @@ void TQuadro_VF_recordset::load()
if (var_cred < ZERO) // ??? if (var_cred < ZERO) // ???
{ {
add_value("VF24.2", -var_cred); add_value("VF26.2", -var_cred);
add_value("VF51.2", -var_cred); add_value("VF51.2", -var_cred);
} }
add_value("VF70.2", var_cred); add_value("VF70.2", var_cred);
} }
val = evaluate_recordset_imponibile(REP_INTRA, year()); if (repid == 'a')
add_value("VF26.1", val); {
val = evaluate_recordset_imposta(REP_INTRA, year()); val = evaluate_recordset_imponibile(REP_INTRA, year());
add_value("VF26.2", val); add_value("VF28.1", val);
val = evaluate_recordset_imponibile(REP_IMPORTAZIONI, year()); val = evaluate_recordset_imposta(REP_INTRA, year());
add_value("VF26.3", val); add_value("VF28.2", val);
val = evaluate_recordset_imposta(REP_IMPORTAZIONI, year()); val = evaluate_recordset_imponibile(REP_IMPORTAZIONI, year());
add_value("VF26.4", val); add_value("VF28.3", val);
val = evaluate_recordset_imponibile(REP_SANMARINO, year()); val = evaluate_recordset_imposta(REP_IMPORTAZIONI, year());
add_value("VF26.5", val); add_value("VF28.4", val);
val = evaluate_recordset_imposta(REP_SANMARINO, year()); val = evaluate_recordset_imponibile(REP_SANMARINO, year());
add_value("VF24.6", val); add_value("VF28.5", val);
val = evaluate_recordset_imposta(REP_SANMARINO, year());
add_value("VF26.6", val);
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==2"); val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==2");
add_value("VF27.1", val); add_value("VF29.1", val);
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==8"); val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==8");
add_value("VF27.2", val); add_value("VF29.2", val);
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "(RMOVIVA.TIPOCR==1)||(RMOVIVA.TIPOCR==51)"); val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "(RMOVIVA.TIPOCR==1)||(RMOVIVA.TIPOCR==51)");
add_value("VF27.3", val); add_value("VF29.3", val);
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "(RMOVIVA.TIPOCR==0)||(RMOVIVA.TIPOCR==3)||(RMOVIVA.TIPOCR==5)||(RMOVIVA.TIPOCR==9)||(RMOVIVA.TIPOCR==17)"); // val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "(RMOVIVA.TIPOCR==0)||(RMOVIVA.TIPOCR==3)||(RMOVIVA.TIPOCR==5)||(RMOVIVA.TIPOCR==9)||(RMOVIVA.TIPOCR==17)");
add_value("VF27.4", val); // add_value("VF29.4", val);
}
else
{
// VF32.1 Se per lanno 2016 sono state effettuate esclusivamente operazioni esenti barrare la casella
set_bool("VF32.1", prorata100);
// VF33.1 Se per lanno 2016 ha avuto effetto lopzione di cui allart. 36-bis barrare la casella
set_bool("VF33.1");
// VF34.1-9 Dati per il calcolo della percentuale di detrazione
// VF32.1 Se per lanno 2016 sono state effettuate esclusivamente operazioni esenti barrare la casella // VF36.1 IVA detraibile per gli acquisti relativi alloro effettuati dai soggetti diversi dai produttori e trasformatori ai sensi dellart. 19, comma 5 bis
set_bool("VF32.1", prorata100); // VF54.2 Importo detraibile per le cessioni, anche intracomunitarie, dei prodotti agricoli di cui allart.34, primo comma, effettuate ai sensi degli articoli 8, primo comma, 38 quater e 72 ???
// VF33.1 Se per lanno 2016 ha avuto effetto lopzione di cui allart. 36-bis barrare la casella // VF60.1 Se le operazioni esenti effettuate sono occasionali ovvero riguardano esclusivamente operazioni di cui ai nn. da 1 a 9 dellart.10, non rientranti nellattività propria dellimpresa o accessorie ad operazioni imponibili barrare la casella
set_bool("VF33.1"); set_bool("VF60.1", prorata && !prorataprev);
// VF34.1-9 Dati per il calcolo della percentuale di detrazione // VF60.2 Se le operazioni imponibili effettuate sono occasionali barrare la casella
set_bool("VF60.2", prorataprev);
// VF61.1 Se sono state effettuate cessioni occasionali di beni usati con lapplicazione del regime del margine (d.l. n. 41/1995) barrare la casella
set_bool("VF61.1");
// VF62.1 2 Operazioni occasionali rientranti nel regime previsto dallart. 34-bis per le attività agricole connesse
for (int i = 1; i < 14; i++)
add_value("VF71.0", get_real_value(format("VF%02d.2", i)));
add_value("VF71.0", get_real_value("VF26.2"));
}
// VF36.1 IVA detraibile per gli acquisti relativi alloro effettuati dai soggetti diversi dai produttori e trasformatori ai sensi dellart. 19, comma 5 bis
// VF54.2 Importo detraibile per le cessioni, anche intracomunitarie, dei prodotti agricoli di cui allart.34, primo comma, effettuate ai sensi degli articoli 8, primo comma, 38 quater e 72 ???
// VF60.1 Se le operazioni esenti effettuate sono occasionali ovvero riguardano esclusivamente operazioni di cui ai nn. da 1 a 9 dellart.10, non rientranti nellattività propria dellimpresa o accessorie ad operazioni imponibili barrare la casella
set_bool("VF60.1", prorata && !prorataprev);
// VF60.2 Se le operazioni imponibili effettuate sono occasionali barrare la casella
set_bool("VF60.2", prorataprev);
// VF61.1 Se sono state effettuate cessioni occasionali di beni usati con lapplicazione del regime del margine (d.l. n. 41/1995) barrare la casella
set_bool("VF61.1");
// VF62.1 2 Operazioni occasionali rientranti nel regime previsto dallart. 34-bis per le attività agricole connesse
} }
class TQuadro_VF_app : public TQuadro_IVA_app class TQuadro_VF_app : public TQuadro_IVA_app
@ -466,7 +488,7 @@ protected:
virtual char last_quadro_report() const { return 'b';} virtual char last_quadro_report() const { return 'b';}
public: public:
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year) { return new TQuadro_VF_recordset(mask(), use, year); } virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) { return new TQuadro_VF_recordset(mask(), use, year, repid); }
virtual void load_sheet(TSheet_field & sf); virtual void load_sheet(TSheet_field & sf);
TQuadro_VF_app() : TQuadro_IVA_app("Stampa Quadro VF", "cg7700a") {} TQuadro_VF_app() : TQuadro_IVA_app("Stampa Quadro VF", "cg7700a") {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 KiB

After

Width:  |  Height:  |  Size: 190 KiB

View File

@ -88,7 +88,7 @@
<source>VF11.1</source> <source>VF11.1</source>
</field> </field>
<field x="65.5" y="22.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1102" pattern="1" hide_zero="" text="###.###.###"> <field x="65.5" y="22.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1102" pattern="1" hide_zero="" text="###.###.###">
<source>V11.2</source> <source>VF11.2</source>
</field> </field>
<field x="51" y="23.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1201" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="23.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1201" pattern="1" hide_zero="" text="###.###.###">
<source>VF12.1</source> <source>VF12.1</source>
@ -102,86 +102,80 @@
<field x="65.5" y="24.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1302" pattern="1" hide_zero="" text="###.###.###"> <field x="65.5" y="24.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1302" pattern="1" hide_zero="" text="###.###.###">
<source>VF13.2</source> <source>VF13.2</source>
</field> </field>
<field x="51" y="25.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1401" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="25.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1701" pattern="1" hide_zero="" text="###.###.###">
<source>VF14.1</source>
</field>
<field x="65.5" y="25.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1402" pattern="1" hide_zero="" text="###.###.###">
<source>VF14.2</source>
</field>
<field x="51" y="26.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1501" pattern="1" hide_zero="" text="###.###.###">
<source>VF15.1</source>
</field>
<field x="51" y="27.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1601" pattern="1" hide_zero="" text="###.###.###">
<source>VF16.1</source>
</field>
<field x="51" y="28.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1602" pattern="1" hide_zero="" text="###.###.###">
<source>VF16.2</source>
</field>
<field x="51" y="29.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1701" pattern="1" hide_zero="" text="###.###.###">
<source>VF17.1</source> <source>VF17.1</source>
</field> </field>
<field x="33" y="31.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1702" pattern="1" hide_zero="" text="###.###.###"> <field x="33" y="30.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1702" pattern="1" hide_zero="" text="###.###.###">
<source>VF17.2</source> <source>VF19.2</source>
</field> </field>
<field x="51" y="32.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1801" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="26.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1801" pattern="1" hide_zero="" text="###.###.###">
<source>VF18.1</source> <source>VF18.1</source>
</field> </field>
<field x="51" y="33.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1901" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="27.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1802" pattern="1" hide_zero="" text="###.###.###">
<source>VF18.2</source>
</field>
<field x="51" y="29" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="1901" pattern="1" hide_zero="" text="###.###.###">
<source>VF19.1</source> <source>VF19.1</source>
</field> </field>
<field x="51" y="35" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2001" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="32" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2001" pattern="1" hide_zero="" text="###.###.###">
<source>VF20.1</source> <source>VF20.1</source>
</field> </field>
<field x="51" y="36" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2101" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="33" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2101" pattern="1" hide_zero="" text="###.###.###">
<source>VF21.1</source> <source>VF21.1</source>
</field> </field>
<field x="33" y="37.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2102" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="34" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2201" pattern="1" hide_zero="" text="###.###.###">
<source>VF21.2</source>
</field>
<field x="51" y="39" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2201" pattern="1" hide_zero="" text="###.###.###">
<source>VF22.1</source> <source>VF22.1</source>
</field> </field>
<field x="51" y="40" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2301" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="35" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2301" pattern="1" hide_zero="" text="###.###.###">
<source>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#1201+#1301+#1401+#1501+#1601+#1602+#1701+#1801+#1901+#2001+#2101-#2201</source> <source>VF23.1</source>
</field> </field>
<field x="65" y="40" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2302" pattern="1" hide_zero="" text="###.###.###"> <field x="34.5" y="37" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2302" pattern="1" hide_zero="" text="###.###.###">
<source>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#1202+#1302+#1402</source> <source>VF23.2</source>
</field> </field>
<field x="65" y="41" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2402" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="38" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2401" pattern="1" hide_zero="" text="###.###.###">
<source>VF24.2</source> <source>VF24.1</source>
</field> </field>
<field x="65" y="42" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2502" pattern="1" hide_zero="" text="###.###.###"> <field x="51" y="39" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2501" pattern="1" hide_zero="" text="###.###.###">
<source>#2302+#2402</source> <source>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#1201+#1301+#1701+#1801+#1901+#2001+#2101+#2201+#2301-#2401</source>
</field> </field>
<field x="41.5" y="44" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2601" pattern="1" hide_zero="" text="###.###.###"> <field x="65" y="39" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2502" pattern="1" hide_zero="" text="###.###.###">
<source>VF26.1</source> <source>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#1202+#1302</source>
</field> </field>
<field x="65.5" y="44" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2602" pattern="1" hide_zero="" text="###.###.###"> <field x="65" y="40" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2602" pattern="1" hide_zero="" text="###.###.###">
<source>VF26.2</source> <source>VF26.2</source>
</field> </field>
<field x="41.5" y="46" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2603" pattern="1" hide_zero="" text="###.###.###"> <field x="65" y="41" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2702" pattern="1" hide_zero="" text="###.###.###">
<source>VF26.3</source> <source>#2502+#2602</source>
</field> </field>
<field x="65.5" y="46" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2604" pattern="1" hide_zero="" text="###.###.###"> <field x="41.5" y="43" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2801" pattern="1" hide_zero="" text="###.###.###">
<source>VF26.4</source> <source>VF28.1</source>
</field> </field>
<field x="41.5" y="48.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2605" pattern="1" hide_zero="" text="###.###.###"> <field x="65.5" y="43" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2802" pattern="1" hide_zero="" text="###.###.###">
<source>VF26.5</source> <source>VF28.2</source>
</field> </field>
<field x="65.5" y="48" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2606" pattern="1" hide_zero="" text="###.###.###"> <field x="41.5" y="45" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2803" pattern="1" hide_zero="" text="###.###.###">
<source>VF26.6</source> <source>VF28.3</source>
</field> </field>
<field x="20" y="51.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2701" pattern="1" hide_zero="" text="###.###.###"> <field x="65.5" y="45" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2804" pattern="1" hide_zero="" text="###.###.###">
<source>VF27.1</source> <source>VF28.4</source>
</field> </field>
<field x="35.5" y="51.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2702" pattern="1" hide_zero="" text="###.###.###"> <field x="41.5" y="47.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2805" pattern="1" hide_zero="" text="###.###.###">
<source>VF27.2</source> <source>VF28.5</source>
</field> </field>
<field x="50.5" y="51.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2703" pattern="1" hide_zero="" text="###.###.###"> <field x="65.5" y="47" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2806" pattern="1" hide_zero="" text="###.###.###">
<source>VF27.3</source> <source>VF28.6</source>
</field> </field>
<field x="65.5" y="51.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2704" pattern="1" hide_zero="" text="###.###.###"> <field x="20" y="50.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2901" pattern="1" hide_zero="" text="###.###.###">
<source>VF27.4</source> <source>VF29.1</source>
</field>
<field x="35.5" y="50.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2902" pattern="1" hide_zero="" text="###.###.###">
<source>VF29.2</source>
</field>
<field x="50.5" y="50.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2903" pattern="1" hide_zero="" text="###.###.###">
<source>VF29.3</source>
</field>
<field x="65.5" y="50.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2904" pattern="1" hide_zero="" text="###.###.###">
<source>#2501-#2901-#2902-#2903</source>
</field> </field>
</section> </section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" /> <section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -5,7 +5,7 @@
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1" /> <section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" /> <section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="" hidden="" page_break="" can_break="" pattern="1"> <section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="" hidden="" page_break="" can_break="" pattern="1">
<field deactivated="" type="Immagine" hidden="" link="" dynamic_height="" shade_offset="" width="83" codval="" height="72" id="" pattern="1" hide_zero="" text=""> <field deactivated="" type="Immagine" hidden="" image_resize_type="" link="" dynamic_height="" shade_offset="" width="83" codval="" height="72" id="" pattern="1" hide_zero="" text="">
<source>"cg7700b.png"</source> <source>"cg7700b.png"</source>
</field> </field>
</section> </section>
@ -89,6 +89,9 @@
<field x="65.5" y="20.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="3408" pattern="1" hide_zero="" text="###.###.###"> <field x="65.5" y="20.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="3408" pattern="1" hide_zero="" text="###.###.###">
<source>V34.8</source> <source>V34.8</source>
</field> </field>
<field x="20" y="23.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="3409" pattern="1" hide_zero="" text="###.###.###">
<source>V34.9</source>
</field>
<field x="66" y="24.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="3502" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="24.75" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="3502" pattern="1" hide_zero="" text="###.###.###">
<source>VF35.2</source> <source>VF35.2</source>
</field> </field>
@ -170,50 +173,67 @@
<field x="66" y="41" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="4902" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="41" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="4902" pattern="1" hide_zero="" text="###.###.###">
<source>VF49.2</source> <source>VF49.2</source>
</field> </field>
<field x="51.5" y="42" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5001" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="42" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5102" pattern="1" hide_zero="" text="###.###.###">
<source>VF50.1</source>
</field>
<field x="66" y="42" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5002" pattern="1" hide_zero="" text="###.###.###">
<source>VF50.2</source>
</field>
<field x="66" y="43" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5102" pattern="1" hide_zero="" text="###.###.###">
<source>VF51.2</source> <source>VF51.2</source>
</field> </field>
<field x="52" y="44" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5201" pattern="1" hide_zero="" text="###.###.###"> <field x="52" y="43.1" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5201" pattern="1" hide_zero="" text="###.###.###">
<source>#3901+#4001+#4101+#4201+#4301+#4401+#4501+#4601+#4701+#4801+#4901+#5001</source> <source>#3901+#4001+#4101+#4201+#4301+#4401+#4501+#4601+#4701+#4801+#4901+#5001</source>
</field> </field>
<field x="66" y="44" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5202" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="43.1" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5202" pattern="1" hide_zero="" text="###.###.###">
<source>#3902+#4002+#4102+#4202+#4302+#4402+#4502+#4602+#4702+#4802+#4902+#5002</source> <source>#3902+#4002+#4102+#4202+#4302+#4402+#4502+#4602+#4702+#4802+#4902</source>
</field> </field>
<field x="66" y="45" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5302" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="44.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5302" pattern="1" hide_zero="" text="###.###.###">
<source>#3802</source> <source>#3802</source>
</field> </field>
<field x="66" y="47.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5402" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="46.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5402" pattern="1" hide_zero="" text="###.###.###">
<source>VF54.2</source> <source>VF54.2</source>
</field> </field>
<field x="66" y="48.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5502" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="47.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="5502" pattern="1" hide_zero="" text="###.###.###">
<source>#5202+#5302+#5402</source> <source>#5202+#5302+#5402</source>
</field> </field>
<field x="66" y="51" deactivated="" type="Booleano" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="2" codval="" id="6001" pattern="1" hide_zero="" text="###.###.###"> <field x="65.8" y="50.1" deactivated="" type="Booleano" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="2" codval="" id="6001" pattern="1" hide_zero="" text="###.###.###">
<source>VF60.1</source> <source>VF60.1</source>
</field> </field>
<field x="66" y="53" deactivated="" type="Booleano" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="2" codval="" id="6002" pattern="1" hide_zero="" text="###.###.###"> <field x="65.8" y="52.1" deactivated="" type="Booleano" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="2" codval="" id="6002" pattern="1" hide_zero="" text="###.###.###">
<source>VF60.2</source> <source>VF60.2</source>
</field> </field>
<field x="66" y="55" deactivated="" type="Booleano" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="2" codval="" id="6101" pattern="1" hide_zero="" text="###.###.###"> <field x="65.8" y="54.1" deactivated="" type="Booleano" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="2" codval="" id="6101" pattern="1" hide_zero="" text="###.###.###">
<source>VF61.1</source> <source>VF61.1</source>
</field> </field>
<field x="52" y="58.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="6201" pattern="1" hide_zero="" text="###.###.###"> <field x="52.5" y="57.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="6201" pattern="1" hide_zero="" text="###.###.###">
<source>VF62.1</source> <source>VF62.1</source>
</field> </field>
<field x="65.5" y="58.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="6202" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="57.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="6202" pattern="1" hide_zero="" text="###.###.###">
<source>VF62.2</source> <source>VF62.2</source>
</field> </field>
<field x="65.5" y="60.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="7002" pattern="1" hide_zero="" text="###.###.###"> <field x="66" y="59.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="7002" pattern="1" hide_zero="" text="###.###.###">
<source>VF70.2</source> <source>VF70.2</source>
</field> </field>
<field x="65.5" y="61.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="7102" pattern="1" hide_zero="" text="###.###.###"> <field x="53" y="60.5" deactivated="" type="Numero" hidden="1" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="7100" pattern="1" hide_zero="" text="###.###.###">
<source>NUM(#6001!="X"&#26;&#26;#6002!="X")*(#2502+#6202&#2F;2+#7002)</source> <source>VF71.0</source>
</field>
<field x="66" y="60.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="7102" pattern="1" hide_zero="" text="###.###.###">
<prescript description="B1.7102 PRESCRIPT">MON #7100 @
#5502 @
+
#7002 @
+
#6001 @
1
&#3C;&#3E;
IF
#6202 @
+
ELSE
#6002 @
1
&#3C;&#3E;
IF
#6202 @
+
THEN
THEN
#THIS !</prescript>
</field> </field>
</section> </section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" /> <section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" />

View File

@ -17,14 +17,14 @@ class TQuadro_VJ_recordset : public TQuadro_IVA_recordset
TQuadro_IVA_mask * _mask; TQuadro_IVA_mask * _mask;
protected: protected:
virtual void load(); virtual void load(const char repid);
public: public:
TQuadro_VJ_recordset(TQuadro_IVA_mask * mask, const char* use, const int year) : TQuadro_IVA_recordset(mask, use, year) { load(); } TQuadro_VJ_recordset(TQuadro_IVA_mask * mask, const char* use, const int year, const char repid) : TQuadro_IVA_recordset(mask, use, year, repid) { load(repid); }
virtual ~TQuadro_VJ_recordset() {} virtual ~TQuadro_VJ_recordset() {}
}; };
void TQuadro_VJ_recordset::load() void TQuadro_VJ_recordset::load(const char repid)
{ {
clear(); clear();
@ -148,7 +148,7 @@ protected:
virtual void load_sheet(TSheet_field & sf); virtual void load_sheet(TSheet_field & sf);
public: public:
virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year) { return new TQuadro_VJ_recordset(mask(), use, year); } virtual TQuadro_IVA_recordset * app_recordset(const char* use, const int year, const char repid) { return new TQuadro_VJ_recordset(mask(), use, year,repid); }
TQuadro_VJ_app() : TQuadro_IVA_app("Stampa Quadro VJ", "cg7800a") {} TQuadro_VJ_app() : TQuadro_IVA_app("Stampa Quadro VJ", "cg7800a") {}
virtual ~TQuadro_VJ_app() {} virtual ~TQuadro_VJ_app() {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 KiB

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 KiB

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 KiB

After

Width:  |  Height:  |  Size: 136 KiB

BIN
src/cg/cg7l00a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -925,7 +925,11 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
{ {
TToken_string& tt = rata(row); TToken_string& tt = rata(row);
TToken_string& ss = (TToken_string&)srate[row]; TToken_string& ss = (TToken_string&)srate[row];
lastdate = scad;
lastdate = scad;
TDate ddd(scad);
int lastscad = oldscad; int lastscad = oldscad;
// controlla errore sulla data scadenza // controlla errore sulla data scadenza
if (i > 0) if (i > 0)
@ -939,16 +943,19 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
return P_INIZIO; // _inizio return P_INIZIO; // _inizio
lastscad = scad_rata(0); lastscad = scad_rata(0);
} }
tt.add(scad,3); tt.add(lastscad, 0); if (a_fine_mese())
ss.add(scad,3); ss.add(lastscad, 0); ddd.set_end_month();
tt.add(ddd.string(),3); tt.add(lastscad, 0);
ss.add(ddd.string(),3); ss.add(lastscad, 0);
// ricalcola rate successive: se si vuole modificarne solo una // ricalcola rate successive: se si vuole modificarne solo una
// ci si fotte e si disabilita il ricalcolo // ci si fotte e si disabilita il ricalcolo
TDate ddd (lastdate);
for (int j = row+1; j < srate.items(); j++) for (int j = row+1; j < srate.items(); j++)
{ {
TToken_string& ttt = rata(j); TToken_string& ttt = rata(j);
TToken_string& sss = (TToken_string&)srate[j]; TToken_string& sss = (TToken_string&)srate[j];
next_scad(ddd,scad_rata(j), mcomm,j); next_scad(ddd,scad_rata(j), mcomm,j);
if (a_fine_mese())
ddd.set_end_month();
ttt.add(ddd.string(),3); ttt.add(ddd.string(),3);
sss.add(ddd.string(),3); sss.add(ddd.string(),3);
need_recalc = true; need_recalc = true;
@ -1009,7 +1016,6 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
} }
} }
} }
adjust_fixed_scad(); adjust_fixed_scad();
return P_OK; return P_OK;
} }
@ -1480,7 +1486,8 @@ bool TPagamento::read(TTable* t, TTable* r)
// set everything // set everything
_rdiff = t->get_bool("B1"); _a_fine_mese = t->get_bool("B2");
_rdiff = t->get_bool("B1");
_mcomm = t->get_bool("B0"); _mcomm = t->get_bool("B0");
_tpr = t->get_int("S3"); _tpr = t->get_int("S3");
_inscad = t->get_char("S1"); _inscad = t->get_char("S1");
@ -1979,7 +1986,7 @@ TPagamento::TPagamento(const char* codtab, const char* data) :
_code(codtab), _imponval(0.0), _imposval(0.0), _speseval(0.0), _code(codtab), _imponval(0.0), _imposval(0.0), _speseval(0.0),
_imponlit(0.0), _imposlit(0.0), _speselit(0.0), _new(false), _mcomm(false), // _cambio(1.0), _imponlit(0.0), _imposlit(0.0), _speselit(0.0), _new(false), _mcomm(false), // _cambio(1.0),
_rdiff(false), _tpr(0), _dirty(false), _inited(false), _roundlit(0), _roundval(3), _int_rate(30), _rdiff(false), _tpr(0), _dirty(false), _inited(false), _roundlit(0), _roundval(3), _int_rate(30),
_def_tpr(1), _def_ulc(""), _was_tpr4(false), _in_valuta(false), _tipocf('C'), _codcf(0L) _def_tpr(1), _def_ulc(""), _was_tpr4(false), _in_valuta(false), _tipocf('C'), _codcf(0L), _a_fine_mese(false)
{ {
_fixd[0] = _fixd[1] = _fixd[2] = 0; _fixd[0] = _fixd[1] = _fixd[2] = 0;
if (data != nullptr && *data) if (data != nullptr && *data)

View File

@ -79,6 +79,7 @@ class TPagamento : public TObject
bool _was_tpr4; bool _was_tpr4;
bool _in_valuta; // in valuta o non bool _in_valuta; // in valuta o non
bool _a_fine_mese;
char _tipocf; char _tipocf;
long _codcf; long _codcf;
@ -141,7 +142,8 @@ public:
char inizio_scadenza() const { return _inscad; } char inizio_scadenza() const { return _inscad; }
bool mese_commerciale() const { return _mcomm; } bool mese_commerciale() const { return _mcomm; }
bool rate_differenziate() const { return _rdiff; } bool rate_differenziate() const { return _rdiff; }
int tipo_prima_rata() const { return _tpr; } bool a_fine_mese() const { return _a_fine_mese; }
int tipo_prima_rata() const { return _tpr; }
int intervallo_rate() const { return _int_rate; } int intervallo_rate() const { return _int_rate; }
int round(bool v) const { return v ? _roundval : _roundlit; } int round(bool v) const { return v ? _roundval : _roundlit; }
@ -159,7 +161,8 @@ public:
// con il parametro modificato // con il parametro modificato
void set_intervallo_rate(int i); void set_intervallo_rate(int i);
void set_mese_commerciale(bool v, int& sscad); void set_mese_commerciale(bool v, int& sscad);
void set_rate_differenziate(int v); void set_rate_differenziate(int v);
void set_a_fine_mese(bool on = true) { _a_fine_mese = on; }
void set_tipo_prima_rata(int v, int sscad = -1); void set_tipo_prima_rata(int v, int sscad = -1);
void set_percrata(int n, real r); void set_percrata(int n, real r);
void set_datarata(int n, const TDate & d); void set_datarata(int n, const TDate & d);

View File

@ -5,6 +5,22 @@
// funzione per classificare i PIM e sommare tutto cio' che contengono // funzione per classificare i PIM e sommare tutto cio' che contengono
#include "cgpim.h" #include "cgpim.h"
void classify_pim_array(const TRectype& pimr, TArray & imponibili, TArray & imposte, bool tipost, const bool dich)
{
real imp;
real iva;
tiporec tprec;
int last_tprec = -1;
imponibili.destroy();
imposte.destroy();
while (classify_pim(pimr, imp, iva, tprec, tipost, last_tprec, dich))
{
imponibili.add(imp, tprec);
imposte.add(iva, tprec);
}
}
bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool tipost, int & last_tiporec, const bool dich) bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool tipost, int & last_tiporec, const bool dich)
{ {
// parse CODTAB of pim record // parse CODTAB of pim record
@ -24,18 +40,27 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
// cominciamo cosi' // cominciamo cosi'
imp = ZERO; iva = ZERO; imp = ZERO; iva = ZERO;
bool found = false; bool found = false;
#ifdef DBG
TString8 codiva = ctab.mid(16, 4);
static const char * codici[] = { "22", "22R", nullptr };
codiva.trim();
for (int i = 0; codici[i] != nullptr; i++)
if (strcmp(codiva, codici[i]) == 0)
int z = 1;
#endif
for (int i = last_tiporec + 1; i <= stop_tiporec; i++) for (int i = ++last_tiporec; i <= stop_tiporec; i++)
{ {
tiporec tocheck = (tiporec)i; tiporec tocheck = (tiporec)i;
switch(tocheck) switch (tocheck)
{ {
case acq_norm: case acq_norm:
//found = tipomov == 2 && tipoiva != "NS"; found = tipomov == 2 && tipodet == 0;
found = tipomov == 2;
found &= (tipodet == 0 /* || tipodet == 1 || tipodet == 3 ||
tipodet == 5 || tipodet == 9 */);
if (found) if (found)
{ {
if (tipost) //stampa if (tipost) //stampa
@ -56,8 +81,7 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
} }
break; break;
case vend_norm: case vend_norm:
//found = tipomov == 1 /* && corrisp == 1 */ && tipoiva != "NS"; found = tipomov == 1;
found = tipomov == 1 /* && corrisp == 1 */;
if (found) if (found)
{ {
imp = pimr.get_real("R0"); imp = pimr.get_real("R0");
@ -214,7 +238,7 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
{ {
imp = pimr.get_real("R0"); imp = pimr.get_real("R0");
iva = pimr.get_real("R1"); iva = pimr.get_real("R1");
found &= (!imp.is_zero() || !iva.is_zero()); found &= /*(*/!imp.is_zero();// || !iva.is_zero());
} }
break; break;
case vend_rimborso: case vend_rimborso:
@ -252,6 +276,5 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
break; break;
} }
} }
return found; return found;
} }

View File

@ -37,6 +37,21 @@ enum tiporec { acq_norm = 0, vend_norm = 1, // acquisti e vendite normali
// ACHTUNG: se si aggiunge, cambiare sotto!!! // ACHTUNG: se si aggiunge, cambiare sotto!!!
}; };
// ---------------------------------------------------------------
// "classifica" un record progressivo IVA passato per reference
// mette gli imponibili in imp, l'imposta in iva, nell' elemento corrispondente
// dell'enum di cui sopra, che dice di che tipo e'
// l'importo ritornato
// ---------------------------------------------------------------
// RITORNA TRUE SE gli array conengono valori
// ---------------------------------------------------------------
// mese, anno, attivita' vanno gestiti esternamente. Quando un pim
// contiene dati che valgono per piu' di un caso, ritorna TRUE
// finche' i casi possibili non sono esauriti
// ---------------------------------------------------------------
void classify_pim_array(const TRectype& pimr, TArray & imponibili, TArray & imposte, bool tipost, const bool dich);
// --------------------------------------------------------------- // ---------------------------------------------------------------
// "classifica" un record progressivo IVA passato per reference // "classifica" un record progressivo IVA passato per reference
// mette l'imponibile in imp, l'imposta in iva, e in t mette // mette l'imponibile in imp, l'imposta in iva, e in t mette