Chiusura/Apertura conti con gestione riveduta codici esercizio
git-svn-id: svn://10.65.10.50/trunk@2668 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8206bb98e0
commit
d38c313f86
@ -95,7 +95,7 @@ HIDDEN bool anni_contigui (int annoch, int annoap)
|
||||
{
|
||||
TString16 dep(format("%04d", annoch));
|
||||
|
||||
TTable esc ("ESC");
|
||||
TTable esc ("ESC");
|
||||
|
||||
esc.zero();
|
||||
esc.put("CODTAB", dep);
|
||||
@ -155,16 +155,6 @@ bool mask_datac (TMask_field& f, KEY k)
|
||||
TDate iniziop = TabEsap.get_date("D0");
|
||||
TDate finep = TabEsap.get_date("D1");
|
||||
TDate data = f.get();
|
||||
/*
|
||||
TabEs.last();
|
||||
TDate inizio = TabEs.get_date("D0");
|
||||
TDate fine = TabEs.get_date("D1");
|
||||
TDate scarico = TabEs.get_date("D2");
|
||||
TabEs.prev();
|
||||
TDate iniziop = TabEs.get_date("D0");
|
||||
TDate finep = TabEs.get_date("D1");
|
||||
TDate data = f.get();
|
||||
*/
|
||||
TString istr = inizio.string();
|
||||
TString fstr = fine.string();
|
||||
|
||||
@ -253,16 +243,7 @@ bool mask_dataap (TMask_field& f, KEY k)
|
||||
TDate iniziop = TabEsap.get_date("D0");
|
||||
TDate finep = TabEsap.get_date("D1");
|
||||
TDate data = f.get();
|
||||
/*
|
||||
TabEs.last();
|
||||
TDate inizio = TabEs.get_date("D0");
|
||||
TDate fine = TabEs.get_date("D1");
|
||||
TDate scarico = TabEs.get_date("D2");
|
||||
TabEs.prev();
|
||||
TDate iniziop = TabEs.get_date("D0");
|
||||
TDate finep = TabEs.get_date("D1");
|
||||
TDate data = f.get();
|
||||
*/
|
||||
|
||||
TString istr = inizio.string();
|
||||
TString fstr = fine.string();
|
||||
|
||||
@ -506,13 +487,43 @@ bool CG4600_application::set()
|
||||
|
||||
m.set(F_CHIUSURA, conf.get("CoCaCh"));
|
||||
m.set(F_APERTURA, conf.get("CoCaAp"));
|
||||
|
||||
TabEs.last();
|
||||
int annoap = TabEs.get_int ("CODTAB");
|
||||
|
||||
//
|
||||
TabEs.first();
|
||||
TRecnotype rnc = TabEs.recno();
|
||||
TRecnotype rnp = TabEs.recno();
|
||||
TDate fin = TabEs.get_date("D1"); //data fine es. in corso
|
||||
TDate ini = TabEs.get_date("D0");
|
||||
|
||||
// determina esercizio con data fine piu' alta
|
||||
for ( ; !TabEs.eof(); TabEs.next())
|
||||
if (TabEs.get_date("D1") > fin)
|
||||
{
|
||||
rnc = TabEs.recno();
|
||||
fin = TabEs.get_date("D1");
|
||||
ini = TabEs.get_date("D0");
|
||||
}
|
||||
|
||||
// determina quello precedente
|
||||
--ini;
|
||||
for (TabEs.first(); !TabEs.eof(); TabEs.next())
|
||||
{
|
||||
if (TabEs.get_date("D1") == ini)
|
||||
{
|
||||
rnp = TabEs.recno();
|
||||
break;
|
||||
}
|
||||
else if (TabEs.get_date("D1") <= ini)
|
||||
rnp = TabEs.recno();
|
||||
}
|
||||
|
||||
TabEs.readat(rnc);
|
||||
int annoap = TabEs.get_int("CODTAB");
|
||||
TDate inizio = TabEs.get_date("D0"); //data inizio es. in corso
|
||||
TabEs.prev();
|
||||
int annoch = TabEs.get_int ("CODTAB");
|
||||
TabEs.readat(rnp);
|
||||
int annoch = TabEs.get_int("CODTAB");
|
||||
TDate fine = TabEs.get_date("D1"); //data fine es. precedente
|
||||
|
||||
m.set(F_ANNO, annoap);
|
||||
m.set(F_ANNOCH, annoch);
|
||||
m.set(F_DATAC, fine.string());
|
||||
|
Loading…
x
Reference in New Issue
Block a user