114 lines
2.6 KiB
C++
114 lines
2.6 KiB
C++
|
#include <applicat.h>
|
||
|
#include <automask.h>
|
||
|
#include <form.h>
|
||
|
#include <report.h>
|
||
|
#include <reprint.h>
|
||
|
#include <tabutil.h>
|
||
|
#include <textset.h>
|
||
|
|
||
|
#include "co2.h"
|
||
|
#include "co2400a.h"
|
||
|
|
||
|
#include "socicoop.h"
|
||
|
|
||
|
#include "..\ve\velib.h"
|
||
|
#include "..\ve\velib07.h"
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////
|
||
|
// MASCHERA
|
||
|
////////////////////////////////////////////////////////
|
||
|
class TRegistroCS_mask : public TAutomask
|
||
|
{
|
||
|
protected:
|
||
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||
|
public:
|
||
|
TRegistroCS_mask();
|
||
|
virtual ~TRegistroCS_mask() {};
|
||
|
};
|
||
|
|
||
|
TRegistroCS_mask::TRegistroCS_mask() :TAutomask ("co2400a")
|
||
|
{
|
||
|
}
|
||
|
|
||
|
bool TRegistroCS_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
/////////////////////////////////////////////////////////////
|
||
|
// REPORT
|
||
|
/////////////////////////////////////////////////////////////
|
||
|
class TRegistroCS_report : public TReport
|
||
|
{
|
||
|
protected:
|
||
|
virtual bool use_mask() { return false; }
|
||
|
public:
|
||
|
TRegistroCS_report() {}
|
||
|
};
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////
|
||
|
// APPLICAZIONE
|
||
|
////////////////////////////////////////////////////////
|
||
|
|
||
|
class TRegistroCS : public TSkeleton_application
|
||
|
{
|
||
|
public:
|
||
|
virtual void main_loop();
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////
|
||
|
// APPLICAZIONE
|
||
|
////////////////////////////////////////////////////////
|
||
|
|
||
|
class TEstrattoConto : public TSkeleton_application
|
||
|
{
|
||
|
public:
|
||
|
virtual void main_loop();
|
||
|
};
|
||
|
|
||
|
void TEstrattoConto::main_loop()
|
||
|
{
|
||
|
TRegistroCS_mask m;
|
||
|
while (m.run() == K_ENTER)
|
||
|
{
|
||
|
TReport_book book;
|
||
|
TRegistroCS_report rep;
|
||
|
if (rep.load("co2400a"))
|
||
|
{
|
||
|
const TString8 codnum = m.get(F_CODNUM);
|
||
|
const TString8 tipodoc = m.get(F_TIPODOC);
|
||
|
const int anno = m.get_int(F_ANNO);
|
||
|
const int perc = m.get_int(F_PERC);
|
||
|
|
||
|
// creo recordset dei soci da stampare
|
||
|
TISAM_recordset soci("USE SOCICOOP\nFROM CODCF=#DASOCIO\nTO CODCF=#ASOCIO");
|
||
|
soci.set_var("#DASOCIO", m.get_long(F_DASOCIO));
|
||
|
soci.set_var("#ASOCIO", m.get_long(F_ASOCIO));
|
||
|
|
||
|
for (bool ok = soci.move_first(); ok; ok = soci.move_next())
|
||
|
{
|
||
|
TRecordset* r = rep.recordset();
|
||
|
long codcf = soci.get(SC_CODCF).as_int();
|
||
|
r->set_var("#SOCIO", soci.get("CODCF"));
|
||
|
r->set_var("#ANNO", TVariant(long(anno)));
|
||
|
r->set_var("#CODNUM", codnum);
|
||
|
r->set_var("#TIPODOC", tipodoc);
|
||
|
r->set_var("#PERC", TVariant(long(perc)), true);
|
||
|
book.add(rep);
|
||
|
}
|
||
|
book.print_or_preview();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int co2400(int argc, char* argv[])
|
||
|
{
|
||
|
TEstrattoConto a;
|
||
|
a.run(argc, argv, TR("Stampa registro carico e scarico"));
|
||
|
return 0;
|
||
|
}
|