2005-03-31 23:41:34 +00:00
|
|
|
#include <applicat.h>
|
2005-04-01 07:09:14 +00:00
|
|
|
#include <execp.h>
|
2005-03-31 23:41:34 +00:00
|
|
|
#include <reprint.h>
|
|
|
|
|
|
|
|
#include "ca1.h"
|
|
|
|
#include "ca1400a.h"
|
2005-04-01 07:09:14 +00:00
|
|
|
#include "calib01.h"
|
2005-03-31 23:41:34 +00:00
|
|
|
#include "calib02.h"
|
|
|
|
|
2005-04-01 11:23:49 +00:00
|
|
|
class TMask_print_pdc : public TAutomask
|
|
|
|
{
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly) {return true;}
|
|
|
|
public:
|
|
|
|
TMask_print_pdc();
|
|
|
|
virtual ~TMask_print_pdc() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
TMask_print_pdc::TMask_print_pdc()
|
|
|
|
:TAutomask("ca1400a")
|
|
|
|
{
|
2005-04-20 14:48:20 +00:00
|
|
|
ca_create_fields(*this, 0, LF_PCONANA, 3, 2, F_DACONTO, F_DACONTO + 100, 0x0, "#DACONTO");
|
|
|
|
int nfields = ca_create_fields(*this, 0, LF_PCONANA, 3, 8, F_ACONTO, F_ACONTO + 100, 0x0, "#ACONTO");
|
2005-04-01 11:23:49 +00:00
|
|
|
for (int i = 0; i < nfields; i++)
|
|
|
|
{
|
2005-04-01 15:16:14 +00:00
|
|
|
TMask_field& daconto = field(F_DACONTO + i);
|
|
|
|
daconto.set_group(1);
|
|
|
|
daconto.check_type(CHECK_NORMAL);
|
|
|
|
TMask_field& aconto = field(F_ACONTO + i);
|
|
|
|
aconto.set_group(2);
|
|
|
|
aconto.check_type(CHECK_NORMAL);
|
2005-04-01 11:23:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
class TPrint_pdc : public TSkeleton_application
|
|
|
|
{
|
2005-04-01 07:09:14 +00:00
|
|
|
bool create();
|
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
public:
|
|
|
|
virtual void main_loop();
|
|
|
|
};
|
|
|
|
|
2005-04-01 07:09:14 +00:00
|
|
|
bool TPrint_pdc::create()
|
|
|
|
{
|
2005-09-16 14:52:59 +00:00
|
|
|
TConfig_anal& cfg = ca_config();
|
2005-04-12 15:54:05 +00:00
|
|
|
const TString& pdc = cfg.get("Pdci", NULL, 1);
|
|
|
|
|
|
|
|
if (pdc.blank())
|
|
|
|
{
|
|
|
|
const bool use_cg1 = cfg.get_bool("UsePdcc");
|
|
|
|
|
|
|
|
if (use_cg1)
|
|
|
|
{
|
|
|
|
TExternal_app app("cg1 -0");
|
|
|
|
app.run(true);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return error_box(TR("Il piano dei conti analitico non e' stato configurato"));
|
|
|
|
}
|
2005-04-01 07:09:14 +00:00
|
|
|
return TSkeleton_application::create();
|
|
|
|
}
|
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
void TPrint_pdc::main_loop()
|
|
|
|
{
|
|
|
|
TFilename path;
|
2005-04-01 11:23:49 +00:00
|
|
|
TMask_print_pdc m;
|
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
while (m.run() == K_ENTER)
|
|
|
|
{
|
|
|
|
TReport_book book;
|
|
|
|
TAnal_report rep;
|
2005-04-01 11:23:49 +00:00
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
path = m.get(F_REPORT);
|
|
|
|
if (path.empty())
|
2005-04-02 22:36:27 +00:00
|
|
|
path = "ca1400a";
|
2005-04-01 11:23:49 +00:00
|
|
|
rep.load(path);
|
|
|
|
rep.mask2report(m);
|
2005-03-31 23:41:34 +00:00
|
|
|
book.add(rep);
|
|
|
|
book.print_or_preview();
|
2005-04-01 11:23:49 +00:00
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int ca1400(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
TPrint_pdc a;
|
|
|
|
a.run(argc, argv, TR("Stampa piano dei conti analitica"));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|