112 lines
2.2 KiB
C++
112 lines
2.2 KiB
C++
|
#include <applicat.h>
|
||
|
#include <automask.h>
|
||
|
#include <report.h>
|
||
|
#include <strings.h>
|
||
|
|
||
|
#include "../ba/ba8500.h"
|
||
|
|
||
|
#include "../cg/cg7200a.h"
|
||
|
|
||
|
///////////////////////////////////////////////////////////
|
||
|
// Report
|
||
|
///////////////////////////////////////////////////////////
|
||
|
|
||
|
class TPrint_x_imponibile_report : public TReport
|
||
|
{
|
||
|
protected:
|
||
|
virtual bool use_mask() { return false; }
|
||
|
|
||
|
public:
|
||
|
TPrint_x_imponibile_report();
|
||
|
};
|
||
|
|
||
|
TPrint_x_imponibile_report::TPrint_x_imponibile_report()
|
||
|
{
|
||
|
load("cg7200a");
|
||
|
}
|
||
|
|
||
|
///////////////////////////////////////////////////////////
|
||
|
// Maschera
|
||
|
///////////////////////////////////////////////////////////
|
||
|
|
||
|
class TPrint_x_imponibile_mask : public TAutomask
|
||
|
{
|
||
|
protected:
|
||
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||
|
|
||
|
public:
|
||
|
void elabora();
|
||
|
TPrint_x_imponibile_mask();
|
||
|
virtual ~TPrint_x_imponibile_mask() {}
|
||
|
};
|
||
|
|
||
|
|
||
|
void TPrint_x_imponibile_mask::elabora()
|
||
|
{
|
||
|
const char tipodate = get(F_TIPODATE)[0];
|
||
|
const char tipoelenco = get(F_TIPOELENCO)[0];
|
||
|
const long codcf = get_long(F_CODCF);
|
||
|
const int anno = get_int(F_ANNO);
|
||
|
|
||
|
TString query;
|
||
|
|
||
|
if (tipodate == 'R') //per data di 'R'egistrazione
|
||
|
{
|
||
|
query << "USE MOV KEY 3";
|
||
|
query << "\nSELECT (ANNOIVA=" << anno << ")";
|
||
|
query << "\nFROM TIPO=" << tipoelenco;
|
||
|
if (codcf > 0L)
|
||
|
query << " CODCF=" << codcf;
|
||
|
query << "\nTO TIPO=" << tipoelenco;
|
||
|
if (codcf > 0L)
|
||
|
query << " CODCF=" << codcf;
|
||
|
}
|
||
|
else //per data 'D'ocumento
|
||
|
{
|
||
|
}
|
||
|
|
||
|
TPrint_x_imponibile_report rep;
|
||
|
rep.set_recordset(query);
|
||
|
|
||
|
}
|
||
|
|
||
|
bool TPrint_x_imponibile_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
TPrint_x_imponibile_mask::TPrint_x_imponibile_mask() : TAutomask("cg7200a")
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
///////////////////////////////////////////////////////////
|
||
|
// Applicazione
|
||
|
///////////////////////////////////////////////////////////
|
||
|
|
||
|
class TPrint_x_imponibile : public TKlarkKent_app
|
||
|
{
|
||
|
protected:
|
||
|
|
||
|
public:
|
||
|
virtual void main_loop();
|
||
|
};
|
||
|
|
||
|
|
||
|
void TPrint_x_imponibile::main_loop()
|
||
|
{
|
||
|
TPrint_x_imponibile_mask mask;
|
||
|
|
||
|
while (mask.run() == K_ENTER)
|
||
|
{
|
||
|
mask.elabora();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int cg7200(int argc, char* argv[])
|
||
|
{
|
||
|
TPrint_x_imponibile app;
|
||
|
app.run(argc, argv, TR("Lista fatture per imponibile"));
|
||
|
return 0;
|
||
|
}
|