Patch level : 12.00 1378
Files correlati : cg0.exe cg0800a.msk cg0900a.msk cg0800a.rep cg0900a.rep cg4.exe cg4b00a.msk cg4c00a.msk cg4b00a.rep cg4c00a.rep cgmenu.men Bug : Commento: Progressivi IVA per attività (registrazione e competenza)
This commit is contained in:
parent
383a6f7d36
commit
0f1e9ee173
@ -52,14 +52,98 @@ bool TRiepilogoIVA_mask::on_field_event(TOperable_field& o, TField_event e, long
|
|||||||
class TRiepilogoIVA_app : public TSkeleton_application
|
class TRiepilogoIVA_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
void execute_print(TAutomask & m, TReport & rep, KEY k);
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TRiepilogoIVA_app::execute_print(TAutomask & m, TReport & rep, KEY k)
|
||||||
|
{
|
||||||
|
TReport_book b;
|
||||||
|
export_type type = _export_printer;
|
||||||
|
|
||||||
|
switch (k)
|
||||||
|
{
|
||||||
|
case K_ENTER:
|
||||||
|
case K_PRINT:
|
||||||
|
type = _export_printer;
|
||||||
|
break;
|
||||||
|
case K_EXCEL:
|
||||||
|
type = _export_excel;
|
||||||
|
break;
|
||||||
|
case K_EXPORT:
|
||||||
|
type = _export_generic;
|
||||||
|
break;
|
||||||
|
case K_PDF:
|
||||||
|
type = _export_pdf;
|
||||||
|
break;
|
||||||
|
case K_TEXT:
|
||||||
|
type = _export_text;
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
case K_VISUALIZE:
|
||||||
|
type = _export_visualize;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = _export_user;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename name = m.get(DLG_OUTPUTD);
|
||||||
|
TString fname = m.get(DLG_OUTPUTF);
|
||||||
|
|
||||||
|
if (name.blank())
|
||||||
|
name.tempdir();
|
||||||
|
if (!dexist(name))
|
||||||
|
if (!make_dir(name))
|
||||||
|
{
|
||||||
|
error_box(FR("Non posso creare %s uso il direttorio temporaneo"), (const char *)name);
|
||||||
|
name.cut(0);
|
||||||
|
name.tempdir();
|
||||||
|
}
|
||||||
|
if (fname.blank())
|
||||||
|
{
|
||||||
|
TString t(20);
|
||||||
|
|
||||||
|
fname = "cg0800";
|
||||||
|
_strtime_s(t.get_buffer(), t.size());
|
||||||
|
t.strip(":");
|
||||||
|
fname << '_' << today.date2ansi() << '_' << t;
|
||||||
|
}
|
||||||
|
name.add(fname);
|
||||||
|
rep.set_export_sections(type);
|
||||||
|
b.add(rep, type);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case _export_printer:
|
||||||
|
b.print_or_preview();
|
||||||
|
break;
|
||||||
|
case _export_generic:
|
||||||
|
b.esporta();
|
||||||
|
break;
|
||||||
|
case _export_excel:
|
||||||
|
b.export_excel(name, false, true, false, '\t');
|
||||||
|
break;
|
||||||
|
case _export_pdf:
|
||||||
|
b.export_pdf(name, false, true);
|
||||||
|
break;
|
||||||
|
case _export_text:
|
||||||
|
b.export_text(name, 0, false, true);
|
||||||
|
break;
|
||||||
|
case _export_visualize:
|
||||||
|
b.preview();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TRiepilogoIVA_app::main_loop()
|
void TRiepilogoIVA_app::main_loop()
|
||||||
{
|
{
|
||||||
TRiepilogoIVA_mask m;
|
TRiepilogoIVA_mask m;
|
||||||
|
KEY k;
|
||||||
|
|
||||||
while (m.run() != K_QUIT)
|
while ((k = m.run()) != K_QUIT)
|
||||||
{
|
{
|
||||||
TRiepilogoIVA_report rep;
|
TRiepilogoIVA_report rep;
|
||||||
TFilename repname = m.get(DLG_REPORT);
|
TFilename repname = m.get(DLG_REPORT);
|
||||||
@ -68,36 +152,36 @@ void TRiepilogoIVA_app::main_loop()
|
|||||||
if (repname.blank())
|
if (repname.blank())
|
||||||
repname = "cg0800a";
|
repname = "cg0800a";
|
||||||
|
|
||||||
rep.load(repname);
|
rep.load(repname);
|
||||||
if (recset != NULL)
|
if (recset != nullptr)
|
||||||
{
|
{
|
||||||
int anno = m.get_int(F_ANNO);
|
int anno = m.get_int(F_ANNO);
|
||||||
int damese = m.get_int(F_DAMESE);
|
int damese = m.get_int(F_DAMESE);
|
||||||
int amese = m.get_int(F_AMESE);
|
int amese = m.get_int(F_AMESE);
|
||||||
|
|
||||||
recset->freeze();
|
recset->freeze();
|
||||||
recset->set_anno(anno);
|
recset->set_anno(anno);
|
||||||
|
|
||||||
if (damese == 13)
|
if (damese == 13)
|
||||||
{
|
{
|
||||||
damese = 1;
|
damese = 1;
|
||||||
amese = 12;
|
amese = 12;
|
||||||
recset->set_annual(true);
|
recset->set_annual(true);
|
||||||
}
|
}
|
||||||
recset->set_da_mese(damese);
|
recset->set_da_mese(damese);
|
||||||
recset->set_a_mese(amese);
|
recset->set_a_mese(amese);
|
||||||
|
|
||||||
const TDate da(1, damese, anno);
|
const TDate da(1, damese, anno);
|
||||||
TDate a(1, amese, anno);
|
TDate a(1, amese, anno);
|
||||||
|
|
||||||
if (m.get_long(F_DAMESE) == 13)
|
if (m.get_long(F_DAMESE) == 13)
|
||||||
a.addyear();
|
a.addyear();
|
||||||
a.set_end_month();
|
a.set_end_month();
|
||||||
recset->set_from(da);
|
recset->set_from(da);
|
||||||
recset->set_to(a);
|
recset->set_to(a);
|
||||||
rep.set_recordset(recset);
|
rep.set_recordset(recset);
|
||||||
rep.print_or_preview();
|
execute_print(m, rep, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "cg0800a.h"
|
#include "cg0800a.h"
|
||||||
|
|
||||||
#define ALL_EXPORT
|
#define EXPORT_EXCEL
|
||||||
|
#define EXPORT_PDF
|
||||||
|
#define EXPORT_TEXT
|
||||||
#define REPORT
|
#define REPORT
|
||||||
#define CLASS_NAME "cg0800a"
|
#define CLASS_NAME "cg0800a"
|
||||||
|
|
||||||
|
@ -52,14 +52,99 @@ bool TRiepilogoIVAatt_mask::on_field_event(TOperable_field& o, TField_event e, l
|
|||||||
class TRiepilogoIVAatt_app : public TSkeleton_application
|
class TRiepilogoIVAatt_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
void execute_print(TAutomask & m, TReport & rep, KEY k);
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TRiepilogoIVAatt_app::execute_print(TAutomask & m, TReport & rep, KEY k)
|
||||||
|
{
|
||||||
|
TReport_book b;
|
||||||
|
export_type type = _export_printer;
|
||||||
|
|
||||||
|
switch (k)
|
||||||
|
{
|
||||||
|
case K_ENTER:
|
||||||
|
case K_PRINT:
|
||||||
|
type = _export_printer;
|
||||||
|
break;
|
||||||
|
case K_EXCEL:
|
||||||
|
type = _export_excel;
|
||||||
|
rep.section('B', 1).find_field(90)->show(true);
|
||||||
|
break;
|
||||||
|
case K_EXPORT:
|
||||||
|
type = _export_generic;
|
||||||
|
break;
|
||||||
|
case K_PDF:
|
||||||
|
type = _export_pdf;
|
||||||
|
break;
|
||||||
|
case K_TEXT:
|
||||||
|
type = _export_text;
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
case K_VISUALIZE:
|
||||||
|
type = _export_visualize;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = _export_user;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename name = m.get(DLG_OUTPUTD);
|
||||||
|
TString fname = m.get(DLG_OUTPUTF);
|
||||||
|
|
||||||
|
if (name.blank())
|
||||||
|
name.tempdir();
|
||||||
|
if (!dexist(name))
|
||||||
|
if (!make_dir(name))
|
||||||
|
{
|
||||||
|
error_box(FR("Non posso creare %s uso il direttorio temporaneo"), (const char *)name);
|
||||||
|
name.cut(0);
|
||||||
|
name.tempdir();
|
||||||
|
}
|
||||||
|
if (fname.blank())
|
||||||
|
{
|
||||||
|
TString t(20);
|
||||||
|
|
||||||
|
fname = "cg0800";
|
||||||
|
_strtime_s(t.get_buffer(), t.size());
|
||||||
|
t.strip(":");
|
||||||
|
fname << '_' << today.date2ansi() << '_' << t;
|
||||||
|
}
|
||||||
|
name.add(fname);
|
||||||
|
rep.set_export_sections(type);
|
||||||
|
b.add(rep, type);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case _export_printer:
|
||||||
|
b.print_or_preview();
|
||||||
|
break;
|
||||||
|
case _export_generic:
|
||||||
|
b.esporta();
|
||||||
|
break;
|
||||||
|
case _export_excel:
|
||||||
|
b.export_excel(name, false, true, false, '\t');
|
||||||
|
break;
|
||||||
|
case _export_pdf:
|
||||||
|
b.export_pdf(name, false, true);
|
||||||
|
break;
|
||||||
|
case _export_text:
|
||||||
|
b.export_text(name, 0, false, true);
|
||||||
|
break;
|
||||||
|
case _export_visualize:
|
||||||
|
b.preview();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TRiepilogoIVAatt_app::main_loop()
|
void TRiepilogoIVAatt_app::main_loop()
|
||||||
{
|
{
|
||||||
TRiepilogoIVAatt_mask m;
|
TRiepilogoIVAatt_mask m;
|
||||||
|
KEY k;
|
||||||
|
|
||||||
while (m.run() != K_QUIT)
|
while ((k = m.run()) != K_QUIT)
|
||||||
{
|
{
|
||||||
TRiepilogoIVA_report rep;
|
TRiepilogoIVA_report rep;
|
||||||
TFilename repname = m.get(DLG_REPORT);
|
TFilename repname = m.get(DLG_REPORT);
|
||||||
@ -69,7 +154,7 @@ void TRiepilogoIVAatt_app::main_loop()
|
|||||||
repname = "cg0900a";
|
repname = "cg0900a";
|
||||||
|
|
||||||
rep.load(repname);
|
rep.load(repname);
|
||||||
if (recset != NULL)
|
if (recset != nullptr)
|
||||||
{
|
{
|
||||||
int anno = m.get_int(F_ANNO);
|
int anno = m.get_int(F_ANNO);
|
||||||
int damese = m.get_int(F_DAMESE);
|
int damese = m.get_int(F_DAMESE);
|
||||||
@ -112,8 +197,7 @@ void TRiepilogoIVAatt_app::main_loop()
|
|||||||
f1->field(i).hide();
|
f1->field(i).hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
execute_print(m, rep, k);
|
||||||
rep.print_or_preview();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,9 @@
|
|||||||
<postscript description="B1.0 POSTSCRIPT">#THIS @
|
<postscript description="B1.0 POSTSCRIPT">#THIS @
|
||||||
#F2.109 +!</postscript>
|
#F2.109 +!</postscript>
|
||||||
</field>
|
</field>
|
||||||
|
<field deactivated="" type="Stringa" hidden="1" link="" dynamic_height="" shade_offset="" width="5" codval="" id="90" pattern="1" hide_zero="" text="">
|
||||||
|
<source>COD[1,5]</source>
|
||||||
|
</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" />
|
||||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="1" hidden="" page_break="" can_break="" pattern="1">
|
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="1" hidden="" page_break="" can_break="" pattern="1">
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "cg0900a.h"
|
#include "cg0900a.h"
|
||||||
|
|
||||||
#define ALL_EXPORT
|
#define EXPORT_EXCEL
|
||||||
|
#define EXPORT_PDF
|
||||||
|
#define EXPORT_TEXT
|
||||||
#define REPORT
|
#define REPORT
|
||||||
#define CLASS_NAME "cg0900a"
|
#define CLASS_NAME "cg0900a"
|
||||||
|
|
||||||
|
@ -88,14 +88,98 @@ public:
|
|||||||
class TRiepilogoIVA_app : public TSkeleton_application
|
class TRiepilogoIVA_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
void execute_print(TAutomask & m, TReport & rep, KEY k);
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TRiepilogoIVA_app::execute_print(TAutomask & m, TReport & rep, KEY k)
|
||||||
|
{
|
||||||
|
TReport_book b;
|
||||||
|
export_type type = _export_printer;
|
||||||
|
|
||||||
|
switch (k)
|
||||||
|
{
|
||||||
|
case K_ENTER:
|
||||||
|
case K_PRINT:
|
||||||
|
type = _export_printer;
|
||||||
|
break;
|
||||||
|
case K_EXCEL:
|
||||||
|
type = _export_excel;
|
||||||
|
break;
|
||||||
|
case K_EXPORT:
|
||||||
|
type = _export_generic;
|
||||||
|
break;
|
||||||
|
case K_PDF:
|
||||||
|
type = _export_pdf;
|
||||||
|
break;
|
||||||
|
case K_TEXT:
|
||||||
|
type = _export_text;
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
case K_VISUALIZE:
|
||||||
|
type = _export_visualize;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = _export_user;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename name = m.get(DLG_OUTPUTD);
|
||||||
|
TString fname = m.get(DLG_OUTPUTF);
|
||||||
|
|
||||||
|
if (name.blank())
|
||||||
|
name.tempdir();
|
||||||
|
if (!dexist(name))
|
||||||
|
if (!make_dir(name))
|
||||||
|
{
|
||||||
|
error_box(FR("Non posso creare %s uso il direttorio temporaneo"), (const char *)name);
|
||||||
|
name.cut(0);
|
||||||
|
name.tempdir();
|
||||||
|
}
|
||||||
|
if (fname.blank())
|
||||||
|
{
|
||||||
|
TString t(20);
|
||||||
|
|
||||||
|
fname = "cg0800";
|
||||||
|
_strtime_s(t.get_buffer(), t.size());
|
||||||
|
t.strip(":");
|
||||||
|
fname << '_' << today.date2ansi() << '_' << t;
|
||||||
|
}
|
||||||
|
name.add(fname);
|
||||||
|
rep.set_export_sections(type);
|
||||||
|
b.add(rep, type);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case _export_printer:
|
||||||
|
b.print_or_preview();
|
||||||
|
break;
|
||||||
|
case _export_generic:
|
||||||
|
b.esporta();
|
||||||
|
break;
|
||||||
|
case _export_excel:
|
||||||
|
b.export_excel(name, false, true, false, '\t');
|
||||||
|
break;
|
||||||
|
case _export_pdf:
|
||||||
|
b.export_pdf(name, false, true);
|
||||||
|
break;
|
||||||
|
case _export_text:
|
||||||
|
b.export_text(name, 0, false, true);
|
||||||
|
break;
|
||||||
|
case _export_visualize:
|
||||||
|
b.preview();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TRiepilogoIVA_app::main_loop()
|
void TRiepilogoIVA_app::main_loop()
|
||||||
{
|
{
|
||||||
TRiepilogoIVA_mask m;
|
TRiepilogoIVA_mask m;
|
||||||
|
KEY k;
|
||||||
|
|
||||||
while (m.run() != K_QUIT)
|
while ((k = m.run()) != K_QUIT)
|
||||||
{
|
{
|
||||||
TRiepilogoIVA_report rep;
|
TRiepilogoIVA_report rep;
|
||||||
TFilename repname = m.get(DLG_REPORT);
|
TFilename repname = m.get(DLG_REPORT);
|
||||||
@ -104,7 +188,7 @@ void TRiepilogoIVA_app::main_loop()
|
|||||||
if (repname.blank())
|
if (repname.blank())
|
||||||
repname = "cg4b00a";
|
repname = "cg4b00a";
|
||||||
rep.load(repname);
|
rep.load(repname);
|
||||||
if (recset != NULL)
|
if (recset != nullptr)
|
||||||
{
|
{
|
||||||
int anno = m.get_int(F_ANNO);
|
int anno = m.get_int(F_ANNO);
|
||||||
int damese = m.get_int(F_DAMESE);
|
int damese = m.get_int(F_DAMESE);
|
||||||
@ -123,7 +207,7 @@ void TRiepilogoIVA_app::main_loop()
|
|||||||
recset->set_from(m.get_date(F_DADATA));
|
recset->set_from(m.get_date(F_DADATA));
|
||||||
recset->set_to(m.get_date(F_ADATA));
|
recset->set_to(m.get_date(F_ADATA));
|
||||||
rep.set_recordset(recset);
|
rep.set_recordset(recset);
|
||||||
rep.print_or_preview();
|
execute_print(m, rep, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "cg4c00a.h"
|
#include "cg4c00a.h"
|
||||||
|
|
||||||
#define ALL_EXPORT
|
#define EXPORT_EXCEL
|
||||||
|
#define EXPORT_PDF
|
||||||
|
#define EXPORT_TEXT
|
||||||
#define REPORT
|
#define REPORT
|
||||||
#define CLASS_NAME "cg4b00a"
|
#define CLASS_NAME "cg4b00a"
|
||||||
|
|
||||||
|
@ -88,14 +88,99 @@ public:
|
|||||||
class TRiepilogoIVAatt_app : public TSkeleton_application
|
class TRiepilogoIVAatt_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
void execute_print(TAutomask & m, TReport & rep, KEY k);
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TRiepilogoIVAatt_app::execute_print(TAutomask & m, TReport & rep, KEY k)
|
||||||
|
{
|
||||||
|
TReport_book b;
|
||||||
|
export_type type = _export_printer;
|
||||||
|
|
||||||
|
switch (k)
|
||||||
|
{
|
||||||
|
case K_ENTER:
|
||||||
|
case K_PRINT:
|
||||||
|
type = _export_printer;
|
||||||
|
break;
|
||||||
|
case K_EXCEL:
|
||||||
|
type = _export_excel;
|
||||||
|
rep.section('B', 1).find_field(90)->show(true);
|
||||||
|
break;
|
||||||
|
case K_EXPORT:
|
||||||
|
type = _export_generic;
|
||||||
|
break;
|
||||||
|
case K_PDF:
|
||||||
|
type = _export_pdf;
|
||||||
|
break;
|
||||||
|
case K_TEXT:
|
||||||
|
type = _export_text;
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
case K_VISUALIZE:
|
||||||
|
type = _export_visualize;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = _export_user;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TFilename name = m.get(DLG_OUTPUTD);
|
||||||
|
TString fname = m.get(DLG_OUTPUTF);
|
||||||
|
|
||||||
|
if (name.blank())
|
||||||
|
name.tempdir();
|
||||||
|
if (!dexist(name))
|
||||||
|
if (!make_dir(name))
|
||||||
|
{
|
||||||
|
error_box(FR("Non posso creare %s uso il direttorio temporaneo"), (const char *)name);
|
||||||
|
name.cut(0);
|
||||||
|
name.tempdir();
|
||||||
|
}
|
||||||
|
if (fname.blank())
|
||||||
|
{
|
||||||
|
TString t(20);
|
||||||
|
|
||||||
|
fname = "cg0800";
|
||||||
|
_strtime_s(t.get_buffer(), t.size());
|
||||||
|
t.strip(":");
|
||||||
|
fname << '_' << today.date2ansi() << '_' << t;
|
||||||
|
}
|
||||||
|
name.add(fname);
|
||||||
|
rep.set_export_sections(type);
|
||||||
|
b.add(rep, type);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case _export_printer:
|
||||||
|
b.print_or_preview();
|
||||||
|
break;
|
||||||
|
case _export_generic:
|
||||||
|
b.esporta();
|
||||||
|
break;
|
||||||
|
case _export_excel:
|
||||||
|
b.export_excel(name, false, true, false, '\t');
|
||||||
|
break;
|
||||||
|
case _export_pdf:
|
||||||
|
b.export_pdf(name, false, true);
|
||||||
|
break;
|
||||||
|
case _export_text:
|
||||||
|
b.export_text(name, 0, false, true);
|
||||||
|
break;
|
||||||
|
case _export_visualize:
|
||||||
|
b.preview();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TRiepilogoIVAatt_app::main_loop()
|
void TRiepilogoIVAatt_app::main_loop()
|
||||||
{
|
{
|
||||||
TRiepilogoIVAatt_mask m;
|
TRiepilogoIVAatt_mask m;
|
||||||
|
KEY k;
|
||||||
|
|
||||||
while (m.run() != K_QUIT)
|
while ((k = m.run()) != K_QUIT)
|
||||||
{
|
{
|
||||||
TRiepilogoIVA_report rep;
|
TRiepilogoIVA_report rep;
|
||||||
TFilename repname = m.get(DLG_REPORT);
|
TFilename repname = m.get(DLG_REPORT);
|
||||||
@ -104,7 +189,7 @@ void TRiepilogoIVAatt_app::main_loop()
|
|||||||
if (repname.blank())
|
if (repname.blank())
|
||||||
repname = "cg4c00a";
|
repname = "cg4c00a";
|
||||||
rep.load(repname);
|
rep.load(repname);
|
||||||
if (recset != NULL)
|
if (recset != nullptr)
|
||||||
{
|
{
|
||||||
int anno = m.get_int(F_ANNO);
|
int anno = m.get_int(F_ANNO);
|
||||||
int damese = m.get_int(F_DAMESE);
|
int damese = m.get_int(F_DAMESE);
|
||||||
@ -139,7 +224,7 @@ void TRiepilogoIVAatt_app::main_loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.set_recordset(recset);
|
rep.set_recordset(recset);
|
||||||
rep.print_or_preview();
|
execute_print(m, rep, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,6 +169,9 @@
|
|||||||
<postscript description="B1.0 POSTSCRIPT">#THIS @
|
<postscript description="B1.0 POSTSCRIPT">#THIS @
|
||||||
#F2.109 +!</postscript>
|
#F2.109 +!</postscript>
|
||||||
</field>
|
</field>
|
||||||
|
<field deactivated="" type="Stringa" hidden="1" link="" dynamic_height="" shade_offset="" width="5" codval="" id="90" pattern="1" hide_zero="" text="">
|
||||||
|
<source>COD[1,5]</source>
|
||||||
|
</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" />
|
||||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="1" hidden="" page_break="" can_break="" pattern="1">
|
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="1" hidden="" page_break="" can_break="" pattern="1">
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "cg4c00a.h"
|
#include "cg4c00a.h"
|
||||||
|
|
||||||
#define ALL_EXPORT
|
#define EXPORT_EXCEL
|
||||||
|
#define EXPORT_PDF
|
||||||
|
#define EXPORT_TEXT
|
||||||
#define REPORT
|
#define REPORT
|
||||||
#define CLASS_NAME "cg4c00a"
|
#define CLASS_NAME "cg4c00a"
|
||||||
|
|
||||||
|
@ -146,89 +146,95 @@ void TRiepilogoIVA_recordset::requery()
|
|||||||
recset.set_var("#AMESE", (long)a_mese(), true);
|
recset.set_var("#AMESE", (long)a_mese(), true);
|
||||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||||
{
|
{
|
||||||
const TRegistro & reg = cached_registro((const char *)recset.get(FIELD_NAME(LF_MOV, MOV_REG)).as_string(), anno());
|
const TString codreg = recset.get_string(FIELD_NAME(LF_MOV, MOV_REG));
|
||||||
TipoIVA t = reg.iva();
|
|
||||||
|
|
||||||
_mov_codatt = reg.attivita();
|
if (codreg.full())
|
||||||
|
|
||||||
TString16 cod = codice(recset.cursor()->curr());
|
|
||||||
|
|
||||||
if (cod.full())
|
|
||||||
{
|
{
|
||||||
long gruppo = recset.get(RMI_GRUPPO).as_int();
|
const TRegistro & reg = cached_registro(codreg, anno());
|
||||||
long conto = recset.get(RMI_CONTO).as_int();
|
|
||||||
long sottoconto = recset.get(RMI_SOTTOCONTO).as_int();
|
|
||||||
int indetr = recset.get(RMI_TIPODET).as_int();
|
|
||||||
TDate data = recset.get(FIELD_NAME(LF_MOV, MOV_DATAREG)).as_date();
|
|
||||||
const int meseliq = recset.get(FIELD_NAME(LF_MOV, MOV_MESELIQ)).as_int();
|
|
||||||
const TDate datadoc = recset.get(FIELD_NAME(LF_MOV, MOV_DATADOC)).as_date();
|
|
||||||
|
|
||||||
const bool fatt_rit_2018 = recset.get(FIELD_NAME(LF_MOV, MOV_RITFATT)).as_bool() && (data.year() >= 2018);
|
TipoIVA t = reg.iva();
|
||||||
const int year_diff = data.year() - datadoc.year();
|
|
||||||
const bool fattritind = ((t == iva_acquisti) && fatt_rit_2018) && ((year_diff > 2) || ((year_diff >= 1) && data.month() >= 5));
|
|
||||||
const bool fattrit = ((t == iva_acquisti) && !fattritind && fatt_rit_2018) && (year_diff >= 1);
|
|
||||||
|
|
||||||
if (is_competenza())
|
_mov_codatt = reg.attivita();
|
||||||
|
|
||||||
|
TString16 cod = codice(recset.cursor()->curr());
|
||||||
|
|
||||||
|
if (cod.full())
|
||||||
{
|
{
|
||||||
if (meseliq != 0)
|
long gruppo = recset.get(RMI_GRUPPO).as_int();
|
||||||
|
long conto = recset.get(RMI_CONTO).as_int();
|
||||||
|
long sottoconto = recset.get(RMI_SOTTOCONTO).as_int();
|
||||||
|
int indetr = recset.get(RMI_TIPODET).as_int();
|
||||||
|
TDate data = recset.get(FIELD_NAME(LF_MOV, MOV_DATAREG)).as_date();
|
||||||
|
const int meseliq = recset.get(FIELD_NAME(LF_MOV, MOV_MESELIQ)).as_int();
|
||||||
|
const TDate datadoc = recset.get(FIELD_NAME(LF_MOV, MOV_DATADOC)).as_date();
|
||||||
|
|
||||||
|
const bool fatt_rit_2018 = recset.get(FIELD_NAME(LF_MOV, MOV_RITFATT)).as_bool() && (data.year() >= 2018);
|
||||||
|
const int year_diff = data.year() - datadoc.year();
|
||||||
|
const bool fattritind = ((t == iva_acquisti) && fatt_rit_2018) && ((year_diff > 2) || ((year_diff >= 1) && data.month() >= 5));
|
||||||
|
const bool fattrit = ((t == iva_acquisti) && !fattritind && fatt_rit_2018) && (year_diff >= 1);
|
||||||
|
|
||||||
|
if (is_competenza())
|
||||||
{
|
{
|
||||||
if (meseliq > data.month())
|
if (meseliq != 0)
|
||||||
data.addyear(-1);
|
{
|
||||||
data.set_month(meseliq);
|
if (meseliq > data.month())
|
||||||
|
data.addyear(-1);
|
||||||
|
data.set_month(meseliq);
|
||||||
|
data.set_end_month();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fattrit)
|
||||||
|
{
|
||||||
|
data.addyear(-1);
|
||||||
|
data.set_month(12);
|
||||||
data.set_end_month();
|
data.set_end_month();
|
||||||
}
|
}
|
||||||
}
|
if (data.year() != anno() || (data.year() == anno() && (data.month() < da_mese() || data.month() > a_mese())))
|
||||||
if (fattrit)
|
continue;
|
||||||
{
|
|
||||||
data.addyear(-1);
|
|
||||||
data.set_month(12);
|
|
||||||
data.set_end_month();
|
|
||||||
}
|
|
||||||
if (data.year() != anno() || (data.year() == anno() && (data.month() < da_mese() || data.month() > a_mese())))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
TRiepilogoIVA_record * rec = (TRiepilogoIVA_record *)work_array.objptr(cod);
|
TRiepilogoIVA_record * rec = (TRiepilogoIVA_record *)work_array.objptr(cod);
|
||||||
|
|
||||||
if (rec == nullptr)
|
if (rec == nullptr)
|
||||||
work_array.add(cod, rec = new TRiepilogoIVA_record(cod));
|
work_array.add(cod, rec = new TRiepilogoIVA_record(cod));
|
||||||
if (t == iva_acquisti)
|
if (t == iva_acquisti)
|
||||||
{
|
|
||||||
if (indetr == 0)
|
|
||||||
{
|
{
|
||||||
real & r = rec->impacq();
|
if (indetr == 0)
|
||||||
r += recset.get(RMI_IMPONIBILE).as_real();
|
|
||||||
real & r1 = rec->ivaacq();
|
|
||||||
r1 += recset.get(RMI_IMPOSTA).as_real();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
real & r = rec->impacqind();
|
|
||||||
r += recset.get(RMI_IMPONIBILE).as_real();
|
|
||||||
real & r1 = rec->ivaacqind();
|
|
||||||
r1 += recset.get(RMI_IMPOSTA).as_real();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (t == iva_vendite)
|
|
||||||
{
|
|
||||||
if (reg.corrispettivi())
|
|
||||||
{
|
{
|
||||||
real & r = rec->impcorr();
|
real & r = rec->impacq();
|
||||||
r += recset.get(RMI_IMPONIBILE).as_real();
|
r += recset.get(RMI_IMPONIBILE).as_real();
|
||||||
real & r1 = rec->ivacorr();
|
real & r1 = rec->ivaacq();
|
||||||
r1 += recset.get(RMI_IMPOSTA).as_real();
|
r1 += recset.get(RMI_IMPOSTA).as_real();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
real & r = rec->impven();
|
real & r = rec->impacqind();
|
||||||
r += recset.get(RMI_IMPONIBILE).as_real();
|
r += recset.get(RMI_IMPONIBILE).as_real();
|
||||||
real & r1 = rec->ivaven();
|
real & r1 = rec->ivaacqind();
|
||||||
r1 += recset.get(RMI_IMPOSTA).as_real();
|
r1 += recset.get(RMI_IMPOSTA).as_real();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (t == iva_vendite)
|
||||||
|
{
|
||||||
|
if (reg.corrispettivi())
|
||||||
|
{
|
||||||
|
real & r = rec->impcorr();
|
||||||
|
r += recset.get(RMI_IMPONIBILE).as_real();
|
||||||
|
real & r1 = rec->ivacorr();
|
||||||
|
r1 += recset.get(RMI_IMPOSTA).as_real();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
real & r = rec->impven();
|
||||||
|
r += recset.get(RMI_IMPONIBILE).as_real();
|
||||||
|
real & r1 = rec->ivaven();
|
||||||
|
r1 += recset.get(RMI_IMPOSTA).as_real();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TString_array keys;
|
TString_array keys;
|
||||||
|
|
||||||
work_array.get_keys(keys);
|
work_array.get_keys(keys);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user