Aggiunta la funzione setfiler.

Aggiornato l'uso della funzione filter e setregion


git-svn-id: svn://10.65.10.50/trunk@72 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-26 14:06:07 +00:00
parent fe146577cf
commit 10cb8b20f6
17 changed files with 4639 additions and 4555 deletions

View File

@ -17,14 +17,14 @@
class BA3200_application : public TPrintapp class BA3200_application : public TPrintapp
{ {
// TTable* _tab; // TTable* _tab;
TString _tabname; TString _tabname;
TFilename _rptname; TFilename _rptname;
TRelation* _rel; TRelation* _rel;
TCursor *_cur; TCursor *_cur;
TMask* _msk; TMask* _msk;
TString _maskname; TString _maskname;
// TScanner *_rpt; // TScanner *_rpt;
int _logicnum; int _logicnum;
public: public:
@ -69,7 +69,7 @@ bool BA3200_application::set_print(int)
} }
} }
_cur->filter ("", from.empty() ? NULL : &from, to.empty() ? NULL : &to); _cur->setregion (from, to);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
@ -229,7 +229,7 @@ void BA3200_application::user_create()
fatal_box("Impossibile aprire il file '%s'", (const char*)_rptname); fatal_box("Impossibile aprire il file '%s'", (const char*)_rptname);
// _tab = new TTable (_tabname); // _tab = new TTable (_tabname);
_rel = new TRelation (_tabname); _rel = new TRelation (_tabname);
_cur = new TCursor (_rel); _cur = new TCursor (_rel);
@ -256,7 +256,7 @@ void BA3200_application::user_destroy()
delete _msk; delete _msk;
delete _cur; delete _cur;
delete _rel; delete _rel;
// delete _tab; // delete _tab;
} }
int ba3200(int argc, char* argv[]) int ba3200(int argc, char* argv[])

View File

@ -43,7 +43,7 @@ BEGIN
INPUT TIPOA "G" INPUT TIPOA "G"
INPUT CODANAGR FLD_CODANAGR INPUT CODANAGR FLD_CODANAGR
DISPLAY "Codice" CODANAGR DISPLAY "Codice" CODANAGR
DISPLAY "Denominazione@50" RAGSOC DISPLAY "Ragione sociale@50" RAGSOC
DISPLAY "Codice Fiscale@16" COFI DISPLAY "Codice Fiscale@16" COFI
OUTPUT FLD_CODANAGR CODANAGR OUTPUT FLD_CODANAGR CODANAGR
OUTPUT FLD_AG1_RAGSOC RAGSOC OUTPUT FLD_AG1_RAGSOC RAGSOC
@ -64,7 +64,7 @@ BEGIN
INPUT TIPOA "G" INPUT TIPOA "G"
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
INPUT RAGSOC FLD_AG1_RAGSOC INPUT RAGSOC FLD_AG1_RAGSOC
DISPLAY "Denominazione@50" RAGSOC DISPLAY "Ragione sociale@50" RAGSOC
DISPLAY "Codice" CODANAGR DISPLAY "Codice" CODANAGR
DISPLAY "Codice Fiscale " COFI DISPLAY "Codice Fiscale " COFI
COPY OUTPUT FLD_CODANAGR COPY OUTPUT FLD_CODANAGR
@ -115,7 +115,7 @@ BEGIN
INPUT TIPOA "G" INPUT TIPOA "G"
INPUT COFI FLD_AG1_COFI INPUT COFI FLD_AG1_COFI
DISPLAY "Codice Fiscale@16" COFI DISPLAY "Codice Fiscale@16" COFI
DISPLAY "Denominazione@50" RAGSOC DISPLAY "Ragione sociale@50" RAGSOC
DISPLAY "Codice" CODANAGR DISPLAY "Codice" CODANAGR
COPY OUTPUT FLD_CODANAGR COPY OUTPUT FLD_CODANAGR
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
@ -1071,7 +1071,7 @@ END
STRING F_IMP_PROVCOM 5 STRING F_IMP_PROVCOM 5
BEGIN BEGIN
PROMPT 64 6 "Prov." PROMPT 62 6 "Prov."
FLAGS "D" FLAGS "D"
END END
@ -1092,10 +1092,15 @@ BEGIN
WARNING "Ufficio imposte assente" WARNING "Ufficio imposte assente"
END END
STRINF F_DENUFFIIDD 50 STRINF F_DENUFFIIDD 50 48
BEGIN BEGIN
PROMPT 23 7 " " PROMPT 23 7 " "
FLAGS "D" USE %UID KEY 2
INPUT S0 F_DENUFFIIDD
DISPLAY "Denominazione@50" S0
DISPLAY "Ufficio" CODTAB
DISPLAY "C.C.@8" S4
COPY OUTPUT F_UFFIIDD
END END
STRING F_CC_ESATTORIA 8 STRING F_CC_ESATTORIA 8
@ -1115,7 +1120,7 @@ BEGIN
FLAGS "UDG" FLAGS "UDG"
END END
STRING F_DENUFFREG 50 STRING F_DENUFFREG 50 48
BEGIN BEGIN
PROMPT 24 9 "" PROMPT 24 9 ""
FLAGS "D" FLAGS "D"
@ -1132,7 +1137,7 @@ BEGIN
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
STRING F_DENUFFCONC 50 STRING F_DENUFFCONC 50 48
BEGIN BEGIN
PROMPT 24 10 "" PROMPT 24 10 ""
FLAGS "D" FLAGS "D"
@ -1149,7 +1154,7 @@ BEGIN
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
STRING F_DENUFFSERV 50 STRING F_DENUFFSERV 50 48
BEGIN BEGIN
PROMPT 24 11 "" PROMPT 24 11 ""
FLAGS "D" FLAGS "D"

View File

@ -309,7 +309,7 @@ STRING FLD_GD1_COMAA_COMUNI_DESCR 50
BEGIN BEGIN
PROMPT 8 12 ": Nome " PROMPT 8 12 ": Nome "
USE LF_COMUNI KEY 2 SELECT STATO="" USE LF_COMUNI KEY 2 SELECT STATO=""
INPUT COM FLD_GD1_COMAA_COMUNI_DESCR INPUT DENCOM FLD_GD1_COMAA_COMUNI_DESCR
#include <comdden.h> #include <comdden.h>
OUTPUT FLD_GD1_COMAA COM OUTPUT FLD_GD1_COMAA COM
OUTPUT FLD_GD1_COMAA_COMUNI_DESCR DENCOM OUTPUT FLD_GD1_COMAA_COMUNI_DESCR DENCOM

View File

@ -407,7 +407,7 @@ bool BA6100_App::set_print(int)
} }
} }
} }
current_cursor()->setregion(&tr1, &tr2); current_cursor()->setregion(tr1, tr2);
} }
break; break;
case nditte: case nditte:
@ -438,15 +438,14 @@ bool BA6100_App::set_print(int)
tr1.put("RAGSOC",cod_from); tr1.put("RAGSOC",cod_from);
tr2.put("RAGSOC",cod_to); tr2.put("RAGSOC",cod_to);
} }
current_cursor()->setregion(cod_from.empty() ? NULL : &tr1, current_cursor()->setregion(tr1, tr2);
cod_to.empty() ? NULL : &tr2);
} }
break; break;
} }
// setup links and set headers // setup links and set headers
init_print(); init_print();
// enable_print_menu(); // enable_print_menu();
return TRUE; return TRUE;
} }
@ -454,7 +453,7 @@ bool BA6100_App::set_print(int)
void BA6100_App::user_create() void BA6100_App::user_create()
{ {
TToken_string rxp(40); TToken_string rxp(40);
{ {
TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30); TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);
// setup relation // setup relation
@ -545,7 +544,7 @@ void BA6100_App::user_create()
set_wait_threshold(0); set_wait_threshold(0);
p.addstatus(1); p.addstatus(1);
} }
} }
void BA6100_App::user_destroy() void BA6100_App::user_destroy()

View File

@ -183,7 +183,7 @@ bool BA6200_application::set_print(int)
a.put(COM_STATO,statofine); a.put(COM_STATO,statofine);
a.put(COM_COM ,codicefine); a.put(COM_COM ,codicefine);
current_cursor()->setregion(&da, &a); current_cursor()->setregion(da, a);
} }
else else
if (scelta == 2) if (scelta == 2)
@ -207,7 +207,7 @@ bool BA6200_application::set_print(int)
a.put (COM_DENCOM, denomfine); a.put (COM_DENCOM, denomfine);
current_cursor()->setregion(&da, &a); current_cursor()->setregion(da, a);
} }
//set_print_zero(); //set_print_zero();

View File

@ -288,14 +288,13 @@ HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB) if (key == K_TAB)
{ {
TString gruppo(f.mask().get(FLD_CM1_GRUPPO)); int gruppo = f.mask().get_int(FLD_CM1_GRUPPO);
if (gruppo.empty()) return TRUE; if (gruppo == 0) return TRUE;
TString conto(f.mask().get(FLD_CM1_CONTO)); int conto = f.mask().get_int(FLD_CM1_CONTO);
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO)); long sottoconto = f.mask().get_long(FLD_CM1_SOTTOCONTO);
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO"); if (sottoconto != 0 && conto == 0) return f.error_box("Manca il CONTO");
dispatch_e_char(f.parent(), K_AUTO_ENTER); f.mask().stop_run(K_AUTO_ENTER);
} }
return TRUE; return TRUE;
} }

View File

@ -50,7 +50,7 @@ HIDDEN bool key_handler (TMask_field& f, KEY k)
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() && if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
m.get(F_CODCF).not_empty()) m.get(F_CODCF).not_empty())
m.send_key(K_AUTO_ENTER, 0); m.stop_run(K_AUTO_ENTER);
} }
return TRUE; return TRUE;
} }

View File

@ -2813,9 +2813,9 @@ bool CG1500_application::set_print(int)
_cur->setkey(3); _cur->setkey(3);
if (_situazione.not_empty()) if (_situazione.not_empty())
_cur->filter(format("TIPOCF = \"%s\"",(const char*)_situazione)); _cur->setfilter(format("TIPOCF = \"%s\"",(const char*)_situazione));
else else
_cur->filter(""); _cur->setfilter("");
_prog = new TProgind(_cur->items(),"Elaborazione in corso... prego attendere",FALSE); _prog = new TProgind(_cur->items(),"Elaborazione in corso... prego attendere",FALSE);

View File

@ -31,7 +31,7 @@ enum liste {
movimenti=1, movimenti=1,
fatture=2, fatture=2,
movimenti_sezionale=3 movimenti_sezionale=3
}; };
bool filter_func (const TRelation *); bool filter_func (const TRelation *);
bool filter_func_fatture (const TRelation *); bool filter_func_fatture (const TRelation *);
@ -1074,14 +1074,14 @@ print_action CG3100_application::postprocess_print(int file,int count)
--(*cur); --(*cur);
cur->restore_status(); cur->restore_status();
} }
/* /*
esito = my_next(mov); esito = my_next(mov);
if (esito == NOERR) if (esito == NOERR)
{ {
long numrec = mov->get_long(MOV_NUMREG); long numrec = mov->get_long(MOV_NUMREG);
datarec = mov->get_date(MOV_DATAREG); datarec = mov->get_date(MOV_DATAREG);
} }
*/ */
// mov->readat(nrec); // mov->readat(nrec);
_tot_avere_giornaliero += _tot_avere; _tot_avere_giornaliero += _tot_avere;
@ -1336,8 +1336,8 @@ bool CG3100_application::set_print(int m)
{ {
select_cursor(_cur1); select_cursor(_cur1);
if (!provvis) if (!provvis)
_curr1->filter("(PROVVIS=\"\")"); _curr1->setfilter("(PROVVIS=\"\")");
else _curr1->filter(""); else _curr1->setfilter("");
fl = current_cursor()->file(LF_MOV); fl = current_cursor()->file(LF_MOV);
TRectype da (fl->curr()); TRectype da (fl->curr());
TRectype a (fl->curr()); TRectype a (fl->curr());
@ -1345,7 +1345,7 @@ bool CG3100_application::set_print(int m)
a.zero(); a.zero();
da.put(MOV_NUMREG, _numreg_ini); da.put(MOV_NUMREG, _numreg_ini);
a.put(MOV_NUMREG, _numreg_fin); a.put(MOV_NUMREG, _numreg_fin);
current_cursor()->setregion(&da,&a); current_cursor()->setregion(da,a);
add_file(LF_MOV); add_file(LF_MOV);
add_file(LF_RMOV,LF_MOV); add_file(LF_RMOV,LF_MOV);
add_file(LF_RMOVIVA,LF_MOV); add_file(LF_RMOVIVA,LF_MOV);
@ -1354,7 +1354,7 @@ bool CG3100_application::set_print(int m)
{ {
select_cursor(_cur2); select_cursor(_cur2);
if (!provvis) if (!provvis)
_curr2->filter("(PROVVIS=\"\")"); else _curr2->filter(""); _curr2->setfilter("(PROVVIS=\"\")"); else _curr2->setfilter("");
fl = current_cursor()->file(LF_MOV); fl = current_cursor()->file(LF_MOV);
TRectype da (fl->curr()); TRectype da (fl->curr());
TRectype a (fl->curr()); TRectype a (fl->curr());
@ -1362,7 +1362,7 @@ bool CG3100_application::set_print(int m)
a.zero(); a.zero();
da.put(MOV_DATAREG, _data_ini); da.put(MOV_DATAREG, _data_ini);
a.put(MOV_DATAREG, _data_fin); a.put(MOV_DATAREG, _data_fin);
current_cursor()->setregion(&da,&a); current_cursor()->setregion(da,a);
add_file(LF_MOV); add_file(LF_MOV);
add_file(LF_RMOV,LF_MOV); add_file(LF_RMOV,LF_MOV);
add_file(LF_RMOVIVA,LF_MOV); add_file(LF_RMOVIVA,LF_MOV);
@ -1371,7 +1371,7 @@ bool CG3100_application::set_print(int m)
break; break;
case fatture: case fatture:
{ {
fl = current_cursor()->file(LF_MOV); fl = current_cursor()->file(LF_MOV);
TString tipo = msk.get(F_TIPOELENCO); TString tipo = msk.get(F_TIPOELENCO);
bool movprov = msk.get_bool(F_STAMPAMOVP); bool movprov = msk.get_bool(F_STAMPAMOVP);
@ -1399,8 +1399,8 @@ bool CG3100_application::set_print(int m)
} }
select_cursor(_cur3); select_cursor(_cur3);
if (!movprov) if (!movprov)
_curr3->filter("(PROVVIS=\"\")"); _curr3->setfilter("(PROVVIS=\"\")");
else _curr3->filter(""); else _curr3->setfilter("");
TRectype da (fl->curr()); TRectype da (fl->curr());
TRectype a (fl->curr()); TRectype a (fl->curr());
da.zero(); da.zero();
@ -1413,25 +1413,25 @@ bool CG3100_application::set_print(int m)
da.put(MOV_DATAREG, _data_ini); da.put(MOV_DATAREG, _data_ini);
a.put(MOV_DATAREG, _data_fin); a.put(MOV_DATAREG, _data_fin);
da.put(MOV_TIPO, _tipo_ini); da.put(MOV_TIPO, _tipo_ini);
current_cursor()->setregion(&da,&a); current_cursor()->setregion(da,a);
add_file(LF_MOV); add_file(LF_MOV);
add_file(LF_RMOVIVA,LF_MOV); add_file(LF_RMOVIVA,LF_MOV);
} }
break; break;
case movimenti_sezionale: case movimenti_sezionale:
break; break;
default: default:
break; break;
} }
init_print(msk); init_print(msk);
return TRUE; return TRUE;
} }
@ -1562,9 +1562,9 @@ void CG3100_application::init_print(const TMask& msk)
case fatture: case fatture:
{ {
_flags = 0; _flags = 0;
{ {
reset_print(); reset_print();
_settata_prima_riga = FALSE; _settata_prima_riga = FALSE;
_tipo_clifo_prec = ""; _tipo_clifo_prec = "";
@ -1610,17 +1610,17 @@ void CG3100_application::init_print(const TMask& msk)
_tipo_ini = tipo; _tipo_ini = tipo;
_tipo_fin = tipo; _tipo_fin = tipo;
} }
} }
} }
break; break;
case movimenti_sezionale: case movimenti_sezionale:
break; break;
default: default:
break; break;
} }
} }

View File

@ -996,7 +996,7 @@ bool CG3200_application::set_print(int)
a.put(PCN_CONTO,contofine); a.put(PCN_CONTO,contofine);
a.put(PCN_SOTTOCONTO,sottocontofine); a.put(PCN_SOTTOCONTO,sottocontofine);
current_cursor()->setregion(&da, &a); current_cursor()->setregion(da, a);
} }
else else
{ {
@ -1026,7 +1026,7 @@ bool CG3200_application::set_print(int)
a.put(CLI_CONTO,contofine); a.put(CLI_CONTO,contofine);
a.put(CLI_CODCF,sottocontofine); a.put(CLI_CODCF,sottocontofine);
current_cursor()->setregion(&da, &a); current_cursor()->setregion(da, a);
} }
if (_stampatotiva) if (_stampatotiva)
@ -1280,6 +1280,81 @@ void CG3200_application::calcola_progressivi_al()
void CG3200_application::calcola_progressivi() void CG3200_application::calcola_progressivi()
{ {
<<<<<<< cg3200.cpp
TLocalisamfile pconti(LF_PCON);
TLocalisamfile saldi (LF_SALDI);
real pdaresca,paveresca,pdarescap,paverescap;
real progdare_attuale,progavere_attuale,progdare_prec,progavere_prec;
real saldo,progredare_eseprec,progreavere_eseprec,pdarep,paverep;
int indbil;
char salini;
TRectype record(saldi.curr());
saldo = 0.00;
pdarep = 0.00;
paverep = 0.00;
pdaresca = 0.00;
paveresca = 0.00;
pdarescap = 0.00;
paverescap = 0.00;
// Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto
// uguali a quelli di rmov per il calcolo dei progressivi precedenti
record.zero();
record.put(SLD_GRUPPO, _gruppo);
record.put(SLD_CONTO, _conto);
record.put(SLD_SOTTOCONTO, _sottoc);
if (_ricerca == 'P')
indbil = atoi (current_cursor()->file(LF_PCON)->get(PCN_INDBIL));
else
{
if ((_ricerca == 'C') || (_ricerca == 'F'))
{
pconti.setkey(1);
pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO , _conto);
pconti.read();
if (pconti.good())
indbil = atoi (pconti.get(PCN_INDBIL));
else
indbil = 0;
}
}
saldi.setkey(2);
saldi.zero();
saldi.put(SLD_GRUPPO, _gruppo);
saldi.put(SLD_CONTO, _conto);
saldi.put(SLD_SOTTOCONTO, _sottoc);
for ( saldi.read();
((saldi.curr()==record) && !saldi.eof());
saldi.next())
{
long annoes_saldi = saldi.curr().get_long(SLD_ANNOES);
//Calcola i progressivi dell'esercizio attuale
if (annoes_saldi == _annomsk)
{
pdaresca = saldi.curr().get_real(SLD_PDARESCA);
paveresca = saldi.curr().get_real(SLD_PAVERESCA);
saldo = saldi.curr().get_real(SLD_SALDO);
salini = saldi.curr().get(SLD_FLAGSALINI)[0];
}
//Calcola i progressivi dell'esercizio precedente
if (annoes_saldi == _annoesmsk)
{
pdarescap = saldi.curr().get_real(SLD_PDARESCA);
pdarep = saldi.curr().get_real(SLD_PDARE);
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
paverep = saldi.curr().get_real(SLD_PAVERE);
=======
TLocalisamfile pconti(LF_PCON); TLocalisamfile pconti(LF_PCON);
TLocalisamfile saldi (LF_SALDI); TLocalisamfile saldi (LF_SALDI);
real pdaresca,paveresca,pdarescap,paverescap; real pdaresca,paveresca,pdarescap,paverescap;
@ -1353,6 +1428,7 @@ void CG3200_application::calcola_progressivi()
pdarep = saldi.curr().get_real(SLD_PDARE); pdarep = saldi.curr().get_real(SLD_PDARE);
paverescap = saldi.curr().get_real(SLD_PAVERESCA); paverescap = saldi.curr().get_real(SLD_PAVERESCA);
paverep = saldi.curr().get_real(SLD_PAVERE); paverep = saldi.curr().get_real(SLD_PAVERE);
>>>>>>> 1.2
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che // Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere // quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere

View File

@ -193,7 +193,7 @@ const char * CG3400_application::SimboloValuta (const char * cod)
{ {
TTable& tab_val = *_tabval; TTable& tab_val = *_tabval;
TString codtab = format ("%-3s", cod); TString codtab = format ("%-3s", cod);
// static char simbolo; // static char simbolo;
tab_val.zero(); tab_val.zero();
@ -284,7 +284,7 @@ void CG3400_application::get_dati_ditta ()
_cofi = _anag->get(ANA_COFI); _cofi = _anag->get(ANA_COFI);
_paiva = _anag->get(ANA_PAIV); _paiva = _anag->get(ANA_PAIV);
// _ragsoc = _anag->get(ANA_RAGSOC); // _ragsoc = _anag->get(ANA_RAGSOC);
_comunefis = _anag->get(ANA_COMRF); _comunefis = _anag->get(ANA_COMRF);
if (_comunefis.empty()) if (_comunefis.empty())
@ -406,12 +406,12 @@ void CG3400_application::stampa_totali_giorno(TDate data, bool ff)
dep = "@10gOperazioni del "; dep = "@10gOperazioni del ";
dep << data.string(); dep << data.string();
// dep.center_just(); // dep.center_just();
set_row (1, "%s", (const char *)dep); set_row (1, "%s", (const char *)dep);
if (_stampa_width == 132) if (_stampa_width == 132)
// set_row (1, "@94g %15r @112g %15r", &_tot_dare_gg, &_tot_avere_gg ); // set_row (1, "@94g %15r @112g %15r", &_tot_dare_gg, &_tot_avere_gg );
set_row (1, "@94g %r @112g %r", &_tot_dare_gg, &_tot_avere_gg ); set_row (1, "@94g %r @112g %r", &_tot_dare_gg, &_tot_avere_gg );
else else
set_row (1, "@142g %r @164g %r", &_tot_dare_gg, &_tot_avere_gg ); set_row (1, "@142g %r @164g %r", &_tot_dare_gg, &_tot_avere_gg );
@ -420,7 +420,7 @@ void CG3400_application::stampa_totali_giorno(TDate data, bool ff)
{ {
dep = "@10gOperazioni del "; dep = "@10gOperazioni del ";
dep << data.string() << " " << "Anno precedente"; dep << data.string() << " " << "Anno precedente";
// dep.center_just(); // dep.center_just();
set_row (2, "%s", (const char *)dep); set_row (2, "%s", (const char *)dep);
if (_stampa_width == 132) if (_stampa_width == 132)
set_row (2, "@95g %r @112g %r", &_tot_dare_ac, set_row (2, "@95g %r @112g %r", &_tot_dare_ac,
@ -515,13 +515,13 @@ void CG3400_application::set_page_198 (int file, int counter)
set_row (r, "@80g@3s", FLD(LF_MOV, MOV_CODCAUS)); set_row (r, "@80g@3s", FLD(LF_MOV, MOV_CODCAUS));
set_row (r, "#50t", &_descr_causale); set_row (r, "#50t", &_descr_causale);
// set_row (r, "@50s", FLD(LF_RMOV, RMV_DESCR)); // set_row (r, "@50s", FLD(LF_RMOV, RMV_DESCR));
set_row (r, "#50t", &_descr_operazione); set_row (r, "#50t", &_descr_operazione);
// Dare e avere sono settati nella preprocess_page // Dare e avere sono settati nella preprocess_page
// Cosi' pure l'indirizzo nel caso di gestione libro cronologico // Cosi' pure l'indirizzo nel caso di gestione libro cronologico
// _descr contiene la descrizione conto o la ragione sociale // _descr contiene la descrizione conto o la ragione sociale
// v. preprocess_page // v. preprocess_page
break; break;
case LF_RMOVIVA: case LF_RMOVIVA:
break; break;
@ -726,9 +726,9 @@ int CG3400_application::set_header_132()
r++; r++;
} }
else else
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// NO LIBRO GIORNALE IVA UNICO // NO LIBRO GIORNALE IVA UNICO
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
{ {
set_header(r, "Numero@12gDocumento@28gCodice@115gImporti@127g A S"); set_header(r, "Numero@12gDocumento@28gCodice@115gImporti@127g A S");
r++; r++;
@ -823,12 +823,12 @@ bool CG3400_application::preprocess_print(int file, int counter)
else else
_last_header = set_header_198(); _last_header = set_header_198();
// set_real_picture ("###.###.###.###"); // set_real_picture ("###.###.###.###");
set_real_picture (REAL_PICTURE); set_real_picture (REAL_PICTURE);
set_wait_message ("Stampa in corso"); set_wait_message ("Stampa in corso");
if (_stampa_ok == -1) if (_stampa_ok == -1)
; ;
// printer().set_from_page (_pagina_da); // printer().set_from_page (_pagina_da);
else { // la stampa precedente era andata male else { // la stampa precedente era andata male
set_page_number (_stampa_ok); set_page_number (_stampa_ok);
printer().set_from_page (_pagina_da); printer().set_from_page (_pagina_da);
@ -877,8 +877,8 @@ print_action CG3400_application::postprocess_page(int file, int counter)
r = setta_righe_iva(); r = setta_righe_iva();
if (r > 0) if (r > 0)
return REPEAT_PAGE; return REPEAT_PAGE;
// else // else
// return NEXT_PAGE; // return NEXT_PAGE;
} }
_cur->save_status(); _cur->save_status();
++(*_cur); ++(*_cur);
@ -986,7 +986,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
g = current_cursor()->curr(LF_RMOV).get_int(RMV_GRUPPO); g = current_cursor()->curr(LF_RMOV).get_int(RMV_GRUPPO);
c = current_cursor()->curr(LF_RMOV).get_int(RMV_CONTO); c = current_cursor()->curr(LF_RMOV).get_int(RMV_CONTO);
s = current_cursor()->curr(LF_RMOV).get_long(RMV_SOTTOCONTO); s = current_cursor()->curr(LF_RMOV).get_long(RMV_SOTTOCONTO);
// _descr = get_descr (g,c,s); // _descr = get_descr (g,c,s);
boh = get_descr (_pconti, _clifo, g,c,s); boh = get_descr (_pconti, _clifo, g,c,s);
if (boh!=NULL) if (boh!=NULL)
@ -1026,7 +1026,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
sezione = _cur->file(LF_RMOV)->get (RMV_SEZIONE); sezione = _cur->file(LF_RMOV)->get (RMV_SEZIONE);
importo = _cur->file(LF_RMOV)->get_real (RMV_IMPORTO); importo = _cur->file(LF_RMOV)->get_real (RMV_IMPORTO);
// imp = importo.string ("######"); // imp = importo.string ("######");
if (sezione == "D") if (sezione == "D")
{ {
_tot_dare_progr += importo; // prog. generali _tot_dare_progr += importo; // prog. generali
@ -1117,7 +1117,7 @@ void CG3400_application::setta_righe_descr(TParagraph_string* str, enum descr de
} }
while ((r = str->get()) != NULL) while ((r = str->get()) != NULL)
{ {
// reset_row(i); // reset_row(i);
set_row (i, (const char*)frm, r); set_row (i, (const char*)frm, r);
i++; i++;
} }
@ -1160,11 +1160,11 @@ void CG3400_application::setta_righe_valuta()
intracom = current_cursor()->curr(LF_RMOVIVA).get_bool(RMI_INTRA); intracom = current_cursor()->curr(LF_RMOVIVA).get_bool(RMI_INTRA);
simbolo = SimboloValuta(codval); simbolo = SimboloValuta(codval);
// _allegb = CausAlleg(_codcaus); // _allegb = CausAlleg(_codcaus);
// _descr_doc = DescrDoc(_tipodoc); // _descr_doc = DescrDoc(_tipodoc);
// _totdocumenti += _totdoc; // _totdocumenti += _totdoc;
// _ricser = current_cursor()->curr(LF_RMOVIVA).get_int(RMI_RICSER); // _ricser = current_cursor()->curr(LF_RMOVIVA).get_int(RMI_RICSER);
// long numeroreg = cur->curr(LF_RMOVIVA).get_long(RMI_NUMREG); // long numeroreg = cur->curr(LF_RMOVIVA).get_long(RMI_NUMREG);
if ((codval != "LIT") && intracom) if ((codval != "LIT") && intracom)
{ {
@ -1184,8 +1184,8 @@ void CG3400_application::setta_righe_indirizzo()
{ {
TString comune, prov; TString comune, prov;
// Se e' un cliente occasionale leggo indirizzo da mov, senno' e' stato // Se e' un cliente occasionale leggo indirizzo da mov, senno' e' stato
// gia' letto da clifo nella get_descr, richiamata nella preprocess_page // gia' letto da clifo nella get_descr, richiamata nella preprocess_page
if (_occas) if (_occas)
{ {
TCursor * cur = current_cursor(); TCursor * cur = current_cursor();
@ -1196,12 +1196,12 @@ void CG3400_application::setta_righe_indirizzo()
_capcf = occ->get (OCC_CAP); _capcf = occ->get (OCC_CAP);
_comcf = occ->get (OCC_COM); _comcf = occ->get (OCC_COM);
/****** /******
_viacf = cur->file(LF_MOV)->get (MOV_OCINDIR); _viacf = cur->file(LF_MOV)->get (MOV_OCINDIR);
_civcf = cur->file(LF_MOV)->get (MOV_OCCIV); _civcf = cur->file(LF_MOV)->get (MOV_OCCIV);
_capcf = cur->file(LF_MOV)->get (MOV_OCCAP); _capcf = cur->file(LF_MOV)->get (MOV_OCCAP);
_comcf = cur->file(LF_MOV)->get (MOV_OCCOM); _comcf = cur->file(LF_MOV)->get (MOV_OCCOM);
********/ ********/
} }
TRectype dep = look_com (_comcf, _com); TRectype dep = look_com (_comcf, _com);
@ -1357,8 +1357,8 @@ bool CG3400_application::set_print(int)
ma.set_handler (DATA_A, mask_a_data); ma.set_handler (DATA_A, mask_a_data);
mb.set_handler (DLG_RIPRISTINA, mask_b_ripristina); mb.set_handler (DLG_RIPRISTINA, mask_b_ripristina);
// m.set_handler (REG_ANNO, mask_set_pagina_da); // m.set_handler (REG_ANNO, mask_set_pagina_da);
// m.set_handler (REG_DESC, mask_set_pagina_da); // m.set_handler (REG_DESC, mask_set_pagina_da);
tasto = ma.run(); tasto = ma.run();
@ -1385,7 +1385,7 @@ bool CG3400_application::set_print(int)
da.put(MOV_DATAREG, _data_da); da.put(MOV_DATAREG, _data_da);
a.put (MOV_DATAREG, _data_a); a.put (MOV_DATAREG, _data_a);
_cur->setregion (&da, &a); _cur->setregion(da, a);
mb.set (PROGR_DARE, _tot_dare.string()); mb.set (PROGR_DARE, _tot_dare.string());
mb.set (N_RIGA_STAMPATO, _nprog_da); mb.set (N_RIGA_STAMPATO, _nprog_da);

View File

@ -165,7 +165,7 @@ bool CG4300_App::set_print(int n)
if (_year != yy) if (_year != yy)
{ {
TString cond(format("ANNOES=%s",(const char*)_year)); TString cond(format("ANNOES=%s",(const char*)_year));
_cur->filter(cond); _cur->setfilter(cond);
} }
recalc_all(); recalc_all();
return _isprint; return _isprint;
@ -180,7 +180,7 @@ bool CG4300_App::set_print(int n)
if (_year != yy) if (_year != yy)
{ {
TString cond(format("ANNOES=%s",(const char*)_year)); TString cond(format("ANNOES=%s",(const char*)_year));
_cur->filter(cond); _cur->setfilter(cond);
} }
extract_deleghe(); extract_deleghe();
return FALSE; return FALSE;
@ -193,7 +193,7 @@ bool CG4300_App::set_print(int n)
if (_year != yy) if (_year != yy)
{ {
TString cond(format("ANNOES=%s",(const char*)_year)); TString cond(format("ANNOES=%s",(const char*)_year));
_cur->filter(cond); _cur->setfilter(cond);
} }
recalc_acconti(); recalc_acconti();
return _isprint; return _isprint;

View File

@ -1,4 +1,4 @@
// $Id: maskfld.cpp,v 1.4 1994-08-26 13:07:14 guy Exp $ // $Id: maskfld.cpp,v 1.5 1994-08-26 14:05:29 alex Exp $
#include <xvt.h> #include <xvt.h>
#include <applicat.h> #include <applicat.h>
@ -1160,7 +1160,8 @@ int TBrowse::do_input(bool filter)
else work << _filter[i]; else work << _filter[i];
} }
const char* w = work.empty() ? NULL : (const char*) work; _cursor->setfilter(work);
_cursor->setregion(filtrec, filtrec);
if (filtrec.empty()) _cursor->filter(w); if (filtrec.empty()) _cursor->filter(w);
else _cursor->filter(w, &filtrec, &filtrec); else _cursor->filter(w, &filtrec, &filtrec);

View File

@ -718,7 +718,7 @@ bool TSpreadsheet::on_key(KEY k)
{ {
switch(k) switch(k)
{ {
case K_SHIFT_ENTER: case K_CTRL_ENTER:
case K_ESC: case K_ESC:
mask().send_key(k, 0); mask().send_key(k, 0);
return TRUE; return TRUE;

View File

@ -1,4 +1,4 @@
// $Id: relapp.cpp,v 1.3 1994-08-23 13:52:26 guy Exp $ // $Id: relapp.cpp,v 1.4 1994-08-26 14:05:47 alex Exp $
#include <mailbox.h> #include <mailbox.h>
#include <sheet.h> #include <sheet.h>
#include <urldefid.h> #include <urldefid.h>
@ -829,7 +829,8 @@ bool TRelation_application::filter()
if (campo != NULL) if (campo != NULL)
campo->write(t.mid(u+1), rec); campo->write(t.mid(u+1), rec);
} }
cur->filter("", &rec, &rec); cur->setfilter("");
cur->setregion(rec, rec);
if (s == NULL) id = 0; if (s == NULL) id = 0;
} }
} }

View File

@ -1,4 +1,4 @@
// $Id: relation.cpp,v 1.4 1994-08-24 07:24:04 villa Exp $ // $Id: relation.cpp,v 1.5 1994-08-26 14:06:00 alex Exp $
// relation.cpp // relation.cpp
// fv 12/8/93 // fv 12/8/93
// relation class for isam files // relation class for isam files
@ -845,7 +845,8 @@ TRecnotype TCursor::update()
} }
void TCursor::filter(const char* filter, TRectype *from, TRectype* to) void TCursor::filter(const char* filter, const TRectype *from,
const TRectype* to)
{ {
CHECK(!_frozen, "Impossibile filtrare un cursore congelato"); CHECK(!_frozen, "Impossibile filtrare un cursore congelato");

View File

@ -1,4 +1,4 @@
/* $Id: relation.h,v 1.1.1.1 1994-08-12 10:52:02 alex Exp $ */ /* $Id: relation.h,v 1.2 1994-08-26 14:06:07 alex Exp $ */
// join.h // join.h
// fv 12/8/93 // fv 12/8/93
// join class for isam files // join class for isam files
@ -21,17 +21,17 @@ class TRelation : public TObject
{ {
friend class TRelationdef; friend class TRelationdef;
// class TRelation : public TLocalisamfile // class TRelation : public TLocalisamfile
// @END // @END
// @DPRIV // @DPRIV
TToken_string _status; // stato della relazione TToken_string _status; // stato della relazione
TArray _files; // file descriptors TArray _files; // file descriptors
TArray _reldefs; // TRelationdef array TArray _reldefs; // TRelationdef array
int _errors; int _errors;
// @END // @END
// @FPROT // @FPROT
protected: protected:
virtual void print_on(ostream& out) const; virtual void print_on(ostream& out) const;
@ -49,10 +49,10 @@ protected:
// @END // @END
int position_rels(TIsamop op = _isequal, TReclock lockop = _nolock, TDate& atdate = botime, int first = 0); int position_rels(TIsamop op = _isequal, TReclock lockop = _nolock, TDate& atdate = botime, int first = 0);
friend class TCursor; friend class TCursor;
public: public:
// @FPUB // @FPUB
int update() { return position_rels(_isequal, _nolock);} int update() { return position_rels(_isequal, _nolock);}
void zero(); void zero();
virtual int next(TReclock lockop = _nolock) { return file()->next(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); } virtual int next(TReclock lockop = _nolock) { return file()->next(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
@ -150,7 +150,7 @@ typedef bool (*FILTERFUNCTION)(const TRelation* r);
class TCursor : public TObject class TCursor : public TObject
{ {
// @DPRIV // @DPRIV
TRelation* _if; TRelation* _if;
int _nkey; int _nkey;
TRecnotype _pos; // Posizione corrente TRecnotype _pos; // Posizione corrente
@ -165,9 +165,9 @@ class TCursor : public TObject
bool _frozen; bool _frozen;
FILTERFUNCTION _filterfunction; FILTERFUNCTION _filterfunction;
TFilename _indexname; TFilename _indexname;
// @END // @END
// @FPRIV // @FPRIV
virtual TRecnotype buildcursor(TRecnotype rp); virtual TRecnotype buildcursor(TRecnotype rp);
int filtercursor(int pagecnt, TRecnotype* page); int filtercursor(int pagecnt, TRecnotype* page);
bool changed(); bool changed();
@ -176,11 +176,13 @@ class TCursor : public TObject
TRecnotype update(); TRecnotype update();
protected: protected:
TRecnotype readrec(); TRecnotype readrec();
void filter(const char* filter, const TRectype* from = NULL,
const TRectype* to = NULL);
public: public:
// @FPUB // @FPUB
TRecnotype operator =(const TRecnotype nr); // Assegnazione TRecnotype operator =(const TRecnotype nr); // Assegnazione
TCursor& operator +=(const TRecnotype nr); // Scorri avanti TCursor& operator +=(const TRecnotype nr); // Scorri avanti
TCursor& operator -=(const TRecnotype nr); // Scorri indietro TCursor& operator -=(const TRecnotype nr); // Scorri indietro
@ -198,12 +200,12 @@ class TCursor : public TObject
TRecnotype read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime); TRecnotype read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime);
virtual bool ok() const; virtual bool ok() const;
void filter(const char* filter, TRectype* from = NULL, TRectype* to = NULL);
const char* filter() const { return _filter; } const char* filter() const { return _filter; }
void freeze(bool on = TRUE) { _frozen = on; } void freeze(bool on = TRUE) { _frozen = on; }
bool frozen() const { return _frozen; } bool frozen() const { return _frozen; }
void setregion(TRectype* from = NULL, TRectype* to = NULL) void setfilter(const char* filter_expr) { filter(filter_expr); }
{ filter(NULL,from,to); } void setregion(const TRectype& from, const TRectype& to)
{ filter(NULL,&from, &to); }
TRelation* relation() const { return _if; } TRelation* relation() const { return _if; }
TLocalisamfile* file(int lnum = 0) const { return _if->lfile(lnum); } TLocalisamfile* file(int lnum = 0) const { return _if->lfile(lnum); }
@ -234,7 +236,7 @@ class TCursor : public TObject
class TFieldref : public TObject class TFieldref : public TObject
{ {
// @DPRIV // @DPRIV
short _fileid; // Numero del file short _fileid; // Numero del file
TString16 _id; // Nome tabella o stringa col numero del file TString16 _id; // Nome tabella o stringa col numero del file
TString16 _name; // Nome del campo TString16 _name; // Nome del campo
@ -244,7 +246,7 @@ protected:
virtual void print_on(ostream& out) const; virtual void print_on(ostream& out) const;
public: public:
// @FPUB // @FPUB
TFieldref(); TFieldref();
TFieldref(const TString&, short defid); TFieldref(const TString&, short defid);