Patch level : 11.0
Files correlati : mr0 Commento : Aggiornato C/C git-svn-id: svn://10.65.10.50/branches/R_10_00@23738 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
233e376808
commit
d4003bc11c
@ -430,9 +430,13 @@ bool TCampass_app::a01a(const TString id) const
|
|||||||
curRdoc = 0;
|
curRdoc = 0;
|
||||||
// Prendo la riga di RDOC
|
// Prendo la riga di RDOC
|
||||||
TRectype rowRDoc = curRdoc.curr();
|
TRectype rowRDoc = curRdoc.curr();
|
||||||
|
bool trovato = false;
|
||||||
|
for(curFiltro = 0; curFiltro.pos() < curFiltro.items() && !trovato; ++curFiltro)
|
||||||
|
{
|
||||||
|
trovato = rowRDoc.get_int("DAIDRIGA") == curFiltro.curr().get_int("IDRIGA");
|
||||||
|
}
|
||||||
// Riapplico i filtri
|
// Riapplico i filtri
|
||||||
if(rowRilprod.get("CODART") != rowRDoc.get("CODARTMAG") || rowFiltro.get("IDRIGA") != rowRDoc.get("DAIDRIGA")) continue;
|
if(rowRilprod.get("CODART") != rowRDoc.get("CODARTMAG") || !trovato) continue;
|
||||||
|
|
||||||
// Dichiaro la stringa
|
// Dichiaro la stringa
|
||||||
TString sqlQuery;
|
TString sqlQuery;
|
||||||
@ -497,10 +501,13 @@ bool TCampass_app::o01a(const TString id) const
|
|||||||
filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
|
filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
|
||||||
filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
|
filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
|
||||||
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
||||||
curFiltro = 0;
|
|
||||||
|
|
||||||
// Filtro aggiuntivo
|
bool trovato = false;
|
||||||
if (curFiltro.items() == 0 || rowRDoc.get_int("DAIDRIGA") != curFiltro.curr().get_int("IDRIGA")|| curFiltro.curr().get_bool("RIGAEVASA")) continue;
|
for(curFiltro = 0; curFiltro.pos() < curFiltro.items() && !trovato; ++curFiltro)
|
||||||
|
{
|
||||||
|
trovato = rowRDoc.get_int("DAIDRIGA") == curFiltro.curr().get_int("IDRIGA");
|
||||||
|
}
|
||||||
|
if(curFiltro.items() <= 0 || !trovato || curFiltro.curr().get_bool("RIGAEVASA")) continue;
|
||||||
|
|
||||||
// Dichiaro la stringa
|
// Dichiaro la stringa
|
||||||
TString sqlQuery;
|
TString sqlQuery;
|
||||||
@ -587,34 +594,43 @@ bool TCampass_app::o01c(const TString id) const
|
|||||||
|
|
||||||
if(rowRDoc.get("CODART") != rowRDist.get("CODDIST")) continue;
|
if(rowRDoc.get("CODART") != rowRDist.get("CODDIST")) continue;
|
||||||
|
|
||||||
// Filtro aggiuntivo
|
for(;rowRDoc.get("CODART") == rowRDist.get("CODDIST");)
|
||||||
if(rowRDist.get("TIPO") != "A" || rowRDoc.get_bool("RIGAEVASA")) continue; // Filtro RIGAEVASA prima così mi risparmio righe
|
|
||||||
|
|
||||||
// Vado a prendere la riga di riferimento
|
|
||||||
TRectype filtroFiltro(filtro.curr());
|
|
||||||
if(rowRDoc.get("DACODNUM") == "ORC" || rowRDoc.get("DACODNUM") == "PRC")
|
|
||||||
{
|
{
|
||||||
filtroFiltro.put("CODNUM", rowRDoc.get("DACODNUM"));
|
// Filtro aggiuntivo
|
||||||
filtroFiltro.put("ANNO", rowRDoc.get("DAANNO"));
|
if(rowRDist.get("TIPO") == "A" && !rowRDoc.get_bool("RIGAEVASA"))
|
||||||
filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
|
|
||||||
filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
|
|
||||||
//filtroFiltro.put("IDRIGA", rowRDoc.get("DAIDRIGA"));
|
|
||||||
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
|
||||||
for (curFiltro = 0; curFiltro.pos() < curFiltro.items() && !p.is_cancelled(); ++curFiltro)
|
|
||||||
{
|
{
|
||||||
// Filtro aggiuntivo
|
|
||||||
if(curFiltro.curr().get_int("IDRIGA") != rowRDoc.get_int("DAIDRIGA") || curFiltro.curr().get_bool("RIGAEVASA")) continue;
|
// Vado a prendere la riga di riferimento
|
||||||
TString sqlQuery;
|
TRectype filtroFiltro(filtro.curr());
|
||||||
sqlQuery << "INSERT INTO O01C ( IKRUNIMP, CStr, CPRD, CARTFIL, CUDM, QIMP, QBASE, XTCALC, NSEQ ) \
|
if(rowRDoc.get("DACODNUM") == "ORC" || rowRDoc.get("DACODNUM") == "PRC")
|
||||||
VALUES('" << id << "','DBS','" << zeroFill(rowRDoc.get("NDOC")) << "." << rowRDoc.get("IDRIGA") << "','" << rowRDist.get("CODCOMP") << "','"
|
|
||||||
<< rowRDist.get("UM") << "','" << rowRDist.get("EXPR") << "','1','0','" << rowRDist.get("NRIG") << "');";
|
|
||||||
if(sqlset.exec(sqlQuery) != 1)
|
|
||||||
{
|
{
|
||||||
message_box(sqlQuery);
|
filtroFiltro.put("CODNUM", rowRDoc.get("DACODNUM"));
|
||||||
return false;
|
filtroFiltro.put("ANNO", rowRDoc.get("DAANNO"));
|
||||||
|
filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
|
||||||
|
filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
|
||||||
|
//filtroFiltro.put("IDRIGA", rowRDoc.get("DAIDRIGA"));
|
||||||
|
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
||||||
|
for (curFiltro = 0; curFiltro.pos() < curFiltro.items() && !p.is_cancelled(); ++curFiltro)
|
||||||
|
{
|
||||||
|
// Filtro aggiuntivo
|
||||||
|
if(curFiltro.curr().get_int("IDRIGA") != rowRDoc.get_int("DAIDRIGA") || curFiltro.curr().get_bool("RIGAEVASA")) continue;
|
||||||
|
TString sqlQuery;
|
||||||
|
sqlQuery << "INSERT INTO O01C ( IKRUNIMP, CStr, CPRD, CARTFIL, CUDM, QIMP, QBASE, XTCALC, NSEQ ) \
|
||||||
|
VALUES('" << id << "','DBS','" << zeroFill(rowRDoc.get("NDOC")) << "." << rowRDoc.get("IDRIGA") << "','" << rowRDist.get("CODCOMP") << "','"
|
||||||
|
<< rowRDist.get("UM") << "','" << rowRDist.get("EXPR") << "','1','0','" << rowRDist.get("NRIG") << "');";
|
||||||
|
if(sqlset.exec(sqlQuery) != 1)
|
||||||
|
{
|
||||||
|
message_box(sqlQuery);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
++curRDist;
|
||||||
|
rowRDist = curRDist.curr();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return sqlset.commit() == -1 ? false : true;
|
return sqlset.commit() == -1 ? false : true;
|
||||||
}
|
}
|
||||||
@ -717,9 +733,8 @@ bool TCampass_app::o02a(const TString CodNum, const TString id) const
|
|||||||
filtroDoc.put(DOC_CODNUM, rowRDoc.get("CODNUM"));
|
filtroDoc.put(DOC_CODNUM, rowRDoc.get("CODNUM"));
|
||||||
filtroDoc.put(DOC_NDOC, rowRDoc.get("NDOC"));
|
filtroDoc.put(DOC_NDOC, rowRDoc.get("NDOC"));
|
||||||
TCursor curDoc(&doc, "", 1, &filtroDoc, &filtroDoc);
|
TCursor curDoc(&doc, "", 1, &filtroDoc, &filtroDoc);
|
||||||
curDoc.items();
|
|
||||||
// Forzo a 0, sennò ci sono problemi di sporcizia
|
// Forzo a 0, sennò ci sono problemi di sporcizia
|
||||||
curDoc = 0;
|
curDoc = 0; curDoc.items();
|
||||||
TRectype rowDoc = (curDoc.curr());
|
TRectype rowDoc = (curDoc.curr());
|
||||||
|
|
||||||
// Inserisco IKRUNIMP, FAZI, CStr, CMAG, CCLIH, CCLIR, CCLI
|
// Inserisco IKRUNIMP, FAZI, CStr, CMAG, CCLIH, CCLIR, CCLI
|
||||||
@ -779,9 +794,14 @@ bool TCampass_app::o02c(const TString CodNum, const TString id) const
|
|||||||
//filtroFiltro.put("IDRIGA", rowRDoc.get("DAIDRIGA"));
|
//filtroFiltro.put("IDRIGA", rowRDoc.get("DAIDRIGA"));
|
||||||
|
|
||||||
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
||||||
curFiltro = 0;
|
|
||||||
// Se non ho elementi salto tutto
|
// Se non ho elementi salto tutto
|
||||||
if(curFiltro.items() <= 0 || rowRDoc.get_int("DAIDRIGA") != curFiltro.curr().get_int("IDRIGA") || curFiltro.curr().get_bool("RIGAEVASA")) continue; // Aggiungo ulteriore controllo, PERCHÉ NON METTE DAIDRIGA!?
|
bool trovato = false;
|
||||||
|
for(curFiltro = 0; curFiltro.pos() < curFiltro.items() && !trovato; ++curFiltro)
|
||||||
|
{
|
||||||
|
trovato = rowRDoc.get_int("DAIDRIGA") == curFiltro.curr().get_int("IDRIGA");
|
||||||
|
}
|
||||||
|
if(curFiltro.items() <= 0 || !trovato || curFiltro.curr().get_bool("RIGAEVASA") || rowRDoc.get_bool("RIGAEVASA")) continue;
|
||||||
// Dichiaro la stringa
|
// Dichiaro la stringa
|
||||||
TString sqlQuery;
|
TString sqlQuery;
|
||||||
// Inserisco Tutto
|
// Inserisco Tutto
|
||||||
@ -806,7 +826,7 @@ bool TCampass_app::o03a(const TString id) const
|
|||||||
TRelation clifo(LF_CLIFO);
|
TRelation clifo(LF_CLIFO);
|
||||||
int items;
|
int items;
|
||||||
TString msg("Esportazione tabella "); msg << "O03A";
|
TString msg("Esportazione tabella "); msg << "O03A";
|
||||||
// Creo il filtro per la chiave del cursore, da quel che ho capito le chiavi sono più veloci di un filtro (come è possibile?)
|
|
||||||
TRectype filtro(clifo.curr()); filtro.put("TIPOCF", "C");
|
TRectype filtro(clifo.curr()); filtro.put("TIPOCF", "C");
|
||||||
TCursor curClifo(&clifo, "", 1, &filtro, &filtro);
|
TCursor curClifo(&clifo, "", 1, &filtro, &filtro);
|
||||||
items = curClifo.items();
|
items = curClifo.items();
|
||||||
@ -1014,7 +1034,7 @@ bool TCampass_app::p02a(const TString id) const
|
|||||||
TRelation tab(LF_TAB);
|
TRelation tab(LF_TAB);
|
||||||
int items;
|
int items;
|
||||||
TString msg("Esportazione tabella "); msg << "P02A";
|
TString msg("Esportazione tabella "); msg << "P02A";
|
||||||
// Creo il filtro per la chiave del cursore, da quel che ho capito le chiavi sono più veloci di un filtro (come è possibile?)
|
|
||||||
TRectype filtroTab(tab.curr()); filtroTab.put("COD", "GCA"); filtroTab.put("CODTAB", "2");
|
TRectype filtroTab(tab.curr()); filtroTab.put("COD", "GCA"); filtroTab.put("CODTAB", "2");
|
||||||
TCursor curTab(&tab, "", 1, &filtroTab, &filtroTab);
|
TCursor curTab(&tab, "", 1, &filtroTab, &filtroTab);
|
||||||
items = curTab.items();
|
items = curTab.items();
|
||||||
@ -1092,7 +1112,7 @@ bool TCampass_app::o01b(const TString& DSN) const
|
|||||||
TRelation rdoc(LF_RIGHEDOC), rdist(LF_RDIST), tab(LF_TAB);
|
TRelation rdoc(LF_RIGHEDOC), rdist(LF_RDIST), tab(LF_TAB);
|
||||||
int items;
|
int items;
|
||||||
TString msg("Esportazione tabella "); msg << "O01B";
|
TString msg("Esportazione tabella "); msg << "O01B";
|
||||||
// Creo il filtro per la chiave del cursore, da quel che ho capito le chiavi sono più veloci di un filtro (come è possibile?)
|
|
||||||
TRectype filtroRdoc(rdoc.curr()); filtroRdoc.put("CODNUM", "ORP1");
|
TRectype filtroRdoc(rdoc.curr()); filtroRdoc.put("CODNUM", "ORP1");
|
||||||
TRectype filtroTab(rdoc.curr()); filtroTab.put("CODTAB", "LAV");
|
TRectype filtroTab(rdoc.curr()); filtroTab.put("CODTAB", "LAV");
|
||||||
TCursor curRDoc(&rdoc, "RIGAEVASA != \"X\"", 1, &filtroRdoc, &filtroRdoc);
|
TCursor curRDoc(&rdoc, "RIGAEVASA != \"X\"", 1, &filtroRdoc, &filtroRdoc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user