Patch level : 12.0 no-patch
Files correlati : mr0 Commento : Aggiornamento Campo/Compass query O01C git-svn-id: svn://10.65.10.50/branches/R_10_00@23756 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
59b4119fbe
commit
93354dec55
@ -580,55 +580,53 @@ bool TCampass_app::o01c(const TString id) const
|
||||
if (!p.add_status())
|
||||
break;
|
||||
|
||||
rowRDoc = curRDoc.curr();
|
||||
while(rowRDoc.get("CODART") < rowRDist.get("CODDIST"))
|
||||
{
|
||||
++curRDoc;
|
||||
rowRDoc = curRDoc.curr();
|
||||
}
|
||||
while(rowRDoc.get("CODART") > rowRDist.get("CODDIST"))
|
||||
{
|
||||
++curRDist;
|
||||
rowRDist = curRDist.curr();
|
||||
}
|
||||
rowRDoc = curRDoc.curr();
|
||||
rowRDist = curRDist.curr();
|
||||
|
||||
if(rowRDoc.get("CODART") != rowRDist.get("CODDIST")) continue;
|
||||
|
||||
for(;rowRDoc.get("CODART") == rowRDist.get("CODDIST");)
|
||||
while (rowRDoc.get("CODART") != rowRDist.get("CODDIST"))
|
||||
{
|
||||
// Filtro aggiuntivo
|
||||
if(rowRDist.get("TIPO") == "A" && !rowRDoc.get_bool("RIGAEVASA"))
|
||||
while(rowRDoc.get("CODART") < rowRDist.get("CODDIST"))
|
||||
{
|
||||
++curRDoc;
|
||||
rowRDoc = curRDoc.curr();
|
||||
}
|
||||
while(rowRDoc.get("CODART") > rowRDist.get("CODDIST"))
|
||||
{
|
||||
++curRDist;
|
||||
rowRDist = curRDist.curr();
|
||||
}
|
||||
}
|
||||
|
||||
// Vado a prendere la riga di riferimento
|
||||
TRectype filtroFiltro(filtro.curr());
|
||||
if(rowRDoc.get("DACODNUM") == "ORC" || rowRDoc.get("DACODNUM") == "PRC")
|
||||
// Filtro aggiuntivo
|
||||
if(rowRDist.get("TIPO") == "A" && !rowRDoc.get_bool("RIGAEVASA"))
|
||||
{
|
||||
|
||||
// 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"));
|
||||
filtroFiltro.put("ANNO", rowRDoc.get("DAANNO"));
|
||||
filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
|
||||
filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
|
||||
|
||||
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
||||
for (curFiltro = 0; curFiltro.pos() < curFiltro.items() && !p.is_cancelled(); ++curFiltro)
|
||||
{
|
||||
filtroFiltro.put("CODNUM", rowRDoc.get("DACODNUM"));
|
||||
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)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
message_box(sqlQuery);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
++curRDist;
|
||||
rowRDist = curRDist.curr();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user