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
646
ps/pd5317100.cpp
646
ps/pd5317100.cpp
@ -221,343 +221,383 @@ void TRiepCarrelli::add(TString articolo,TString user[],TDate dataDoc,
|
||||
//metodo principale di elaborazione
|
||||
void TCarrelli_app::elabora(const TMask& mask)const
|
||||
{
|
||||
bool search = true;
|
||||
bool venduto = mask.get_bool(F_VENDUTO);
|
||||
|
||||
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())
|
||||
if(!venduto && TVariant(mask.get(F_COD_CMS))==TVariant(mask.get(F_COD_CMS_TO)))
|
||||
{
|
||||
commessa = riep.get("SALDANA.COMMESSA").as_string();
|
||||
articolo = riep.get("ANAMAG.CODART").as_string();//A
|
||||
TISAM_recordset carico(get_query(0,true));
|
||||
|
||||
if(commessa==commessaOld ||
|
||||
commessa.empty() ||
|
||||
articolo.empty())
|
||||
{
|
||||
continue;
|
||||
//inserire parametri filtri
|
||||
carico.set_var("#FROM",TVariant(mask.get(F_COD_CMS)));//
|
||||
carico.set_var("#TO",TVariant(mask.get(F_COD_CMS_TO)));//
|
||||
carico.set_var("#F_VEN",TVariant(mask.get(F_VENDUTO)));//
|
||||
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(articolo.not_empty())
|
||||
if(search){
|
||||
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";
|
||||
campo << numUser;
|
||||
user[a] = riep.get(campo).as_string();
|
||||
numUser++;
|
||||
}
|
||||
TISAM_recordset carico(get_query(0,true));
|
||||
|
||||
ragsoc = "";//M
|
||||
indir = "";//N
|
||||
dataDoc= "";//O
|
||||
|
||||
TISAM_recordset bolle(get_query(1));
|
||||
bolle.set_var("#COMM",TVariant(articolo));
|
||||
for(bool ok2 = bolle.move_last();ok2;ok2=bolle.move_next())
|
||||
{
|
||||
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();
|
||||
//inserire parametri filtri
|
||||
carico.set_var("#FROM",TVariant(mask.get(F_COD_CMS)));//
|
||||
carico.set_var("#TO",TVariant(mask.get(F_COD_CMS_TO)));//
|
||||
carico.set_var("#F_VEN",TVariant(mask.get(F_VENDUTO)));//
|
||||
carico.set_var("#F_CAR",TVariant(mask.get(F_CARICO)));//
|
||||
for(bool ok = carico.move_first();ok;ok=carico.move_next()){
|
||||
search = false;
|
||||
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(!search){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(commessa==commessaOld ||
|
||||
commessa.empty() ||
|
||||
articolo.empty())
|
||||
{
|
||||
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;
|
||||
continue;
|
||||
}
|
||||
/*if(fornitore.move_next()){
|
||||
descr_conto = fornitore.get("CLIFO.RAGSOC").as_string();
|
||||
}*/
|
||||
commessaOld=commessa;
|
||||
|
||||
|
||||
//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())
|
||||
int numUser = 1;
|
||||
//if(articolo.not_empty())
|
||||
{
|
||||
//VENDUTO
|
||||
TISAM_recordset saldana(get_query_saldana("004076000003"));
|
||||
for(int a = 0; a<14; a++) //da B a N
|
||||
{
|
||||
campo = "ANAMAG.USER";
|
||||
campo << numUser;
|
||||
user[a] = riep.get(campo).as_string();
|
||||
numUser++;
|
||||
}
|
||||
|
||||
ragsoc = "";//M
|
||||
indir = "";//N
|
||||
dataDoc= "";//O
|
||||
|
||||
TISAM_recordset bolle(get_query(1));
|
||||
bolle.set_var("#COMM",TVariant(articolo));
|
||||
for(bool ok2 = bolle.move_last();ok2;ok2=bolle.move_next())
|
||||
{
|
||||
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 ok2 = saldana.move_last();ok2;ok2=saldana.move_next())
|
||||
for(bool ok3 = saldana.move_first();ok3;ok3=saldana.move_next())
|
||||
{
|
||||
venduto_a = "VENDUTO";
|
||||
prezzoVend = prezzoVend + saldana.get("SALDANA.SALDO").as_real();
|
||||
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;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
//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())
|
||||
{
|
||||
//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
|
||||
TISAM_recordset saldana(get_query_saldana("004076000003"));
|
||||
saldana.set_var("#COMM",TVariant(articolo));
|
||||
for(bool ok2 = saldana.move_last();ok2;ok2=saldana.move_next())
|
||||
{
|
||||
venduto_a = "CESPITE";
|
||||
break;
|
||||
venduto_a = "VENDUTO";
|
||||
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())
|
||||
{
|
||||
//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;
|
||||
}
|
||||
}
|
||||
prezzo_p1 = (prezzoAcq + manutenzione)*1.10;//Y
|
||||
prezzo_autom = (prezzo_p1.get_num() * 1.1 * 1.2) - (noleggio.get_num()/2.0);//Z
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
prezzo_p1 = (prezzoAcq + manutenzione)*1.10;//Y
|
||||
prezzo_autom = (prezzo_p1.get_num() * 1.1 * 1.2) - (noleggio.get_num()/2.0);//Z
|
||||
//gestione report
|
||||
TCarrelli_report rep;
|
||||
bool stampa = rep.load("pd5317100");
|
||||
TCarrelli_recordset* riep_set = new TCarrelli_recordset();
|
||||
rep.set_recordset(riep_set);
|
||||
|
||||
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
|
||||
TCarrelli_report rep;
|
||||
bool stampa = rep.load("pd5317100");
|
||||
TCarrelli_recordset* riep_set = new TCarrelli_recordset();
|
||||
rep.set_recordset(riep_set);
|
||||
|
||||
//scandisce clienti e tiene buoni solo quelli valorizzati
|
||||
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)
|
||||
//scandisce clienti e tiene buoni solo quelli valorizzati
|
||||
FOR_EACH_ARRAY_ITEM(riepilogo,c,obj)
|
||||
{
|
||||
//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"));
|
||||
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
|
||||
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user