Migliorata creazione dinamica campi analitici
git-svn-id: svn://10.65.10.50/branches/R_10_00@22879 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d2d92a2761
commit
c30ae25f49
@ -77,10 +77,10 @@ const TString& TConfig_anal::get(const char* varname, const char* section, int i
|
|||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
TConfig& ca_config(bool force)
|
TConfig& ca_config(bool force_reload)
|
||||||
{
|
{
|
||||||
static TConfig_anal* cfg = NULL;
|
static TConfig_anal* cfg = NULL;
|
||||||
if (cfg == NULL || force)
|
if (cfg == NULL || force_reload)
|
||||||
{
|
{
|
||||||
if (cfg != NULL)
|
if (cfg != NULL)
|
||||||
delete cfg;
|
delete cfg;
|
||||||
@ -967,9 +967,9 @@ int ca_create_fields_compact(TMask& msk, int page, int logicnum, int x, int y,
|
|||||||
return mci.levels();
|
return mci.levels();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id, unsigned int mode,
|
int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
|
||||||
short& first_cdc, short& first_cms, short& first_fase, short& first_conto,
|
short& first_cdc, short& first_cms, short& first_fase, short& first_conto,
|
||||||
const TString80 cdc_fld, const TString80 cms_fld, const TString80 fase_fld, const TString80 conto_fld)
|
const char* cdc_fld, const char* cms_fld, const char* fase_fld, const char* conto_fld)
|
||||||
{
|
{
|
||||||
int numero_campi = 0;
|
int numero_campi = 0;
|
||||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||||
@ -981,7 +981,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id, unsig
|
|||||||
{
|
{
|
||||||
const TString& level = ini.get("Level", NULL, i+1); // Legge il livello 1 o 2
|
const TString& level = ini.get("Level", NULL, i+1); // Legge il livello 1 o 2
|
||||||
|
|
||||||
if (level == "CDC" && !cdc_fld.empty()) // Crea centro di costo
|
if (level == "CDC" && cdc_fld) // Crea centro di costo
|
||||||
{
|
{
|
||||||
if (fasinfo.parent() == LF_CDC)
|
if (fasinfo.parent() == LF_CDC)
|
||||||
{
|
{
|
||||||
@ -1000,33 +1000,30 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id, unsig
|
|||||||
dlg += sh;
|
dlg += sh;
|
||||||
numero_campi += sh;
|
numero_campi += sh;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else if(!cms_fld.empty())
|
if (level == "CMS" && cms_fld) // Crea commessa
|
||||||
{
|
{
|
||||||
if (level == "CMS") // Crea commessa
|
if (fasinfo.parent() == LF_COMMESSE)
|
||||||
{
|
{
|
||||||
if (fasinfo.parent() == LF_COMMESSE)
|
int h = ca_multilevel_code_info(LF_COMMESSE).levels();
|
||||||
{
|
const int sh = ca_create_fields_compact(m, 0, LF_FASI, x, y, dlg, dlg + 50);
|
||||||
int h = ca_multilevel_code_info(LF_COMMESSE).levels();
|
y += 2;
|
||||||
const int sh = ca_create_fields_compact(m, 0, LF_FASI, x, y, dlg, dlg + 50);
|
first_cms = dlg;
|
||||||
y += 2;
|
first_fase = first_cms + h;
|
||||||
first_cms = dlg;
|
dlg += sh;
|
||||||
first_fase = first_cms + h;
|
numero_campi += sh;
|
||||||
dlg += sh;
|
}
|
||||||
numero_campi += sh;
|
else
|
||||||
}
|
{
|
||||||
else
|
const int sh = ca_create_fields_compact(m, 0, LF_COMMESSE, x, y++, dlg, dlg + 50);
|
||||||
{
|
first_cms = dlg;
|
||||||
const int sh = ca_create_fields_compact(m, 0, LF_COMMESSE, x, y++, dlg, dlg + 50);
|
dlg += sh;
|
||||||
first_cms = dlg;
|
numero_campi += sh;
|
||||||
dlg += sh;
|
}
|
||||||
numero_campi += sh;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0 && !fase_fld.empty()) //Crea fase
|
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0 && fase_fld) //Crea fase
|
||||||
{
|
{
|
||||||
const int sh = ca_create_fields_compact(m, 0, LF_FASI, x, y++, dlg, dlg + 50);
|
const int sh = ca_create_fields_compact(m, 0, LF_FASI, x, y++, dlg, dlg + 50);
|
||||||
first_fase = dlg;
|
first_fase = dlg;
|
||||||
@ -1034,7 +1031,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id, unsig
|
|||||||
numero_campi += sh;
|
numero_campi += sh;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!conto_fld.empty()) //Crea conto
|
if (conto_fld) //Crea conto
|
||||||
{
|
{
|
||||||
const bool use_pdcc = ini.get_bool("UsePdcc");
|
const bool use_pdcc = ini.get_bool("UsePdcc");
|
||||||
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||||
@ -1044,7 +1041,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id, unsig
|
|||||||
numero_campi += nfields;
|
numero_campi += nfields;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m.get_sheet() != NULL) //Se è una maschera di riga, sistemo le colonne delle sheet
|
if (m.get_sheet() != NULL) //Se è una maschera di riga, sistemo le colonne delle sheet
|
||||||
{
|
{
|
||||||
TSheet_field& s = *m.get_sheet();
|
TSheet_field& s = *m.get_sheet();
|
||||||
for (short id = first_id + 116; id >= first_id + 100; id--)
|
for (short id = first_id + 116; id >= first_id + 100; id--)
|
||||||
|
@ -81,10 +81,10 @@ int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y, short key
|
|||||||
int ca_create_fields_compact(TMask& msk, int page, int logicnum, int x, int y,
|
int ca_create_fields_compact(TMask& msk, int page, int logicnum, int x, int y,
|
||||||
short key_id, short des_id, unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0);
|
short key_id, short des_id, unsigned int mode = 0x0, const char* fieldname = NULL, int from = 0);
|
||||||
|
|
||||||
//CA_CREATE_FIELDS_EXT: crea tutti i campi dell'analitica desiderati in base alla configurazione della contabilità analitica
|
//CA_CREATE_FIELDS_EXT: crea tutti i campi dell'analitica desiderati in base alla configurazione del modulo
|
||||||
int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id, unsigned int mode,
|
int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
|
||||||
short& first_cdc, short& first_cms, short& first_fase, short& first_conto,
|
short& first_cdc, short& first_cms, short& first_fase, short& first_conto,
|
||||||
const TString80 cdc_fld = NULL, const TString80 cms_fld = NULL, const TString80 fase_fld = NULL, const TString80 conto_fld = NULL);
|
const char* cdc_fld = NULL, const char* cms_fld = NULL, const char* fase_fld = NULL, const char* conto_fld = NULL);
|
||||||
|
|
||||||
//CA_GET_FIELDS: getta tutti i campi dell'analitica che sono stati generati in base alla configurazione della contabilità analitica
|
//CA_GET_FIELDS: getta tutti i campi dell'analitica che sono stati generati in base alla configurazione della contabilità analitica
|
||||||
void ca_get_fields(TMask& m,
|
void ca_get_fields(TMask& m,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user