Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : hardy: modifiche hardiche git-svn-id: svn://10.65.10.50/branches/R_10_00@21293 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f3cd2f1a7f
commit
43d0de5ee9
@ -252,49 +252,57 @@ void TIni2Txt::genera_riga_listino_var_txt(TConfig& ini)
|
||||
|
||||
const TString4 segno = ricava_segno(ini);
|
||||
|
||||
//campi da condv (52)
|
||||
//-------------------
|
||||
//ini.set_paragraph("52");
|
||||
|
||||
//campi da rcondv (53)
|
||||
//--------------------
|
||||
//ATTENZIONE!!! Ci sono N righe di tipo 53 per ogni testata, quindi dobbiamo fare il giro
|
||||
for (int r = 1;; r++)
|
||||
TISAM_recordset agenti("USE AGENTI");
|
||||
const long agenti_items = agenti.items();
|
||||
for (bool ok = agenti.move_first(); ok; ok = agenti.move_next())
|
||||
{
|
||||
TString8 paragraph;
|
||||
paragraph.format("%d,%d", LF_RCONDV, r);
|
||||
if (!ini.set_paragraph(paragraph))
|
||||
break;
|
||||
TString8 codage = agenti.get(AGE_CODAGE).as_string();
|
||||
codage = codage.right(3);
|
||||
|
||||
riga_listino.new_rec("");
|
||||
//campi da condv (52)
|
||||
//-------------------
|
||||
//ini.set_paragraph("52");
|
||||
|
||||
riga_listino.set("CodiceTerminale", 0L); //nel caso del listino non ci va l'agente/terminale
|
||||
riga_listino.set("Segno", segno);
|
||||
|
||||
riga_listino.set(RCONDV_COD, ini.get(RCONDV_COD));
|
||||
TString80 codart = ini.get(RCONDV_CODRIGA);
|
||||
riga_listino.set(RCONDV_CODRIGA, codart);
|
||||
|
||||
//prezzo
|
||||
real prezzo = ini.get(RCONDV_PREZZO);
|
||||
if (prezzo.is_zero())
|
||||
//campi da rcondv (53)
|
||||
//--------------------
|
||||
//ATTENZIONE!!! Ci sono N righe di tipo 53 per ogni testata, quindi dobbiamo fare il giro
|
||||
for (int r = 1;; r++)
|
||||
{
|
||||
TToken_string key_umart;
|
||||
key_umart.add(codart);
|
||||
key_umart.add(1);
|
||||
const TRectype& rec_umart = cache().get(LF_UMART, key_umart);
|
||||
prezzo = rec_umart.get_real(UMART_PREZZO);
|
||||
}
|
||||
prezzo *= 1000;
|
||||
prezzo.round();
|
||||
riga_listino.set(RCONDV_PREZZO, prezzo.integer());
|
||||
TString8 paragraph;
|
||||
paragraph.format("%d,%d", LF_RCONDV, r);
|
||||
if (!ini.set_paragraph(paragraph))
|
||||
break;
|
||||
|
||||
//sconto
|
||||
const TString& str_sconto = ini.get(RCONDV_SCONTO);
|
||||
riga_listino.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
||||
riga_listino.new_rec("");
|
||||
|
||||
} //for(int r=1;;...
|
||||
riga_listino.set("CodiceTerminale", codage);
|
||||
riga_listino.set("Segno", segno);
|
||||
|
||||
riga_listino.set(RCONDV_COD, ini.get(RCONDV_COD));
|
||||
TString80 codart = ini.get(RCONDV_CODRIGA);
|
||||
riga_listino.set(RCONDV_CODRIGA, codart);
|
||||
|
||||
//prezzo
|
||||
real prezzo = ini.get(RCONDV_PREZZO);
|
||||
if (prezzo.is_zero())
|
||||
{
|
||||
TToken_string key_umart;
|
||||
key_umart.add(codart);
|
||||
key_umart.add(1);
|
||||
const TRectype& rec_umart = cache().get(LF_UMART, key_umart);
|
||||
prezzo = rec_umart.get_real(UMART_PREZZO);
|
||||
}
|
||||
prezzo *= 1000;
|
||||
prezzo.round();
|
||||
riga_listino.set(RCONDV_PREZZO, prezzo.integer());
|
||||
|
||||
//sconto
|
||||
const TString& str_sconto = ini.get(RCONDV_SCONTO);
|
||||
riga_listino.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
||||
|
||||
} //for(int r=1;;...
|
||||
|
||||
}
|
||||
//prepara il nome corretto del file .txt e lo genera
|
||||
//--------------------------------------------------
|
||||
const TString prefisso = "listvar";
|
||||
|
@ -312,41 +312,49 @@ void TFile2Txt::genera_righelistini_txt()
|
||||
{
|
||||
TEsporta_listini_recordset righe_listini;
|
||||
|
||||
TString query;
|
||||
query << "USE RCONDV";
|
||||
query << "\nFROM TIPO=L";
|
||||
query << "\nTO TIPO=L";
|
||||
|
||||
TISAM_recordset archivio_rcondv(query);
|
||||
const long archivio_rcondv_items = archivio_rcondv.items();
|
||||
|
||||
TProgind progind(archivio_rcondv_items, "Listini...", false, true);
|
||||
for (bool ok = archivio_rcondv.move_first(); ok; ok = archivio_rcondv.move_next())
|
||||
TISAM_recordset agenti("USE AGENTI");
|
||||
const long agenti_items = agenti.items();
|
||||
for (bool ok = agenti.move_first(); ok; ok = agenti.move_next())
|
||||
{
|
||||
progind.addstatus(1);
|
||||
TString8 codage = agenti.get(AGE_CODAGE).as_string();
|
||||
codage = codage.right(3);
|
||||
|
||||
righe_listini.new_rec("");
|
||||
TString query;
|
||||
query << "USE RCONDV";
|
||||
query << "\nFROM TIPO=L";
|
||||
query << "\nTO TIPO=L";
|
||||
|
||||
righe_listini.set("CodiceTerminale", 0L);
|
||||
righe_listini.set(RCONDV_COD, archivio_rcondv.get(RCONDV_COD));
|
||||
TString80 codart = archivio_rcondv.get(RCONDV_CODRIGA).as_string();
|
||||
righe_listini.set(RCONDV_CODRIGA, codart);
|
||||
TISAM_recordset archivio_rcondv(query);
|
||||
const long archivio_rcondv_items = archivio_rcondv.items();
|
||||
|
||||
real prezzo = archivio_rcondv.get(RCONDV_PREZZO).as_real();
|
||||
if (prezzo.is_zero())
|
||||
TProgind progind(archivio_rcondv_items, "Listini...", false, true);
|
||||
for (bool ok = archivio_rcondv.move_first(); ok; ok = archivio_rcondv.move_next())
|
||||
{
|
||||
TToken_string key_umart;
|
||||
key_umart.add(codart);
|
||||
key_umart.add(1);
|
||||
const TRectype& rec_umart = cache().get(LF_UMART, key_umart);
|
||||
prezzo = rec_umart.get_real(UMART_PREZZO);
|
||||
}
|
||||
prezzo *= 1000;
|
||||
prezzo.round();
|
||||
righe_listini.set(RCONDV_PREZZO, prezzo.integer());
|
||||
progind.addstatus(1);
|
||||
|
||||
const TString& str_sconto = archivio_rcondv.get(RCONDV_SCONTO).as_string();
|
||||
righe_listini.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
||||
righe_listini.new_rec("");
|
||||
|
||||
righe_listini.set("CodiceTerminale", codage);
|
||||
righe_listini.set(RCONDV_COD, archivio_rcondv.get(RCONDV_COD));
|
||||
TString80 codart = archivio_rcondv.get(RCONDV_CODRIGA).as_string();
|
||||
righe_listini.set(RCONDV_CODRIGA, codart);
|
||||
|
||||
real prezzo = archivio_rcondv.get(RCONDV_PREZZO).as_real();
|
||||
if (prezzo.is_zero())
|
||||
{
|
||||
TToken_string key_umart;
|
||||
key_umart.add(codart);
|
||||
key_umart.add(1);
|
||||
const TRectype& rec_umart = cache().get(LF_UMART, key_umart);
|
||||
prezzo = rec_umart.get_real(UMART_PREZZO);
|
||||
}
|
||||
prezzo *= 1000;
|
||||
prezzo.round();
|
||||
righe_listini.set(RCONDV_PREZZO, prezzo.integer());
|
||||
|
||||
const TString& str_sconto = archivio_rcondv.get(RCONDV_SCONTO).as_string();
|
||||
righe_listini.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
||||
}
|
||||
}
|
||||
|
||||
TFilename output_path = genera_path("listini");
|
||||
@ -588,12 +596,15 @@ void TFile2Txt::genera_carico_txt()
|
||||
|
||||
carico.new_rec("");
|
||||
|
||||
carico.set("CodiceTerminale", archivio_rdoc.get(DOC_CODAG));
|
||||
TString8 codage = archivio_rdoc.get("DOC.CODAG").as_string();
|
||||
codage = codage.right(3);
|
||||
carico.set("CodiceTerminale", codage);
|
||||
carico.set(RDOC_CODART, archivio_rdoc.get(RDOC_CODART));
|
||||
real qta = archivio_rdoc.get(RDOC_QTA).as_real();
|
||||
qta *= CENTO;
|
||||
qta.round();
|
||||
carico.set(RDOC_QTA, qta);
|
||||
carico.set(RDOC_LIVELLO, archivio_rdoc.get(RDOC_LIVELLO));
|
||||
}
|
||||
|
||||
TFilename output_path = genera_path("carico");
|
||||
|
Loading…
x
Reference in New Issue
Block a user