2005-03-17 14:20:42 +00:00
|
|
|
|
#include "calib01.h"
|
|
|
|
|
#include "calib02.h"
|
2005-09-06 17:58:13 +00:00
|
|
|
|
#include "camask.h"
|
2005-03-17 14:20:42 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
#include <rdoc.h>
|
|
|
|
|
#include <pconti.h>
|
2005-06-27 16:35:27 +00:00
|
|
|
|
|
2005-06-23 12:16:21 +00:00
|
|
|
|
#include "movana.h"
|
2005-06-29 13:04:49 +00:00
|
|
|
|
#include "pconana.h"
|
2005-06-23 12:16:21 +00:00
|
|
|
|
#include "rmovana.h"
|
|
|
|
|
#include "saldana.h"
|
|
|
|
|
|
2005-08-08 14:08:52 +00:00
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
// TSaldanal
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
void TSaldanal::copy(const TSaldanal& sa)
|
|
|
|
|
{
|
|
|
|
|
_ini = sa._ini;
|
|
|
|
|
_dare = sa._dare;
|
|
|
|
|
_avere = sa._avere;
|
|
|
|
|
_fin = sa._fin;
|
|
|
|
|
_movimentato = sa._movimentato;
|
|
|
|
|
}
|
|
|
|
|
|
2005-06-29 13:04:49 +00:00
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
// TPconana_recordset
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TVariant& TPconana_recordset::get(const char* field) const
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TFixed_string column_name(field);
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name[0] == '#')
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name == "#CMSCDC")
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_FASI);
|
|
|
|
|
switch (info.parent())
|
|
|
|
|
{
|
|
|
|
|
case LF_CDC : return get_tmp_var() = _bill.costo();
|
|
|
|
|
case LF_COMMESSE: return get_tmp_var() = _bill.commessa();
|
|
|
|
|
default : return NULL_VARIANT;
|
|
|
|
|
}
|
2005-06-29 13:04:49 +00:00
|
|
|
|
}
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name == "#COSTO")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return get_tmp_var() = _bill.costo();
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name == "#COMMESSA")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return get_tmp_var() = _bill.commessa();
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name == "#FASE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return get_tmp_var() = _bill.fase();
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (column_name == "#DATA_INIZIALE")
|
|
|
|
|
return get_tmp_var() = _dal;
|
|
|
|
|
if (column_name == "#DATA_FINALE")
|
|
|
|
|
return get_tmp_var() = _al;
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-08-08 11:55:59 +00:00
|
|
|
|
const TRectype& curr = relation()->curr();
|
|
|
|
|
if (column_name.starts_with(PCONANA_CODCONTO))
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TString80 str;
|
|
|
|
|
if (_tipo == 'C')
|
|
|
|
|
{
|
2005-08-08 11:55:59 +00:00
|
|
|
|
const TBill b(curr);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
str = b.string(0x8);
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
str = curr.get(PCONANA_CODCONTO);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
|
|
|
|
|
if (column_name[8] == ':')
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(_tipo == 'C' ? LF_PCON : LF_PCONANA);
|
|
|
|
|
const int level = column_name[9] - '1';
|
|
|
|
|
str.cut(info.total_len(level));
|
|
|
|
|
}
|
|
|
|
|
return get_tmp_var() = str;
|
|
|
|
|
}
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name.starts_with(PCONANA_DESCR))
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TString80 str;
|
|
|
|
|
if (_tipo == 'C')
|
|
|
|
|
{
|
2005-08-08 11:55:59 +00:00
|
|
|
|
TBill b(curr);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
if (column_name[5] == ':')
|
|
|
|
|
{
|
|
|
|
|
if (column_name[6] == '1')
|
|
|
|
|
b.set(b.gruppo(), 0, 0); else
|
|
|
|
|
if (column_name[6] == '2')
|
|
|
|
|
b.set(b.gruppo(), b.conto(), 0);
|
|
|
|
|
}
|
|
|
|
|
str = b.descrizione();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (column_name[5] == ':')
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
const int level = column_name[6] - '1';
|
2005-08-08 11:55:59 +00:00
|
|
|
|
str = curr.get(PCONANA_CODCONTO);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
str.cut(info.total_len(level));
|
|
|
|
|
str = cache().get(LF_PCONANA, str, PCONANA_DESCR);
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
str = curr.get(PCONANA_DESCR);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
return get_tmp_var() = str;
|
2005-06-29 13:04:49 +00:00
|
|
|
|
}
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name == PCONANA_INDBIL)
|
|
|
|
|
{
|
|
|
|
|
long ib = curr.get_int(PCONANA_INDBIL);
|
|
|
|
|
if (ib == 0)
|
|
|
|
|
{
|
|
|
|
|
if (_tipo == 'C')
|
|
|
|
|
{
|
|
|
|
|
TBill b(curr);
|
|
|
|
|
ib = b.indicatore_bilancio();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const TString80 conto = curr.get(PCONANA_CODCONTO);
|
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
for (int i = info.levels()-2; i >= 0 && ib <= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
const TString& k = conto.left(info.total_len(i));
|
|
|
|
|
const TRectype& pca = cache().get(LF_PCONANA, conto);
|
|
|
|
|
ib = pca.get_long(PCONANA_INDBIL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return get_tmp_var() = ib;
|
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (column_name.starts_with("SALDO:"))
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-08-08 11:55:59 +00:00
|
|
|
|
TString16 sub_field = column_name.mid(6);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const char last = sub_field.right(1)[0];
|
|
|
|
|
int tipimov = 0;
|
|
|
|
|
switch (last)
|
|
|
|
|
{
|
|
|
|
|
case 'C': tipimov = _saldanal_consuntivo; sub_field.rtrim(1); break; // Consuntivo
|
|
|
|
|
case 'P':
|
|
|
|
|
case 'V': tipimov = _saldanal_preventivi; sub_field.rtrim(1); break; // Preventivo o variazione preventivo
|
|
|
|
|
default : tipimov = _tipimov; break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
((TAnal_bill&)_bill).set_conto(get(PCONANA_CODCONTO).as_string());
|
|
|
|
|
const TSaldanal& s = ca_saldo(_bill, _dal, _al, tipimov);
|
|
|
|
|
|
|
|
|
|
TVariant& var = get_tmp_var();
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (sub_field == "INI_DARE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
var = s._ini.sezione() == 'D' ? s._ini.valore() : ZERO;
|
|
|
|
|
} else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (sub_field == "INI_AVERE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
var = s._ini.sezione() == 'A' ? s._ini.valore() : ZERO;
|
|
|
|
|
} else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (sub_field == "MOV_DARE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
var = s._dare.valore();
|
|
|
|
|
} else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (sub_field == "MOV_AVERE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
var = s._avere.valore();
|
|
|
|
|
} else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (sub_field == "FIN_DARE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
var = s._fin.sezione() == 'D' ? s._fin.valore() : ZERO;
|
|
|
|
|
} else
|
2005-08-08 11:55:59 +00:00
|
|
|
|
if (sub_field == "FIN_AVERE")
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
var = s._fin.sezione() == 'A' ? s._fin.valore() : ZERO;
|
|
|
|
|
}
|
|
|
|
|
return var;
|
2005-06-29 13:04:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return TISAM_recordset::get(column_name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TPconana_recordset::valid_record(const TRelation& rel) const
|
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TString80 conto;
|
2005-09-19 10:16:43 +00:00
|
|
|
|
const TRectype& curr = rel.curr();
|
|
|
|
|
if (curr.num() == LF_PCON)
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2005-09-08 13:05:21 +00:00
|
|
|
|
const TBill b(curr);
|
2005-09-01 23:28:02 +00:00
|
|
|
|
|
2005-09-08 13:05:21 +00:00
|
|
|
|
int level = 0;
|
|
|
|
|
if (b.conto() != 0)
|
|
|
|
|
level++;
|
|
|
|
|
if (b.sottoconto() != 0)
|
|
|
|
|
level++;
|
|
|
|
|
|
|
|
|
|
(bool&)(_is_anal[level]) = curr.get_bool(PCN_ANALITICA);
|
|
|
|
|
|
|
|
|
|
if (level < 2) // Ignora gruppi e conti
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return false;
|
2005-09-06 17:35:31 +00:00
|
|
|
|
|
2005-09-08 13:05:21 +00:00
|
|
|
|
// Ignora i sottoconti non analitici nemmeno a livello di conto o gruppo
|
|
|
|
|
if (!(_is_anal[2] || _is_anal[1] || _is_anal[0]))
|
2005-09-06 17:35:31 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
conto = b.string(0x8);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-09-19 10:16:43 +00:00
|
|
|
|
conto = curr.get(PCONANA_CODCONTO);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
if (conto.len() <= _conto_minlen)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2005-06-29 13:04:49 +00:00
|
|
|
|
if (_movimentati || _nonnulli)
|
|
|
|
|
{
|
|
|
|
|
((TAnal_bill&)_bill).set_conto(conto);
|
|
|
|
|
const TSaldanal& s = ca_saldo(_bill, _dal, _al, _tipimov);
|
|
|
|
|
if (_movimentati && !s._movimentato)
|
|
|
|
|
return false;
|
2005-07-07 17:05:02 +00:00
|
|
|
|
if (_nonnulli && s._fin.is_zero())
|
2005-06-29 13:04:49 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const TPconana_recordset* _current_recset = NULL;
|
|
|
|
|
|
|
|
|
|
bool TPconana_recordset::pianoconti_filter(const TRelation* rel)
|
|
|
|
|
{ return _current_recset->valid_record(*rel); }
|
|
|
|
|
|
|
|
|
|
void TPconana_recordset::set_custom_filter(TCursor& cursor) const
|
|
|
|
|
{
|
2005-09-19 10:16:43 +00:00
|
|
|
|
const int logic = cursor.curr().num();
|
|
|
|
|
TRectype darec(logic), arec(logic);
|
|
|
|
|
if (logic == LF_PCON)
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (_da_conto.full())
|
2005-09-08 13:05:21 +00:00
|
|
|
|
{
|
|
|
|
|
darec.put(PCN_GRUPPO, _da_conto.mid(0,3));
|
|
|
|
|
darec.put(PCN_CONTO, _da_conto.mid(3,3));
|
|
|
|
|
darec.put(PCN_SOTTOCONTO, _da_conto.mid(6,6));
|
|
|
|
|
}
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (_a_conto.full())
|
2005-09-08 13:05:21 +00:00
|
|
|
|
{
|
|
|
|
|
arec.put(PCN_GRUPPO, _a_conto.mid(0,3));
|
|
|
|
|
arec.put(PCN_CONTO, _a_conto.mid(3,3));
|
|
|
|
|
arec.put(PCN_SOTTOCONTO, _a_conto.mid(6,6));
|
|
|
|
|
}
|
|
|
|
|
memset((void*)_is_anal, 0, sizeof(_is_anal)); // Azzera flags di conti analitici
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
darec.put(PCONANA_CODCONTO, _da_conto);
|
|
|
|
|
arec.put(PCONANA_CODCONTO, _a_conto);
|
|
|
|
|
}
|
2005-09-19 10:16:43 +00:00
|
|
|
|
cursor.setregion(darec, arec);
|
2005-06-29 13:04:49 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
_current_recset = this;
|
|
|
|
|
cursor.set_filterfunction(pianoconti_filter);
|
|
|
|
|
}
|
2005-06-29 13:04:49 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
void TPconana_recordset::set_tipo(char tipo)
|
|
|
|
|
{
|
|
|
|
|
if (tipo != 'A' && tipo != 'C')
|
|
|
|
|
{
|
2005-09-19 10:16:43 +00:00
|
|
|
|
TConfig& cfg = ca_config();
|
2005-07-07 17:05:02 +00:00
|
|
|
|
tipo = cfg.get_bool("UsePdcc") ? 'C' : 'A';
|
|
|
|
|
}
|
|
|
|
|
_tipo = tipo;
|
|
|
|
|
|
|
|
|
|
if (_tipo == 'A')
|
2005-06-29 13:04:49 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
set("USE PCONANA");
|
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
_conto_minlen = info.total_len(-1); // Lunghezza fino al penultimo livello
|
2005-06-29 13:04:49 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
set("USE PCON");
|
|
|
|
|
_conto_minlen = 6; // Gruppo(3)+Conto(3)
|
|
|
|
|
}
|
2005-06-29 13:04:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
void TPconana_recordset::set_filter(char tipo, const char* da_conto, const char* a_conto,
|
2005-06-29 13:04:49 +00:00
|
|
|
|
const char* costo, const char* commessa, const char* fase,
|
|
|
|
|
const TDate& dal, const TDate& al,
|
|
|
|
|
word tipimov, bool movimentati, bool nonnulli)
|
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
set_tipo(tipo);
|
2005-06-29 13:04:49 +00:00
|
|
|
|
|
|
|
|
|
_da_conto = da_conto;
|
|
|
|
|
_a_conto = a_conto;
|
|
|
|
|
|
|
|
|
|
_dal = dal;
|
|
|
|
|
_al = al;
|
|
|
|
|
|
|
|
|
|
_tipimov= tipimov;
|
|
|
|
|
_movimentati = movimentati;
|
|
|
|
|
_nonnulli = nonnulli;
|
|
|
|
|
|
|
|
|
|
_bill.reset();
|
|
|
|
|
_bill.set_costo(costo);
|
|
|
|
|
_bill.set_commessa(commessa);
|
|
|
|
|
_bill.set_fase(fase);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TPconana_recordset::TPconana_recordset(char tipo) : TISAM_recordset("USE PCONANA")
|
|
|
|
|
{
|
|
|
|
|
set_tipo(tipo);
|
|
|
|
|
}
|
2005-06-29 13:04:49 +00:00
|
|
|
|
|
2005-06-23 12:16:21 +00:00
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
// TAnal_report
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
2005-03-17 14:20:42 +00:00
|
|
|
|
size_t TAnal_report::get_usr_words(TString_array& words) const
|
|
|
|
|
{
|
|
|
|
|
TReport::get_usr_words(words);
|
|
|
|
|
|
|
|
|
|
const char* const name[] =
|
|
|
|
|
{
|
|
|
|
|
"CA_FORMAT_COSTO",
|
|
|
|
|
"CA_FORMAT_COMMESSA",
|
|
|
|
|
"CA_FORMAT_FASE",
|
|
|
|
|
"CA_FORMAT_CONTO",
|
2005-03-31 23:41:34 +00:00
|
|
|
|
"CA_FORMAT_CMSCDC",
|
2005-03-17 14:20:42 +00:00
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
((TAnal_report*)this)->_first_msg = words.items(); // Calcola il primo numero disponibile
|
|
|
|
|
size_t i;
|
|
|
|
|
for (i = 0; name[i] != NULL; i++)
|
|
|
|
|
words.add(name[i]);
|
|
|
|
|
|
|
|
|
|
return words.items();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TAnal_report::msg_format(int logicnum, TVariant_stack& stack)
|
|
|
|
|
{
|
|
|
|
|
const TString& str_in = curr_field()->get().as_string();
|
2006-02-08 13:11:11 +00:00
|
|
|
|
if (str_in.full())
|
2005-03-17 14:20:42 +00:00
|
|
|
|
{
|
2005-09-12 16:24:04 +00:00
|
|
|
|
TString8 separator = " ";
|
2005-03-17 14:20:42 +00:00
|
|
|
|
if (stack.items() > 0)
|
|
|
|
|
separator = stack.pop().as_string();
|
|
|
|
|
if (separator.not_empty())
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& mci = ca_multilevel_code_info(logicnum);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TString80 str_out = str_in;
|
|
|
|
|
for (int i = mci.levels()-2; i >= 0; i--)
|
|
|
|
|
str_out.insert(separator, mci.total_len(i));
|
2005-03-17 14:20:42 +00:00
|
|
|
|
curr_field()->set(str_out);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-12 16:24:04 +00:00
|
|
|
|
void TAnal_report::msg_format_costo(TVariant_stack& stack)
|
2005-03-17 14:20:42 +00:00
|
|
|
|
{ msg_format(LF_CDC, stack); }
|
|
|
|
|
|
|
|
|
|
void TAnal_report::msg_format_commessa(TVariant_stack& stack)
|
|
|
|
|
{ msg_format(LF_COMMESSE, stack); }
|
|
|
|
|
|
2005-09-12 16:24:04 +00:00
|
|
|
|
void TAnal_report::msg_format_fase(TVariant_stack& stack)
|
2005-03-17 14:20:42 +00:00
|
|
|
|
{ msg_format(LF_FASI, stack); }
|
|
|
|
|
|
2005-09-12 16:24:04 +00:00
|
|
|
|
void TAnal_report::msg_format_conto(TVariant_stack& stack)
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
// Cerca di determinare se si usa il piano contabile o analitico
|
2005-09-08 13:05:21 +00:00
|
|
|
|
const TString& conto = curr_field()->get().as_string();
|
2005-09-12 16:24:04 +00:00
|
|
|
|
if (conto.len() == 12 && real::is_natural(conto))
|
2005-07-07 17:05:02 +00:00
|
|
|
|
msg_format(LF_PCON, stack);
|
2005-09-08 13:05:21 +00:00
|
|
|
|
else
|
|
|
|
|
msg_format(LF_PCONANA, stack);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
2005-03-17 14:20:42 +00:00
|
|
|
|
|
2005-03-31 23:41:34 +00:00
|
|
|
|
void TAnal_report::msg_format_commessa_costo(TVariant_stack& stack)
|
|
|
|
|
{
|
2005-09-12 16:24:04 +00:00
|
|
|
|
const TMultilevel_code_info& fas_info = ca_multilevel_code_info(LF_FASI);
|
|
|
|
|
const int pa = fas_info.parent();
|
|
|
|
|
if (pa > 0)
|
|
|
|
|
msg_format(pa, stack);
|
2005-03-31 23:41:34 +00:00
|
|
|
|
}
|
2005-06-21 11:46:26 +00:00
|
|
|
|
|
|
|
|
|
bool TAnal_report::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
|
|
|
|
|
{
|
2005-09-19 10:16:43 +00:00
|
|
|
|
bool ok = true;
|
|
|
|
|
if (opcode >= _first_msg)
|
2005-06-21 11:46:26 +00:00
|
|
|
|
{
|
2005-09-19 10:16:43 +00:00
|
|
|
|
opcode -= _first_msg;
|
|
|
|
|
switch (opcode)
|
|
|
|
|
{
|
|
|
|
|
case 0 : msg_format_costo(stack); break;
|
|
|
|
|
case 1 : msg_format_commessa(stack); break;
|
|
|
|
|
case 2 : msg_format_fase(stack); break;
|
|
|
|
|
case 3 : msg_format_conto(stack); break;
|
|
|
|
|
case 4 : msg_format_commessa_costo(stack); break;
|
|
|
|
|
default: ok = false; break;
|
|
|
|
|
}
|
2005-06-21 11:46:26 +00:00
|
|
|
|
}
|
2005-09-19 10:16:43 +00:00
|
|
|
|
else
|
|
|
|
|
ok = TReport::execute_usr_word(opcode, stack);
|
|
|
|
|
return ok;
|
2005-06-21 11:46:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
// TAnal_bill
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
int TAnal_bill::compare(const TSortable& s) const
|
|
|
|
|
{
|
|
|
|
|
const TAnal_bill& b = (const TAnal_bill&)s;
|
|
|
|
|
int cmp = _conto.compare(b._conto);
|
|
|
|
|
if (cmp == 0)
|
|
|
|
|
{
|
|
|
|
|
cmp = _costo.compare(b._costo);
|
|
|
|
|
if (cmp == 0)
|
|
|
|
|
{
|
|
|
|
|
cmp = _commessa.compare(b._commessa);
|
|
|
|
|
if (cmp == 0)
|
|
|
|
|
cmp = _fase.compare(b._fase);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return cmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TAnal_bill::match(const TAnal_bill& b) const
|
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b._conto.full() && _conto != b._conto)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
return false;
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b._costo.full() && _costo != b._costo)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
return false;
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b._commessa.full() && _commessa != b._commessa)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
return false;
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b._fase.full() && _fase != b._fase)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TAnal_bill::set_conto(const char* c)
|
|
|
|
|
{ _conto = c; _conto.trim(); }
|
|
|
|
|
|
|
|
|
|
void TAnal_bill::set_costo(const char* c)
|
|
|
|
|
{ _costo = c; _costo.trim(); }
|
|
|
|
|
|
|
|
|
|
void TAnal_bill::set_commessa(const char* c)
|
|
|
|
|
{ _commessa = c; _commessa.trim(); }
|
|
|
|
|
|
|
|
|
|
void TAnal_bill::set_fase(const char* c)
|
|
|
|
|
{ _fase = c; _fase.trim(); }
|
|
|
|
|
|
|
|
|
|
const TString& TAnal_bill::conto() const
|
|
|
|
|
{ return _conto; }
|
|
|
|
|
|
|
|
|
|
const TString& TAnal_bill::costo() const
|
|
|
|
|
{ return _costo; }
|
|
|
|
|
|
|
|
|
|
const TString& TAnal_bill::commessa() const
|
|
|
|
|
{ return _commessa; }
|
|
|
|
|
|
|
|
|
|
const TString& TAnal_bill::fase() const
|
|
|
|
|
{ return _fase; }
|
|
|
|
|
|
|
|
|
|
void TAnal_bill::reset()
|
|
|
|
|
{
|
|
|
|
|
_conto = _costo = _commessa = _fase = "";
|
|
|
|
|
}
|
|
|
|
|
|
2007-03-15 15:57:26 +00:00
|
|
|
|
TIndbil TAnal_bill::indicatore_bilancio() const
|
2005-09-12 13:25:55 +00:00
|
|
|
|
{
|
2007-03-15 15:57:26 +00:00
|
|
|
|
TIndbil indbil = ib_null;
|
2005-09-12 13:25:55 +00:00
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
|
2007-03-15 15:57:26 +00:00
|
|
|
|
TString80 conto = _conto; // Codice conto da affettare in sottolivelli
|
|
|
|
|
for (int i = info.levels() - 1; i >= 0 && indbil == ib_null; i--)
|
2005-09-12 13:25:55 +00:00
|
|
|
|
{
|
2007-03-15 15:57:26 +00:00
|
|
|
|
conto.cut(info.total_len(i));
|
|
|
|
|
const TRectype& pconana = cache().get(LF_PCONANA, conto);
|
|
|
|
|
indbil = TIndbil(pconana.get_int(PCONANA_INDBIL));
|
2005-09-12 13:25:55 +00:00
|
|
|
|
}
|
2007-06-22 15:07:47 +00:00
|
|
|
|
//non ha trovato l'indicatore;potrebbe essere il caso di un conto contabile usato in analitica
|
|
|
|
|
if (indbil == ib_null && _conto.len() == 12 && real::is_natural(_conto))
|
|
|
|
|
{
|
|
|
|
|
const int gr = atoi(_conto.mid(0,3));
|
|
|
|
|
const int co = atoi(_conto.mid(3,3));
|
|
|
|
|
const long so = atol(_conto.mid(6,6));
|
|
|
|
|
const TBill zio_cg(gr, co, so);
|
|
|
|
|
indbil = TIndbil(zio_cg.indicatore_bilancio());
|
|
|
|
|
}
|
2005-09-12 13:25:55 +00:00
|
|
|
|
|
|
|
|
|
return indbil;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-09 12:12:20 +00:00
|
|
|
|
const TString& TAnal_bill::testata() const
|
|
|
|
|
{
|
|
|
|
|
const TRectype& rec = cache().get(LF_PCONANA, _conto);
|
|
|
|
|
const TString& testata = rec.get(PCONANA_TESTATA);
|
|
|
|
|
if (testata.full())
|
|
|
|
|
return testata;
|
|
|
|
|
else //metodo fichissimo per evitare parole troncate!
|
|
|
|
|
{
|
|
|
|
|
const TString& descr = rec.get(PCONANA_DESCR);
|
|
|
|
|
//se la descrizione e' abbastanza corta da stare nel campo testata la usa direttamente..
|
|
|
|
|
if (descr.len() <= 15)
|
|
|
|
|
return descr;
|
|
|
|
|
//..in caso contrario fa in modo da adattarla senza troncamenti
|
|
|
|
|
TParagraph_string str(descr, 15);
|
|
|
|
|
TString& tmp = get_tmp_string();
|
|
|
|
|
tmp = str.get(0);
|
2007-03-15 15:57:26 +00:00
|
|
|
|
tmp << '\n' << str.get(1);
|
2006-11-09 12:12:20 +00:00
|
|
|
|
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
bool TAnal_bill::get(const TRectype& rec)
|
|
|
|
|
{
|
|
|
|
|
bool ok = true;
|
|
|
|
|
reset();
|
|
|
|
|
switch(rec.num())
|
|
|
|
|
{
|
|
|
|
|
case LF_RMOVANA:
|
|
|
|
|
set_conto(rec.get(RMOVANA_CODCONTO));
|
|
|
|
|
set_costo(rec.get(RMOVANA_CODCCOSTO));
|
|
|
|
|
set_commessa(rec.get(RMOVANA_CODCMS));
|
|
|
|
|
set_fase(rec.get(RMOVANA_CODFASE));
|
|
|
|
|
break;
|
|
|
|
|
case LF_RIGHEDOC:
|
|
|
|
|
set_commessa(RDOC_CODCMS);
|
|
|
|
|
set_fase(RDOC_FASCMS);
|
|
|
|
|
break;
|
|
|
|
|
case LF_SALDANA:
|
|
|
|
|
set_conto(rec.get(SALDANA_CONTO));
|
|
|
|
|
set_costo(rec.get(SALDANA_COSTO));
|
|
|
|
|
set_commessa(rec.get(SALDANA_COMMESSA));
|
|
|
|
|
set_fase(rec.get(SALDANA_FASE));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ok = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return ok;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
void TAnal_bill::copy(const TAnal_bill& b)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
{
|
|
|
|
|
set_conto(b.conto());
|
|
|
|
|
set_costo(b.costo());
|
|
|
|
|
set_commessa(b.commessa());
|
|
|
|
|
set_fase(b.fase());
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TAnal_bill& TAnal_bill::operator=(const TAnal_bill& b)
|
|
|
|
|
{
|
|
|
|
|
copy(b);
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TAnal_bill::TAnal_bill()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
TAnal_bill::TAnal_bill(const TAnal_bill& b)
|
|
|
|
|
{ copy(b); }
|
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
TAnal_bill::TAnal_bill(const char* conto, const char* costo, const char* commessa, const char* fase)
|
|
|
|
|
{
|
|
|
|
|
set_conto(conto);
|
|
|
|
|
set_costo(costo);
|
|
|
|
|
set_commessa(commessa);
|
|
|
|
|
set_fase(fase);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TAnal_bill::TAnal_bill(const TRectype& rec)
|
|
|
|
|
{
|
|
|
|
|
get(rec);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
// TRiclassify_cache
|
|
|
|
|
////////////////////////////////////////////////////////
|
2005-06-23 12:16:21 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
class TRiclassify_cache : public TCache
|
2005-06-24 11:24:40 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
int _conto_min;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual TObject* key2obj(const char* key);
|
2005-08-08 11:55:59 +00:00
|
|
|
|
void extract(const TString& conto, TString_array& conti) const;
|
2005-07-07 17:05:02 +00:00
|
|
|
|
|
2005-06-24 11:24:40 +00:00
|
|
|
|
public:
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TString_array& conti(const TString& conto);
|
|
|
|
|
TRiclassify_cache();
|
2005-06-24 11:24:40 +00:00
|
|
|
|
};
|
|
|
|
|
|
2005-08-08 11:55:59 +00:00
|
|
|
|
void TRiclassify_cache::extract(const TString& conto, TString_array& conti) const
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TRecord_array table(conto, LF_PANAPDC);
|
|
|
|
|
for (int r = table.last_row(); r > 0; r = table.pred_row(r))
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TRectype& row = table.row(r);
|
|
|
|
|
const TBill b(row);
|
|
|
|
|
conti.add(b.string(0x8));
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-06-23 12:16:21 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TObject* TRiclassify_cache::key2obj(const char* key)
|
|
|
|
|
{
|
|
|
|
|
TString_array* k = new TString_array;
|
|
|
|
|
if (key && int(strlen(key)) > _conto_min)
|
|
|
|
|
{
|
|
|
|
|
extract(key, *k);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TString query = "USE PCONANA";
|
|
|
|
|
if (key && *key)
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
query << "\nFROM CODCONTO=" << key;
|
|
|
|
|
query << "\nTO CODCONTO=" << key;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TISAM_recordset pconana(query);
|
|
|
|
|
for (TRecnotype i = 0; pconana.move_to(i); i++)
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const TString& conto = pconana.get(PCONANA_CODCONTO).as_string();
|
|
|
|
|
extract(conto, *k);
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
return k;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TString_array& TRiclassify_cache::conti(const TString& conto)
|
|
|
|
|
{
|
|
|
|
|
return *(const TString_array*)objptr(conto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TRiclassify_cache::TRiclassify_cache() : TCache(7)
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
|
|
|
|
_conto_min = info.total_len(-1); // Lunghezza conti fino al penultimo livello
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
// TSaldi_cache
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class TSaldi_cache : private TCache
|
|
|
|
|
{
|
|
|
|
|
TEsercizi_contabili _esc;
|
|
|
|
|
TRiclassify_cache _riclass;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual TObject* key2obj(const char* key);
|
|
|
|
|
|
|
|
|
|
bool int_saldo_annuale(const TAnal_bill& bill, int annoini, int annofin, word tipo, TImporto& dare, TImporto& avere) const;
|
|
|
|
|
bool int_saldo_movimenti(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipo, TSaldanal& s) const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool saldo_annuale(const TAnal_bill& bill, int annoini, int annofin, word tipo, TImporto& dare, TImporto& avere);
|
|
|
|
|
bool saldo_movimenti(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipo, TSaldanal& s);
|
|
|
|
|
bool saldi(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipo, TSaldanal& s);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
const TSaldanal& saldo(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipi = 0x1);
|
|
|
|
|
TSaldi_cache();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Calcolo saldo annuale di un conto reale NON riclassificato
|
|
|
|
|
bool TSaldi_cache::int_saldo_annuale(const TAnal_bill& b, int da_anno, int ad_anno, word tipo,
|
|
|
|
|
TImporto& dare, TImporto& avere) const
|
|
|
|
|
{
|
|
|
|
|
bool movim = false;
|
|
|
|
|
TString query, select;
|
|
|
|
|
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.costo().full())
|
2005-07-07 17:05:02 +00:00
|
|
|
|
select << "(COSTO=='" << b.costo() << "')";
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.commessa().full())
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full()) select << "&&";
|
2005-07-07 17:05:02 +00:00
|
|
|
|
select << "(COMMESSA=='" << b.commessa() << "')";
|
|
|
|
|
}
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.fase().full())
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full()) select << "&&";
|
2005-07-07 17:05:02 +00:00
|
|
|
|
select << "(FASE=='" << b.fase() << "')";
|
|
|
|
|
}
|
2005-09-12 16:24:04 +00:00
|
|
|
|
if (da_anno > 0)
|
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full()) select << "&&";
|
2005-09-12 16:24:04 +00:00
|
|
|
|
select << "(ANNO>=" << da_anno << ")";
|
|
|
|
|
}
|
|
|
|
|
if (ad_anno > 0)
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full()) select << "&&";
|
2005-09-12 16:24:04 +00:00
|
|
|
|
select << "(ANNO<=" << ad_anno << ")";
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-09-12 16:24:04 +00:00
|
|
|
|
query << "USE SALDANA KEY 2";
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full())
|
2005-07-07 17:05:02 +00:00
|
|
|
|
query << " SELECT " << select;
|
2005-09-12 16:24:04 +00:00
|
|
|
|
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.conto().full())
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2005-09-12 16:24:04 +00:00
|
|
|
|
query << "\nFROM CONTO=" << b.conto();
|
|
|
|
|
if (da_anno > 0)
|
|
|
|
|
query << " ANNO=" << da_anno;
|
|
|
|
|
query << "\nTO CONTO=" << b.conto();
|
|
|
|
|
if (ad_anno > 0)
|
|
|
|
|
query << " ANNO=" << ad_anno;
|
2005-07-07 17:05:02 +00:00
|
|
|
|
query << '\n';
|
|
|
|
|
}
|
2005-09-12 16:24:04 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TISAM_recordset saldini(query);
|
|
|
|
|
|
|
|
|
|
for (TRecnotype i = 0; saldini.move_to(i); i++)
|
|
|
|
|
{
|
|
|
|
|
char sez = ' ';
|
|
|
|
|
real imp;
|
|
|
|
|
if (tipo & _saldanal_consuntivo)
|
2005-06-24 15:07:14 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
sez = saldini.get(SALDANA_SEZIONE).as_string()[0];
|
|
|
|
|
imp = saldini.get(SALDANA_SALDO).as_real();
|
2005-06-24 15:07:14 +00:00
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
if (tipo & _saldanal_preventivo)
|
|
|
|
|
{
|
|
|
|
|
sez = saldini.get(SALDANA_SEZIONEP).as_string()[0];
|
|
|
|
|
imp = saldini.get(SALDANA_SALDOP).as_real();
|
|
|
|
|
}
|
|
|
|
|
if (tipo & _saldanal_variazione)
|
|
|
|
|
{
|
|
|
|
|
sez = saldini.get(SALDANA_SEZIONEV).as_string()[0];
|
|
|
|
|
imp = saldini.get(SALDANA_SALDOV).as_real();
|
|
|
|
|
}
|
|
|
|
|
if (sez > ' ')
|
|
|
|
|
{
|
|
|
|
|
if (sez == 'D')
|
|
|
|
|
dare += TImporto('D', imp);
|
|
|
|
|
else
|
|
|
|
|
avere += TImporto('A', imp);
|
|
|
|
|
movim = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-06-23 12:16:21 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return movim;
|
|
|
|
|
}
|
2005-06-23 12:16:21 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
bool TSaldi_cache::saldo_annuale(const TAnal_bill& b, int da_anno, int ad_anno, word tipo,
|
|
|
|
|
TImporto& dare, TImporto& avere)
|
|
|
|
|
{
|
|
|
|
|
bool movim = false;
|
2005-09-12 16:24:04 +00:00
|
|
|
|
if (ad_anno >= 0)
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
|
|
|
|
if (tipo & _saldanal_riclassify)
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
// Legge tabella di riclassificazione
|
|
|
|
|
const TString_array& table = _riclass.conti(b.conto());
|
|
|
|
|
if (!table.empty())
|
2005-06-23 15:32:55 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
TAnal_bill c(b); // Conto riclassificato
|
|
|
|
|
FOR_EACH_ARRAY_ROW(table, i, row)
|
|
|
|
|
{
|
|
|
|
|
c.set_conto(*row);
|
|
|
|
|
movim |= int_saldo_annuale(c, da_anno, ad_anno, tipo, dare, avere);
|
|
|
|
|
}
|
2005-06-23 15:32:55 +00:00
|
|
|
|
}
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
else
|
|
|
|
|
movim = int_saldo_annuale(b, da_anno, ad_anno, tipo, dare, avere);
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return movim;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
bool TSaldi_cache::int_saldo_movimenti(const TAnal_bill& b,
|
|
|
|
|
const TDate& dal, const TDate& al,
|
|
|
|
|
word tipo, TSaldanal& s) const
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
|
|
|
|
TDate dataini;
|
|
|
|
|
if (dal.ok())
|
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const int annoprec = _esc.date2prevesc(dal);
|
2005-06-23 12:16:21 +00:00
|
|
|
|
if (annoprec > 0)
|
2005-07-07 17:05:02 +00:00
|
|
|
|
dataini = _esc[annoprec].fine()+1L;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-06-24 15:07:14 +00:00
|
|
|
|
TString query, select;
|
|
|
|
|
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.costo().full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
select << "&&";
|
2005-06-27 16:35:27 +00:00
|
|
|
|
select << "(CODCOSTO==\"" << b.costo() << "\")";
|
2005-06-24 15:07:14 +00:00
|
|
|
|
}
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.commessa().full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
select << "&&";
|
2005-06-27 16:35:27 +00:00
|
|
|
|
select << "(CODCMS==\"" << b.commessa() << "\")";
|
2005-06-24 15:07:14 +00:00
|
|
|
|
}
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (b.fase().full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
{
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
select << "&&";
|
2005-06-27 16:35:27 +00:00
|
|
|
|
select << "(CODFASE==\"" << b.fase() << "\")";
|
2005-06-24 15:07:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
query << "USE RMOVANA KEY 2\n";
|
2006-02-09 16:33:56 +00:00
|
|
|
|
if (select.full())
|
2005-06-24 15:07:14 +00:00
|
|
|
|
query << "SELECT " << select << "\n";
|
2005-06-23 12:16:21 +00:00
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
// Faccio la join solo se mi serve il tipo movimento in testata
|
2005-07-07 17:05:02 +00:00
|
|
|
|
const bool filtra_tipo = (tipo & _saldanal_qualsiasi) != 0 &&
|
|
|
|
|
(tipo & _saldanal_qualsiasi) != _saldanal_qualsiasi;
|
|
|
|
|
if (filtra_tipo)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
query << "JOIN MOVANA INTO NUMREG==NUMREG\n";
|
|
|
|
|
|
|
|
|
|
query << "FROM CODCONTO=" << b.conto();
|
2005-06-23 12:16:21 +00:00
|
|
|
|
if (dataini.ok())
|
2005-06-27 16:35:27 +00:00
|
|
|
|
query << " DATACOMP=" << dataini;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
query << "\n";
|
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
query << "TO CODCONTO=" << b.conto();
|
2005-06-23 12:16:21 +00:00
|
|
|
|
if (al.ok())
|
2005-06-27 16:35:27 +00:00
|
|
|
|
query << " DATACOMP=" << al;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
query << "\n";
|
|
|
|
|
|
|
|
|
|
TISAM_recordset rmovana(query);
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
for (TRecnotype i = 0; rmovana.move_to(i); i++)
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-06-27 16:35:27 +00:00
|
|
|
|
// Controllo il tipo movimento solo se necessario
|
2005-07-07 17:05:02 +00:00
|
|
|
|
if (filtra_tipo)
|
2005-06-27 16:35:27 +00:00
|
|
|
|
{
|
|
|
|
|
const char tipomov = rmovana.get("107.TIPOMOV").as_string()[0];
|
|
|
|
|
int ntipomov = 0;
|
|
|
|
|
if (tipomov == 'P')
|
2005-07-07 17:05:02 +00:00
|
|
|
|
ntipomov = _saldanal_preventivo; else
|
2005-06-27 16:35:27 +00:00
|
|
|
|
if (tipomov == 'V')
|
2005-07-07 17:05:02 +00:00
|
|
|
|
ntipomov = _saldanal_variazione;
|
2005-06-27 16:35:27 +00:00
|
|
|
|
else
|
2005-07-07 17:05:02 +00:00
|
|
|
|
ntipomov = _saldanal_consuntivo;
|
2005-06-27 16:35:27 +00:00
|
|
|
|
if ((ntipomov & tipo) == 0)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2005-06-23 15:32:55 +00:00
|
|
|
|
|
2005-06-24 16:40:56 +00:00
|
|
|
|
const TDate data = rmovana.get(RMOVANA_DATACOMP).as_date();
|
2005-06-23 12:16:21 +00:00
|
|
|
|
const TImporto imp(rmovana.get(RMOVANA_SEZIONE).as_string()[0],
|
|
|
|
|
rmovana.get(RMOVANA_IMPORTO).as_real());
|
|
|
|
|
if (data >= dal)
|
|
|
|
|
{
|
|
|
|
|
if (imp.sezione() == 'D')
|
2005-06-27 16:35:27 +00:00
|
|
|
|
s._dare += imp;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
else
|
2005-06-27 16:35:27 +00:00
|
|
|
|
s._avere += imp;
|
|
|
|
|
s._movimentato = true;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-06-27 16:35:27 +00:00
|
|
|
|
s._ini += imp;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2005-06-27 16:35:27 +00:00
|
|
|
|
return s._movimentato;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
bool TSaldi_cache::saldo_movimenti(const TAnal_bill& b,
|
|
|
|
|
const TDate& dal, const TDate& al,
|
|
|
|
|
word tipo, TSaldanal& s)
|
2005-06-23 12:16:21 +00:00
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
|
bool movim = false;
|
|
|
|
|
if (tipo & _saldanal_riclassify)
|
|
|
|
|
{
|
|
|
|
|
// Legge tabella di riclassificazione
|
|
|
|
|
const TString_array& table = _riclass.conti(b.conto());
|
|
|
|
|
if (!table.empty())
|
|
|
|
|
{
|
|
|
|
|
TAnal_bill c(b); // Conto riclassificato
|
|
|
|
|
FOR_EACH_ARRAY_ROW(table, i, row)
|
|
|
|
|
{
|
|
|
|
|
c.set_conto(*row);
|
|
|
|
|
movim |= int_saldo_movimenti(c, dal, al, tipo, s);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
movim = int_saldo_movimenti(b, dal, al, tipo, s);
|
|
|
|
|
return movim;
|
2005-06-23 12:16:21 +00:00
|
|
|
|
}
|
2005-06-24 11:24:40 +00:00
|
|
|
|
|
2007-03-15 15:57:26 +00:00
|
|
|
|
bool TSaldi_cache::saldi(const TAnal_bill& bill, const TDate& dal, const TDate& al,
|
|
|
|
|
word tipo, TSaldanal& s)
|
2005-06-24 11:24:40 +00:00
|
|
|
|
{
|
2005-09-12 16:24:04 +00:00
|
|
|
|
if (dal.ok() || al.ok())
|
2005-07-07 17:05:02 +00:00
|
|
|
|
{
|
2005-09-12 16:24:04 +00:00
|
|
|
|
// Calcolo i saldi fino all'anno scorso.
|
|
|
|
|
// In assemza di data iniziale mi torna 0
|
|
|
|
|
const int anno_prec = _esc.date2prevesc(dal);
|
|
|
|
|
if (anno_prec > 0)
|
|
|
|
|
{
|
2007-03-15 15:57:26 +00:00
|
|
|
|
// Calcolo il saldo precedente solo per attivita' e passivita'
|
|
|
|
|
const TIndbil indbil = bill.indicatore_bilancio();
|
|
|
|
|
if (indbil == ib_attivita || indbil == ib_passivita)
|
|
|
|
|
{
|
|
|
|
|
TImporto dare, avere;
|
|
|
|
|
saldo_annuale(bill, 0, anno_prec, tipo, dare, avere);
|
|
|
|
|
s._ini = dare;
|
|
|
|
|
s._ini += avere;
|
|
|
|
|
}
|
2005-09-12 16:24:04 +00:00
|
|
|
|
}
|
2005-06-27 16:35:27 +00:00
|
|
|
|
|
2005-09-12 16:24:04 +00:00
|
|
|
|
if ((tipo & _saldanal_ultima_imm)!=0)
|
|
|
|
|
{
|
|
|
|
|
// Calcolo i saldi di quest'anno
|
|
|
|
|
// In assemza di data iniziale somma tutti gli anni (fino al 9999)
|
|
|
|
|
const int anno_ini = _esc.date2esc(dal);
|
|
|
|
|
const int anno_fin = anno_ini > 0 ? anno_ini : 0;
|
|
|
|
|
s._movimentato = saldo_annuale(bill, anno_ini, anno_fin, tipo, s._dare, s._avere);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
saldo_movimenti(bill, dal, al, tipo, s);
|
|
|
|
|
}
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-09-12 16:24:04 +00:00
|
|
|
|
// Se non viene specificata nessuna data voglio il saldo all'ultima immissione
|
|
|
|
|
s._movimentato = saldo_annuale(bill, 0, 0, tipo, s._dare, s._avere);
|
2005-07-07 17:05:02 +00:00
|
|
|
|
}
|
2005-09-12 16:24:04 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
s._ini.normalize();
|
|
|
|
|
s._fin = s._ini;
|
|
|
|
|
s._fin += s._dare;
|
|
|
|
|
s._fin += s._avere;
|
|
|
|
|
s._fin.normalize();
|
2005-06-24 11:24:40 +00:00
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
return s._movimentato;
|
|
|
|
|
}
|
2005-06-24 11:24:40 +00:00
|
|
|
|
|
|
|
|
|
TObject* TSaldi_cache::key2obj(const char* key)
|
|
|
|
|
{
|
|
|
|
|
TSaldanal* s = new TSaldanal;
|
|
|
|
|
|
|
|
|
|
TToken_string tok(key);
|
2005-06-27 16:35:27 +00:00
|
|
|
|
const TAnal_bill bill(tok.get(0), tok.get(1), tok.get(2), tok.get(3));
|
|
|
|
|
const TDate dal = tok.get(4); // Le get precedenti avvengono in ordine inverso!
|
2005-06-24 11:24:40 +00:00
|
|
|
|
const TDate al = tok.get();
|
2005-06-27 16:35:27 +00:00
|
|
|
|
const int tipo = tok.get_int();
|
2005-08-08 11:55:59 +00:00
|
|
|
|
saldi(bill, dal, al, tipo, *s);
|
2005-06-24 11:24:40 +00:00
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
const TSaldanal& TSaldi_cache::saldo(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipi)
|
2005-06-24 11:24:40 +00:00
|
|
|
|
{
|
|
|
|
|
TToken_string key;
|
2005-06-27 16:35:27 +00:00
|
|
|
|
key.add(bill.conto(), 0);
|
|
|
|
|
key.add(bill.costo(), 1);
|
|
|
|
|
key.add(bill.commessa(), 2);
|
|
|
|
|
key.add(bill.fase(), 3);
|
2005-06-24 11:24:40 +00:00
|
|
|
|
key.add(dal, 4);
|
|
|
|
|
key.add(al, 5);
|
|
|
|
|
key.add(tipi, 6);
|
|
|
|
|
return *(const TSaldanal*)objptr(key);
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
|
|
|
|
|
|
TSaldi_cache::TSaldi_cache() : TCache(3881) // Numero primo
|
|
|
|
|
{ }
|
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
|
const TSaldanal& ca_saldo(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipi)
|
2005-06-24 11:24:40 +00:00
|
|
|
|
{
|
|
|
|
|
static TSaldi_cache* cache = NULL;
|
2005-06-24 11:28:19 +00:00
|
|
|
|
if (cache == NULL)
|
2005-06-24 11:24:40 +00:00
|
|
|
|
cache = new TSaldi_cache;
|
2005-06-27 16:35:27 +00:00
|
|
|
|
return cache->saldo(bill, dal, al, tipi);
|
2005-06-24 11:24:40 +00:00
|
|
|
|
}
|
2005-09-05 17:14:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
// TAnal_report_mask
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
|
2006-03-08 16:58:36 +00:00
|
|
|
|
bool TAnal_report_mask::on_field_event(TOperable_field& , TField_event , long )
|
2005-09-05 17:14:07 +00:00
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int TAnal_report_mask::create_sheet_fields(short sheet_id, int lf, int& y, short& dlg)
|
|
|
|
|
{
|
|
|
|
|
TSheet_field& sf = sfield(sheet_id);
|
|
|
|
|
TMask& sm = sf.sheet_mask();
|
|
|
|
|
|
2006-03-08 16:58:36 +00:00
|
|
|
|
const int h = ca_create_fields(sm, 0, lf, 1, y, dlg, short(dlg+50));
|
2005-09-05 17:14:07 +00:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < h; i++)
|
|
|
|
|
{
|
2006-03-08 16:58:36 +00:00
|
|
|
|
TEdit_field& fld = sm.efield(short(dlg+i));
|
2005-09-05 17:14:07 +00:00
|
|
|
|
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(CHECK_SEARCH); //search e non normal perch<63> nelle..
|
|
|
|
|
//..stampe non si vuole la fase legata alla commessa/cdc
|
|
|
|
|
|
2006-03-08 16:58:36 +00:00
|
|
|
|
TEdit_field& dfld = sm.efield(short(dlg+50+i));
|
2005-09-05 17:14:07 +00:00
|
|
|
|
dfld.set_field(EMPTY_STRING); // Toglie campi che fan saltare gli output!
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
y += h+1;
|
2006-03-08 16:58:36 +00:00
|
|
|
|
dlg = short(dlg+h);
|
2005-09-05 17:14:07 +00:00
|
|
|
|
|
|
|
|
|
return h;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TAnal_report_mask::create_sheet(short sheet_id)
|
|
|
|
|
{
|
|
|
|
|
TSheet_field& sf = sfield(sheet_id);
|
|
|
|
|
TMask& sm = sf.sheet_mask();
|
|
|
|
|
sm.hide(-1);
|
|
|
|
|
|
|
|
|
|
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
|
|
|
|
|
2005-09-19 10:16:43 +00:00
|
|
|
|
TConfig& ini = ca_config();
|
2005-09-05 17:14:07 +00:00
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
create_sheet_fields(sheet_id, LF_FASI, y, dlg);
|
|
|
|
|
else
|
|
|
|
|
create_sheet_fields(sheet_id, LF_CDC, y, dlg);
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
if (level == "CMS") // Crea commessa
|
|
|
|
|
{
|
|
|
|
|
if (fasinfo.parent() == LF_COMMESSE)
|
|
|
|
|
create_sheet_fields(sheet_id, LF_FASI, y, dlg);
|
|
|
|
|
else
|
|
|
|
|
create_sheet_fields(sheet_id, LF_COMMESSE, y, dlg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0)
|
|
|
|
|
create_sheet_fields(sheet_id, LF_FASI, y, dlg);
|
|
|
|
|
|
|
|
|
|
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-10-10 11:26:19 +00:00
|
|
|
|
int TAnal_report_mask::get_row_bill(TSheet_field& sf, int r, TAnal_bill& bill)
|
|
|
|
|
{
|
|
|
|
|
int flag = 0;
|
|
|
|
|
if (r >= 0 && r < sf.items())
|
|
|
|
|
{
|
|
|
|
|
int idx = sf.cid2index(S_CDC1);
|
|
|
|
|
TToken_string& row = sf.row(r);
|
|
|
|
|
for (int level = 0; level <= 2; level++)
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info* info = ca_multilevel_code_info_by_index(level);
|
|
|
|
|
if (info == NULL)
|
|
|
|
|
break;
|
|
|
|
|
TString80 code;
|
|
|
|
|
for (int i = 0; i < info->levels(); i++)
|
|
|
|
|
code << row.get(idx++);
|
|
|
|
|
switch (info->logic())
|
|
|
|
|
{
|
|
|
|
|
case LF_CDC : bill.set_costo(code); flag |= 1; break;
|
|
|
|
|
case LF_COMMESSE: bill.set_commessa(code); flag |= 2; break;
|
|
|
|
|
case LF_FASI : bill.set_fase(code); flag |= 4; break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int TAnal_report_mask::set_row_bill(TSheet_field& sf, int r, const TAnal_bill& bill)
|
|
|
|
|
{
|
|
|
|
|
int flag = 0;
|
|
|
|
|
int idx = sf.cid2index(S_CDC1);
|
|
|
|
|
TToken_string& row = sf.row(r);
|
|
|
|
|
for (int level = 0; level <= 2; level++)
|
|
|
|
|
{
|
|
|
|
|
const TMultilevel_code_info* info = ca_multilevel_code_info_by_index(level);
|
|
|
|
|
if (info == NULL)
|
|
|
|
|
break;
|
|
|
|
|
TToken_string code;
|
|
|
|
|
switch (info->logic())
|
|
|
|
|
{
|
|
|
|
|
case LF_CDC : code = bill.costo(); flag |= 1; break;
|
|
|
|
|
case LF_COMMESSE: code = bill.commessa(); flag |= 2; break;
|
|
|
|
|
case LF_FASI : code = bill.fase(); flag |= 4; break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
info->unpack(code);
|
|
|
|
|
FOR_EACH_TOKEN(code, tok)
|
|
|
|
|
row.add(tok, idx++);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-21 18:19:36 +00:00
|
|
|
|
bool TAnal_report_mask::esistono_riclassificazioni() const
|
|
|
|
|
{
|
|
|
|
|
TLocalisamfile ric(LF_PANAPDC);
|
|
|
|
|
return ric.first() == NOERR;
|
|
|
|
|
}
|