2005-06-29 14:34:28 +00:00
|
|
|
|
#include <applicat.h>
|
|
|
|
|
#include <execp.h>
|
|
|
|
|
#include <progind.h>
|
|
|
|
|
#include <reprint.h>
|
2005-07-07 17:25:53 +00:00
|
|
|
|
#include <doc.h>
|
|
|
|
|
#include <rdoc.h>
|
2005-07-15 17:29:53 +00:00
|
|
|
|
#include "../cg/cg2103.h"
|
|
|
|
|
#include "../cg/cglib01.h"
|
2005-07-07 17:25:53 +00:00
|
|
|
|
#include "../ve/velib04.h"
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
#include "panapdc.h"
|
2005-06-29 14:34:28 +00:00
|
|
|
|
#include "pconana.h"
|
|
|
|
|
#include "movana.h"
|
|
|
|
|
#include "rmovana.h"
|
|
|
|
|
|
|
|
|
|
#include "ca3.h"
|
|
|
|
|
#include "ca3700.h"
|
|
|
|
|
#include "calib01.h"
|
|
|
|
|
#include "calib02.h"
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
// MASCHERA
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
class TPrint_rendiconto_ca_mask : public TAutomask
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
2005-06-29 15:12:31 +00:00
|
|
|
|
const TString& get_report_class() const;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
bool test_compatible_report();
|
2005-07-19 11:05:25 +00:00
|
|
|
|
|
|
|
|
|
bool esistono_riclassificazioni() const;
|
|
|
|
|
void create_sheet();
|
|
|
|
|
int create_sheet_fields(int lf, int& y, short& dlg, bool required);
|
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
public:
|
|
|
|
|
TPrint_rendiconto_ca_mask();
|
|
|
|
|
virtual ~TPrint_rendiconto_ca_mask() {}
|
|
|
|
|
};
|
|
|
|
|
|
2005-06-29 15:12:31 +00:00
|
|
|
|
const TString& TPrint_rendiconto_ca_mask::get_report_class() const
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-06-29 15:12:31 +00:00
|
|
|
|
TString& classe = get_tmp_string();
|
|
|
|
|
classe = "ca3700a";
|
|
|
|
|
return classe;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TPrint_rendiconto_ca_mask::test_compatible_report()
|
|
|
|
|
{
|
2005-07-19 11:05:25 +00:00
|
|
|
|
const TString& cls = get_report_class();
|
2005-06-29 14:34:28 +00:00
|
|
|
|
const TString& name = get(F_REPORT);
|
|
|
|
|
bool ok = name.not_empty();
|
|
|
|
|
if (ok)
|
|
|
|
|
{
|
|
|
|
|
TReport rep;
|
|
|
|
|
ok = rep.load(name);
|
|
|
|
|
if (ok)
|
|
|
|
|
{
|
2005-06-29 15:12:31 +00:00
|
|
|
|
const TString& classe = rep.get_class();
|
2005-07-19 11:05:25 +00:00
|
|
|
|
ok = classe == cls;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!ok)
|
|
|
|
|
{
|
2005-07-19 11:05:25 +00:00
|
|
|
|
set(F_REPORT, cls);
|
|
|
|
|
TFilename path = cls;
|
|
|
|
|
path.ext("rep");
|
|
|
|
|
ok = path.custom_path();
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
return ok;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TPrint_rendiconto_ca_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|
|
|
|
{
|
|
|
|
|
switch (o.dlg())
|
|
|
|
|
{
|
|
|
|
|
case F_REPORT:
|
|
|
|
|
if (e == fe_button)
|
|
|
|
|
{
|
2005-06-29 15:12:31 +00:00
|
|
|
|
const TString8 lib = get_report_class();
|
2005-06-29 14:34:28 +00:00
|
|
|
|
TFilename path = o.get();
|
|
|
|
|
if (select_custom_file(path, "rep", lib))
|
|
|
|
|
{
|
|
|
|
|
path = path.name();
|
|
|
|
|
path.ext("");
|
|
|
|
|
o.set(path);
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
if (e == fe_close)
|
|
|
|
|
{
|
|
|
|
|
if (!test_compatible_report())
|
2005-07-19 11:05:25 +00:00
|
|
|
|
return error_box("Impossibile trovare un report compatibile");
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2005-07-19 11:05:25 +00:00
|
|
|
|
case F_PRE1:
|
|
|
|
|
case F_PRE2:
|
|
|
|
|
case F_PRE3:
|
|
|
|
|
if ((e == fe_init || e == fe_modify) && o.active())
|
|
|
|
|
{
|
|
|
|
|
const int k = o.dlg()-F_PRE1;
|
|
|
|
|
set(F_PAN1_INI + k, o.get(), 0x2);
|
|
|
|
|
disable(F_PAN1_INI + k);
|
|
|
|
|
disable(F_PANDES1_INI + k);
|
|
|
|
|
|
|
|
|
|
set(F_PAN1_FIN + k, o.get(), 0x2);
|
|
|
|
|
disable(F_PAN1_FIN + k);
|
|
|
|
|
disable(F_PANDES1_FIN + k);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
int TPrint_rendiconto_ca_mask::create_sheet_fields(int lf, int& y, short& dlg, bool required)
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
|
|
|
|
TSheet_field& sf = sfield(F_RIGHE);
|
|
|
|
|
TMask& sm = sf.sheet_mask();
|
|
|
|
|
|
|
|
|
|
const int h = ca_create_fields(sm, 0, lf, 1, y, dlg, dlg+50);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < h; i++)
|
|
|
|
|
{
|
|
|
|
|
TEdit_field& fld = sm.efield(dlg+i);
|
|
|
|
|
int logic = lf;
|
|
|
|
|
if (logic == LF_FASI)
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
|
|
|
|
if (fasinfo.parent() != 0)
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& parinfo = ca_multilevel_code_info(fasinfo.parent());
|
|
|
|
|
if (i < parinfo.levels())
|
|
|
|
|
logic = fasinfo.parent();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char* fieldname = NULL;
|
|
|
|
|
switch(logic)
|
|
|
|
|
{
|
|
|
|
|
case LF_CDC : fieldname = RMOVANA_CODCCOSTO; break;
|
|
|
|
|
case LF_COMMESSE: fieldname = RMOVANA_CODCMS; break;
|
|
|
|
|
case LF_FASI : fieldname = RMOVANA_CODFASE; break;
|
|
|
|
|
default : fieldname = RMOVANA_CODCONTO; break;
|
|
|
|
|
}
|
|
|
|
|
TFieldref* f = (TFieldref*)fld.field();
|
|
|
|
|
f->set_name(fieldname);
|
|
|
|
|
|
|
|
|
|
fld.check_type(required ? CHECK_REQUIRED : CHECK_NORMAL);
|
|
|
|
|
|
|
|
|
|
TEdit_field& dfld = sm.efield(dlg+50+i);
|
|
|
|
|
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output!
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
y += h+1;
|
|
|
|
|
dlg += h;
|
|
|
|
|
|
|
|
|
|
return h;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
void TPrint_rendiconto_ca_mask::create_sheet()
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
|
|
|
|
TSheet_field& sf = sfield(F_RIGHE);
|
|
|
|
|
TMask& sm = sf.sheet_mask();
|
|
|
|
|
sm.hide(-1);
|
|
|
|
|
|
|
|
|
|
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
|
|
|
|
|
|
|
|
|
TConfig_anal ini;
|
|
|
|
|
const bool fsc_req = ini.get_bool("FscRequired");
|
|
|
|
|
|
|
|
|
|
int y = 1;
|
|
|
|
|
short dlg = S_CDC1 + 100; // id del primo campo da generare
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
|
|
{
|
|
|
|
|
const TString& level = ini.get("Level", NULL, i+1); // Legge il livello 1 o 2
|
|
|
|
|
if (level == "CDC") // Crea centro di costo
|
|
|
|
|
{
|
|
|
|
|
if (fasinfo.parent() == LF_CDC)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
create_sheet_fields(LF_FASI, y, dlg, fsc_req);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const bool cdc_req = ini.get_bool("CdcRequired");
|
2005-07-19 11:05:25 +00:00
|
|
|
|
create_sheet_fields(LF_CDC, y, dlg, cdc_req);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
if (level == "CMS") // Crea commessa
|
|
|
|
|
{
|
|
|
|
|
if (fasinfo.parent() == LF_COMMESSE)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
create_sheet_fields(LF_FASI, y, dlg, fsc_req);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const bool cms_req = ini.get_bool("CmsRequired");
|
2005-07-19 11:05:25 +00:00
|
|
|
|
create_sheet_fields(LF_COMMESSE, y, dlg, cms_req);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
create_sheet_fields(LF_FASI, y, dlg, fsc_req);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
for (short id = S_CDC12+100; id >= S_CDC1+100; id--)
|
|
|
|
|
{
|
|
|
|
|
const int pos = sm.id2pos(id);
|
|
|
|
|
if (pos >= 0)
|
|
|
|
|
{
|
|
|
|
|
TMask_field& f = sm.fld(pos);
|
|
|
|
|
const int size = f.size();
|
|
|
|
|
const TString& prompt = f.prompt();
|
|
|
|
|
sf.set_column_header(id, prompt);
|
|
|
|
|
sf.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD));
|
|
|
|
|
sf.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
sf.delete_column(id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
bool TPrint_rendiconto_ca_mask::esistono_riclassificazioni() const
|
|
|
|
|
{
|
|
|
|
|
TLocalisamfile ric(LF_PANAPDC);
|
|
|
|
|
return ric.first() == NOERR;
|
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
TPrint_rendiconto_ca_mask::TPrint_rendiconto_ca_mask()
|
|
|
|
|
:TAutomask("ca3700")
|
|
|
|
|
{
|
|
|
|
|
TConfig_anal cfg;
|
|
|
|
|
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
const int pconana_levels = pconana_info.levels();
|
|
|
|
|
|
|
|
|
|
int pconana_prefix = cfg.get_int("PdcPrefix");
|
|
|
|
|
if (pconana_prefix >= pconana_levels)
|
|
|
|
|
pconana_prefix = pconana_levels-1;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
disable(F_PIANO);
|
|
|
|
|
set(F_PIANO, use_pdcc ? "C" : "A");
|
|
|
|
|
|
|
|
|
|
// Controllo se voglio (e posso) usare il conto analitico come prefisso di quello contabile
|
|
|
|
|
const int pref = cfg.get_int("PdcPrefix");
|
|
|
|
|
if (use_pdcc && pref > 0)
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
const int levels = info.levels();
|
|
|
|
|
if (levels >= 2 && pref < levels && esistono_riclassificazioni())
|
|
|
|
|
{
|
|
|
|
|
enable(F_PIANO);
|
|
|
|
|
ca_create_fields(*this, 0, LF_PCONANA, 2, 4, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO);
|
|
|
|
|
|
|
|
|
|
// Nascondi i campi che non fanno parte del prefisso
|
|
|
|
|
for (int i = 0; i < levels; i++)
|
|
|
|
|
{
|
|
|
|
|
if (i < pref)
|
|
|
|
|
{
|
|
|
|
|
field(F_PRE1 + i).check_type(CHECK_REQUIRED);
|
|
|
|
|
field(F_PRE1 + i).set_group(6);
|
|
|
|
|
field(F_PREDES1 + i).set_group(6);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
field(F_PRE1 + i).hide();
|
|
|
|
|
field(F_PREDES1 + i).hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int g = 5; g <= 6; g++)
|
|
|
|
|
{
|
|
|
|
|
const int logicnum = g == 5 ? LF_PCON : LF_PCONANA;
|
|
|
|
|
const short da_dlg = g == 5 ? F_PDC1_INI : F_PAN1_INI;
|
|
|
|
|
const short da_des = g == 5 ? F_PDCDES1_INI : F_PANDES1_INI;
|
|
|
|
|
const short a_dlg = g == 5 ? F_PDC1_FIN : F_PAN1_FIN;
|
|
|
|
|
const short a_des = g == 5 ? F_PDCDES1_FIN : F_PANDES1_FIN;
|
|
|
|
|
|
|
|
|
|
const int nfields = ca_create_fields(*this, 0, logicnum, 2, 9, da_dlg, da_des, 0x0, PCONANA_CODCONTO);
|
|
|
|
|
ca_create_fields(*this, 0, logicnum, 2, 14, a_dlg, a_des, 0x0, PCONANA_CODCONTO);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < nfields; i++)
|
|
|
|
|
{
|
|
|
|
|
TMask_field& daconto = field(da_dlg + i);
|
|
|
|
|
daconto.set_group(1);
|
|
|
|
|
daconto.set_group(4);
|
|
|
|
|
daconto.set_group(g);
|
2005-07-25 13:29:11 +00:00
|
|
|
|
daconto.check_type(CHECK_SEARCH);
|
2005-07-19 11:05:25 +00:00
|
|
|
|
|
|
|
|
|
field(da_des+i).set_group(4);
|
|
|
|
|
field(da_des+i).set_group(g);
|
|
|
|
|
|
|
|
|
|
TMask_field& aconto = field(a_dlg + i);
|
|
|
|
|
aconto.set_group(2);
|
|
|
|
|
aconto.set_group(4);
|
|
|
|
|
aconto.set_group(g);
|
2005-07-25 13:29:11 +00:00
|
|
|
|
aconto.check_type(CHECK_SEARCH);
|
2005-07-19 11:05:25 +00:00
|
|
|
|
|
|
|
|
|
field(a_des+i).set_group(4);
|
|
|
|
|
field(a_des+i).set_group(g);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// creazione dei campi della seconda pagina della maschera (cdc/cms/fasi)
|
|
|
|
|
create_sheet();
|
|
|
|
|
// setta gli handlers a tutti i campi generati della maschera;senza questa chiamata la on_field_event
|
|
|
|
|
// non puo' funzionare sui campi generati!!!
|
|
|
|
|
set_handlers();
|
|
|
|
|
|
|
|
|
|
//la terza pagina ha uno sheet standard e non necessita di metodi per la creazione
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
2005-07-07 17:25:53 +00:00
|
|
|
|
// RECORDSET
|
2005-06-29 14:34:28 +00:00
|
|
|
|
///////////////////////////////////////////////////////////////
|
2005-07-15 17:29:53 +00:00
|
|
|
|
#define IMPEGNATO 1
|
|
|
|
|
#define MATURATO 2
|
|
|
|
|
#define FATTURATO 4
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
class TPrint_rendiconto_ca_recordset : public TISAM_recordset
|
|
|
|
|
{
|
2005-07-07 17:25:53 +00:00
|
|
|
|
TExternisamfile* _tmp;
|
2005-07-21 17:37:47 +00:00
|
|
|
|
bool _riclassificato;
|
|
|
|
|
TString _prefix, _da_conto_riclas, _a_conto_riclas;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
protected:
|
|
|
|
|
int _anno;
|
|
|
|
|
int _tipoconti;
|
|
|
|
|
TDate _dadata, _adata;
|
|
|
|
|
long _danumreg, _anumreg;
|
|
|
|
|
TString _daconto, _aconto, _codcosto, _codcms, _codfas;
|
|
|
|
|
|
|
|
|
|
protected: //da libreria
|
|
|
|
|
virtual const TVariant& get(const char* column_name) const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
static bool mov_filter(const TRelation* rel);
|
|
|
|
|
bool valid_record(const TRelation& rel) const;
|
|
|
|
|
virtual void set_custom_filter(TCursor& cur) const;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
|
|
|
|
void crea_righe_rmovana();
|
|
|
|
|
void crea_righe_rdoc(const TPrint_rendiconto_ca_mask& msk);
|
|
|
|
|
void crea_trr(const TFilename& trr) const;
|
2005-07-15 17:29:53 +00:00
|
|
|
|
void salva_rmovana(const TRectype& rmovana, const TRectype& movana, const TDocumento* doc);
|
2005-07-11 17:45:52 +00:00
|
|
|
|
real somma_budget(const TString& codconto, const char* tipomovana);
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual void set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row);
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
TPrint_rendiconto_ca_recordset(const TString& sql) : TISAM_recordset(sql), _riclassificato(false) { _tmp = NULL;}
|
2005-07-14 17:47:24 +00:00
|
|
|
|
~TPrint_rendiconto_ca_recordset() {}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
static const TPrint_rendiconto_ca_recordset* myself = NULL;
|
|
|
|
|
|
2005-07-11 17:45:52 +00:00
|
|
|
|
TPrint_rendiconto_ca_recordset* rendiconto_recordset() { return (TPrint_rendiconto_ca_recordset* ) myself;}
|
|
|
|
|
|
2005-07-22 15:05:35 +00:00
|
|
|
|
/*//metodo per riconoscere se il record corrente soddisfa i filtri della maschera...strafighissimo!
|
2005-06-29 14:34:28 +00:00
|
|
|
|
bool TPrint_rendiconto_ca_recordset::valid_record(const TRelation& rel) const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
2005-07-22 15:05:35 +00:00
|
|
|
|
}*/
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-22 15:05:35 +00:00
|
|
|
|
/*bool TPrint_rendiconto_ca_recordset::mov_filter(const TRelation* rel)
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
|
|
|
|
return myself->valid_record(*rel);
|
2005-07-22 15:05:35 +00:00
|
|
|
|
}*/
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const
|
|
|
|
|
{
|
2005-07-14 17:47:24 +00:00
|
|
|
|
relation()->replace(_tmp); //sostituisce il vero file rmovana con quello temporaneo
|
|
|
|
|
|
|
|
|
|
//filtro sul file esterno (_tmp, cio<69> 1000) sui conti selezionati sulla maschera
|
|
|
|
|
TRectype darec(cur.curr()), arec(cur.curr()); //curr perch<63> <20> il file externisamfile
|
2005-07-22 15:05:35 +00:00
|
|
|
|
darec.zero();
|
|
|
|
|
arec.zero();
|
2005-07-21 17:37:47 +00:00
|
|
|
|
if (!_riclassificato)
|
|
|
|
|
{
|
2005-07-22 15:05:35 +00:00
|
|
|
|
if (_daconto.not_empty())
|
|
|
|
|
darec.put("CONTO", _daconto);
|
|
|
|
|
if (_aconto.not_empty())
|
|
|
|
|
arec.put("CONTO", _aconto);
|
2005-07-21 17:37:47 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
darec.put("CONTO", _da_conto_riclas);
|
|
|
|
|
arec.put("CONTO", _a_conto_riclas);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-22 15:05:35 +00:00
|
|
|
|
//filtro sulla data(non avendo anche codnum non ho la chiave completa per mettere la data nella setregion)
|
|
|
|
|
TString filtro;
|
|
|
|
|
if (_dadata.ok())
|
|
|
|
|
filtro << "(ANSI(DATA)>=" << _dadata << ")";
|
|
|
|
|
|
|
|
|
|
if (_adata.ok())
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << "&&";
|
|
|
|
|
filtro << "(ANSI(DATA)<=" << _adata << ")";
|
|
|
|
|
}
|
2005-07-21 17:37:47 +00:00
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
cur.setregion(darec, arec);
|
2005-07-22 15:05:35 +00:00
|
|
|
|
cur.setfilter(filtro);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
myself = this;
|
2005-07-22 15:05:35 +00:00
|
|
|
|
//cur.set_filterfunction(mov_filter, true);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-11 17:45:52 +00:00
|
|
|
|
//metodo per il calcolo del budget PREVENTIVO o VARIAZIONE (sezione di raggruppamento sul report)
|
|
|
|
|
real TPrint_rendiconto_ca_recordset::somma_budget(const TString& codconto, const char* tipomovana)
|
|
|
|
|
{
|
|
|
|
|
real budget = ZERO;
|
|
|
|
|
|
|
|
|
|
TRelation rel_rmovana(LF_RMOVANA);
|
|
|
|
|
rel_rmovana.add(LF_MOVANA, "NUMREG==NUMREG");
|
|
|
|
|
|
2005-07-22 15:05:35 +00:00
|
|
|
|
//..crea un cursore su rmovana per avere solo i conti di tipo tipomovana, con il codice conto
|
2005-07-11 17:45:52 +00:00
|
|
|
|
//selezionato e la datacomp compresa nell'intervallo date
|
|
|
|
|
TRectype da_rmovana(LF_RMOVANA);
|
|
|
|
|
TRectype a_rmovana(LF_RMOVANA);
|
2005-07-25 13:29:11 +00:00
|
|
|
|
|
|
|
|
|
da_rmovana.put(RMOVANA_CODCONTO, codconto);
|
|
|
|
|
a_rmovana.put(RMOVANA_CODCONTO, codconto);
|
2005-07-22 15:05:35 +00:00
|
|
|
|
|
|
|
|
|
da_rmovana.put(RMOVANA_DATACOMP, _dadata);
|
2005-07-11 17:45:52 +00:00
|
|
|
|
a_rmovana.put(RMOVANA_DATACOMP, _adata);
|
|
|
|
|
|
|
|
|
|
TString filtro;
|
2005-07-25 13:29:11 +00:00
|
|
|
|
filtro << "(107->TIPOMOV==\"" << tipomovana << "\")";
|
2005-07-11 17:45:52 +00:00
|
|
|
|
|
|
|
|
|
TCursor cur_rmovana(&rel_rmovana, filtro, 2, &da_rmovana, &a_rmovana);
|
|
|
|
|
const long rmovana_items = cur_rmovana.items();
|
|
|
|
|
cur_rmovana.freeze();
|
|
|
|
|
|
|
|
|
|
if (rmovana_items > 0)
|
|
|
|
|
{
|
|
|
|
|
const TRectype& movana = rel_rmovana.curr(LF_MOVANA);
|
|
|
|
|
for (cur_rmovana = 0; cur_rmovana.pos() < rmovana_items; ++cur_rmovana)
|
|
|
|
|
{
|
|
|
|
|
if (movana.get_char(MOVANA_SEZIONE) == 'D')
|
|
|
|
|
budget -= movana.get_real(MOVANA_TOTDOC);
|
|
|
|
|
if (movana.get_char(MOVANA_SEZIONE) == 'A')
|
|
|
|
|
budget += movana.get_real(MOVANA_TOTDOC);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return budget;
|
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
const TVariant& TPrint_rendiconto_ca_recordset::get(const char* column_name) const
|
|
|
|
|
{
|
|
|
|
|
|
2005-07-11 17:45:52 +00:00
|
|
|
|
if (*column_name == '#')
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(column_name, "#COSTO") == 0)
|
|
|
|
|
{
|
|
|
|
|
TVariant& var = get_tmp_var();
|
|
|
|
|
var = _codcosto;
|
|
|
|
|
return var;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(column_name, "#COMMESSA") == 0)
|
|
|
|
|
{
|
|
|
|
|
TVariant& var = get_tmp_var();
|
|
|
|
|
var = _codcms;
|
|
|
|
|
return var;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(column_name, "#FASE") == 0)
|
|
|
|
|
{
|
|
|
|
|
TVariant& var = get_tmp_var();
|
|
|
|
|
var = _codfas;
|
|
|
|
|
return var;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(column_name, "#PREVENTIVO") == 0)
|
|
|
|
|
{
|
|
|
|
|
TVariant& var = get_tmp_var();
|
2005-07-25 13:29:11 +00:00
|
|
|
|
TString80 conto;
|
|
|
|
|
if (_riclassificato)
|
|
|
|
|
conto = TISAM_recordset::get("CONTOCG").as_string();
|
|
|
|
|
else
|
|
|
|
|
conto = TISAM_recordset::get("CONTO").as_string();
|
|
|
|
|
|
|
|
|
|
var = rendiconto_recordset()->somma_budget(conto, "P");
|
2005-07-11 17:45:52 +00:00
|
|
|
|
return var;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(column_name, "#VARIAZIONE") == 0)
|
|
|
|
|
{
|
|
|
|
|
TVariant& var = get_tmp_var();
|
2005-07-25 13:29:11 +00:00
|
|
|
|
TString80 conto;
|
|
|
|
|
if (_riclassificato)
|
|
|
|
|
conto = TISAM_recordset::get("CONTOCG").as_string();
|
|
|
|
|
else
|
|
|
|
|
conto = TISAM_recordset::get("CONTO").as_string();
|
|
|
|
|
|
|
|
|
|
var = rendiconto_recordset()->somma_budget(conto, "V");
|
2005-07-11 17:45:52 +00:00
|
|
|
|
return var;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
return TISAM_recordset::get(column_name);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-15 17:29:53 +00:00
|
|
|
|
void TPrint_rendiconto_ca_recordset::salva_rmovana(const TRectype& rmovana, const TRectype& movana, const TDocumento* doc)
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-07-15 17:29:53 +00:00
|
|
|
|
//serve un documento da cui ricavare i parametri di stampa
|
|
|
|
|
const bool dadoc = doc != NULL;
|
|
|
|
|
TDocumento* newdoc = (TDocumento*)doc;
|
|
|
|
|
if (newdoc == NULL && movana.get(MOVANA_DNDOC).not_empty())
|
|
|
|
|
{
|
|
|
|
|
const TString16 dacodnum = movana.get(MOVANA_DCODNUM);
|
|
|
|
|
newdoc = new TDocumento('D', movana.get_int(MOVANA_DANNO), dacodnum, movana.get_long(MOVANA_DNDOC));
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
//tipo movimento CONSUNTIVO
|
|
|
|
|
const char tipomov = movana.get_char(MOVANA_TIPOMOV);
|
2005-07-15 17:29:53 +00:00
|
|
|
|
if (tipomov <= ' ' || tipomov == 'T')
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-07-19 11:05:25 +00:00
|
|
|
|
//compila i campi da stampare
|
|
|
|
|
|
|
|
|
|
// il conto puo' essere analitico o contabile...
|
2005-07-21 17:37:47 +00:00
|
|
|
|
//se <20> compilato l'archivio di collegamento PANAPDC
|
|
|
|
|
//si deve usare come conto il campo codconto del panapdc!!!...
|
|
|
|
|
if (_riclassificato)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
{
|
2005-07-21 17:37:47 +00:00
|
|
|
|
TString conto_riclassificato; //stringa che conterr<72> il conto riclassificato (se sara' trovato)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
//prende il gruppo dalla riga rmovana in esame
|
2005-07-19 11:05:25 +00:00
|
|
|
|
const int gruppo = atoi(rmovana.get(RMOVANA_CODCONTO).left(3));
|
|
|
|
|
const int conto = atoi(rmovana.get(RMOVANA_CODCONTO).mid(3,3));
|
|
|
|
|
const long sottoconto = atol(rmovana.get(RMOVANA_CODCONTO).mid(6,6));
|
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
//relazione e cursore su panapdc alla ricerca del conto riclassificato corrispondente
|
|
|
|
|
//alla triade gr/co/sottoc di rmovana
|
|
|
|
|
TRelation rel_panapdc(LF_PANAPDC);
|
|
|
|
|
//servono solamente i record con il gruppo = al gruppo di rmovana
|
|
|
|
|
TRectype da_panapdc(LF_PANAPDC);
|
|
|
|
|
da_panapdc.put(PANAPDC_GRUPPO, gruppo);
|
|
|
|
|
|
|
|
|
|
TString filtro;
|
|
|
|
|
if (_prefix.not_empty())
|
|
|
|
|
filtro << "(CODCONTO[1," << _prefix.len() << "]=='" << _prefix << "')";
|
|
|
|
|
|
|
|
|
|
TCursor cur_panapdc(&rel_panapdc, filtro, 2, &da_panapdc, &da_panapdc);
|
|
|
|
|
const long panapdc_items = cur_panapdc.items();
|
|
|
|
|
cur_panapdc.freeze();
|
|
|
|
|
if (panapdc_items > 0) //se non ci sono record con il gruppo=rmovana.gruppo ed il prefisso voluto->salta l'rmovana
|
2005-07-19 11:05:25 +00:00
|
|
|
|
{
|
2005-07-21 17:37:47 +00:00
|
|
|
|
TRectype& rec_panapdc = cur_panapdc.curr();
|
|
|
|
|
for (cur_panapdc = 0; cur_panapdc.pos() < panapdc_items; ++cur_panapdc)
|
|
|
|
|
{
|
|
|
|
|
int current_conto = rec_panapdc.get_int(PANAPDC_CONTO);
|
|
|
|
|
long current_sottoconto = rec_panapdc.get_long(PANAPDC_SOTTOCONTO);
|
|
|
|
|
|
|
|
|
|
if (current_conto == 0 && current_sottoconto == 0)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
{
|
2005-07-21 17:37:47 +00:00
|
|
|
|
conto_riclassificato = rec_panapdc.get(PANAPDC_CODCONTO);
|
|
|
|
|
_tmp->curr().put("CONTO", conto_riclassificato);
|
|
|
|
|
break; //esce dal casino e passa ai campi successivi
|
|
|
|
|
}
|
|
|
|
|
else if (conto == current_conto && current_sottoconto == 0)
|
|
|
|
|
{
|
|
|
|
|
conto_riclassificato = rec_panapdc.get(PANAPDC_CODCONTO);
|
|
|
|
|
_tmp->curr().put("CONTO", conto_riclassificato);
|
|
|
|
|
break; //esce dal casino e passa ai campi successivi
|
2005-07-19 11:05:25 +00:00
|
|
|
|
}
|
2005-07-21 17:37:47 +00:00
|
|
|
|
else if (conto == current_conto && sottoconto == current_sottoconto)
|
|
|
|
|
{
|
|
|
|
|
conto_riclassificato = rec_panapdc.get(PANAPDC_CODCONTO);
|
|
|
|
|
_tmp->curr().put("CONTO", conto_riclassificato);
|
|
|
|
|
break; //esce dal casino e passa ai campi successivi
|
|
|
|
|
}
|
|
|
|
|
} //for sugli elementi del cursore
|
|
|
|
|
} //if panapdc_items > 0
|
|
|
|
|
|
|
|
|
|
//ATTENZIONE! Se era stata operata una selezione sui conti riclassificati nella maschera
|
|
|
|
|
//ed il conto riclassificato attuale non ricade nell'intervallo selezionato il programma
|
|
|
|
|
//non deve aggiungere il record al file!!
|
2005-07-25 13:29:11 +00:00
|
|
|
|
if ((_da_conto_riclas.not_empty() && conto_riclassificato < _da_conto_riclas) ||
|
|
|
|
|
(_a_conto_riclas.not_empty() && conto_riclassificato.compare(_a_conto_riclas, _a_conto_riclas.len()) > 0))
|
2005-07-21 17:37:47 +00:00
|
|
|
|
return;
|
2005-07-19 11:05:25 +00:00
|
|
|
|
|
|
|
|
|
}
|
2005-07-21 17:37:47 +00:00
|
|
|
|
else //...senn<6E> si usa il normale piano dei conti analitico (cio<69> tutti tranne che il CRPA)
|
2005-07-19 11:05:25 +00:00
|
|
|
|
_tmp->curr().put("CONTO", rmovana.get(RMOVANA_CODCONTO)); //conto
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-25 13:29:11 +00:00
|
|
|
|
//in ogni caso riempio il campo conto_cg
|
|
|
|
|
_tmp->curr().put("CONTOCG", rmovana.get(RMOVANA_CODCONTO)); //conto_cg
|
2005-07-22 15:05:35 +00:00
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
//i movimenti possono essere normali o generati da documento...
|
2005-07-15 17:29:53 +00:00
|
|
|
|
if (dadoc) //movimento generato da documento
|
|
|
|
|
{
|
|
|
|
|
_tmp->curr().put("CODNUM", movana.get(MOVANA_DCODNUM)); //codnum del documento che origina il movana
|
|
|
|
|
_tmp->curr().put("ANNO", movana.get(MOVANA_DANNO)); //anno del doc di origine
|
|
|
|
|
_tmp->curr().put("NUMRD", movana.get(MOVANA_DNDOC)); //numreg del movana
|
|
|
|
|
_tmp->curr().put("DATA", movana.get(MOVANA_DATADOC)); //data del documento che genera movana
|
|
|
|
|
}
|
|
|
|
|
else //movimento normale
|
|
|
|
|
{
|
|
|
|
|
_tmp->curr().put("CODNUM", movana.get(MOVANA_NUMDOC));
|
|
|
|
|
_tmp->curr().put("ANNO", movana.get(MOVANA_ANNOES)); //anno del movimento
|
|
|
|
|
_tmp->curr().put("NUMRD", movana.get(MOVANA_NUMREG)); //numreg del movana
|
|
|
|
|
_tmp->curr().put("DATA", movana.get(MOVANA_DATACOMP)); //data del movana
|
|
|
|
|
}
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-15 17:29:53 +00:00
|
|
|
|
int selettore = 0;
|
|
|
|
|
if (newdoc != NULL)
|
|
|
|
|
{
|
|
|
|
|
_tmp->curr().put("NUMDOCRIF", newdoc->get(DOC_NUMDOCRIF)); //docrif del documento originante il movana
|
|
|
|
|
_tmp->curr().put("DATADOCRIF", newdoc->get(DOC_DATADOCRIF)); //datadocrif del documento originante il movana
|
|
|
|
|
|
|
|
|
|
const int tipo_documento = newdoc->tipo().tipo();
|
|
|
|
|
int tipo_babbo = 0;
|
|
|
|
|
|
|
|
|
|
TString80 riferimento;
|
|
|
|
|
const int rows = newdoc->physical_rows();
|
|
|
|
|
for (int i = 1; riferimento.empty() && i <= rows; i++)
|
|
|
|
|
{
|
|
|
|
|
const TRiga_documento& riga = (*newdoc)[i];
|
|
|
|
|
const TRectype* babbo = riga.find_original_rdoc();
|
|
|
|
|
if (babbo != NULL)
|
|
|
|
|
{
|
|
|
|
|
const TString8 codnum = babbo->get(RDOC_CODNUM);
|
|
|
|
|
const int anno = babbo->get_int(RDOC_ANNO);
|
|
|
|
|
const long ndoc = babbo->get_long(RDOC_NDOC);
|
|
|
|
|
riferimento << codnum << '-' << anno << '-' << ndoc;
|
|
|
|
|
TDocumento doc_babbo('D', anno, codnum, ndoc);
|
|
|
|
|
tipo_babbo = doc_babbo.tipo().tipo();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (tipo_documento)
|
|
|
|
|
{
|
|
|
|
|
case TTipo_documento::_bolla:
|
|
|
|
|
selettore = MATURATO;
|
|
|
|
|
if (tipo_babbo != TTipo_documento::_ordine)
|
|
|
|
|
selettore |= IMPEGNATO;
|
|
|
|
|
break;
|
|
|
|
|
case TTipo_documento::_fattura:
|
|
|
|
|
selettore = FATTURATO;
|
|
|
|
|
if (tipo_babbo == TTipo_documento::_ordine)
|
|
|
|
|
selettore |= MATURATO;
|
|
|
|
|
else
|
|
|
|
|
selettore |= (IMPEGNATO | MATURATO);
|
|
|
|
|
break;
|
|
|
|
|
case TTipo_documento::_ordine:
|
|
|
|
|
selettore = IMPEGNATO;
|
|
|
|
|
break;
|
|
|
|
|
case TTipo_documento::_altro:
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_tmp->curr().put("DOCORIG", riferimento);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-22 15:05:35 +00:00
|
|
|
|
|
|
|
|
|
//campi comuni
|
2005-07-15 17:29:53 +00:00
|
|
|
|
_tmp->curr().put("DESC", movana.get(MOVANA_DESCR)); //descrizione movana
|
|
|
|
|
_tmp->curr().put("NRIGA", rmovana.get(RMOVANA_NUMRIG));
|
2005-07-22 12:00:50 +00:00
|
|
|
|
_tmp->curr().put("DESCRIGA", rmovana.get(RMOVANA_DESCR)); //descrizione rmovana
|
2005-07-15 17:29:53 +00:00
|
|
|
|
|
|
|
|
|
/*[Tipo documento]
|
|
|
|
|
O=I**
|
|
|
|
|
B=IM*
|
|
|
|
|
BO=*M*
|
|
|
|
|
FB=**F
|
|
|
|
|
FO=*MF
|
|
|
|
|
F=IMF*/
|
|
|
|
|
//****modificare il metodo per accelerare
|
|
|
|
|
const char sezione = rmovana.get_char(RMOVANA_SEZIONE);
|
|
|
|
|
|
|
|
|
|
TImporto imp(sezione, rmovana.get_real(RMOVANA_IMPORTO));
|
|
|
|
|
|
|
|
|
|
TCausale caus(movana.get(MOVANA_CODCAUS));
|
|
|
|
|
TipoIVA tipoiva = caus.iva();
|
|
|
|
|
char sezione_normale;
|
|
|
|
|
|
|
|
|
|
if (tipoiva == iva_vendite)
|
|
|
|
|
sezione_normale = 'A';
|
|
|
|
|
else
|
|
|
|
|
if (tipoiva == iva_acquisti)
|
|
|
|
|
sezione_normale = 'D';
|
|
|
|
|
else
|
|
|
|
|
sezione_normale = 'D'; //questo in preparazione di casi futuri
|
|
|
|
|
|
|
|
|
|
imp.normalize(sezione_normale);
|
|
|
|
|
|
|
|
|
|
if (selettore & FATTURATO)
|
|
|
|
|
_tmp->curr().put("FATTURATO", imp.valore());
|
|
|
|
|
if (selettore & MATURATO)
|
|
|
|
|
_tmp->curr().put("MATURATO", imp.valore());
|
|
|
|
|
if (selettore & IMPEGNATO)
|
|
|
|
|
_tmp->curr().put("IMPEGNATO", imp.valore());
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
|
|
|
|
_tmp->write(); // aggiunge i record al file temporaneo
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
2005-07-15 17:29:53 +00:00
|
|
|
|
if (!dadoc && newdoc != NULL)
|
|
|
|
|
delete newdoc;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
void TPrint_rendiconto_ca_recordset::crea_righe_rmovana()
|
|
|
|
|
{
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
TRelation rel_rmovana(LF_RMOVANA);
|
|
|
|
|
rel_rmovana.add(LF_MOVANA, "NUMREG==NUMREG"); //aggiunge le testate x avere tipi mov e descr
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
//..crea un cursore su rmovana per vedere se i conti selezionati hanno veri movimenti che soddisfano
|
2005-07-21 17:37:47 +00:00
|
|
|
|
//i parametri del filtro sulla maschera. ACHTUNG! Questo filtro ha senso solo se non esiste la
|
|
|
|
|
//riclassificazione!!!
|
2005-07-07 17:25:53 +00:00
|
|
|
|
TRectype da_rmovana(LF_RMOVANA);
|
|
|
|
|
TRectype a_rmovana(LF_RMOVANA);
|
2005-07-21 17:37:47 +00:00
|
|
|
|
if (!_riclassificato)
|
|
|
|
|
{
|
|
|
|
|
da_rmovana.put(RMOVANA_CODCONTO, _daconto);
|
|
|
|
|
a_rmovana.put(RMOVANA_CODCONTO, _aconto);
|
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
TString filtro;
|
2005-07-14 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
if (_dadata.ok())
|
|
|
|
|
filtro << "(ANSI(DATACOMP)>=" << _dadata.date2ansi() << ")";
|
|
|
|
|
if (_adata.ok())
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << "&&";
|
|
|
|
|
|
|
|
|
|
filtro << "(ANSI(DATACOMP)<=" << _adata.date2ansi() << ")";
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
if (_codcosto.not_empty())
|
2005-07-14 17:47:24 +00:00
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << "&&";
|
2005-07-07 17:25:53 +00:00
|
|
|
|
filtro << "(" << RMOVANA_CODCCOSTO << "==\"" << _codcosto << "\")";
|
2005-07-14 17:47:24 +00:00
|
|
|
|
}
|
2005-07-07 17:25:53 +00:00
|
|
|
|
if (_codcms.not_empty())
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << "&&";
|
|
|
|
|
filtro << "(" << RMOVANA_CODCMS << "==\"" << _codcms << "\")";
|
|
|
|
|
}
|
|
|
|
|
if (_codfas.not_empty())
|
|
|
|
|
{
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << "&&";
|
|
|
|
|
filtro << "(" << RMOVANA_CODFASE << "==\"" << _codfas << "\")";
|
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
TCursor cur_rmovana(&rel_rmovana, filtro, 2, &da_rmovana, &a_rmovana);
|
|
|
|
|
const long rmovana_items = cur_rmovana.items();
|
|
|
|
|
cur_rmovana.freeze();
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-15 17:29:53 +00:00
|
|
|
|
//scorre le righe movimenti di analitica che soddisfano il filtro
|
|
|
|
|
//il join a movana serve nel caso necessitino dati di testata per la riga in questione
|
2005-07-07 17:25:53 +00:00
|
|
|
|
if (rmovana_items > 0)
|
|
|
|
|
{
|
|
|
|
|
const TRectype& rmovana = cur_rmovana.curr();
|
|
|
|
|
const TRectype& movana = rel_rmovana.curr(LF_MOVANA);
|
2005-07-21 17:37:47 +00:00
|
|
|
|
TProgind pi(rmovana_items, "Scansione righe movimenti...");
|
2005-07-07 17:25:53 +00:00
|
|
|
|
for (cur_rmovana = 0; cur_rmovana.pos() < rmovana_items; ++cur_rmovana)
|
2005-07-21 17:37:47 +00:00
|
|
|
|
{
|
|
|
|
|
pi.addstatus(1);
|
2005-07-15 17:29:53 +00:00
|
|
|
|
salva_rmovana(rmovana, movana, NULL);
|
2005-07-21 17:37:47 +00:00
|
|
|
|
}
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
void TPrint_rendiconto_ca_recordset::crea_righe_rdoc(const TPrint_rendiconto_ca_mask& msk)
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-07-25 13:29:11 +00:00
|
|
|
|
TRelation rel_rdoc(LF_RIGHEDOC);
|
|
|
|
|
rel_rdoc.add(LF_DOC, "CODNUM==CODNUM|ANNO==ANNO|PROVV==PROVV|NDOC==NDOC"); //aggiunge le testate
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-25 13:29:11 +00:00
|
|
|
|
TRectype dardoc(LF_RIGHEDOC);
|
|
|
|
|
TRectype ardoc(LF_RIGHEDOC);
|
2005-07-07 17:25:53 +00:00
|
|
|
|
TString filtro_date;
|
|
|
|
|
|
2005-07-25 13:29:11 +00:00
|
|
|
|
dardoc.put(RDOC_PROVV, 'D');
|
|
|
|
|
ardoc.put(RDOC_PROVV, 'D');
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
|
|
|
|
//se siamo fortunati l'anno si pu<70> trovare cos<6F>..
|
|
|
|
|
int anno = msk.get_int(F_ANNO);
|
|
|
|
|
if (anno == 0 && _dadata.year() == _adata.year())
|
|
|
|
|
anno = _adata.year();
|
|
|
|
|
|
|
|
|
|
if (anno > 0)
|
|
|
|
|
{
|
2005-07-25 13:29:11 +00:00
|
|
|
|
dardoc.put(RDOC_ANNO, anno);
|
|
|
|
|
ardoc.put(RDOC_ANNO, anno);
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_dadata.ok())
|
2005-07-25 13:29:11 +00:00
|
|
|
|
filtro_date << "(ANSI(33->DATADOC)>=" << _dadata.date2ansi() << ")";
|
2005-07-07 17:25:53 +00:00
|
|
|
|
if (_adata.ok())
|
|
|
|
|
{
|
|
|
|
|
if (filtro_date.not_empty())
|
|
|
|
|
filtro_date << "&&";
|
|
|
|
|
|
2005-07-25 13:29:11 +00:00
|
|
|
|
filtro_date << "(ANSI(33->DATADOC)<=" << _adata.date2ansi() << ")";
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TContabilizzazione_analitica cont_anal; //oggetto necessario per contabilizzare il documento in osservazione
|
|
|
|
|
|
|
|
|
|
//deve filtrare per i soli documenti con codnum presente nello sheet dei codnum
|
|
|
|
|
TSheet_field& sheet = msk.sfield(F_RIGHE_NUM);
|
|
|
|
|
|
|
|
|
|
FOR_EACH_SHEET_ROW(sheet, r, row)
|
|
|
|
|
{
|
|
|
|
|
const TString4 codnum(row->get(0)); //prende il codice numerazione sulla riga
|
|
|
|
|
if (anno > 0)
|
|
|
|
|
{
|
2005-07-25 13:29:11 +00:00
|
|
|
|
dardoc.put(RDOC_CODNUM, codnum);
|
|
|
|
|
ardoc.put(RDOC_CODNUM, codnum);
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TString filtro = filtro_date;
|
|
|
|
|
if (filtro.not_empty())
|
|
|
|
|
filtro << "&&";
|
2005-07-14 17:47:24 +00:00
|
|
|
|
filtro << "(CODNUM==\"" << codnum << "\")";
|
2005-07-25 13:29:11 +00:00
|
|
|
|
filtro << "&&(33->STATO>=\"" << row->get(2) << "\")";
|
|
|
|
|
filtro << "&&(33->STATO<=\"" << row->get(3) << "\")";
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-25 13:29:11 +00:00
|
|
|
|
TCursor cur_rdoc(&rel_rdoc, filtro, 1, &dardoc, &ardoc);
|
|
|
|
|
const long rdoc_items = cur_rdoc.items();
|
|
|
|
|
cur_rdoc.freeze();
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-25 13:29:11 +00:00
|
|
|
|
if (rdoc_items > 0)
|
2005-07-07 17:25:53 +00:00
|
|
|
|
{
|
2005-07-22 12:00:50 +00:00
|
|
|
|
TString commento_progind;
|
2005-07-25 13:29:11 +00:00
|
|
|
|
commento_progind << "Scansione righe documenti " << codnum << "...";
|
|
|
|
|
TProgind pi(rdoc_items, commento_progind);
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
//scanning del file dei documenti alla ricerca di quelli che hanno la data ed il CODNUM
|
|
|
|
|
//validi nei filtri impostati dall'utente
|
2005-07-25 13:29:11 +00:00
|
|
|
|
for (cur_rdoc = 0; cur_rdoc.pos() < rdoc_items; ++cur_rdoc)
|
2005-07-21 17:37:47 +00:00
|
|
|
|
{
|
|
|
|
|
pi.addstatus(1);
|
2005-07-25 13:29:11 +00:00
|
|
|
|
TDocumento doc(cur_rdoc.curr(LF_DOC));
|
2005-07-21 17:37:47 +00:00
|
|
|
|
TAnal_mov mov;
|
|
|
|
|
cont_anal.elabora(doc, 0, NULL, false, mov);
|
|
|
|
|
for (int j = 1; j <= mov.rows(); j++)
|
|
|
|
|
{
|
|
|
|
|
salva_rmovana(mov.body()[j], mov, &doc);
|
|
|
|
|
} //for int j...
|
|
|
|
|
} //for cur_doc..
|
|
|
|
|
} //if doc_items
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
|
|
|
|
void TPrint_rendiconto_ca_recordset::crea_trr(const TFilename& trr) const
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-07-07 17:25:53 +00:00
|
|
|
|
ofstream of(trr);
|
2005-07-11 17:45:52 +00:00
|
|
|
|
of << 1000 << endl;
|
2005-07-25 13:29:11 +00:00
|
|
|
|
of << 15 << endl;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
of << "CONTO|1|20|0|Conto analitico" << endl;
|
|
|
|
|
of << "CODNUM|1|4|0|Numerazione documento" << endl;
|
|
|
|
|
of << "DATA|5|8|0|Data movimento o documento" << endl;
|
2005-07-14 17:47:24 +00:00
|
|
|
|
of << "NUMRD|3|7|0|Numero registrazione o documento" << endl;
|
2005-07-25 13:29:11 +00:00
|
|
|
|
of << "NRIGA|2|3|0|Riga movimento o documento" << endl;
|
|
|
|
|
of << "ANNO|9|4|0|Anno" << endl;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
of << "NUMDOCRIF|1|7|0|Numero documento riferimento" << endl;
|
|
|
|
|
of << "DATADOCRIF|5|8|0|Data documento riferimento" << endl;
|
|
|
|
|
of << "DESC|1|50|0|Descrizione movimento o documento" << endl;
|
|
|
|
|
of << "DESCRIGA|1|50|0|Descrizione riga movimento o documento" << endl;
|
2005-07-15 17:29:53 +00:00
|
|
|
|
of << "DOCORIG|1|20|0|Riferimento ordine/bolla" << endl;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
of << "FATTURATO|4|18|5|Fatturato" << endl;
|
|
|
|
|
of << "MATURATO|4|18|5|Maturato" << endl;
|
|
|
|
|
of << "IMPEGNATO|4|18|5|Impegnato" << endl;
|
2005-07-25 13:29:11 +00:00
|
|
|
|
of << "CONTOCG|1|12|0|Conto contabile" << endl;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
of << 1 << endl;
|
2005-07-25 13:29:11 +00:00
|
|
|
|
of << "CONTO+CODNUM+DATA+NUMRD+NRIGA" << endl;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row)
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-07-07 17:25:53 +00:00
|
|
|
|
//se esiste il file temporano con tracciato persomalizzato lo cancella e lo ricrea vuoto
|
2005-07-14 17:47:24 +00:00
|
|
|
|
TFilename trr; //file tracciato record
|
|
|
|
|
trr.tempdir();
|
|
|
|
|
trr.add("rendy");
|
|
|
|
|
TFilename dbf(trr); //file dati
|
2005-07-11 17:45:52 +00:00
|
|
|
|
|
|
|
|
|
trr.ext("trr");
|
|
|
|
|
dbf.ext("dbf");
|
2005-07-07 17:25:53 +00:00
|
|
|
|
|
|
|
|
|
//crea il file .trr in base ai parametri del metodo
|
|
|
|
|
crea_trr(trr);
|
|
|
|
|
|
|
|
|
|
if (_tmp != NULL)
|
|
|
|
|
delete _tmp;
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
_tmp = new TExternisamfile(dbf, trr);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
|
//prende un po' di dati dalla maschera...
|
2005-06-29 14:34:28 +00:00
|
|
|
|
_daconto, _aconto, _codcosto = _codcms = _codfas = "";
|
|
|
|
|
if (cms_row >= 0)
|
|
|
|
|
{
|
|
|
|
|
TSheet_field& sf = msk.sfield(F_RIGHE);
|
|
|
|
|
TMask& sm = sf.sheet_mask();
|
|
|
|
|
sf.update_mask(cms_row);
|
|
|
|
|
TRelation rel(LF_RMOVANA);
|
|
|
|
|
sm.autosave(rel);
|
|
|
|
|
_codcosto = rel.curr().get(RMOVANA_CODCCOSTO);
|
|
|
|
|
_codcms = rel.curr().get(RMOVANA_CODCMS);
|
|
|
|
|
_codfas = rel.curr().get(RMOVANA_CODFASE);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-19 11:05:25 +00:00
|
|
|
|
const char tc = msk.get(F_PIANO)[0]; // Contabile o Analitico?
|
|
|
|
|
const short dlg_da = tc == 'C' ? F_PDC1_INI : F_PAN1_INI;
|
|
|
|
|
const short dlg_al = tc == 'C' ? F_PDC1_FIN : F_PAN1_FIN;
|
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
//si utilizza la riclassificazione dei conti?
|
|
|
|
|
if (msk.get(F_PIANO) == "A")
|
|
|
|
|
_riclassificato = true;
|
|
|
|
|
else
|
|
|
|
|
_riclassificato = false;
|
|
|
|
|
|
|
|
|
|
//conti non riclassificati
|
|
|
|
|
if (!_riclassificato)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; msk.id2pos(dlg_da+i) > 0; i++)
|
|
|
|
|
{
|
|
|
|
|
_daconto << msk.get(dlg_da+i);
|
|
|
|
|
_aconto << msk.get(dlg_al+i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else //conti riclassificati
|
2005-06-29 14:34:28 +00:00
|
|
|
|
{
|
2005-07-21 17:37:47 +00:00
|
|
|
|
for (int i = 0; msk.id2pos(dlg_da+i) < 43; i++) //***43 andrebbe sostituito con una condizione + seria
|
|
|
|
|
{
|
|
|
|
|
_da_conto_riclas << msk.get(dlg_da+i);
|
|
|
|
|
_a_conto_riclas << msk.get(dlg_al+i);
|
|
|
|
|
}
|
2005-06-29 14:34:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
_dadata = msk.get_date(F_DATAINI);
|
|
|
|
|
_adata = msk.get_date(F_DATAFIN);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
if (_riclassificato)
|
|
|
|
|
{
|
|
|
|
|
//esiste un prefisso a pi<70> livelli?
|
|
|
|
|
if (msk.get(F_PRE1).not_empty())
|
|
|
|
|
{
|
|
|
|
|
_prefix << msk.get(F_PRE1);
|
|
|
|
|
if (msk.get(F_PRE2).not_empty())
|
|
|
|
|
{
|
|
|
|
|
_prefix << msk.get(F_PRE1);
|
|
|
|
|
if (msk.get(F_PRE3).not_empty())
|
|
|
|
|
_prefix << msk.get(F_PRE3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-07-07 17:25:53 +00:00
|
|
|
|
//metodo per riempire il file
|
|
|
|
|
crea_righe_rmovana();
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
crea_righe_rdoc(msk);
|
2005-06-29 14:34:28 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
// REPORT
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
class TPrint_rendiconto_ca_rep : public TAnal_report
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual bool set_recordset(const TString& sql);
|
|
|
|
|
virtual bool get_usr_val(const TString& name, TVariant& var) const;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bool TPrint_rendiconto_ca_rep::get_usr_val(const TString& name, TVariant& var) const
|
|
|
|
|
{
|
|
|
|
|
return TAnal_report::get_usr_val(name, var);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TPrint_rendiconto_ca_rep::set_recordset(const TString& sql)
|
|
|
|
|
{
|
|
|
|
|
TPrint_rendiconto_ca_recordset* rs = new TPrint_rendiconto_ca_recordset(sql);
|
|
|
|
|
return TReport::set_recordset(rs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TPrint_rendiconto_ca_rep::set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row)
|
|
|
|
|
{
|
|
|
|
|
TPrint_rendiconto_ca_recordset* recset = NULL;
|
|
|
|
|
|
2005-07-21 17:37:47 +00:00
|
|
|
|
const char* query ="USE 1000\nJOIN MOVANA INTO NUMREG==NUMRD\nJOIN RMOVANA INTO NUMREG==NUMRD NUMRIG==NRIGA";
|
2005-07-14 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
recset = new TPrint_rendiconto_ca_recordset(query);
|
|
|
|
|
|
2005-06-29 14:34:28 +00:00
|
|
|
|
recset->set_filter(msk, cms_row);
|
|
|
|
|
TAnal_report::set_recordset(recset);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
// APPLICAZIONE
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
class TPrint_rendiconto_ca : public TSkeleton_application
|
|
|
|
|
{
|
|
|
|
|
TPrint_rendiconto_ca_mask * _mask;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool create();
|
|
|
|
|
bool destroy();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual void main_loop();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bool TPrint_rendiconto_ca::create()
|
|
|
|
|
{
|
|
|
|
|
_mask = new TPrint_rendiconto_ca_mask;
|
|
|
|
|
return TSkeleton_application::create();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TPrint_rendiconto_ca::destroy()
|
|
|
|
|
{
|
|
|
|
|
delete _mask;
|
|
|
|
|
return TSkeleton_application::destroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TPrint_rendiconto_ca::main_loop()
|
|
|
|
|
{
|
|
|
|
|
while (_mask->run() == K_ENTER)
|
|
|
|
|
{
|
|
|
|
|
//costruzione della query x il report in base ai parametri della maschera
|
|
|
|
|
TSheet_field& sheet = _mask->sfield(F_RIGHE);
|
|
|
|
|
const int n_righe_sheet = sheet.items();
|
|
|
|
|
//se lo sheet <20> vuoto aggiunge una riga vuota
|
|
|
|
|
if (n_righe_sheet == 0)
|
|
|
|
|
sheet.insert();
|
|
|
|
|
|
|
|
|
|
//report e book
|
|
|
|
|
TReport_book book; //book dei report
|
|
|
|
|
TString path = _mask->get(F_REPORT);
|
|
|
|
|
if (path.empty())
|
|
|
|
|
path = "ca3700a";
|
|
|
|
|
TPrint_rendiconto_ca_rep rep;
|
|
|
|
|
rep.load(path);
|
|
|
|
|
|
|
|
|
|
FOR_EACH_SHEET_ROW(sheet, r, row)
|
|
|
|
|
{
|
|
|
|
|
rep.set_filter(*_mask, r);
|
|
|
|
|
book.add(rep);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
book.print_or_preview(); //stampa il book dei report
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ca3700(int argc, char* argv[])
|
|
|
|
|
{
|
|
|
|
|
TPrint_rendiconto_ca a;
|
|
|
|
|
a.run(argc, argv, TR("Stampa rendiconto"));
|
|
|
|
|
return 0;
|
2005-07-07 17:25:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
//Prototipi di metodi di calcolo (ricordarsi di usare come importi quelli di riga)
|
|
|
|
|
COMM = impegnato
|
|
|
|
|
ACEM = maturato
|
|
|
|
|
CONS = fatturato
|
|
|
|
|
CNTBZ = checazzoneso
|
|
|
|
|
|
|
|
|
|
//Calcolatore per tipi (AN,PN),FM
|
|
|
|
|
calcolatore (const int tipo, const int classe, const int dare)
|
|
|
|
|
{
|
|
|
|
|
const int segno = classe * dare; //essendo classe e dare = + o - 1, il segno lo si ottiene direttamente
|
|
|
|
|
if (classe == 1 && dare == -1) //unico caso in cui non rispetta il prodotto dei segni
|
|
|
|
|
{
|
|
|
|
|
I_ACEM = (I_ACEM - segno * NEW_ACEMVAL) * tipo; //tipo = 1 se AN,PN; = 0 se FM
|
|
|
|
|
I_STIMA = I_STIMA - segno * NEW_STIMAVAL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
I_ACEM = (I_ACEM + segno * NEW_ACEMVAL) * tipo;
|
|
|
|
|
I_STIMA = I_STIMA + segno * NEW_STIMAVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//questa <20> comunque sempre corretta
|
|
|
|
|
I_CNTBZ = I_CNTBZ + segno * NEW_ICNTBZVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-07-15 17:29:53 +00:00
|
|
|
|
//Calcolatore per tipi (OA,OV) -> impegnato, (BA,BV) -> maturato, (FA,FN) -> fatturato,
|
2005-07-07 17:25:53 +00:00
|
|
|
|
calcolatore (const int tipo)
|
|
|
|
|
{
|
|
|
|
|
switch (tipo):
|
|
|
|
|
case OA:
|
|
|
|
|
case OV:
|
|
|
|
|
I_COMM = I_COMM + NEW_COMMVAL;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BA:
|
|
|
|
|
case BV:
|
|
|
|
|
I_ACEM = I_ACEM + NEW_ACEMVAL;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FA:
|
|
|
|
|
case FN:
|
|
|
|
|
I_CONS = I_CONS + NEW_CONSVAL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|