Migliorata generazione campi commesse

git-svn-id: svn://10.65.10.50/branches/R_10_00@23018 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2014-12-10 16:02:53 +00:00
parent 885f9482de
commit b1c386d1db

View File

@ -1139,7 +1139,7 @@ int ca_create_fields_ext(TMask& m, int page, int x, int y, short first_id,
void ca_get_fields(TMask& m,
TString& cdc, TString& cms, TString& fase, TString& conto,
const short first_cdc, const short first_cms, const short first_fase, const 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)
{
TString val;
cdc.cut(0);
@ -1147,7 +1147,7 @@ void ca_get_fields(TMask& m,
fase.cut(0);
conto.cut(0);
if (!cdc_fld.empty())
if (cdc_fld && *cdc_fld)
for (short id = first_cdc; id < first_cdc + 4; id++)
{
TMask_field& fld = m.field(id);
@ -1159,7 +1159,7 @@ void ca_get_fields(TMask& m,
}
cdc.trim();
if (!cms_fld.empty())
if (cms_fld && *cms_fld)
for (short id = first_cms; id < first_cms + 4; id++)
{
TMask_field& fld = m.field(id);
@ -1171,7 +1171,7 @@ void ca_get_fields(TMask& m,
}
cms.trim();
if (!fase_fld.empty())
if (fase_fld && *fase_fld)
for (short id = first_fase; id < first_fase + 4; id++)
{
TMask_field& fld = m.field(id);
@ -1183,7 +1183,7 @@ void ca_get_fields(TMask& m,
}
fase.trim();
if (!conto_fld.empty())
if (conto_fld && *conto_fld)
for (short id = first_conto; id <= first_conto + 4; id++)
{
TMask_field& fld = m.field(id);
@ -1197,9 +1197,9 @@ void ca_get_fields(TMask& m,
}
void ca_get_row_fields(TSheet_field& sheet, const int selected_row,
TString& cdc, TString& cms, TString& fase, TString& conto,
const short first_cdc, const short first_cms, const short first_fase, const short first_conto,
const TString80 cdc_fld, const TString80 cms_fld, const TString80 fase_fld, const TString80 conto_fld)
TString& cdc, TString& cms, TString& fase, TString& conto,
const short first_cdc, const short first_cms, const short first_fase, const short first_conto,
const char* cdc_fld, const char* cms_fld, const char* fase_fld, const char* conto_fld)
{
TString val;
cdc.cut(0);
@ -1210,11 +1210,11 @@ void ca_get_row_fields(TSheet_field& sheet, const int selected_row,
TToken_string& row = sheet.row(selected_row);
TMask& m = sheet.sheet_mask();
if (!cdc_fld.empty())
if (cdc_fld && *cdc_fld)
for (short id = first_cdc; id < first_cdc + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != cdc_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != cdc_fld)
break;
val = row.get(sheet.cid2index(id));
val.rpad(fld.size());
@ -1222,11 +1222,11 @@ void ca_get_row_fields(TSheet_field& sheet, const int selected_row,
}
cdc.trim();
if (!cms_fld.empty())
if (cms_fld && *cms_fld)
for (short id = first_cms; id < first_cms + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != cms_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != cms_fld)
break;
val = row.get(sheet.cid2index(id));
val.rpad(fld.size());
@ -1234,11 +1234,11 @@ void ca_get_row_fields(TSheet_field& sheet, const int selected_row,
}
cms.trim();
if (!fase_fld.empty())
if (fase_fld && *fase_fld)
for (short id = first_fase; id < first_fase + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != fase_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != fase_fld)
break;
val = row.get(sheet.cid2index(id));
val.rpad(fld.size());
@ -1246,11 +1246,11 @@ void ca_get_row_fields(TSheet_field& sheet, const int selected_row,
}
fase.trim();
if (!conto_fld.empty())
if (conto_fld && *conto_fld)
for (short id = first_conto; id <= first_conto + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != conto_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != conto_fld)
break;
val = row.get(sheet.cid2index(id));
val.rpad(fld.size());
@ -1259,20 +1259,20 @@ void ca_get_row_fields(TSheet_field& sheet, const int selected_row,
conto.trim();
}
void ca_put_row_fields(TSheet_field& sheet, const int selected_row,
TString& cdc, TString& cms, TString& fase, TString& conto,
const short first_cdc, const short first_cms, const short first_fase, const short first_conto,
const TString80 cdc_fld, const TString80 cms_fld, const TString80 fase_fld, const TString80 conto_fld)
void ca_put_row_fields(TSheet_field& sheet, const int selected_row,
TString& cdc, TString& cms, TString& fase, TString& conto,
const short first_cdc, const short first_cms, const short first_fase, const short first_conto,
const char* cdc_fld, const char* cms_fld, const char* fase_fld, const char* conto_fld)
{
TMask& m = sheet.sheet_mask();
TToken_string& row = sheet.row(selected_row);
int pos = 0;
if (!cdc_fld.empty())
if (cdc_fld && *cdc_fld)
for (short id = first_cdc; id < first_cdc + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != cdc_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != cdc_fld)
break;
const int len = fld.size();
row.add(cdc.mid(pos, len), sheet.cid2index(id));
@ -1280,11 +1280,11 @@ void ca_put_row_fields(TSheet_field& sheet, const int selected_row,
}
pos = 0;
if (!cms_fld.empty())
if (cms_fld && *cms_fld)
for (short id = first_cms; id < first_cms + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != cms_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != cms_fld)
break;
const int len = fld.size();
row.add(cdc.mid(pos, len), sheet.cid2index(id));
@ -1292,11 +1292,11 @@ void ca_put_row_fields(TSheet_field& sheet, const int selected_row,
}
pos = 0;
if (!fase_fld.empty())
if (fase_fld && *fase_fld)
for (short id = first_fase; id < first_fase + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != fase_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != fase_fld)
break;
const int len = fld.size();
row.add(cdc.mid(pos, len), sheet.cid2index(id));
@ -1304,11 +1304,11 @@ void ca_put_row_fields(TSheet_field& sheet, const int selected_row,
}
pos = 0;
if (!conto_fld.empty())
if (conto_fld && *conto_fld)
for (short id = first_conto; id < first_conto + 4; id++)
{
TMask_field& fld = m.field(id);
if(fld.prompt() != conto_fld)
const TMask_field& fld = m.field(id);
if (fld.prompt() != conto_fld)
break;
const int len = fld.size();
row.add(cdc.mid(pos, len), sheet.cid2index(id));
@ -2848,9 +2848,9 @@ TObject* TCache_ripartizioni::key2obj(const char* key)
break;
default: //chiave 4: normali ripartizioni batch
{
const TString80 codcosto = parametro.get(1);
const TString80 commessa = parametro.get(2);
const TString16 fase = parametro.get(3);
const TCodice_cdc codcosto = parametro.get(1);
const TCodice_cms commessa = parametro.get(2);
const TCodice_fas fase = parametro.get(3);
const int anno = parametro.get_int(4);
const int indbil = parametro.get_int(5);
const int classe_mov = parametro.get_int(6);