Patch level : 10.0
Files correlati : ps0713 Ricompilazione Demo : [ ] Commento : Migliorato l'inserimento delle commesse: utilizzando i Systemisamfile è diventato molto più veloce git-svn-id: svn://10.65.10.50/trunk@20500 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
065f2502a3
commit
52c74c4e00
@ -105,9 +105,9 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
|||||||
TProgind pi(righe.items(), "Importazione commesse 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);
|
TSystemisamfile com(LF_COMMESSE); com.open(_excllock);
|
||||||
TLocalisamfile rip(LF_RIP);
|
TSystemisamfile rip(LF_RIP); rip.open(_excllock);
|
||||||
TLocalisamfile rrip(LF_RRIP);
|
TSystemisamfile rrip(LF_RRIP); rrip.open(_excllock);
|
||||||
rip.last();
|
rip.last();
|
||||||
const TRectype& r = rip.curr();
|
const TRectype& r = rip.curr();
|
||||||
long codice = r.get_long("CODICE");
|
long codice = r.get_long("CODICE");
|
||||||
@ -123,13 +123,13 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
|||||||
TString str;
|
TString str;
|
||||||
str << "La commessa " << codcms;
|
str << "La commessa " << codcms;
|
||||||
|
|
||||||
TString query;
|
rip.zero();
|
||||||
query << "USE RIP KEY 4\n"
|
rip.put("TIPO", 'B');
|
||||||
<< "FROM TIPO=\"B\" CODCOSTO=\"\" CODCMS=\"" << codcms << "\"\n"
|
rip.put("CODCOSTO", "");
|
||||||
<< "TO TIPO=\"B\" CODCOSTO=\"\" CODCMS=\"" << codcms << "\"\n";
|
rip.put("CODCMS", codcms);
|
||||||
const TISAM_recordset riprec(query);
|
int err_read = rip.read();
|
||||||
|
|
||||||
if(riprec.empty())
|
if(err_read != NOERR)
|
||||||
{
|
{
|
||||||
const int gruppo = cms.gruppo(); TString4 grup; grup.format("%03d", gruppo);
|
const int gruppo = cms.gruppo(); TString4 grup; grup.format("%03d", gruppo);
|
||||||
const int conto = cms.conto(); TString4 cont; cont.format("%03d", conto);
|
const int conto = cms.conto(); TString4 cont; cont.format("%03d", conto);
|
||||||
@ -150,7 +150,8 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
|||||||
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());
|
if(gruppo > 0 && conto > 0 && sotco > 0)
|
||||||
|
rip.put("INDBIL", bill.indicatore_bilancio());
|
||||||
rip.put("DESCRIZ", descr);
|
rip.put("DESCRIZ", descr);
|
||||||
|
|
||||||
rrip.put("TIPO", 'B');
|
rrip.put("TIPO", 'B');
|
||||||
@ -169,7 +170,7 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
|||||||
|
|
||||||
if(err == NOERR)
|
if(err == NOERR)
|
||||||
{
|
{
|
||||||
str << codcms << " è stata inserita";
|
str << " è stata inserita";
|
||||||
log.log(0, str);
|
log.log(0, str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -180,10 +181,14 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str << codcms << " NON è stata inserita perchè esiste già";
|
str << " NON è stata inserita perchè esiste già";
|
||||||
log.log(2, str);
|
log.log(2, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rrip.close();
|
||||||
|
rip.close();
|
||||||
|
com.close();
|
||||||
//stampo a video il log
|
//stampo a video il log
|
||||||
TReport_book buc;
|
TReport_book buc;
|
||||||
buc.add(log);
|
buc.add(log);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user