Patch level : 10.1036

Files correlati     :   ci2.exe
Ricompilazione Demo : [ ]
Commento            :

Corretta rilevazione ore


git-svn-id: svn://10.65.10.50/branches/R_10_00@22323 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2011-06-24 20:18:09 +00:00
parent c957e734e4
commit 2234ff0150

View File

@ -519,7 +519,7 @@ TImporta_rilore_rec::TImporta_rilore_rec(TFilename& filename)
class TImporta_rilore_msk : public TAutomask
{
TAssoc_array _matricole;
TAssoc_array _ore;
TArray _ore;
protected:
void importa();
@ -528,7 +528,7 @@ protected:
public:
TAssoc_array & matricole() {return _matricole;}
TAssoc_array & ore() {return _ore;}
TArray & ore() {return _ore;}
TImporta_rilore_msk();
};
@ -570,8 +570,10 @@ void TImporta_rilore_msk::importa()
{
key = "R";
tpora = "0000";
if (ore().is_key(tpora))
tpora = (TString &) ore()[tpora];
const int index = atoi(tpora);
if (ore().objptr(index) != NULL)
tpora = (TString &) ore()[index];
msg_head = data.string();
msg_head << " Addetto - " << codice;
key << codice << data.string(ANSI) << tpora; // cambiare
@ -594,11 +596,14 @@ void TImporta_rilore_msk::importa()
{
fieldname.format("%02d_%s%1d", i, CODGIU, t);
tpora = recordset.get(fieldname).as_string();
if (atoi(tpora) > 0)
const int index = atoi(tpora);
if (index > 0)
{
if (ore().is_key(tpora))
if (ore().objptr(index) != NULL)
{
tpora = (TString &) ore()[tpora];
tpora = (TString &) ore()[index];
fieldname.format("%02d_%s%1d", i, OREGIU, t);
oreril = recordset.get(fieldname).as_real() / CENTO;
@ -685,14 +690,10 @@ static bool scan_rss(const TRelation & rel, void *pJolly)
static bool scan_ore(const TRelation & rel, void *pJolly)
{
TImporta_rilore_msk & mask = *((TImporta_rilore_msk *)pJolly);
TString80 cod_est = rel.curr().get("S1");
const int cod_est = atoi(rel.curr().get("S1"));
const TString& codice = rel.curr().get("CODTAB");
if (cod_est.full())
{
const TString16 codice = rel.curr().get("CODTAB");
mask.ore().add(cod_est, codice);
}
mask.ore().add(codice, cod_est);
return true;
}