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
BIN
src/cg/IVA_2023_istr.pdf
Normal file
BIN
src/cg/IVA_2023_mod.pdf
Normal file
@ -14,15 +14,16 @@
|
||||
|
||||
class TQuadro_VIAB_recordset : public TQuadro_IVA_recordset
|
||||
{
|
||||
|
||||
protected:
|
||||
virtual void load();
|
||||
virtual void load(const char repid);
|
||||
|
||||
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() {}
|
||||
};
|
||||
|
||||
void TQuadro_VIAB_recordset::load()
|
||||
void TQuadro_VIAB_recordset::load(const char repid)
|
||||
{
|
||||
const TRectype & ditta = cache().get(LF_NDITTE, app().get_firm());
|
||||
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'; }
|
||||
|
||||
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);
|
||||
|
||||
TQuadro_VIAB_app() : TQuadro_IVA_app("Stampa Quadro VC", "cg7400a") {}
|
||||
|
Before Width: | Height: | Size: 631 KiB After Width: | Height: | Size: 181 KiB |
Before Width: | Height: | Size: 640 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 122 KiB |
@ -171,16 +171,19 @@ TISAM_recordset & TQuadro_IVA_recordset::get_recordset(const int code, const int
|
||||
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;
|
||||
TProgram_report & rep = _mask->get_report(code - 1);
|
||||
TISAM_recordset * set = (TISAM_recordset *) rep.recordset();
|
||||
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("#DITTA", codditta);
|
||||
|
||||
if (set->items() > 0)
|
||||
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"));
|
||||
}
|
||||
*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)
|
||||
{
|
||||
TString * val = (TString *)_values.objptr(s);
|
||||
@ -262,7 +284,9 @@ void TQuadro_IVA_recordset::set_bool(const char *s, bool on)
|
||||
if (val == nullptr)
|
||||
{
|
||||
const TString8 key(s);
|
||||
|
||||
_values.add(key, val = new TString4);
|
||||
_types.add(key, TString("bool"));
|
||||
}
|
||||
*val = on ? "X" : "";
|
||||
}
|
||||
@ -274,7 +298,9 @@ void TQuadro_IVA_recordset::set(const char *s, const char * value)
|
||||
if (val == nullptr)
|
||||
{
|
||||
const TString8 key(s);
|
||||
|
||||
_values.add(key, val = new TString);
|
||||
_types.add(key, TString("string"));
|
||||
}
|
||||
*val = value;
|
||||
}
|
||||
@ -314,7 +340,7 @@ void TQuadro_IVA_app::print()
|
||||
TQuadro_IVA_report rep(repname);
|
||||
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();
|
||||
TReport_section * sec = rep.find_section('B', 1);
|
||||
TReport_field * fld = sec->find_field(100);
|
||||
@ -326,6 +352,7 @@ void TQuadro_IVA_app::print()
|
||||
book.add(rep);
|
||||
}
|
||||
}
|
||||
|
||||
_mask->restart_reports();
|
||||
TProgram_report * rep = _mask->get_report();
|
||||
TFilename repname = rep->filename();
|
||||
|
@ -40,23 +40,25 @@ class TQuadro_IVA_recordset : public TISAM_recordset
|
||||
TAssoc_array _types;
|
||||
TQuadro_IVA_mask * _mask;
|
||||
int _year;
|
||||
char _repid;
|
||||
|
||||
protected:
|
||||
const TMask & mask() { return *_mask; }
|
||||
void add_value(const char *s, const real value);
|
||||
void sub_value(const char *s, const real value) { add_value(s, -value); }
|
||||
void set_bool(const char *s, bool on = false);
|
||||
real get_real_value(const char *s);
|
||||
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;
|
||||
void clear() { _values.destroy(); _types.destroy(); }
|
||||
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_imposta(const int code, const int year, const char * expr = nullptr) { return evaluate_recordset(code, year, RMI_IMPOSTA, expr); }
|
||||
|
||||
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);
|
||||
int year() { return _year; }
|
||||
@ -84,7 +86,7 @@ protected:
|
||||
virtual char last_quadro_report() const { return 'a';}
|
||||
|
||||
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 bool firm_change_enabled() const { return false; }
|
||||
TQuadro_IVA_mask * mask() const { return _mask; }
|
||||
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 190 KiB |
@ -27,14 +27,14 @@
|
||||
class TQuadro_VE_recordset : public TQuadro_IVA_recordset
|
||||
{
|
||||
protected:
|
||||
virtual void load();
|
||||
virtual void load(const char repid);
|
||||
|
||||
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() {}
|
||||
};
|
||||
|
||||
void TQuadro_VE_recordset::load()
|
||||
void TQuadro_VE_recordset::load(const char repid)
|
||||
{
|
||||
clear();
|
||||
|
||||
@ -47,26 +47,24 @@ void TQuadro_VE_recordset::load()
|
||||
imposta_agricola.add("2.00", TString8("VE01.2"));
|
||||
imponibile_agricolo.add("4.00", TString8("VE02.2"));
|
||||
imposta_agricola.add("4.00", TString8("VE02.2"));
|
||||
imponibile_agricolo.add("6.00", TString8("V03.1"));
|
||||
imposta_agricola.add("6.00", TString8("VE03.2"));
|
||||
imponibile_agricolo.add("6.40", TString8("V03.1"));
|
||||
imposta_agricola.add("6.40", TString8("VE03.2"));
|
||||
imponibile_agricolo.add("7.30", TString8("V04.1"));
|
||||
imposta_agricola.add("7.30", TString8("VE04.2"));
|
||||
imponibile_agricolo.add("7.50", TString8("VE05.1"));
|
||||
imposta_agricola.add("7.50", TString8("VE05.2"));
|
||||
imponibile_agricolo.add("7.65", TString8("VE06.1"));
|
||||
imposta_agricola.add("7.65", TString8("VE06.2"));
|
||||
imponibile_agricolo.add("7.95", TString8("VE07.1"));
|
||||
imposta_agricola.add("7.65", TString8("VE07.2"));
|
||||
imponibile_agricolo.add("8.30", TString8("VE08.1"));
|
||||
imposta_agricola.add("8.30", TString8("VE08.2"));
|
||||
imponibile_agricolo.add("8,50", TString8("VE09.1"));
|
||||
imposta_agricola.add("8,50", TString8("VE09.2"));
|
||||
imponibile_agricolo.add("8.80", TString8("VE10.1"));
|
||||
imposta_agricola.add("8.80", TString8("VE10.2"));
|
||||
imponibile_agricolo.add("10.00", TString8("VE11.1"));
|
||||
imposta_agricola.add("10.00", TString8("VE11.2"));
|
||||
imponibile_agricolo.add("12.30", TString8("VE12.1"));
|
||||
imposta_agricola.add("12.30", TString8("VE12.2"));
|
||||
imponibile_agricolo.add("8.30", TString8("VE06.1"));
|
||||
imposta_agricola.add("8.30", TString8("VE06.2"));
|
||||
imponibile_agricolo.add("8.50", TString8("VE07.1"));
|
||||
imposta_agricola.add("8.50", TString8("VE07.2"));
|
||||
imponibile_agricolo.add("8.80", TString8("VE08.1"));
|
||||
imposta_agricola.add("8.80", TString8("VE08.2"));
|
||||
imponibile_agricolo.add("9,50", TString8("VE09.1"));
|
||||
imposta_agricola.add("9,50", TString8("VE09.2"));
|
||||
imponibile_agricolo.add("10.00", TString8("VE10.1"));
|
||||
imposta_agricola.add("10.00", TString8("VE10.2"));
|
||||
imponibile_agricolo.add("12.30", TString8("VE11.1"));
|
||||
imposta_agricola.add("12.30", TString8("VE11.2"));
|
||||
|
||||
imponibile.add("4.00", TString8("VE20.1"));
|
||||
imposta.add("4.00", TString8("VE20.2"));
|
||||
@ -75,17 +73,19 @@ void TQuadro_VE_recordset::load()
|
||||
imponibile.add("10.00",TString8("VE22.1"));
|
||||
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"));
|
||||
imponibile.add("5.00", TString8("VE21.1"));
|
||||
imposta.add("5.00", TString8("VE21.2"));
|
||||
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
|
||||
|
||||
imponibile.add("20.00", TString8("VE23.1"));
|
||||
imposta.add("20.00", TString8("VE23.2"));
|
||||
imponibile.add("19.00", TString8("VE23.1"));
|
||||
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"));
|
||||
imposta.add("21.00", TString8("VE23.2"));
|
||||
|
||||
@ -97,7 +97,6 @@ void TQuadro_VE_recordset::load()
|
||||
query << year() << "\nTO CODTAB=" << year();
|
||||
|
||||
TISAM_recordset pim(query);
|
||||
bool good = false;
|
||||
|
||||
for (pim.move_first(); !pim.eof(); pim.move_next())
|
||||
{
|
||||
@ -127,17 +126,21 @@ void TQuadro_VE_recordset::load()
|
||||
codatt.add(codtab.mid(4, 5));
|
||||
const TRectype& attiv = cache().get(LF_ATTIV, codatt);
|
||||
const bool attivita_commerciale = !attiv.get_bool(ATT_ATTNONCOM);
|
||||
TArray imponibili;
|
||||
TArray imposte;
|
||||
|
||||
tiporec tipo;
|
||||
real imp;
|
||||
real iva;
|
||||
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;
|
||||
switch (tipo)
|
||||
tiporec tipo = (tiporec) t;
|
||||
|
||||
if (obj != nullptr)
|
||||
{
|
||||
real & imp = (real &)*obj;
|
||||
real & iva = (real &)imposte[t];
|
||||
|
||||
switch (tipo)
|
||||
{
|
||||
case acq_norm: // acquisti normali
|
||||
break;
|
||||
case vend_norm: // vendite normali
|
||||
@ -148,34 +151,29 @@ void TQuadro_VE_recordset::load()
|
||||
|
||||
if (agricolo)
|
||||
{
|
||||
add_value(*(TString *)imponibile_agricolo.objptr(aliquota), imp);
|
||||
add_value(*(TString *)imposta_agricola.objptr(aliquota), iva);
|
||||
add_value(STRING_TOKEN(imponibile_agricolo.objptr(aliquota)), imp);
|
||||
add_value(STRING_TOKEN(imposta_agricola.objptr(aliquota)), iva);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aliquota == "20.00" || aliquota == "21.00")
|
||||
{
|
||||
real imposta_corretta = imp;
|
||||
if (aliquota == "22.00")
|
||||
int q = 1;
|
||||
if (aliquota == "19.00" || aliquota == "20.00" || aliquota == "21.00")
|
||||
{
|
||||
real imposta_corretta = imp;
|
||||
|
||||
imposta_corretta *= 0.22;
|
||||
imposta_corretta.round(0);
|
||||
add_value("VE25.2", iva - imposta_corretta);
|
||||
iva = imposta_corretta;
|
||||
}
|
||||
imposta_corretta *= 0.22;
|
||||
imposta_corretta.round(0);
|
||||
add_value("VE25.2", 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(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;
|
||||
case acq_simp:
|
||||
break;
|
||||
@ -183,47 +181,46 @@ void TQuadro_VE_recordset::load()
|
||||
break;
|
||||
case bolle_doganali: // bolle doganali (acquisti)
|
||||
break;
|
||||
case acq_beni_riv : // acq. beni per rivendita
|
||||
case acq_beni_riv: // acq. beni per rivendita
|
||||
break;
|
||||
case base_ventilazione: // base calcolo per ventil.
|
||||
case base_ventilazione: // base calcolo per ventil.
|
||||
break;
|
||||
case corr_simp: // corrispettivi n. e s. imp.
|
||||
break;
|
||||
case acq_beni_ammort: // acq. beni ammortizz. detr.
|
||||
case acq_beni_ammort: // acq. beni ammortizz. detr.
|
||||
break;
|
||||
case acq_beni_ammort_nd: // beni ammort. non detraibili
|
||||
case acq_beni_ammort_nd: // beni ammort. non detraibili
|
||||
break;
|
||||
case acq_beni_leasing: // beni strum. acq in leasing
|
||||
case acq_beni_leasing: // beni strum. acq in leasing
|
||||
break;
|
||||
case acq_amm_ultdetr: // beni amm. ult. detr 6%
|
||||
break;
|
||||
case acq_ind_op_es: // acq. indetr. su op.es.
|
||||
case acq_ind_op_es: // acq. indetr. su op.es.
|
||||
break;
|
||||
case acq_ind_pass_int: // passaggi interni
|
||||
if (vendite)
|
||||
add_value("VE40.1", imp);
|
||||
case acq_ind_pass_int: // passaggi interni
|
||||
// add_value("VE40.1", imp);
|
||||
break;
|
||||
case acq_ind_art_19: // indetr. art. 19
|
||||
case acq_ind_art_19: // indetr. art. 19
|
||||
break;
|
||||
case cess_amm: // cessioni amministrative
|
||||
add_value("VE40.1", imp);
|
||||
case cess_amm: // cessioni beni ammortizzabili
|
||||
// add_value("VE40.1", imp);
|
||||
break;
|
||||
case vend_rimborso: // vendite valide per rimborso
|
||||
case vend_rimborso: // vendite valide per rimborso
|
||||
break;
|
||||
case acq_rimborso: // acq. validi per rimborso
|
||||
case acq_rimborso: // acq. validi per rimborso
|
||||
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;
|
||||
default:
|
||||
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 (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);
|
||||
|
||||
query = reg.query_text();
|
||||
pos = query.find("JOIN") - 1;
|
||||
int pos = query.find("JOIN") - 1;
|
||||
query.insert("&&(ATTIV.ATTNONCOM != \"X\")", pos);
|
||||
reg.set(query);
|
||||
reg.requery();
|
||||
@ -333,6 +301,8 @@ void TQuadro_VE_recordset::load()
|
||||
sub_value("VE25.2", imposta_corretta - iva);
|
||||
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(imposta.objptr(aliquota)), iva);
|
||||
}
|
||||
@ -343,7 +313,6 @@ void TQuadro_VE_recordset::load()
|
||||
query << year() << "13\nTO CODTAB==" << year() << "13";
|
||||
|
||||
TISAM_recordset lim(query);
|
||||
good |= lim.items() > 0;
|
||||
|
||||
for (lim.move_first(); !lim.eof(); lim.move_next())
|
||||
{
|
||||
@ -390,34 +359,38 @@ void TQuadro_VE_recordset::load()
|
||||
|
||||
|
||||
TISAM_recordset id(query);
|
||||
TString8 tipo_aliquota, codiva;
|
||||
TString8 cod;
|
||||
TImporto imp371, imp372;
|
||||
|
||||
for (bool ok = id.move_first(); ok; ok = id.move_next())
|
||||
{
|
||||
const long numreg = id.get(RMI_NUMREG).as_int();
|
||||
const int tipoiva = id.get(ID_TIPOIVA).as_int();
|
||||
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();
|
||||
{
|
||||
const long numreg = id.get_long(RMI_NUMREG);
|
||||
const int tipoiva = id.get_int(ID_TIPOIVA);
|
||||
|
||||
key.cut(0);
|
||||
key.add(numreg);
|
||||
key.add(id.get(ID_NUMRIG).as_string());
|
||||
codiva = cache().get(LF_RMOVIVA, key, RMI_CODIVA);
|
||||
key = codiva;
|
||||
tipo_aliquota = cache().get("%IVA", key, "S1");
|
||||
if (tipoiva == 1) // Vendite
|
||||
{
|
||||
const int tipodiff = id.get_int(ID_TIPODIFF);
|
||||
const TRectype & mov = cache().get(LF_MOV, numreg);
|
||||
const char sezione = id.get_string(ID_SEZIONE)[0];
|
||||
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
|
||||
{
|
||||
imp371 += imp;
|
||||
if (tipodiff == 2)
|
||||
imp372 += imp;
|
||||
}
|
||||
key.cut(0);
|
||||
key.add(numreg);
|
||||
key.add(id.get_string(ID_NUMRIG));
|
||||
cod = cache().get(LF_RMOVIVA, key, RMI_CODIVA);
|
||||
|
||||
const TCodiceIVA & codiva = cached_codIVA(cod);
|
||||
|
||||
if (codiva.iva_imponibile() && datapag <= a_datareg)
|
||||
{
|
||||
imp371 += imp;
|
||||
if (tipodiff == 2)
|
||||
imp372 += imp;
|
||||
}
|
||||
}
|
||||
}
|
||||
imp371.normalize('D');
|
||||
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())
|
||||
{
|
||||
const long numreg = idp.get(RMI_NUMREG).as_int();
|
||||
const int tipoiva = idp.get(ID_TIPOIVA).as_int();
|
||||
const TRectype & mov = cache().get(LF_MOV, numreg);
|
||||
const char sezione = idp.get(ID_SEZIONE).as_string()[0];
|
||||
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();
|
||||
const long numreg = idp.get_long(RMI_NUMREG);
|
||||
const int tipoiva = idp.get_int(ID_TIPOIVA);
|
||||
|
||||
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 (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.normalize('A');
|
||||
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:
|
||||
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);
|
||||
|
||||
TQuadro_VE_app() : TQuadro_IVA_app("Stampa Quadro VE", "cg7600a") {}
|
||||
|
Before Width: | Height: | Size: 288 KiB After Width: | Height: | Size: 204 KiB |
@ -26,8 +26,7 @@
|
||||
<font face="Courier New" size="11" />
|
||||
<source>#SYSTEM.CFPI_SPACED</source>
|
||||
</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
|
||||
generato da Campo">
|
||||
<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">
|
||||
<font face="Courier New" bold="1" size="14" />
|
||||
</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" />
|
||||
@ -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="###.###.###">
|
||||
<source>VE11.2</source>
|
||||
</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="###.###.###">
|
||||
<source>VE20.1</source>
|
||||
</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>
|
||||
</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="###.###.###">
|
||||
<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 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>
|
||||
|
@ -22,14 +22,14 @@ class TQuadro_VF_recordset : public TQuadro_IVA_recordset
|
||||
TQuadro_IVA_mask * _mask;
|
||||
|
||||
protected:
|
||||
virtual void load();
|
||||
virtual void load(char repid);
|
||||
|
||||
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() {}
|
||||
};
|
||||
|
||||
void TQuadro_VF_recordset::load()
|
||||
void TQuadro_VF_recordset::load(char repid)
|
||||
{
|
||||
clear();
|
||||
|
||||
@ -44,28 +44,26 @@ void TQuadro_VF_recordset::load()
|
||||
imposta.add("4.00", TString8("VF02.2"));
|
||||
imponibile.add("5.00", TString8("VF03.1"));
|
||||
imposta.add("5.00", TString8("VF03.2"));
|
||||
imponibile.add("6.00", TString8("VF04.1"));
|
||||
imposta.add("6.00", TString8("VF04.2"));
|
||||
imponibile.add("7.30", TString8("VF05.1"));
|
||||
imponibile.add("6.40", TString8("VF04.1"));
|
||||
imposta.add("6.40", TString8("VF04.2"));
|
||||
imponibile.add("7.30", TString8("VF05.1"));
|
||||
imposta.add("7.30", TString8("VF05.2"));
|
||||
imponibile.add("7.50", TString8("VF06.1"));
|
||||
imposta.add("7.50", TString8("VF06.2"));
|
||||
imponibile.add("7.65", TString8("VF07.1"));
|
||||
imposta.add("7.65", TString8("VF07.2"));
|
||||
imponibile.add("7.95", TString8("VF08.1"));
|
||||
imposta.add("7.95", TString8("VF08.2"));
|
||||
imponibile.add("8.30", TString8("VF09.1"));
|
||||
imposta.add("8.30", TString8("VF09.2"));
|
||||
imponibile.add("8,50", TString8("VF10.1"));
|
||||
imposta.add("8,50", TString8("VF10.2"));
|
||||
imponibile.add("8.80", TString8("VF11.1"));
|
||||
imposta.add("8.80", TString8("VF11.2"));
|
||||
imponibile.add("10.00",TString8("VF12.1"));
|
||||
imposta.add("10.00",TString8("VF12.2"));
|
||||
imponibile.add("12.30", TString8("VF13.1"));
|
||||
imposta.add("12.30", TString8("VF13.2"));
|
||||
imponibile.add("22.00", TString8("VF14.1"));
|
||||
imposta.add("22.00", TString8("VF14.2"));
|
||||
imponibile.add("8.30", TString8("VF07.1"));
|
||||
imposta.add("8.30", TString8("VF07.2"));
|
||||
imponibile.add("8.50", TString8("VF08.1"));
|
||||
imposta.add("8.50", TString8("VF08.2"));
|
||||
imponibile.add("8.80", TString8("VF09.1"));
|
||||
imposta.add("8.80", TString8("VF09.2"));
|
||||
imponibile.add("9,50", TString8("VF10.1"));
|
||||
imposta.add("9,50", TString8("VF10.2"));
|
||||
imponibile.add("10.00", TString8("VF11.1"));
|
||||
imposta.add("10.00", TString8("VF11.2"));
|
||||
imponibile.add("12.30", TString8("VF12.1"));
|
||||
imposta.add("12.30", TString8("VF12.2"));
|
||||
imponibile.add("22.00", TString8("VF13.1"));
|
||||
imposta.add("22.00", TString8("VF13.2"));
|
||||
// VF30.1-8 METODO UTILIZZATO PER LA DETERMINAZIONE DELL’IVA AMMESSA IN DETRAZIONE
|
||||
TString query; query << "USE ATTIV\nFROM CODDITTA=#F\nTO CODDITTA=#F";
|
||||
|
||||
@ -105,68 +103,66 @@ void TQuadro_VF_recordset::load()
|
||||
}
|
||||
if (!agricolo)
|
||||
agricolo_misto = false;
|
||||
|
||||
set_bool("VF30.1", agenziaviaggio);
|
||||
set_bool("VF30.2");
|
||||
set_bool("VF30.3", prorataprev);
|
||||
set_bool("VF30.4");
|
||||
set_bool("VF30.5");
|
||||
set_bool("VF30.6", minori);
|
||||
set_bool("VF30.7", agricolo_misto);
|
||||
set_bool("VF30.8", agricolo);
|
||||
set_bool("VF30.9");
|
||||
set_bool("VF30.10");
|
||||
if (repid == 'b')
|
||||
{
|
||||
set_bool("VF30.1", agenziaviaggio);
|
||||
set_bool("VF30.2");
|
||||
set_bool("VF30.3", prorataprev);
|
||||
set_bool("VF30.4");
|
||||
set_bool("VF30.5");
|
||||
set_bool("VF30.6", minori);
|
||||
set_bool("VF30.7", agricolo_misto);
|
||||
set_bool("VF30.8", agricolo);
|
||||
set_bool("VF30.9");
|
||||
set_bool("VF30.10");
|
||||
}
|
||||
|
||||
imponibile_agricolo.add("2.00", TString8("V39.1"));
|
||||
imposta_agricola.add("2.00", TString8("VF39.2"));
|
||||
imponibile_agricolo.add("4.00", TString8("VF40.2"));
|
||||
imposta_agricola.add("4.00", TString8("VF40.2"));
|
||||
imponibile_agricolo.add("6.00", TString8("VF41.1"));
|
||||
imposta_agricola.add("6.00", TString8("VF41.2"));
|
||||
imponibile_agricolo.add("7.30", TString8("VF42.1"));
|
||||
imponibile_agricolo.add("6.40", TString8("VF41.1"));
|
||||
imposta_agricola.add("6.40", TString8("VF41.2"));
|
||||
imponibile_agricolo.add("7.30", TString8("VF42.1"));
|
||||
imposta_agricola.add("7.30", TString8("VF42.2"));
|
||||
imponibile_agricolo.add("7.50", TString8("VF43.1"));
|
||||
imposta_agricola.add("7.50", TString8("VF43.2"));
|
||||
imponibile_agricolo.add("7.65", TString8("VF44.1"));
|
||||
imposta_agricola.add("7.65", TString8("VF44.2"));
|
||||
imponibile_agricolo.add("7.95", TString8("VF45.1"));
|
||||
imposta_agricola.add("7.95", TString8("VF45.2"));
|
||||
imponibile_agricolo.add("8.30", TString8("VF46.1"));
|
||||
imposta_agricola.add("8.30", TString8("VF46.2"));
|
||||
imponibile_agricolo.add("8,50", TString8("VF47.1"));
|
||||
imposta_agricola.add("8,50", TString8("VF47.2"));
|
||||
imponibile_agricolo.add("8.80", TString8("VF48.1"));
|
||||
imposta_agricola.add("8.80", TString8("VF48.2"));
|
||||
imponibile_agricolo.add("10.00",TString8("VF49.1"));
|
||||
imposta_agricola.add("10.00",TString8("VF49.2"));
|
||||
imponibile_agricolo.add("12.30", TString8("VF50.1"));
|
||||
imposta_agricola.add("12.30", TString8("VF50.2"));
|
||||
imponibile_agricolo.add("8.30", TString8("VF44.1"));
|
||||
imposta_agricola.add("8.30", TString8("VF44.2"));
|
||||
imponibile_agricolo.add("8.50", TString8("VF45.1"));
|
||||
imposta_agricola.add("8.50", TString8("VF45.2"));
|
||||
imponibile_agricolo.add("8.80", TString8("VF46.1"));
|
||||
imposta_agricola.add("8.80", TString8("VF46.2"));
|
||||
imponibile_agricolo.add("9.50", TString8("VF47.1"));
|
||||
imposta_agricola.add("9.50", TString8("VF47.2"));
|
||||
imponibile_agricolo.add("10.00", TString8("VF48.1"));
|
||||
imposta_agricola.add("10.00", TString8("VF48.2"));
|
||||
imponibile_agricolo.add("12.30", TString8("VF49.1"));
|
||||
imposta_agricola.add("12.30", TString8("VF49.2"));
|
||||
|
||||
query = "USE PIM\nFROM CODTAB=";
|
||||
query << year() << "\nTO CODTAB=" << year();
|
||||
|
||||
TISAM_recordset pim(query);
|
||||
bool good = false;
|
||||
|
||||
for (pim.move_first(); !pim.eof(); pim.move_next())
|
||||
{
|
||||
|
||||
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 tiporec tipo = (tiporec) reg.get_int("I9");
|
||||
const tiporec tipo = (tiporec)reg.get_int("I9");
|
||||
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)
|
||||
{
|
||||
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 TString8 aliquota = ivar.get("R0");
|
||||
const int tipocr = atoi(codtab.mid(15,1)); // tipo costo_ricavo
|
||||
tiporec tipo;
|
||||
const int tipocr = atoi(codtab.mid(15, 1)); // tipo costo_ricavo
|
||||
const TString4 tipo_aliquota = ivar.get("S1");
|
||||
const TString4 tipo_iva11_acq = ivar.get("S9");
|
||||
const int int_tipo_iva11_acq = atoi(tipo_iva11_acq);
|
||||
@ -174,20 +170,26 @@ void TQuadro_VF_recordset::load()
|
||||
const bool esente = (tipo_aliquota == "ES");
|
||||
const bool non_soggetto = (tipo_aliquota == "NS");
|
||||
const bool terremotati = int_tipo_iva11_acq == 16;
|
||||
real imp;
|
||||
real iva;
|
||||
int last_tiporec = -1;
|
||||
TArray imponibili;
|
||||
TArray imposte;
|
||||
|
||||
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;
|
||||
switch (tipo)
|
||||
tiporec tipo = (tiporec)t;
|
||||
|
||||
if (obj != nullptr)
|
||||
{
|
||||
real & imp = (real &)*obj;
|
||||
real & iva = (real &)imposte[t];
|
||||
|
||||
switch (tipo)
|
||||
{
|
||||
case acq_norm: // acquisti normali
|
||||
if (prorata100)
|
||||
{
|
||||
if (aliquota.full())
|
||||
add_value("VF20.1", imp);
|
||||
add_value("VF22.1", imp);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -197,8 +199,16 @@ void TQuadro_VF_recordset::load()
|
||||
|
||||
if (agricolo)
|
||||
{
|
||||
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
|
||||
if (imponibile_agricolo.objptr(aliquota) == nullptr)
|
||||
{
|
||||
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
|
||||
@ -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.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);
|
||||
if (prorataprev)
|
||||
{
|
||||
@ -226,75 +236,78 @@ void TQuadro_VF_recordset::load()
|
||||
break;
|
||||
case bolle_doganali: // bolle doganali (acquisti)
|
||||
break;
|
||||
case acq_beni_riv : // acq. beni per riVFndita
|
||||
case acq_beni_riv: // acq. beni per riVFndita
|
||||
break;
|
||||
case base_ventilazione: // base calcolo per ventil.
|
||||
case base_ventilazione: // base calcolo per ventil.
|
||||
break;
|
||||
case corr_simp: // corrispettivi n. e s. imp.
|
||||
break;
|
||||
case acq_beni_ammort: // acq. beni ammortizz. detr.
|
||||
case acq_beni_ammort: // acq. beni ammortizz. detr.
|
||||
break;
|
||||
case acq_beni_ammort_nd: // beni ammort. non detraibili
|
||||
case acq_beni_ammort_nd: // beni ammort. non detraibili
|
||||
break;
|
||||
case acq_beni_leasing: // beni strum. acq in leasing
|
||||
case acq_beni_leasing: // beni strum. acq in leasing
|
||||
break;
|
||||
case acq_amm_ultdetr: // beni amm. ult. detr 6%
|
||||
break;
|
||||
case acq_ind_op_es: // acq. indetr. su op.es.
|
||||
case acq_ind_op_es: // acq. indetr. su op.es.
|
||||
break;
|
||||
case acq_ind_pass_int: // passaggi interni
|
||||
case acq_ind_pass_int: // passaggi interni
|
||||
break;
|
||||
case acq_ind_art_19: // indetr. art. 19
|
||||
add_value("VF19.1", imp);
|
||||
case acq_ind_art_19: // indetr. art. 19
|
||||
add_value("VF21.1", imp);
|
||||
break;
|
||||
case cess_amm: // cessioni amministrative
|
||||
case vend_rimborso: // vendite valide per rimborso
|
||||
case cess_amm: // cessioni amministrative
|
||||
case vend_rimborso: // vendite valide per rimborso
|
||||
break;
|
||||
case acq_rimborso: // acq. validi per rimborso
|
||||
case acq_rimborso: // acq. validi per rimborso
|
||||
break;
|
||||
case acq_bd_ind_art_19: // acq. con tipo documento BD e tipo detr 9
|
||||
add_value("VF20.1", imp); // *** verificare !!!!!
|
||||
case acq_bd_ind_art_19: // acq. con tipo documento BD e tipo detr 9
|
||||
add_value("VF22.1", imp); // *** verificare !!!!!
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
imp = pimr.get_real("R0") - pimr.get_real("R9");
|
||||
iva = pimr.get_real("R1") - pimr.get_real("R10");
|
||||
}
|
||||
if (non_imponibile)
|
||||
|
||||
const real imp = pimr.get_real("R0") - pimr.get_real("R9");
|
||||
const real iva = pimr.get_real("R1") - pimr.get_real("R10");
|
||||
|
||||
// if (non_imponibile)
|
||||
{
|
||||
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
|
||||
}
|
||||
else
|
||||
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 (tipo_iva11_acq == "14A")
|
||||
add_value("VF16.2", imp);
|
||||
else
|
||||
if (int_tipo_iva11_acq == 14)
|
||||
add_value("VF16.1", imp);
|
||||
}
|
||||
if (non_soggetto)
|
||||
// if (esente)
|
||||
{
|
||||
if (tipo_iva11_acq == "14A")
|
||||
add_value("VF18.1", imp);
|
||||
else
|
||||
if (int_tipo_iva11_acq == 14)
|
||||
add_value("VF18.2", imp);
|
||||
}
|
||||
// if (non_soggetto)
|
||||
{
|
||||
if (int_tipo_iva11_acq == 15)
|
||||
{
|
||||
if (tipo_iva11_acq == "15B")
|
||||
add_value("VF17.2", imp);
|
||||
add_value("VF17.1", imp);
|
||||
add_value("VF19.2", imp);
|
||||
add_value("VF19.1", imp);
|
||||
}
|
||||
}
|
||||
if (terremotati)
|
||||
add_value("VF18.1", imp);
|
||||
add_value("VF20.1", imp);
|
||||
|
||||
}
|
||||
}
|
||||
@ -358,9 +371,10 @@ void TQuadro_VF_recordset::load()
|
||||
}
|
||||
}
|
||||
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');
|
||||
add_value("VF21.2", imp212.valore()); // VE37.2 iva per cassa da pagare
|
||||
add_value("VF23.2", imp212.valore());
|
||||
|
||||
query.zap();
|
||||
|
||||
@ -396,7 +410,7 @@ void TQuadro_VF_recordset::load()
|
||||
}
|
||||
}
|
||||
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 d’imposta (indicare con il segno +/–)
|
||||
// V50.2 Variazioni e arrotondamenti d’imposta (indicare con il segno +/–)
|
||||
@ -406,7 +420,6 @@ void TQuadro_VF_recordset::load()
|
||||
query << year() << "13\nTO CODTAB==" << year() << "13";
|
||||
|
||||
TISAM_recordset lim(query);
|
||||
good |= lim.items() > 0;
|
||||
|
||||
for (lim.move_first(); !lim.eof(); lim.move_next())
|
||||
{
|
||||
@ -414,49 +427,58 @@ void TQuadro_VF_recordset::load()
|
||||
|
||||
if (var_cred < ZERO) // ???
|
||||
{
|
||||
add_value("VF24.2", -var_cred);
|
||||
add_value("VF26.2", -var_cred);
|
||||
add_value("VF51.2", -var_cred);
|
||||
}
|
||||
add_value("VF70.2", var_cred);
|
||||
}
|
||||
|
||||
val = evaluate_recordset_imponibile(REP_INTRA, year());
|
||||
add_value("VF26.1", val);
|
||||
val = evaluate_recordset_imposta(REP_INTRA, year());
|
||||
add_value("VF26.2", val);
|
||||
val = evaluate_recordset_imponibile(REP_IMPORTAZIONI, year());
|
||||
add_value("VF26.3", val);
|
||||
val = evaluate_recordset_imposta(REP_IMPORTAZIONI, year());
|
||||
add_value("VF26.4", val);
|
||||
val = evaluate_recordset_imponibile(REP_SANMARINO, year());
|
||||
add_value("VF26.5", val);
|
||||
val = evaluate_recordset_imposta(REP_SANMARINO, year());
|
||||
add_value("VF24.6", val);
|
||||
if (repid == 'a')
|
||||
{
|
||||
val = evaluate_recordset_imponibile(REP_INTRA, year());
|
||||
add_value("VF28.1", val);
|
||||
val = evaluate_recordset_imposta(REP_INTRA, year());
|
||||
add_value("VF28.2", val);
|
||||
val = evaluate_recordset_imponibile(REP_IMPORTAZIONI, year());
|
||||
add_value("VF28.3", val);
|
||||
val = evaluate_recordset_imposta(REP_IMPORTAZIONI, year());
|
||||
add_value("VF28.4", val);
|
||||
val = evaluate_recordset_imponibile(REP_SANMARINO, year());
|
||||
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");
|
||||
add_value("VF27.1", val);
|
||||
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==8");
|
||||
add_value("VF27.2", val);
|
||||
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "(RMOVIVA.TIPOCR==1)||(RMOVIVA.TIPOCR==51)");
|
||||
add_value("VF27.3", val);
|
||||
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);
|
||||
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==2");
|
||||
add_value("VF29.1", val);
|
||||
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "RMOVIVA.TIPOCR==8");
|
||||
add_value("VF29.2", val);
|
||||
val = evaluate_recordset_imponibile(REP_RIPACQ, year(), "(RMOVIVA.TIPOCR==1)||(RMOVIVA.TIPOCR==51)");
|
||||
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)");
|
||||
// add_value("VF29.4", val);
|
||||
}
|
||||
else
|
||||
{
|
||||
// VF32.1 Se per l’anno 2016 sono state effettuate esclusivamente operazioni esenti barrare la casella
|
||||
set_bool("VF32.1", prorata100);
|
||||
// VF33.1 Se per l’anno 2016 ha avuto effetto l’opzione di cui all’art. 36-bis barrare la casella
|
||||
set_bool("VF33.1");
|
||||
// VF34.1-9 Dati per il calcolo della percentuale di detrazione
|
||||
|
||||
// VF32.1 Se per l’anno 2016 sono state effettuate esclusivamente operazioni esenti barrare la casella
|
||||
set_bool("VF32.1", prorata100);
|
||||
// VF33.1 Se per l’anno 2016 ha avuto effetto l’opzione di cui all’art. 36-bis barrare la casella
|
||||
set_bool("VF33.1");
|
||||
// VF34.1-9 Dati per il calcolo della percentuale di detrazione
|
||||
// VF36.1 IVA detraibile per gli acquisti relativi all’oro effettuati dai soggetti diversi dai produttori e trasformatori ai sensi dell’art. 19, comma 5 bis
|
||||
// VF54.2 Importo detraibile per le cessioni, anche intracomunitarie, dei prodotti agricoli di cui all’art.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 dell’art.10, non rientranti nell’attività propria dell’impresa 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 l’applicazione 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 dall’art. 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 all’oro effettuati dai soggetti diversi dai produttori e trasformatori ai sensi dell’art. 19, comma 5 bis
|
||||
// VF54.2 Importo detraibile per le cessioni, anche intracomunitarie, dei prodotti agricoli di cui all’art.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 dell’art.10, non rientranti nell’attività propria dell’impresa 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 l’applicazione 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 dall’art. 34-bis per le attività agricole connesse
|
||||
}
|
||||
|
||||
class TQuadro_VF_app : public TQuadro_IVA_app
|
||||
@ -466,7 +488,7 @@ protected:
|
||||
virtual char last_quadro_report() const { return 'b';}
|
||||
|
||||
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);
|
||||
|
||||
TQuadro_VF_app() : TQuadro_IVA_app("Stampa Quadro VF", "cg7700a") {}
|
||||
|
Before Width: | Height: | Size: 573 KiB After Width: | Height: | Size: 190 KiB |
@ -88,7 +88,7 @@
|
||||
<source>VF11.1</source>
|
||||
</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="###.###.###">
|
||||
<source>V11.2</source>
|
||||
<source>VF11.2</source>
|
||||
</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="###.###.###">
|
||||
<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="###.###.###">
|
||||
<source>VF13.2</source>
|
||||
</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="###.###.###">
|
||||
<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="###.###.###">
|
||||
<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>VF17.1</source>
|
||||
</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="###.###.###">
|
||||
<source>VF17.2</source>
|
||||
<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>VF19.2</source>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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="###.###.###">
|
||||
<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="###.###.###">
|
||||
<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>VF22.1</source>
|
||||
</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="###.###.###">
|
||||
<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>
|
||||
<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>VF23.1</source>
|
||||
</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="###.###.###">
|
||||
<source>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#1202+#1302+#1402</source>
|
||||
<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>VF23.2</source>
|
||||
</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="###.###.###">
|
||||
<source>VF24.2</source>
|
||||
<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.1</source>
|
||||
</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="###.###.###">
|
||||
<source>#2302+#2402</source>
|
||||
<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>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#1201+#1301+#1701+#1801+#1901+#2001+#2101+#2201+#2301-#2401</source>
|
||||
</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="###.###.###">
|
||||
<source>VF26.1</source>
|
||||
<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>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#1202+#1302</source>
|
||||
</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>
|
||||
</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="###.###.###">
|
||||
<source>VF26.3</source>
|
||||
<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>#2502+#2602</source>
|
||||
</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="###.###.###">
|
||||
<source>VF26.4</source>
|
||||
<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>VF28.1</source>
|
||||
</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="###.###.###">
|
||||
<source>VF26.5</source>
|
||||
<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>VF28.2</source>
|
||||
</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="###.###.###">
|
||||
<source>VF26.6</source>
|
||||
<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>VF28.3</source>
|
||||
</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="###.###.###">
|
||||
<source>VF27.1</source>
|
||||
<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>VF28.4</source>
|
||||
</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="###.###.###">
|
||||
<source>VF27.2</source>
|
||||
<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>VF28.5</source>
|
||||
</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="###.###.###">
|
||||
<source>VF27.3</source>
|
||||
<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>VF28.6</source>
|
||||
</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="###.###.###">
|
||||
<source>VF27.4</source>
|
||||
<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>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>
|
||||
</section>
|
||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" />
|
||||
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 110 KiB |
@ -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="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">
|
||||
<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>
|
||||
</field>
|
||||
</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="###.###.###">
|
||||
<source>V34.8</source>
|
||||
</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="###.###.###">
|
||||
<source>VF35.2</source>
|
||||
</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="###.###.###">
|
||||
<source>VF49.2</source>
|
||||
</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="###.###.###">
|
||||
<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="###.###.###">
|
||||
<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>VF51.2</source>
|
||||
</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>
|
||||
</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="###.###.###">
|
||||
<source>#3902+#4002+#4102+#4202+#4302+#4402+#4502+#4602+#4702+#4802+#4902+#5002</source>
|
||||
<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</source>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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="###.###.###">
|
||||
<source>NUM(#6001!="X"#6002!="X")*(#2502+#6202F;2+#7002)</source>
|
||||
<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>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
|
||||
C;E;
|
||||
IF
|
||||
#6202 @
|
||||
+
|
||||
ELSE
|
||||
#6002 @
|
||||
1
|
||||
C;E;
|
||||
IF
|
||||
#6202 @
|
||||
+
|
||||
THEN
|
||||
THEN
|
||||
#THIS !</prescript>
|
||||
</field>
|
||||
</section>
|
||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" />
|
||||
|
@ -17,14 +17,14 @@ class TQuadro_VJ_recordset : public TQuadro_IVA_recordset
|
||||
TQuadro_IVA_mask * _mask;
|
||||
|
||||
protected:
|
||||
virtual void load();
|
||||
virtual void load(const char repid);
|
||||
|
||||
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() {}
|
||||
};
|
||||
|
||||
void TQuadro_VJ_recordset::load()
|
||||
void TQuadro_VJ_recordset::load(const char repid)
|
||||
{
|
||||
clear();
|
||||
|
||||
@ -148,7 +148,7 @@ protected:
|
||||
virtual void load_sheet(TSheet_field & sf);
|
||||
|
||||
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") {}
|
||||
virtual ~TQuadro_VJ_app() {}
|
||||
|
Before Width: | Height: | Size: 666 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 830 KiB After Width: | Height: | Size: 197 KiB |
Before Width: | Height: | Size: 593 KiB After Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 932 KiB After Width: | Height: | Size: 206 KiB |
Before Width: | Height: | Size: 648 KiB After Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 956 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 748 KiB After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 877 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 660 KiB After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 211 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 534 KiB After Width: | Height: | Size: 136 KiB |
BIN
src/cg/cg7l00a.png
Normal file
After Width: | Height: | Size: 147 KiB |
@ -925,7 +925,11 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
|
||||
{
|
||||
TToken_string& tt = rata(row);
|
||||
TToken_string& ss = (TToken_string&)srate[row];
|
||||
|
||||
lastdate = scad;
|
||||
|
||||
TDate ddd(scad);
|
||||
|
||||
int lastscad = oldscad;
|
||||
// controlla errore sulla data scadenza
|
||||
if (i > 0)
|
||||
@ -939,16 +943,19 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
|
||||
return P_INIZIO; // _inizio
|
||||
lastscad = scad_rata(0);
|
||||
}
|
||||
tt.add(scad,3); tt.add(lastscad, 0);
|
||||
ss.add(scad,3); ss.add(lastscad, 0);
|
||||
if (a_fine_mese())
|
||||
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
|
||||
// ci si fotte e si disabilita il ricalcolo
|
||||
TDate ddd (lastdate);
|
||||
for (int j = row+1; j < srate.items(); j++)
|
||||
{
|
||||
TToken_string& ttt = rata(j);
|
||||
TToken_string& sss = (TToken_string&)srate[j];
|
||||
next_scad(ddd,scad_rata(j), mcomm,j);
|
||||
if (a_fine_mese())
|
||||
ddd.set_end_month();
|
||||
ttt.add(ddd.string(),3);
|
||||
sss.add(ddd.string(),3);
|
||||
need_recalc = true;
|
||||
@ -1009,7 +1016,6 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
adjust_fixed_scad();
|
||||
return P_OK;
|
||||
}
|
||||
@ -1480,7 +1486,8 @@ bool TPagamento::read(TTable* t, TTable* r)
|
||||
|
||||
|
||||
// set everything
|
||||
_rdiff = t->get_bool("B1");
|
||||
_a_fine_mese = t->get_bool("B2");
|
||||
_rdiff = t->get_bool("B1");
|
||||
_mcomm = t->get_bool("B0");
|
||||
_tpr = t->get_int("S3");
|
||||
_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),
|
||||
_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),
|
||||
_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;
|
||||
if (data != nullptr && *data)
|
||||
|
@ -79,6 +79,7 @@ class TPagamento : public TObject
|
||||
|
||||
bool _was_tpr4;
|
||||
bool _in_valuta; // in valuta o non
|
||||
bool _a_fine_mese;
|
||||
|
||||
char _tipocf;
|
||||
long _codcf;
|
||||
@ -141,7 +142,8 @@ public:
|
||||
char inizio_scadenza() const { return _inscad; }
|
||||
bool mese_commerciale() const { return _mcomm; }
|
||||
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 round(bool v) const { return v ? _roundval : _roundlit; }
|
||||
|
||||
@ -159,7 +161,8 @@ public:
|
||||
// con il parametro modificato
|
||||
void set_intervallo_rate(int i);
|
||||
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_percrata(int n, real r);
|
||||
void set_datarata(int n, const TDate & d);
|
||||
|
@ -5,6 +5,22 @@
|
||||
// funzione per classificare i PIM e sommare tutto cio' che contengono
|
||||
#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)
|
||||
{
|
||||
// parse CODTAB of pim record
|
||||
@ -25,17 +41,26 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
|
||||
imp = ZERO; iva = ZERO;
|
||||
bool found = false;
|
||||
|
||||
for (int i = last_tiporec + 1; i <= stop_tiporec; i++)
|
||||
|
||||
|
||||
#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; i <= stop_tiporec; i++)
|
||||
{
|
||||
tiporec tocheck = (tiporec)i;
|
||||
|
||||
switch(tocheck)
|
||||
switch (tocheck)
|
||||
{
|
||||
case acq_norm:
|
||||
//found = tipomov == 2 && tipoiva != "NS";
|
||||
found = tipomov == 2;
|
||||
found &= (tipodet == 0 /* || tipodet == 1 || tipodet == 3 ||
|
||||
tipodet == 5 || tipodet == 9 */);
|
||||
found = tipomov == 2 && tipodet == 0;
|
||||
if (found)
|
||||
{
|
||||
if (tipost) //stampa
|
||||
@ -56,8 +81,7 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
|
||||
}
|
||||
break;
|
||||
case vend_norm:
|
||||
//found = tipomov == 1 /* && corrisp == 1 */ && tipoiva != "NS";
|
||||
found = tipomov == 1 /* && corrisp == 1 */;
|
||||
found = tipomov == 1;
|
||||
if (found)
|
||||
{
|
||||
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");
|
||||
iva = pimr.get_real("R1");
|
||||
found &= (!imp.is_zero() || !iva.is_zero());
|
||||
found &= /*(*/!imp.is_zero();// || !iva.is_zero());
|
||||
}
|
||||
break;
|
||||
case vend_rimborso:
|
||||
@ -252,6 +276,5 @@ bool classify_pim(const TRectype& pimr, real& imp, real& iva, tiporec& t, bool t
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
@ -37,6 +37,21 @@ enum tiporec { acq_norm = 0, vend_norm = 1, // acquisti e vendite normali
|
||||
// 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
|
||||
// mette l'imponibile in imp, l'imposta in iva, e in t mette
|
||||
|