Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento :Gestione Carrelli in Carico git-svn-id: svn://10.65.10.50/trunk@20350 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e544252fd7
commit
062a39d7b4
638
ps/pd5317100.cpp
638
ps/pd5317100.cpp
@ -221,343 +221,383 @@ void TRiepCarrelli::add(TString articolo,TString user[],TDate dataDoc,
|
|||||||
//metodo principale di elaborazione
|
//metodo principale di elaborazione
|
||||||
void TCarrelli_app::elabora(const TMask& mask)const
|
void TCarrelli_app::elabora(const TMask& mask)const
|
||||||
{
|
{
|
||||||
|
bool search = true;
|
||||||
bool venduto = mask.get_bool(F_VENDUTO);
|
bool venduto = mask.get_bool(F_VENDUTO);
|
||||||
|
|
||||||
TISAM_recordset riep(get_query(0,venduto));
|
if(!venduto && TVariant(mask.get(F_COD_CMS))==TVariant(mask.get(F_COD_CMS_TO)))
|
||||||
|
|
||||||
//inserire parametri filtri
|
|
||||||
riep.set_var("#FROM",TVariant(mask.get(F_COD_CMS)));//
|
|
||||||
riep.set_var("#TO",TVariant(mask.get(F_COD_CMS_TO)));//
|
|
||||||
riep.set_var("#F_VEN",TVariant(mask.get(F_VENDUTO)));//
|
|
||||||
riep.set_var("#F_CAR",TVariant(mask.get(F_CARICO)));//
|
|
||||||
|
|
||||||
TRiepCarrelli riepilogo;
|
|
||||||
|
|
||||||
//inizializzazione variabili da utilizzare nella
|
|
||||||
//struttura
|
|
||||||
TString articolo;
|
|
||||||
TString user[14];
|
|
||||||
TString campo;
|
|
||||||
TString ragsoc;
|
|
||||||
TString indir;
|
|
||||||
TDate dataDoc;
|
|
||||||
TDate data_gara;
|
|
||||||
TString descr_conto;
|
|
||||||
TString conto;
|
|
||||||
TString prov;
|
|
||||||
TString modello;
|
|
||||||
TString descr_null;
|
|
||||||
int gruppo1;
|
|
||||||
int conto1;
|
|
||||||
int sottoGruppo1;
|
|
||||||
|
|
||||||
TCurrency importob;
|
|
||||||
TCurrency prezzoAcq;
|
|
||||||
TString venduto_a;
|
|
||||||
TCurrency prezzoVend;
|
|
||||||
TCurrency prezzo_p1;
|
|
||||||
TCurrency noleggio;
|
|
||||||
TCurrency manutenzione;
|
|
||||||
TCurrency prezzo_autom;
|
|
||||||
TCurrency prezzo_recup;
|
|
||||||
TCurrency prezzo_null;
|
|
||||||
|
|
||||||
TString commessa;
|
|
||||||
TString commessaOld;
|
|
||||||
|
|
||||||
for(bool ok = riep.move_first();ok;ok=riep.move_next())
|
|
||||||
{
|
{
|
||||||
commessa = riep.get("SALDANA.COMMESSA").as_string();
|
TISAM_recordset carico(get_query(0,true));
|
||||||
articolo = riep.get("ANAMAG.CODART").as_string();//A
|
|
||||||
|
|
||||||
if(commessa==commessaOld ||
|
//inserire parametri filtri
|
||||||
commessa.empty() ||
|
carico.set_var("#FROM",TVariant(mask.get(F_COD_CMS)));//
|
||||||
articolo.empty())
|
carico.set_var("#TO",TVariant(mask.get(F_COD_CMS_TO)));//
|
||||||
{
|
carico.set_var("#F_VEN",TVariant(mask.get(F_VENDUTO)));//
|
||||||
continue;
|
carico.set_var("#F_CAR",TVariant(mask.get(F_CARICO)));//
|
||||||
|
for(bool ok = carico.move_first();ok;ok=carico.move_next()){
|
||||||
|
search = false;
|
||||||
|
warning_box (TR("Attenzione:Il carrello risulta venduto!"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
commessaOld=commessa;
|
}
|
||||||
|
|
||||||
int numUser = 1;
|
if(search){
|
||||||
//if(articolo.not_empty())
|
TISAM_recordset riep(get_query(0,venduto));
|
||||||
|
|
||||||
|
//inserire parametri filtri
|
||||||
|
riep.set_var("#FROM",TVariant(mask.get(F_COD_CMS)));//
|
||||||
|
riep.set_var("#TO",TVariant(mask.get(F_COD_CMS_TO)));//
|
||||||
|
riep.set_var("#F_VEN",TVariant(mask.get(F_VENDUTO)));//
|
||||||
|
riep.set_var("#F_CAR",TVariant(mask.get(F_CARICO)));//
|
||||||
|
|
||||||
|
TRiepCarrelli riepilogo;
|
||||||
|
|
||||||
|
//inizializzazione variabili da utilizzare nella
|
||||||
|
//struttura
|
||||||
|
TString articolo;
|
||||||
|
TString user[14];
|
||||||
|
TString campo;
|
||||||
|
TString ragsoc;
|
||||||
|
TString indir;
|
||||||
|
TDate dataDoc;
|
||||||
|
TDate data_gara;
|
||||||
|
TString descr_conto;
|
||||||
|
TString conto;
|
||||||
|
TString prov;
|
||||||
|
TString modello;
|
||||||
|
TString descr_null;
|
||||||
|
int gruppo1;
|
||||||
|
int conto1;
|
||||||
|
int sottoGruppo1;
|
||||||
|
|
||||||
|
TCurrency importob;
|
||||||
|
TCurrency prezzoAcq;
|
||||||
|
TString venduto_a;
|
||||||
|
TCurrency prezzoVend;
|
||||||
|
TCurrency prezzo_p1;
|
||||||
|
TCurrency noleggio;
|
||||||
|
TCurrency manutenzione;
|
||||||
|
TCurrency prezzo_autom;
|
||||||
|
TCurrency prezzo_recup;
|
||||||
|
TCurrency prezzo_null;
|
||||||
|
|
||||||
|
TString commessa;
|
||||||
|
TString commessaOld;
|
||||||
|
|
||||||
|
for(bool ok = riep.move_first();ok;ok=riep.move_next())
|
||||||
{
|
{
|
||||||
for(int a = 0; a<14; a++) //da B a N
|
commessa = riep.get("SALDANA.COMMESSA").as_string();
|
||||||
|
articolo = riep.get("ANAMAG.CODART").as_string();//A
|
||||||
|
search = true;
|
||||||
|
|
||||||
|
if(!venduto)
|
||||||
{
|
{
|
||||||
campo = "ANAMAG.USER";
|
TISAM_recordset carico(get_query(0,true));
|
||||||
campo << numUser;
|
|
||||||
user[a] = riep.get(campo).as_string();
|
|
||||||
numUser++;
|
|
||||||
}
|
|
||||||
|
|
||||||
ragsoc = "";//M
|
//inserire parametri filtri
|
||||||
indir = "";//N
|
carico.set_var("#FROM",TVariant(mask.get(F_COD_CMS)));//
|
||||||
dataDoc= "";//O
|
carico.set_var("#TO",TVariant(mask.get(F_COD_CMS_TO)));//
|
||||||
|
carico.set_var("#F_VEN",TVariant(mask.get(F_VENDUTO)));//
|
||||||
TISAM_recordset bolle(get_query(1));
|
carico.set_var("#F_CAR",TVariant(mask.get(F_CARICO)));//
|
||||||
bolle.set_var("#COMM",TVariant(articolo));
|
for(bool ok = carico.move_first();ok;ok=carico.move_next()){
|
||||||
for(bool ok2 = bolle.move_last();ok2;ok2=bolle.move_next())
|
search = false;
|
||||||
{
|
|
||||||
ragsoc = bolle.get("CLIFO.RAGSOC").as_string();
|
|
||||||
indir = bolle.get("INDSPED.LOCALITA").as_string();
|
|
||||||
dataDoc= bolle.get("DATADOC").as_date();
|
|
||||||
|
|
||||||
if(indir.empty())
|
|
||||||
{
|
|
||||||
indir = bolle.get("COMUNI.DENCOM").as_string();
|
|
||||||
prov = bolle.get("COMUNI.PROVCOM").as_string();
|
|
||||||
indir.trim() << "(" << prov.trim() << ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ragsoc.not_empty())
|
|
||||||
{
|
|
||||||
user[11] = ragsoc;
|
|
||||||
user[12] = indir ;
|
|
||||||
}
|
|
||||||
|
|
||||||
importob = riep.get("COMMESSE.IMPORTOB").as_real();//P
|
|
||||||
data_gara = riep.get("COMMESSE.DATAGARA").as_string();//Q
|
|
||||||
modello = riep.get("COMMESSE.DESCRIZ").as_string();//T
|
|
||||||
|
|
||||||
prezzoAcq.set_price(0);//R
|
|
||||||
|
|
||||||
conto="";
|
|
||||||
TISAM_recordset saldana(get_query(2));
|
|
||||||
saldana.set_var("#COMM",TVariant(articolo));
|
|
||||||
for(bool ok3 = saldana.move_first();ok3;ok3=saldana.move_next())
|
|
||||||
{
|
|
||||||
prezzoAcq = prezzoAcq + saldana.get("SALDANA.SALDO").as_real();
|
|
||||||
conto = saldana.get("SALDANA.CONTO").as_string();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*if(conto.not_empty())
|
|
||||||
{
|
|
||||||
gruppo1 = atoi(conto.sub(0,3));
|
|
||||||
conto1 = atoi(conto.sub(3,6));
|
|
||||||
sottoGruppo1 = atoi(conto.sub(6));
|
|
||||||
|
|
||||||
TISAM_recordset pconto(get_query(3));
|
|
||||||
pconto.set_var("#GRUPPO1",TVariant(long (gruppo1)));//
|
|
||||||
pconto.set_var("#CONTO1",TVariant(long (conto1)));//
|
|
||||||
pconto.set_var("#SOTTOCONTO1",TVariant(long (sottoGruppo1)));//
|
|
||||||
for(bool ok3 = pconto.move_first();ok3;ok3=pconto.move_next())
|
|
||||||
{
|
|
||||||
descr_conto = pconto.get("PCON.DESCR").as_string();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
if(!search){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//RECUPERO FORNITORE
|
if(commessa==commessaOld ||
|
||||||
descr_conto=descr_null;//S
|
commessa.empty() ||
|
||||||
TISAM_recordset fornitore(get_query(5,false,commessa));
|
articolo.empty())
|
||||||
for(bool ok3 = fornitore.move_last();ok3;ok3=fornitore.move_next())
|
|
||||||
{
|
{
|
||||||
if(fornitore.get("MOVANA.NUMREGCG").as_int() == 0 ||
|
continue;
|
||||||
fornitore.get("MOVANA.NUMREGCG").as_string().empty() ){
|
}
|
||||||
}else{
|
commessaOld=commessa;
|
||||||
descr_conto = fornitore.get("CLIFO.RAGSOC").as_string();
|
|
||||||
|
int numUser = 1;
|
||||||
|
//if(articolo.not_empty())
|
||||||
|
{
|
||||||
|
for(int a = 0; a<14; a++) //da B a N
|
||||||
|
{
|
||||||
|
campo = "ANAMAG.USER";
|
||||||
|
campo << numUser;
|
||||||
|
user[a] = riep.get(campo).as_string();
|
||||||
|
numUser++;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
/*if(fornitore.move_next()){
|
|
||||||
descr_conto = fornitore.get("CLIFO.RAGSOC").as_string();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
ragsoc = "";//M
|
||||||
|
indir = "";//N
|
||||||
|
dataDoc= "";//O
|
||||||
|
|
||||||
//NOLEGGIO
|
TISAM_recordset bolle(get_query(1));
|
||||||
noleggio.set_price(0);//U
|
bolle.set_var("#COMM",TVariant(articolo));
|
||||||
TISAM_recordset noleg(get_query_saldana("004076000004"));
|
for(bool ok2 = bolle.move_last();ok2;ok2=bolle.move_next())
|
||||||
noleg.set_var("#COMM",TVariant(articolo));
|
{
|
||||||
for(bool ok2 = noleg.move_first();ok2;ok2=noleg.move_next())
|
ragsoc = bolle.get("CLIFO.RAGSOC").as_string();
|
||||||
{
|
indir = bolle.get("INDSPED.LOCALITA").as_string();
|
||||||
noleggio = noleggio + noleg.get("SALDANA.SALDO").as_real();
|
dataDoc= bolle.get("DATADOC").as_date();
|
||||||
}
|
|
||||||
|
|
||||||
//MANUTENZIONE
|
if(indir.empty())
|
||||||
manutenzione.set_price(0);//U
|
{
|
||||||
TISAM_recordset manut(get_query_saldana("003071000003"));
|
indir = bolle.get("COMUNI.DENCOM").as_string();
|
||||||
manut.set_var("#COMM",TVariant(articolo));
|
prov = bolle.get("COMUNI.PROVCOM").as_string();
|
||||||
for(bool ok2 = manut.move_first();ok2;ok2=manut.move_next())
|
indir.trim() << "(" << prov.trim() << ")";
|
||||||
{
|
}
|
||||||
manutenzione = manutenzione + manut.get("SALDANA.SALDO").as_real();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
break;
|
||||||
Scaletta per il recupero del venduto:
|
}
|
||||||
1) user1 prelevato da anamag
|
|
||||||
2) se esiste su SALDANA con il conto 004 076 000003(Venduto)
|
if(ragsoc.not_empty())
|
||||||
3) controllo su multirel se si tratta di un cespite
|
{
|
||||||
4) se esiste su SALDANA con il conto 003 071 000002 (acquistato)
|
user[11] = ragsoc;
|
||||||
5) se esiste su SALDANA con il conto 003 081 000043
|
user[12] = indir ;
|
||||||
sino al 003 081 999999 (leasing)
|
}
|
||||||
*/
|
|
||||||
venduto_a = user[0];//W
|
importob = riep.get("COMMESSE.IMPORTOB").as_real();//P
|
||||||
prezzoVend.set_price(0);//X
|
data_gara = riep.get("COMMESSE.DATAGARA").as_string();//Q
|
||||||
if(venduto_a.empty())
|
modello = riep.get("COMMESSE.DESCRIZ").as_string();//T
|
||||||
{
|
|
||||||
//VENDUTO
|
prezzoAcq.set_price(0);//R
|
||||||
TISAM_recordset saldana(get_query_saldana("004076000003"));
|
|
||||||
|
conto="";
|
||||||
|
TISAM_recordset saldana(get_query(2));
|
||||||
saldana.set_var("#COMM",TVariant(articolo));
|
saldana.set_var("#COMM",TVariant(articolo));
|
||||||
for(bool ok2 = saldana.move_last();ok2;ok2=saldana.move_next())
|
for(bool ok3 = saldana.move_first();ok3;ok3=saldana.move_next())
|
||||||
{
|
{
|
||||||
venduto_a = "VENDUTO";
|
prezzoAcq = prezzoAcq + saldana.get("SALDANA.SALDO").as_real();
|
||||||
prezzoVend = prezzoVend + saldana.get("SALDANA.SALDO").as_real();
|
conto = saldana.get("SALDANA.CONTO").as_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*if(conto.not_empty())
|
||||||
|
{
|
||||||
|
gruppo1 = atoi(conto.sub(0,3));
|
||||||
|
conto1 = atoi(conto.sub(3,6));
|
||||||
|
sottoGruppo1 = atoi(conto.sub(6));
|
||||||
|
|
||||||
|
TISAM_recordset pconto(get_query(3));
|
||||||
|
pconto.set_var("#GRUPPO1",TVariant(long (gruppo1)));//
|
||||||
|
pconto.set_var("#CONTO1",TVariant(long (conto1)));//
|
||||||
|
pconto.set_var("#SOTTOCONTO1",TVariant(long (sottoGruppo1)));//
|
||||||
|
for(bool ok3 = pconto.move_first();ok3;ok3=pconto.move_next())
|
||||||
|
{
|
||||||
|
descr_conto = pconto.get("PCON.DESCR").as_string();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
//RECUPERO FORNITORE
|
||||||
|
descr_conto=descr_null;//S
|
||||||
|
TISAM_recordset fornitore(get_query(5,false,commessa));
|
||||||
|
for(bool ok3 = fornitore.move_last();ok3;ok3=fornitore.move_next())
|
||||||
|
{
|
||||||
|
if(fornitore.get("MOVANA.NUMREGCG").as_int() == 0 ||
|
||||||
|
fornitore.get("MOVANA.NUMREGCG").as_string().empty() ){
|
||||||
|
}else{
|
||||||
|
descr_conto = fornitore.get("CLIFO.RAGSOC").as_string();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/*if(fornitore.move_next()){
|
||||||
|
descr_conto = fornitore.get("CLIFO.RAGSOC").as_string();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
//NOLEGGIO
|
||||||
|
noleggio.set_price(0);//U
|
||||||
|
TISAM_recordset noleg(get_query_saldana("004076000004"));
|
||||||
|
noleg.set_var("#COMM",TVariant(articolo));
|
||||||
|
for(bool ok2 = noleg.move_first();ok2;ok2=noleg.move_next())
|
||||||
|
{
|
||||||
|
noleggio = noleggio + noleg.get("SALDANA.SALDO").as_real();
|
||||||
|
}
|
||||||
|
|
||||||
|
//MANUTENZIONE
|
||||||
|
manutenzione.set_price(0);//U
|
||||||
|
TISAM_recordset manut(get_query_saldana("003071000003"));
|
||||||
|
manut.set_var("#COMM",TVariant(articolo));
|
||||||
|
for(bool ok2 = manut.move_first();ok2;ok2=manut.move_next())
|
||||||
|
{
|
||||||
|
manutenzione = manutenzione + manut.get("SALDANA.SALDO").as_real();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Scaletta per il recupero del venduto:
|
||||||
|
1) user1 prelevato da anamag
|
||||||
|
2) se esiste su SALDANA con il conto 004 076 000003(Venduto)
|
||||||
|
3) controllo su multirel se si tratta di un cespite
|
||||||
|
4) se esiste su SALDANA con il conto 003 071 000002 (acquistato)
|
||||||
|
5) se esiste su SALDANA con il conto 003 081 000043
|
||||||
|
sino al 003 081 999999 (leasing)
|
||||||
|
*/
|
||||||
|
venduto_a = user[0];//W
|
||||||
|
prezzoVend.set_price(0);//X
|
||||||
if(venduto_a.empty())
|
if(venduto_a.empty())
|
||||||
{
|
{
|
||||||
//CESPITE
|
//VENDUTO
|
||||||
TISAM_recordset cespite(get_query(4));
|
TISAM_recordset saldana(get_query_saldana("004076000003"));
|
||||||
cespite.set_var("#COMM",TVariant(articolo));
|
saldana.set_var("#COMM",TVariant(articolo));
|
||||||
for(bool ok2 = cespite.move_last();ok2;ok2=cespite.move_next())
|
for(bool ok2 = saldana.move_last();ok2;ok2=saldana.move_next())
|
||||||
{
|
{
|
||||||
venduto_a = "CESPITE";
|
venduto_a = "VENDUTO";
|
||||||
break;
|
prezzoVend = prezzoVend + saldana.get("SALDANA.SALDO").as_real();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(venduto_a.empty())
|
||||||
|
{
|
||||||
|
//CESPITE
|
||||||
|
TISAM_recordset cespite(get_query(4));
|
||||||
|
cespite.set_var("#COMM",TVariant(articolo));
|
||||||
|
for(bool ok2 = cespite.move_last();ok2;ok2=cespite.move_next())
|
||||||
|
{
|
||||||
|
venduto_a = "CESPITE";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(venduto_a.empty())
|
||||||
|
{
|
||||||
|
//ACQUISTATO
|
||||||
|
TISAM_recordset acquistato(get_query_saldana("003071000002"));
|
||||||
|
acquistato.set_var("#COMM",TVariant(articolo));
|
||||||
|
for(bool ok2 = acquistato.move_last();ok2;ok2=acquistato.move_next())
|
||||||
|
{
|
||||||
|
venduto_a = "ACQUISTATO";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(venduto_a.empty())
|
||||||
|
{
|
||||||
|
//LEASING
|
||||||
|
TISAM_recordset leasing(get_query_saldana("?=","003081*"));
|
||||||
|
leasing.set_var("#COMM",TVariant(articolo));
|
||||||
|
for(bool ok2 = leasing.move_last();ok2;ok2=leasing.move_next())
|
||||||
|
{
|
||||||
|
venduto_a = "LEASING";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(venduto_a.empty())
|
prezzo_p1 = (prezzoAcq + manutenzione)*1.10;//Y
|
||||||
{
|
prezzo_autom = (prezzo_p1.get_num() * 1.1 * 1.2) - (noleggio.get_num()/2.0);//Z
|
||||||
//ACQUISTATO
|
|
||||||
TISAM_recordset acquistato(get_query_saldana("003071000002"));
|
|
||||||
acquistato.set_var("#COMM",TVariant(articolo));
|
|
||||||
for(bool ok2 = acquistato.move_last();ok2;ok2=acquistato.move_next())
|
|
||||||
{
|
|
||||||
venduto_a = "ACQUISTATO";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(venduto_a.empty())
|
prezzo_recup = noleggio - prezzoVend - prezzo_p1;//AB
|
||||||
{
|
|
||||||
//LEASING
|
riepilogo.add(articolo,user,dataDoc,importob,data_gara,
|
||||||
TISAM_recordset leasing(get_query_saldana("?=","003081*"));
|
prezzoAcq,descr_conto,modello,
|
||||||
leasing.set_var("#COMM",TVariant(articolo));
|
noleggio,manutenzione,venduto_a,prezzoVend,
|
||||||
for(bool ok2 = leasing.move_last();ok2;ok2=leasing.move_next())
|
prezzo_p1, prezzo_autom,prezzo_recup);
|
||||||
{
|
|
||||||
venduto_a = "LEASING";
|
//TString pippo1 = prezzo_p1.string();
|
||||||
break;
|
|
||||||
}
|
prezzo_p1 = prezzo_null;
|
||||||
}
|
prezzoAcq = prezzo_null;
|
||||||
|
manutenzione = prezzo_null;
|
||||||
|
prezzo_autom = prezzo_null;
|
||||||
|
prezzo_recup = prezzo_null;
|
||||||
|
noleggio = prezzo_null;
|
||||||
|
prezzoVend = prezzo_null;
|
||||||
}
|
}
|
||||||
|
|
||||||
prezzo_p1 = (prezzoAcq + manutenzione)*1.10;//Y
|
|
||||||
prezzo_autom = (prezzo_p1.get_num() * 1.1 * 1.2) - (noleggio.get_num()/2.0);//Z
|
|
||||||
|
|
||||||
prezzo_recup = noleggio - prezzoVend - prezzo_p1;//AB
|
|
||||||
|
|
||||||
riepilogo.add(articolo,user,dataDoc,importob,data_gara,
|
|
||||||
prezzoAcq,descr_conto,modello,
|
|
||||||
noleggio,manutenzione,venduto_a,prezzoVend,
|
|
||||||
prezzo_p1, prezzo_autom,prezzo_recup);
|
|
||||||
|
|
||||||
//TString pippo1 = prezzo_p1.string();
|
|
||||||
|
|
||||||
prezzo_p1 = prezzo_null;
|
|
||||||
prezzoAcq = prezzo_null;
|
|
||||||
manutenzione = prezzo_null;
|
|
||||||
prezzo_autom = prezzo_null;
|
|
||||||
prezzo_recup = prezzo_null;
|
|
||||||
noleggio = prezzo_null;
|
|
||||||
prezzoVend = prezzo_null;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//gestione report
|
//gestione report
|
||||||
TCarrelli_report rep;
|
TCarrelli_report rep;
|
||||||
bool stampa = rep.load("pd5317100");
|
bool stampa = rep.load("pd5317100");
|
||||||
TCarrelli_recordset* riep_set = new TCarrelli_recordset();
|
TCarrelli_recordset* riep_set = new TCarrelli_recordset();
|
||||||
rep.set_recordset(riep_set);
|
rep.set_recordset(riep_set);
|
||||||
|
|
||||||
//scandisce clienti e tiene buoni solo quelli valorizzati
|
//scandisce clienti e tiene buoni solo quelli valorizzati
|
||||||
FOR_EACH_ARRAY_ITEM(riepilogo,c,obj)
|
FOR_EACH_ARRAY_ITEM(riepilogo,c,obj)
|
||||||
{
|
|
||||||
TStruttura_carrelli& s = *(TStruttura_carrelli*) obj;
|
|
||||||
|
|
||||||
riep_set->new_rec();
|
|
||||||
int colonna = 0;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._articolo)));//A
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user1)));//B
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user2)));//C
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user3)));//D
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user4)));//E
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user5)));//F
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user6)));//G
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user7)));//H
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user8)));//I
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user9)));//J
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user10)));//K
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user11)));//L
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user12)));//M
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user13)));//N
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._data_doc)));//O
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant((s._importob).string()));//P
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._data_gara)));//Q
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._prezzoAcq).string())));//R
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._descr_conto)));//S
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._modello)));//T
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._noleggio).string())));//U
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._manutenzione).string())));//V
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._venduto_a)));//W
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._prezzo_vend).string())));//X
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._prezzo_p1).string())));//Y
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._prezzo_autom).string())));//Z
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant(s._user14)));//AA
|
|
||||||
colonna++;
|
|
||||||
riep_set->set(colonna,TVariant(TVariant((s._prezzo_recup).string())));//AB
|
|
||||||
colonna++;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Crea file che contiene il recordset
|
|
||||||
//riep_set->save_as("c:\\riepilogoBolla.txt");
|
|
||||||
|
|
||||||
//Se il report esiste..
|
|
||||||
if(stampa)
|
|
||||||
{
|
|
||||||
//carica tutte le variabili del report.
|
|
||||||
rep.mask2report(mask);
|
|
||||||
|
|
||||||
TReport_book b;
|
|
||||||
bool ok = b.add(rep);// Richiede parametri di stampa in base alla maschera omonima
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
//Se esiste almeno 1 pagina
|
TStruttura_carrelli& s = *(TStruttura_carrelli*) obj;
|
||||||
if (b.pages() > 0)
|
|
||||||
b.print_or_preview(); // Stampa effettivamente
|
riep_set->new_rec();
|
||||||
else
|
int colonna = 0;
|
||||||
warning_box (TR("Nessun record estratto per i parametri inseriti"));
|
riep_set->set(colonna,TVariant(TVariant(s._articolo)));//A
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user1)));//B
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user2)));//C
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user3)));//D
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user4)));//E
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user5)));//F
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user6)));//G
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user7)));//H
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user8)));//I
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user9)));//J
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user10)));//K
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user11)));//L
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user12)));//M
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user13)));//N
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._data_doc)));//O
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant((s._importob).string()));//P
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._data_gara)));//Q
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._prezzoAcq).string())));//R
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._descr_conto)));//S
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._modello)));//T
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._noleggio).string())));//U
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._manutenzione).string())));//V
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._venduto_a)));//W
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._prezzo_vend).string())));//X
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._prezzo_p1).string())));//Y
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._prezzo_autom).string())));//Z
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant(s._user14)));//AA
|
||||||
|
colonna++;
|
||||||
|
riep_set->set(colonna,TVariant(TVariant((s._prezzo_recup).string())));//AB
|
||||||
|
colonna++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Crea file che contiene il recordset
|
||||||
|
//riep_set->save_as("c:\\riepilogoBolla.txt");
|
||||||
|
|
||||||
|
//Se il report esiste..
|
||||||
|
if(stampa)
|
||||||
|
{
|
||||||
|
//carica tutte le variabili del report.
|
||||||
|
rep.mask2report(mask);
|
||||||
|
|
||||||
|
TReport_book b;
|
||||||
|
bool ok = b.add(rep);// Richiede parametri di stampa in base alla maschera omonima
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
//Se esiste almeno 1 pagina
|
||||||
|
if (b.pages() > 0)
|
||||||
|
b.print_or_preview(); // Stampa effettivamente
|
||||||
|
else
|
||||||
|
warning_box (TR("Nessun record estratto per i parametri inseriti"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCarrelli_app::main_loop()
|
void TCarrelli_app::main_loop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user