Patch level : 10.0

Files correlati     : ps0713
Ricompilazione Demo : [ ]
Commento            :
Correzioni in seguito a segnalazioni Roberto


git-svn-id: svn://10.65.10.50/trunk@20497 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca83 2010-05-26 08:37:03 +00:00
parent 1a3b4fcd58
commit 2e40621509
6 changed files with 39 additions and 35 deletions

View File

@ -80,7 +80,7 @@ void TImporta_comm_app::scan_file(const TFilename& file, TAssoc_array& righe)
if (!pi.addstatus(s.tellg())) if (!pi.addstatus(s.tellg()))
break; break;
TString idlavoro = rec.get(0); idlavoro.strip("\""); TString16 idlavoro = rec.get(0); idlavoro.strip("\"");
//salto le righe vuote del file //salto le righe vuote del file
if (idlavoro.empty()) if (idlavoro.empty())
@ -90,29 +90,35 @@ void TImporta_comm_app::scan_file(const TFilename& file, TAssoc_array& righe)
//gruppo conto e sottoconto devono avere dei valori sensati //gruppo conto e sottoconto devono avere dei valori sensati
TString gr = rec.get(1); gr.strip("\""); (gr == "" || gr == "?") ? gr ="0" : gr = gr; TString gr = rec.get(1); gr.strip("\""); (gr == "" || gr == "?") ? gr ="0" : gr = gr;
TString co = rec.get(2); co.strip("\""); (co == "" || co == "?") ? co ="0" : co = co; TString co = rec.get(2); co.strip("\""); (co == "" || co == "?") ? co ="0" : co = co;
TString sc = rec.get(3); sc.strip("\""); (sc == "" || sc == "?") ? sc ="0" : sc = gr; TString sc = rec.get(3); sc.strip("\""); (sc == "" || sc == "?") ? sc ="0" : sc = sc;
TCommessa_string str(atol(idlavoro), atoi(gr), atoi(co), atol(sc)); TCommessa_string str(idlavoro, atoi(gr), atoi(co), atol(sc));
if(!righe.is_key(str)) if(!righe.is_key(str))
righe.add(str, str); righe.add(str, str);
rec = s.line();
} }
} }
void TImporta_comm_app::importa_cms(TAssoc_array& righe) void TImporta_comm_app::importa_cms(TAssoc_array& righe)
{ {
TProgind pi(righe.items(), "Scansione file in corso...", true, true); TProgind pi(righe.items(), "Importazione commesse in corso...", true, true);
TLog_report log("Importazione Commesse"); TLog_report log("Importazione Commesse");
TLocalisamfile com(LF_COMMESSE); TLocalisamfile com(LF_COMMESSE);
TLocalisamfile rip(LF_RIP); TLocalisamfile rip(LF_RIP);
TLocalisamfile rrip(LF_RRIP); TLocalisamfile rrip(LF_RRIP);
const TRectype& r = rip.last(); rip.last();
const TRectype& r = rip.curr();
long codice = r.get_long("CODICE"); long codice = r.get_long("CODICE");
FOR_EACH_ASSOC_OBJECT(righe, obj, key, itm) FOR_EACH_ASSOC_OBJECT(righe, obj, key, itm)
{ {
if (!pi.addstatus(1))
break;
TCommessa_string cms(key); TCommessa_string cms(key);
TString80 codcms; codcms << cms.idlavoro(); TString80 codcms = cms.idlavoro();
TString str; TString str;
str << "La commessa " << codcms; str << "La commessa " << codcms;
@ -132,31 +138,29 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
TString8 cod; TString8 cod;
cod.format("%08ld", ++codice); cod.format("%08ld", ++codice);
TString80 descr; descr << "Comessa " << codice; TString80 descr; descr << "Comessa " << codcms;
TBill bill(gruppo, conto, sotco); TBill bill(gruppo, conto, sotco);
const real percentuale(CENTO); const real percentuale(CENTO);
TString80 desms; descms << "Commessa " << codcms;
com.put("CODCMS", codcms); com.put("CODCMS", codcms);
com.put("DESCRIZ", descms); com.put("DESCRIZ", descr);
rip.put("TIPO", 'B'); rip.put("TIPO", 'B');
rip.put("CODICE", cod); rip.put("CODICE", cod);
rip.put("CODCMS", codcms); rip.put("CODCMS", codcms);
rip.put("INDBIL", bill.indicatore_bilancio()); //rip.put("INDBIL", bill.indicatore_bilancio());
rip.put("DESCRIZ", descr); rip.put("DESCRIZ", descr);
rrip.put("TIPO", 'B'); rrip.put("TIPO", 'B');
rrip.put("CODICE", codice); rrip.put("CODICE", cod);
rrip.put("NRIGA", 1); rrip.put("NRIGA", 1);
rrip.put("CODCMS", codcms); rrip.put("CODCMS", codcms);
rrip.put("CODCONTO", codconto); rrip.put("CODCONTO", codconto);
rrip.put("RIPARTO", percentuale); rrip.put("RIPARTO", percentuale);
int err = com.write(); int err = com.rewrite_write();
if(err == NOERR) if(err == NOERR)
err = rip.write(); err = rip.write();

View File

@ -108,7 +108,7 @@ void TImporta_fatacq_app::genera_analitica(const long numreg, TAssoc_array& righ
break; break;
TCommessa_string& row = (TCommessa_string)keyar; TCommessa_string& row = (TCommessa_string)keyar;
const long idlav = row.idlavoro(); const TString& idlav = row.idlavoro();
const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo); const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo);
const int conto = row.conto(); TString8 cont; cont.format("%03d", conto); const int conto = row.conto(); TString8 cont; cont.format("%03d", conto);
const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco); const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco);

View File

@ -135,7 +135,7 @@ void TImporta_spese_app::genera_movana(const long numreg, TAssoc_array& righean)
break; break;
TCommessa_string& row = (TCommessa_string)keyar; TCommessa_string& row = (TCommessa_string)keyar;
const long idlav = row.idlavoro(); const TString& idlav = row.idlavoro();
const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo); const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo);
const int conto = row.conto(); TString8 cont; cont.format("%03d", conto); const int conto = row.conto(); TString8 cont; cont.format("%03d", conto);
const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco); const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco);

View File

@ -87,7 +87,7 @@ void TImporta_fat_for_app::scan_file(TVB_recset& file, TAssoc_array& righean, TA
continue; continue;
//idlavoro //idlavoro
const long idlavoro = file.get(0).as_int(); const TString16 idlavoro = file.get(0).as_string();
//imponibile //imponibile
TString16 tmp = file.get(1).as_string(); TString16 tmp = file.get(1).as_string();
@ -261,7 +261,7 @@ void TImporta_fat_for_app::genera_analitica(TAssoc_array& righean, TCommessa_str
break; break;
TCommessa_string& row = (TCommessa_string)keyar; TCommessa_string& row = (TCommessa_string)keyar;
const long idlav = row.idlavoro(); const TString& idlav = row.idlavoro();
const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo); const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo);
const int conto = row.conto(); TString8 cont; cont.format("%03d", conto); const int conto = row.conto(); TString8 cont; cont.format("%03d", conto);
const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco); const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco);

View File

@ -5,9 +5,9 @@
//////////////////////////////// ////////////////////////////////
//IDLAVORO: metodo che restituisce l'Idlavoro //IDLAVORO: metodo che restituisce l'Idlavoro
const long TCommessa_string::idlavoro() const TString16 TCommessa_string::idlavoro()
{ {
return get_long(0); return get(0);
} }
//GRUPPO: metodo che restituisce il gruppo //GRUPPO: metodo che restituisce il gruppo
@ -29,7 +29,7 @@ const long TCommessa_string::sotco()
} }
//metodo costruttore //metodo costruttore
TCommessa_string::TCommessa_string(const long idlavoro, const int gruppo, const int conto, const long sotco) TCommessa_string::TCommessa_string(const char* idlavoro, const int gruppo, const int conto, const long sotco)
{ {
add(idlavoro); add(idlavoro);
add(gruppo); add(gruppo);
@ -70,7 +70,7 @@ TCommessa::TCommessa(const char* codcms)
{ {
_codice = rip.get("CODICE").as_string(); _codice = rip.get("CODICE").as_string();
const long codcms = rip.get("CODCMS").as_int(); const TString16 codcms = rip.get("CODCMS").as_string();
query.cut(0); query.cut(0);
query << "USE RRIP\n" query << "USE RRIP\n"

View File

@ -17,14 +17,14 @@
class TCommessa_string: public TToken_string class TCommessa_string: public TToken_string
{ {
public: public:
const long idlavoro(); const TString16 idlavoro();
const int gruppo(); const int gruppo();
const int conto(); const int conto();
const long sotco(); const long sotco();
TCommessa_string& operator= (const char* key){ set(key); return *this; } TCommessa_string& operator= (const char* key){ set(key); return *this; }
TCommessa_string(const long idlavoro, const int gruppo, const int conto, const long sotco); TCommessa_string(const char* idlavoro, const int gruppo, const int conto, const long sotco);
TCommessa_string(const char* key):TToken_string(key){} TCommessa_string(const char* key):TToken_string(key){}
TCommessa_string(const TToken_string& key):TToken_string(key){} TCommessa_string(const TToken_string& key):TToken_string(key){}
TCommessa_string(const TCommessa_string& key):TToken_string(key){} TCommessa_string(const TCommessa_string& key):TToken_string(key){}