Adeguamento alla versione definitva dei progetti (parte terza)
git-svn-id: svn://10.65.10.50/trunk@5716 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ee67f5aaae
commit
4786539661
198
at/at1600.cpp
198
at/at1600.cpp
@ -1,198 +0,0 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <lffiles.h>
|
||||
|
||||
#include "at1.h"
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at1600a.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
class TSbloccoEsclusi : public TPrintapp
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
int _cur;
|
||||
TDate _data_sblocco; // data scadenza esclusione fino a _data_sblocco
|
||||
TDate _data_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
bool _definitiva;
|
||||
|
||||
static bool filter_func_sbloccoesclusi(const TRelation* rel);
|
||||
|
||||
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:
|
||||
void filtra_sezioni();
|
||||
void crea_intestazione();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TSbloccoEsclusi() : _data_sblocco(TODAY), _data_stampa(TODAY) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSbloccoEsclusi& app() { return (TSbloccoEsclusi&) main_app(); }
|
||||
|
||||
void TSbloccoEsclusi::filtra_sezioni()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
bool TSbloccoEsclusi::preprocess_page(int file, int counter)
|
||||
{
|
||||
TRectype& recsog = current_cursor()->curr();
|
||||
if (_definitiva)
|
||||
{
|
||||
recsog.put(SOG_ESCLUSO, " ");
|
||||
recsog.put(SOG_TERMESCL, NULLDATE);
|
||||
current_cursor()->file().rewrite();
|
||||
}
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
||||
const TString16 codsot = recsog.get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TSbloccoEsclusi::set_page(int file, int cnt)
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
||||
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@12g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
|
||||
set_row(1,"@38g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
||||
set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
}
|
||||
|
||||
bool TSbloccoEsclusi::filter_func_sbloccoesclusi(const TRelation* rel)
|
||||
{
|
||||
TRectype& recsog = rel->lfile().curr();
|
||||
TDate scadenza = recsog.get(SOG_TERMESCL);
|
||||
return (scadenza.ok() && scadenza <= app()._data_sblocco);
|
||||
}
|
||||
|
||||
void TSbloccoEsclusi::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TSbloccoEsclusi::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
_data_sblocco = _msk->get(F_DATA);
|
||||
_definitiva = _msk->get_bool(F_DEFINITIVA);
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
current_cursor()->setfilter("ESCLUSO == \"TD\"", TRUE);
|
||||
current_cursor()->set_filterfunction(filter_func_sbloccoesclusi, TRUE);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSbloccoEsclusi::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
TString sep(132);
|
||||
if (_definitiva)
|
||||
sep = "SBLOCCO DEFINITIVO ESCLUSI ";
|
||||
else
|
||||
sep = "STAMPA PROVVISORIA PER SBLOCCO ESCLUSI ";
|
||||
sep << " FINO ALLA DATA ";
|
||||
TString16 data_stampa = _data_sblocco.string();
|
||||
sep << data_stampa;
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il");
|
||||
set_header(5,"@0g--------@9g--@12g-------------------------@38g----------");
|
||||
}
|
||||
|
||||
bool TSbloccoEsclusi::user_create()
|
||||
{
|
||||
_msk = new TMask("at1600a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
//cursore ordinamento per sezione+sottogruppo+cognome+nome
|
||||
_cur = add_cursor(new TCursor(_rel, "", 3));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSbloccoEsclusi::user_destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1600(int argc, char* argv[])
|
||||
{
|
||||
TSbloccoEsclusi a;
|
||||
a.run(argc, argv, "Sblocco esclusi");
|
||||
return 0;
|
||||
}
|
13
at/at1600a.h
13
at/at1600a.h
@ -1,13 +0,0 @@
|
||||
// sblocco esclusi
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_SEZINI 101
|
||||
#define F_D_SEZINI 102
|
||||
#define F_SOTINI 103
|
||||
#define F_D_SOTINI 104
|
||||
#define F_SEZFIN 105
|
||||
#define F_D_SEZFIN 106
|
||||
#define F_SOTFIN 107
|
||||
#define F_D_SOTFIN 108
|
||||
#define F_DATA 109
|
||||
#define F_DEFINITIVA 110
|
149
at/at1600a.uml
149
at/at1600a.uml
@ -1,149 +0,0 @@
|
||||
#include "at1600a.h"
|
||||
|
||||
PAGE "Sblocco esclusi" -1 -1 78 11
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
END
|
||||
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Da "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZINI
|
||||
INPUT CODSOT F_SOTINI
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZINI CODSEZ
|
||||
OUTPUT F_D_SEZINI DENSEZ
|
||||
OUTPUT F_SOTINI CODSOT
|
||||
OUTPUT F_D_SOTINI DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SEZINI 25
|
||||
BEGIN
|
||||
PROMPT 11 2 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SOTINI 2
|
||||
BEGIN
|
||||
PROMPT 2 3 " "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SOTINI 25
|
||||
BEGIN
|
||||
PROMPT 11 3 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZINI
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
INPUT DENSOT F_D_SOTINI
|
||||
COPY DISPLAY F_D_SEZINI
|
||||
COPY OUTPUT F_D_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SEZFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 2 "A "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZFIN
|
||||
INPUT CODSOT F_SOTFIN
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZFIN CODSEZ
|
||||
OUTPUT F_D_SEZFIN DENSEZ
|
||||
OUTPUT F_SOTFIN CODSOT
|
||||
OUTPUT F_D_SOTFIN DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione finale"
|
||||
END
|
||||
|
||||
STRING F_D_SEZFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZFIN
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione finale"
|
||||
END
|
||||
|
||||
STRING F_SOTFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 3 " "
|
||||
COPY ALL F_SEZFIN
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo finale"
|
||||
END
|
||||
|
||||
STRING F_D_SOTFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 3 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZFIN
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
INPUT DENSOT F_D_SOTFIN
|
||||
COPY DISPLAY F_D_SEZFIN
|
||||
COPY OUTPUT F_D_SEZFIN
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per lo sblocco"
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 6 "Scadenza fino al "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data di riferimento per la scadenza (fino al)"
|
||||
END
|
||||
|
||||
BOOLEAN F_DEFINITIVA
|
||||
BEGIN
|
||||
PROMPT 35 6 "Sblocco definitivo"
|
||||
HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user