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())
|
if (!p.add_status())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rowRDoc = curRDoc.curr();
|
rowRDoc = curRDoc.curr();
|
||||||
while(rowRDoc.get("CODART") < rowRDist.get("CODDIST"))
|
rowRDist = curRDist.curr();
|
||||||
{
|
|
||||||
++curRDoc;
|
|
||||||
rowRDoc = curRDoc.curr();
|
|
||||||
}
|
|
||||||
while(rowRDoc.get("CODART") > rowRDist.get("CODDIST"))
|
|
||||||
{
|
|
||||||
++curRDist;
|
|
||||||
rowRDist = curRDist.curr();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(rowRDoc.get("CODART") != rowRDist.get("CODDIST")) continue;
|
while (rowRDoc.get("CODART") != rowRDist.get("CODDIST"))
|
||||||
|
|
||||||
for(;rowRDoc.get("CODART") == rowRDist.get("CODDIST");)
|
|
||||||
{
|
{
|
||||||
// Filtro aggiuntivo
|
while(rowRDoc.get("CODART") < rowRDist.get("CODDIST"))
|
||||||
if(rowRDist.get("TIPO") == "A" && !rowRDoc.get_bool("RIGAEVASA"))
|
|
||||||
{
|
{
|
||||||
|
++curRDoc;
|
||||||
|
rowRDoc = curRDoc.curr();
|
||||||
|
}
|
||||||
|
while(rowRDoc.get("CODART") > rowRDist.get("CODDIST"))
|
||||||
|
{
|
||||||
|
++curRDist;
|
||||||
|
rowRDist = curRDist.curr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Vado a prendere la riga di riferimento
|
// Filtro aggiuntivo
|
||||||
TRectype filtroFiltro(filtro.curr());
|
if(rowRDist.get("TIPO") == "A" && !rowRDoc.get_bool("RIGAEVASA"))
|
||||||
if(rowRDoc.get("DACODNUM") == "ORC" || rowRDoc.get("DACODNUM") == "PRC")
|
{
|
||||||
|
|
||||||
|
// 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"));
|
// Filtro aggiuntivo
|
||||||
filtroFiltro.put("ANNO", rowRDoc.get("DAANNO"));
|
if(curFiltro.curr().get_int("IDRIGA") != rowRDoc.get_int("DAIDRIGA") || curFiltro.curr().get_bool("RIGAEVASA")) continue;
|
||||||
filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
|
TString sqlQuery;
|
||||||
filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
|
sqlQuery << "INSERT INTO O01C ( IKRUNIMP, CStr, CPRD, CARTFIL, CUDM, QIMP, QBASE, XTCALC, NSEQ ) \
|
||||||
//filtroFiltro.put("IDRIGA", rowRDoc.get("DAIDRIGA"));
|
VALUES('" << id << "','DBS','" << zeroFill(rowRDoc.get("NDOC")) << "." << rowRDoc.get("IDRIGA") << "','" << rowRDist.get("CODCOMP") << "','"
|
||||||
TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
|
<< rowRDist.get("UM") << "','" << rowRDist.get("EXPR") << "','1','0','" << rowRDist.get("NRIG") << "');";
|
||||||
for (curFiltro = 0; curFiltro.pos() < curFiltro.items() && !p.is_cancelled(); ++curFiltro)
|
if(sqlset.exec(sqlQuery) != 1)
|
||||||
{
|
{
|
||||||
// Filtro aggiuntivo
|
message_box(sqlQuery);
|
||||||
if(curFiltro.curr().get_int("IDRIGA") != rowRDoc.get_int("DAIDRIGA") || curFiltro.curr().get_bool("RIGAEVASA")) continue;
|
return false;
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user