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;
 | 
			
		||||
				// Prendo la riga di RDOC
 | 
			
		||||
				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
 | 
			
		||||
				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
 | 
			
		||||
				TString sqlQuery;
 | 
			
		||||
@ -497,10 +501,13 @@ bool TCampass_app::o01a(const TString id) const
 | 
			
		||||
			filtroFiltro.put("PROVV", rowRDoc.get("DAPROVV"));
 | 
			
		||||
			filtroFiltro.put("NDOC", rowRDoc.get("DANDOC"));
 | 
			
		||||
			TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
 | 
			
		||||
			curFiltro = 0;
 | 
			
		||||
			
 | 
			
		||||
			// Filtro aggiuntivo
 | 
			
		||||
			if (curFiltro.items() == 0 || rowRDoc.get_int("DAIDRIGA") != curFiltro.curr().get_int("IDRIGA")|| curFiltro.curr().get_bool("RIGAEVASA")) continue; 
 | 
			
		||||
			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")) continue;
 | 
			
		||||
			
 | 
			
		||||
			// Dichiaro la stringa
 | 
			
		||||
			TString sqlQuery;
 | 
			
		||||
@ -587,34 +594,43 @@ bool TCampass_app::o01c(const TString id) const
 | 
			
		||||
 | 
			
		||||
		if(rowRDoc.get("CODART") != rowRDist.get("CODDIST")) continue;
 | 
			
		||||
 | 
			
		||||
		// Filtro aggiuntivo
 | 
			
		||||
		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")
 | 
			
		||||
		for(;rowRDoc.get("CODART") == rowRDist.get("CODDIST");)
 | 
			
		||||
		{
 | 
			
		||||
			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(rowRDist.get("TIPO") == "A" && !rowRDoc.get_bool("RIGAEVASA"))
 | 
			
		||||
			{
 | 
			
		||||
				// 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)
 | 
			
		||||
 | 
			
		||||
				// Vado a prendere la riga di riferimento
 | 
			
		||||
				TRectype filtroFiltro(filtro.curr());
 | 
			
		||||
				if(rowRDoc.get("DACODNUM") == "ORC" || rowRDoc.get("DACODNUM") == "PRC")
 | 
			
		||||
				{
 | 
			
		||||
					message_box(sqlQuery);
 | 
			
		||||
					return false;
 | 
			
		||||
					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)
 | 
			
		||||
						{
 | 
			
		||||
							message_box(sqlQuery);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
			}
 | 
			
		||||
			++curRDist;
 | 
			
		||||
			rowRDist = curRDist.curr();
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
	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_NDOC, rowRDoc.get("NDOC"));
 | 
			
		||||
		TCursor curDoc(&doc, "", 1, &filtroDoc, &filtroDoc);
 | 
			
		||||
		curDoc.items();
 | 
			
		||||
		// Forzo a 0, sennò ci sono problemi di sporcizia
 | 
			
		||||
		curDoc = 0;
 | 
			
		||||
		curDoc = 0; curDoc.items();
 | 
			
		||||
		TRectype rowDoc = (curDoc.curr());
 | 
			
		||||
 | 
			
		||||
		// 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"));
 | 
			
		||||
			
 | 
			
		||||
			TCursor curFiltro(&rdoc, "", 1, &filtroFiltro, &filtroFiltro);
 | 
			
		||||
			curFiltro = 0;
 | 
			
		||||
			
 | 
			
		||||
			// 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
 | 
			
		||||
			TString sqlQuery;
 | 
			
		||||
 			// Inserisco Tutto
 | 
			
		||||
@ -806,7 +826,7 @@ bool TCampass_app::o03a(const TString id) const
 | 
			
		||||
	TRelation clifo(LF_CLIFO);
 | 
			
		||||
	int items;
 | 
			
		||||
	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");
 | 
			
		||||
	TCursor curClifo(&clifo, "", 1, &filtro, &filtro);
 | 
			
		||||
	items = curClifo.items();
 | 
			
		||||
@ -1014,7 +1034,7 @@ bool TCampass_app::p02a(const TString id) const
 | 
			
		||||
	TRelation tab(LF_TAB);
 | 
			
		||||
	int items;
 | 
			
		||||
	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");
 | 
			
		||||
	TCursor curTab(&tab, "", 1, &filtroTab, &filtroTab);
 | 
			
		||||
	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);
 | 
			
		||||
	int items;
 | 
			
		||||
	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 filtroTab(rdoc.curr()); filtroTab.put("CODTAB", "LAV");
 | 
			
		||||
	TCursor curRDoc(&rdoc, "RIGAEVASA != \"X\"", 1, &filtroRdoc, &filtroRdoc);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user