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:
parent
fe146577cf
commit
10cb8b20f6
@ -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 FALSE;
|
||||
|
@ -43,7 +43,7 @@ BEGIN
|
||||
INPUT TIPOA "G"
|
||||
INPUT CODANAGR FLD_CODANAGR
|
||||
DISPLAY "Codice" CODANAGR
|
||||
DISPLAY "Denominazione@50" RAGSOC
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
DISPLAY "Codice Fiscale@16" COFI
|
||||
OUTPUT FLD_CODANAGR CODANAGR
|
||||
OUTPUT FLD_AG1_RAGSOC RAGSOC
|
||||
@ -64,7 +64,7 @@ BEGIN
|
||||
INPUT TIPOA "G"
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT RAGSOC FLD_AG1_RAGSOC
|
||||
DISPLAY "Denominazione@50" RAGSOC
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
DISPLAY "Codice" CODANAGR
|
||||
DISPLAY "Codice Fiscale " COFI
|
||||
COPY OUTPUT FLD_CODANAGR
|
||||
@ -115,7 +115,7 @@ BEGIN
|
||||
INPUT TIPOA "G"
|
||||
INPUT COFI FLD_AG1_COFI
|
||||
DISPLAY "Codice Fiscale@16" COFI
|
||||
DISPLAY "Denominazione@50" RAGSOC
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
DISPLAY "Codice" CODANAGR
|
||||
COPY OUTPUT FLD_CODANAGR
|
||||
CHECKTYPE REQUIRED
|
||||
@ -1071,7 +1071,7 @@ END
|
||||
|
||||
STRING F_IMP_PROVCOM 5
|
||||
BEGIN
|
||||
PROMPT 64 6 "Prov."
|
||||
PROMPT 62 6 "Prov."
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
@ -1092,10 +1092,15 @@ BEGIN
|
||||
WARNING "Ufficio imposte assente"
|
||||
END
|
||||
|
||||
STRINF F_DENUFFIIDD 50
|
||||
STRINF F_DENUFFIIDD 50 48
|
||||
BEGIN
|
||||
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
|
||||
|
||||
STRING F_CC_ESATTORIA 8
|
||||
@ -1115,7 +1120,7 @@ BEGIN
|
||||
FLAGS "UDG"
|
||||
END
|
||||
|
||||
STRING F_DENUFFREG 50
|
||||
STRING F_DENUFFREG 50 48
|
||||
BEGIN
|
||||
PROMPT 24 9 ""
|
||||
FLAGS "D"
|
||||
@ -1132,7 +1137,7 @@ BEGIN
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_DENUFFCONC 50
|
||||
STRING F_DENUFFCONC 50 48
|
||||
BEGIN
|
||||
PROMPT 24 10 ""
|
||||
FLAGS "D"
|
||||
@ -1149,7 +1154,7 @@ BEGIN
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_DENUFFSERV 50
|
||||
STRING F_DENUFFSERV 50 48
|
||||
BEGIN
|
||||
PROMPT 24 11 ""
|
||||
FLAGS "D"
|
||||
|
@ -309,7 +309,7 @@ STRING FLD_GD1_COMAA_COMUNI_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 8 12 ": Nome "
|
||||
USE LF_COMUNI KEY 2 SELECT STATO=""
|
||||
INPUT COM FLD_GD1_COMAA_COMUNI_DESCR
|
||||
INPUT DENCOM FLD_GD1_COMAA_COMUNI_DESCR
|
||||
#include <comdden.h>
|
||||
OUTPUT FLD_GD1_COMAA COM
|
||||
OUTPUT FLD_GD1_COMAA_COMUNI_DESCR DENCOM
|
||||
|
@ -407,7 +407,7 @@ bool BA6100_App::set_print(int)
|
||||
}
|
||||
}
|
||||
}
|
||||
current_cursor()->setregion(&tr1, &tr2);
|
||||
current_cursor()->setregion(tr1, tr2);
|
||||
}
|
||||
break;
|
||||
case nditte:
|
||||
@ -438,8 +438,7 @@ bool BA6100_App::set_print(int)
|
||||
tr1.put("RAGSOC",cod_from);
|
||||
tr2.put("RAGSOC",cod_to);
|
||||
}
|
||||
current_cursor()->setregion(cod_from.empty() ? NULL : &tr1,
|
||||
cod_to.empty() ? NULL : &tr2);
|
||||
current_cursor()->setregion(tr1, tr2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ bool BA6200_application::set_print(int)
|
||||
a.put(COM_STATO,statofine);
|
||||
a.put(COM_COM ,codicefine);
|
||||
|
||||
current_cursor()->setregion(&da, &a);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
else
|
||||
if (scelta == 2)
|
||||
@ -207,7 +207,7 @@ bool BA6200_application::set_print(int)
|
||||
|
||||
a.put (COM_DENCOM, denomfine);
|
||||
|
||||
current_cursor()->setregion(&da, &a);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
//set_print_zero();
|
||||
|
@ -288,14 +288,13 @@ HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_TAB)
|
||||
{
|
||||
TString gruppo(f.mask().get(FLD_CM1_GRUPPO));
|
||||
if (gruppo.empty()) return TRUE;
|
||||
TString conto(f.mask().get(FLD_CM1_CONTO));
|
||||
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
||||
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
||||
dispatch_e_char(f.parent(), K_AUTO_ENTER);
|
||||
int gruppo = f.mask().get_int(FLD_CM1_GRUPPO);
|
||||
if (gruppo == 0) return TRUE;
|
||||
int conto = f.mask().get_int(FLD_CM1_CONTO);
|
||||
long sottoconto = f.mask().get_long(FLD_CM1_SOTTOCONTO);
|
||||
if (sottoconto != 0 && conto == 0) return f.error_box("Manca il CONTO");
|
||||
f.mask().stop_run(K_AUTO_ENTER);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -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() &&
|
||||
m.get(F_CODCF).not_empty())
|
||||
m.send_key(K_AUTO_ENTER, 0);
|
||||
m.stop_run(K_AUTO_ENTER);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -2813,9 +2813,9 @@ bool CG1500_application::set_print(int)
|
||||
_cur->setkey(3);
|
||||
|
||||
if (_situazione.not_empty())
|
||||
_cur->filter(format("TIPOCF = \"%s\"",(const char*)_situazione));
|
||||
_cur->setfilter(format("TIPOCF = \"%s\"",(const char*)_situazione));
|
||||
else
|
||||
_cur->filter("");
|
||||
_cur->setfilter("");
|
||||
|
||||
_prog = new TProgind(_cur->items(),"Elaborazione in corso... prego attendere",FALSE);
|
||||
|
||||
|
@ -1336,8 +1336,8 @@ bool CG3100_application::set_print(int m)
|
||||
{
|
||||
select_cursor(_cur1);
|
||||
if (!provvis)
|
||||
_curr1->filter("(PROVVIS=\"\")");
|
||||
else _curr1->filter("");
|
||||
_curr1->setfilter("(PROVVIS=\"\")");
|
||||
else _curr1->setfilter("");
|
||||
fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
@ -1345,7 +1345,7 @@ bool CG3100_application::set_print(int m)
|
||||
a.zero();
|
||||
da.put(MOV_NUMREG, _numreg_ini);
|
||||
a.put(MOV_NUMREG, _numreg_fin);
|
||||
current_cursor()->setregion(&da,&a);
|
||||
current_cursor()->setregion(da,a);
|
||||
add_file(LF_MOV);
|
||||
add_file(LF_RMOV,LF_MOV);
|
||||
add_file(LF_RMOVIVA,LF_MOV);
|
||||
@ -1354,7 +1354,7 @@ bool CG3100_application::set_print(int m)
|
||||
{
|
||||
select_cursor(_cur2);
|
||||
if (!provvis)
|
||||
_curr2->filter("(PROVVIS=\"\")"); else _curr2->filter("");
|
||||
_curr2->setfilter("(PROVVIS=\"\")"); else _curr2->setfilter("");
|
||||
fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
@ -1362,7 +1362,7 @@ bool CG3100_application::set_print(int m)
|
||||
a.zero();
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
current_cursor()->setregion(&da,&a);
|
||||
current_cursor()->setregion(da,a);
|
||||
add_file(LF_MOV);
|
||||
add_file(LF_RMOV,LF_MOV);
|
||||
add_file(LF_RMOVIVA,LF_MOV);
|
||||
@ -1399,8 +1399,8 @@ bool CG3100_application::set_print(int m)
|
||||
}
|
||||
select_cursor(_cur3);
|
||||
if (!movprov)
|
||||
_curr3->filter("(PROVVIS=\"\")");
|
||||
else _curr3->filter("");
|
||||
_curr3->setfilter("(PROVVIS=\"\")");
|
||||
else _curr3->setfilter("");
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
da.zero();
|
||||
@ -1413,7 +1413,7 @@ bool CG3100_application::set_print(int m)
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
da.put(MOV_TIPO, _tipo_ini);
|
||||
current_cursor()->setregion(&da,&a);
|
||||
current_cursor()->setregion(da,a);
|
||||
add_file(LF_MOV);
|
||||
add_file(LF_RMOVIVA,LF_MOV);
|
||||
|
||||
|
@ -996,7 +996,7 @@ bool CG3200_application::set_print(int)
|
||||
a.put(PCN_CONTO,contofine);
|
||||
a.put(PCN_SOTTOCONTO,sottocontofine);
|
||||
|
||||
current_cursor()->setregion(&da, &a);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1026,7 +1026,7 @@ bool CG3200_application::set_print(int)
|
||||
a.put(CLI_CONTO,contofine);
|
||||
a.put(CLI_CODCF,sottocontofine);
|
||||
|
||||
current_cursor()->setregion(&da, &a);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
if (_stampatotiva)
|
||||
@ -1280,6 +1280,81 @@ void CG3200_application::calcola_progressivi_al()
|
||||
|
||||
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 saldi (LF_SALDI);
|
||||
real pdaresca,paveresca,pdarescap,paverescap;
|
||||
@ -1353,6 +1428,7 @@ void CG3200_application::calcola_progressivi()
|
||||
pdarep = saldi.curr().get_real(SLD_PDARE);
|
||||
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
||||
paverep = saldi.curr().get_real(SLD_PAVERE);
|
||||
>>>>>>> 1.2
|
||||
|
||||
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
||||
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
||||
|
@ -1385,7 +1385,7 @@ bool CG3400_application::set_print(int)
|
||||
da.put(MOV_DATAREG, _data_da);
|
||||
a.put (MOV_DATAREG, _data_a);
|
||||
|
||||
_cur->setregion (&da, &a);
|
||||
_cur->setregion(da, a);
|
||||
|
||||
mb.set (PROGR_DARE, _tot_dare.string());
|
||||
mb.set (N_RIGA_STAMPATO, _nprog_da);
|
||||
|
@ -165,7 +165,7 @@ bool CG4300_App::set_print(int n)
|
||||
if (_year != yy)
|
||||
{
|
||||
TString cond(format("ANNOES=%s",(const char*)_year));
|
||||
_cur->filter(cond);
|
||||
_cur->setfilter(cond);
|
||||
}
|
||||
recalc_all();
|
||||
return _isprint;
|
||||
@ -180,7 +180,7 @@ bool CG4300_App::set_print(int n)
|
||||
if (_year != yy)
|
||||
{
|
||||
TString cond(format("ANNOES=%s",(const char*)_year));
|
||||
_cur->filter(cond);
|
||||
_cur->setfilter(cond);
|
||||
}
|
||||
extract_deleghe();
|
||||
return FALSE;
|
||||
@ -193,7 +193,7 @@ bool CG4300_App::set_print(int n)
|
||||
if (_year != yy)
|
||||
{
|
||||
TString cond(format("ANNOES=%s",(const char*)_year));
|
||||
_cur->filter(cond);
|
||||
_cur->setfilter(cond);
|
||||
}
|
||||
recalc_acconti();
|
||||
return _isprint;
|
||||
|
@ -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 <applicat.h>
|
||||
@ -1160,7 +1160,8 @@ int TBrowse::do_input(bool filter)
|
||||
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);
|
||||
else _cursor->filter(w, &filtrec, &filtrec);
|
||||
|
@ -718,7 +718,7 @@ bool TSpreadsheet::on_key(KEY k)
|
||||
{
|
||||
switch(k)
|
||||
{
|
||||
case K_SHIFT_ENTER:
|
||||
case K_CTRL_ENTER:
|
||||
case K_ESC:
|
||||
mask().send_key(k, 0);
|
||||
return TRUE;
|
||||
|
@ -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 <sheet.h>
|
||||
#include <urldefid.h>
|
||||
@ -829,7 +829,8 @@ bool TRelation_application::filter()
|
||||
if (campo != NULL)
|
||||
campo->write(t.mid(u+1), rec);
|
||||
}
|
||||
cur->filter("", &rec, &rec);
|
||||
cur->setfilter("");
|
||||
cur->setregion(rec, rec);
|
||||
if (s == NULL) id = 0;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
// fv 12/8/93
|
||||
// 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");
|
||||
|
@ -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
|
||||
// fv 12/8/93
|
||||
// join class for isam files
|
||||
@ -178,6 +178,8 @@ class TCursor : public TObject
|
||||
|
||||
protected:
|
||||
TRecnotype readrec();
|
||||
void filter(const char* filter, const TRectype* from = NULL,
|
||||
const TRectype* to = NULL);
|
||||
|
||||
public:
|
||||
// @FPUB
|
||||
@ -198,12 +200,12 @@ class TCursor : public TObject
|
||||
TRecnotype read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime);
|
||||
virtual bool ok() const;
|
||||
|
||||
void filter(const char* filter, TRectype* from = NULL, TRectype* to = NULL);
|
||||
const char* filter() const { return _filter; }
|
||||
void freeze(bool on = TRUE) { _frozen = on; }
|
||||
bool frozen() const { return _frozen; }
|
||||
void setregion(TRectype* from = NULL, TRectype* to = NULL)
|
||||
{ filter(NULL,from,to); }
|
||||
void setfilter(const char* filter_expr) { filter(filter_expr); }
|
||||
void setregion(const TRectype& from, const TRectype& to)
|
||||
{ filter(NULL,&from, &to); }
|
||||
|
||||
TRelation* relation() const { return _if; }
|
||||
TLocalisamfile* file(int lnum = 0) const { return _if->lfile(lnum); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user