Patch level : at
Files correlati : Ricompilazione Demo : [ ] Commento : riorganizzazione storica avis git-svn-id: svn://10.65.10.50/trunk@10587 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4f89d4826a
commit
f14d918267
109
at/at7900.cpp
109
at/at7900.cpp
@ -1,109 +0,0 @@
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <tabutil.h>
|
||||
#include <recarray.h>
|
||||
#include <utility.h>
|
||||
#include <lffiles.h>
|
||||
|
||||
#include "at7.h"
|
||||
#include "atlib.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
|
||||
class TUltimaDon : public TPrintapp
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
int _cur;
|
||||
TLocalisamfile* _donaz;
|
||||
TRecord_array* _sdonazioni;
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
|
||||
public:
|
||||
TUltimaDon() {}
|
||||
};
|
||||
|
||||
HIDDEN inline TUltimaDon& app() { return (TUltimaDon&) main_app(); }
|
||||
|
||||
bool TUltimaDon::preprocess_page(int file, int counter)
|
||||
{
|
||||
bool rewrite = FALSE;
|
||||
TRectype& recsog = current_cursor()->curr();
|
||||
const long codice = recsog.get_long(SOG_CODICE);
|
||||
TRectype* keyd = new TRectype(LF_DONAZ);
|
||||
keyd->put(DON_CODICE, codice);
|
||||
int errd = _sdonazioni->read(keyd);
|
||||
if ((errd == NOERR) && (_sdonazioni->rows()>0))
|
||||
{
|
||||
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
||||
int totdonsi = recsog.get_int(SOG_TOTDONSI);
|
||||
int totdonaf = recsog.get_int(SOG_TOTDONAF);
|
||||
int totdon = recsog.get_int(SOG_TOTDON);
|
||||
int totale = totdonsi+totdonaf;
|
||||
int ultima = _sdonazioni->rows();
|
||||
TRectype& riga = _sdonazioni->row(ultima, TRUE);
|
||||
TDate datadon = riga.get(DON_DATADON);
|
||||
if (datadon > dataultdon || totdon != totale)
|
||||
{
|
||||
rewrite = TRUE;
|
||||
calcola_donazioni_lib(recsog,_sdonazioni);
|
||||
}
|
||||
if (rewrite)
|
||||
current_cursor()->file().rewrite();
|
||||
}
|
||||
return rewrite;
|
||||
}
|
||||
|
||||
void TUltimaDon::set_page(int file, int cnt)
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
||||
}
|
||||
|
||||
bool TUltimaDon::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
reset_print();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TUltimaDon::user_create()
|
||||
{
|
||||
_msk = new TMask("at7900a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_donaz = new TLocalisamfile(LF_DONAZ);
|
||||
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
||||
_cur = add_cursor(new TCursor(_rel, "", 1));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TUltimaDon::user_destroy()
|
||||
{
|
||||
delete _sdonazioni;
|
||||
delete _donaz;
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at7900(int argc, char* argv[])
|
||||
{
|
||||
TUltimaDon a;
|
||||
a.run(argc, argv, "Controllo data ultima donazione e totale");
|
||||
return 0;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
PAGE "Controllo data ultima donazione" -1 -1 78 20
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 14 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user