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);
|
const TString4 segno = ricava_segno(ini);
|
||||||
|
|
||||||
//campi da condv (52)
|
TISAM_recordset agenti("USE AGENTI");
|
||||||
//-------------------
|
const long agenti_items = agenti.items();
|
||||||
//ini.set_paragraph("52");
|
for (bool ok = agenti.move_first(); ok; ok = agenti.move_next())
|
||||||
|
|
||||||
//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++)
|
|
||||||
{
|
{
|
||||||
TString8 paragraph;
|
TString8 codage = agenti.get(AGE_CODAGE).as_string();
|
||||||
paragraph.format("%d,%d", LF_RCONDV, r);
|
codage = codage.right(3);
|
||||||
if (!ini.set_paragraph(paragraph))
|
|
||||||
break;
|
|
||||||
|
|
||||||
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
|
//campi da rcondv (53)
|
||||||
riga_listino.set("Segno", segno);
|
//--------------------
|
||||||
|
//ATTENZIONE!!! Ci sono N righe di tipo 53 per ogni testata, quindi dobbiamo fare il giro
|
||||||
riga_listino.set(RCONDV_COD, ini.get(RCONDV_COD));
|
for (int r = 1;; r++)
|
||||||
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;
|
TString8 paragraph;
|
||||||
key_umart.add(codart);
|
paragraph.format("%d,%d", LF_RCONDV, r);
|
||||||
key_umart.add(1);
|
if (!ini.set_paragraph(paragraph))
|
||||||
const TRectype& rec_umart = cache().get(LF_UMART, key_umart);
|
break;
|
||||||
prezzo = rec_umart.get_real(UMART_PREZZO);
|
|
||||||
}
|
|
||||||
prezzo *= 1000;
|
|
||||||
prezzo.round();
|
|
||||||
riga_listino.set(RCONDV_PREZZO, prezzo.integer());
|
|
||||||
|
|
||||||
//sconto
|
riga_listino.new_rec("");
|
||||||
const TString& str_sconto = ini.get(RCONDV_SCONTO);
|
|
||||||
riga_listino.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
|
||||||
|
|
||||||
} //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
|
//prepara il nome corretto del file .txt e lo genera
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
const TString prefisso = "listvar";
|
const TString prefisso = "listvar";
|
||||||
|
@ -312,41 +312,49 @@ void TFile2Txt::genera_righelistini_txt()
|
|||||||
{
|
{
|
||||||
TEsporta_listini_recordset righe_listini;
|
TEsporta_listini_recordset righe_listini;
|
||||||
|
|
||||||
TString query;
|
TISAM_recordset agenti("USE AGENTI");
|
||||||
query << "USE RCONDV";
|
const long agenti_items = agenti.items();
|
||||||
query << "\nFROM TIPO=L";
|
for (bool ok = agenti.move_first(); ok; ok = agenti.move_next())
|
||||||
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())
|
|
||||||
{
|
{
|
||||||
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);
|
TISAM_recordset archivio_rcondv(query);
|
||||||
righe_listini.set(RCONDV_COD, archivio_rcondv.get(RCONDV_COD));
|
const long archivio_rcondv_items = archivio_rcondv.items();
|
||||||
TString80 codart = archivio_rcondv.get(RCONDV_CODRIGA).as_string();
|
|
||||||
righe_listini.set(RCONDV_CODRIGA, codart);
|
|
||||||
|
|
||||||
real prezzo = archivio_rcondv.get(RCONDV_PREZZO).as_real();
|
TProgind progind(archivio_rcondv_items, "Listini...", false, true);
|
||||||
if (prezzo.is_zero())
|
for (bool ok = archivio_rcondv.move_first(); ok; ok = archivio_rcondv.move_next())
|
||||||
{
|
{
|
||||||
TToken_string key_umart;
|
progind.addstatus(1);
|
||||||
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.new_rec("");
|
||||||
righe_listini.set(RCONDV_SCONTO, hd_find_sconto(str_sconto));
|
|
||||||
|
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");
|
TFilename output_path = genera_path("listini");
|
||||||
@ -588,12 +596,15 @@ void TFile2Txt::genera_carico_txt()
|
|||||||
|
|
||||||
carico.new_rec("");
|
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));
|
carico.set(RDOC_CODART, archivio_rdoc.get(RDOC_CODART));
|
||||||
real qta = archivio_rdoc.get(RDOC_QTA).as_real();
|
real qta = archivio_rdoc.get(RDOC_QTA).as_real();
|
||||||
qta *= CENTO;
|
qta *= CENTO;
|
||||||
qta.round();
|
qta.round();
|
||||||
carico.set(RDOC_QTA, qta);
|
carico.set(RDOC_QTA, qta);
|
||||||
|
carico.set(RDOC_LIVELLO, archivio_rdoc.get(RDOC_LIVELLO));
|
||||||
}
|
}
|
||||||
|
|
||||||
TFilename output_path = genera_path("carico");
|
TFilename output_path = genera_path("carico");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user