Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Stampa sospesi: aggiunto scelta prossimo tipo e motivo git-svn-id: svn://10.65.10.50/trunk@6496 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
82dd9f5c87
commit
9b8e98bb51
@ -4,6 +4,7 @@
|
|||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include "soggetti.h"
|
#include "soggetti.h"
|
||||||
|
#include "contsan.h"
|
||||||
#include "sezioni.h"
|
#include "sezioni.h"
|
||||||
|
|
||||||
#include "at2.h"
|
#include "at2.h"
|
||||||
@ -32,12 +33,14 @@ class TStampaSospesi : public TPrintapp
|
|||||||
{
|
{
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
|
TLocalisamfile* _contsan;
|
||||||
TEti_sospesi_form* _form_eti;
|
TEti_sospesi_form* _form_eti;
|
||||||
TAssoc_array _categorie;
|
TAssoc_array _categorie;
|
||||||
TParagraph_string _cognome_nome;
|
TParagraph_string _cognome_nome;
|
||||||
TDate _data_stampa;
|
TDate _data_stampa;
|
||||||
|
TDate _dataini, _datafin;
|
||||||
ts _tipostampa;
|
ts _tipostampa;
|
||||||
TString16 _codsez, _codsot;
|
TString16 _codsez, _codsot, _motivo;
|
||||||
int _etlarghezza, _etcolonne;
|
int _etlarghezza, _etcolonne;
|
||||||
|
|
||||||
static bool filter_func_sospesi(const TRelation* rel);
|
static bool filter_func_sospesi(const TRelation* rel);
|
||||||
@ -136,6 +139,32 @@ bool TStampaSospesi::filter_func_sospesi(const TRelation* rel)
|
|||||||
const TString16 cat = sog.get(SOG_CATDON);
|
const TString16 cat = sog.get(SOG_CATDON);
|
||||||
filtrato = categorie.is_key((const char*) cat);
|
filtrato = categorie.is_key((const char*) cat);
|
||||||
}
|
}
|
||||||
|
if ((filtrato) && (app()._dataini.ok()))
|
||||||
|
{
|
||||||
|
const TDate datapross = sog.get_date(SOG_DATA_PROS);
|
||||||
|
filtrato = (datapross >= app()._dataini);
|
||||||
|
}
|
||||||
|
if ((filtrato) && (app()._datafin.ok()))
|
||||||
|
{
|
||||||
|
const TDate datapross = sog.get_date(SOG_DATA_PROS);
|
||||||
|
filtrato = (datapross <= app()._datafin);
|
||||||
|
}
|
||||||
|
if ((filtrato) && (app()._motivo.not_empty()))
|
||||||
|
{
|
||||||
|
TLocalisamfile contsan(LF_CONTSAN);
|
||||||
|
contsan.setkey(2);
|
||||||
|
contsan.put(CON_DATACON, sog.get(SOG_DATASTATO));
|
||||||
|
contsan.put(CON_CODICE, sog.get(SOG_CODICE));
|
||||||
|
if (contsan.read() == NOERR)
|
||||||
|
{
|
||||||
|
if (app()._motivo == contsan.get(CON_MOTIVO))
|
||||||
|
filtrato = TRUE;
|
||||||
|
else
|
||||||
|
filtrato = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
filtrato = FALSE;
|
||||||
|
}
|
||||||
return filtrato;
|
return filtrato;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,12 +238,18 @@ bool TStampaSospesi::set_print(int m)
|
|||||||
add_file(LF_SOGGETTI);
|
add_file(LF_SOGGETTI);
|
||||||
// filtro per sezioni selezionati
|
// filtro per sezioni selezionati
|
||||||
filtra_sezioni();
|
filtra_sezioni();
|
||||||
|
_motivo = _msk->get(F_MOTIVO);
|
||||||
|
TString filtro;
|
||||||
// filtro per tipo sospensione
|
// filtro per tipo sospensione
|
||||||
const TString16 tiposo = _msk->get(F_TIPO);
|
const TString16 tiposo = _msk->get(F_TIPO);
|
||||||
if (tiposo.not_empty() && tiposo.ok())
|
if (tiposo.not_empty() && tiposo.ok())
|
||||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tiposo));
|
filtro << '(' << SOG_STATO << "== \"" << tiposo << "\")";
|
||||||
else
|
else
|
||||||
current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE);
|
filtro << "TCS->S6 == \"S\"";
|
||||||
|
const TString16 prosstipo = _msk->get(F_PROSSTIPO);
|
||||||
|
if (prosstipo.not_empty())
|
||||||
|
filtro << " && (" << SOG_PROS_STATO << "== \"" << prosstipo << "\")";
|
||||||
|
current_cursor()->setfilter(filtro, TRUE);
|
||||||
// filtro per categorie
|
// filtro per categorie
|
||||||
_categorie.destroy();
|
_categorie.destroy();
|
||||||
const TString16 catpri = _msk->get(F_CAT1);
|
const TString16 catpri = _msk->get(F_CAT1);
|
||||||
@ -235,6 +270,8 @@ bool TStampaSospesi::set_print(int m)
|
|||||||
_categorie.add((const char*) catqui);
|
_categorie.add((const char*) catqui);
|
||||||
if (catses.not_empty() && catses.ok())
|
if (catses.not_empty() && catses.ok())
|
||||||
_categorie.add((const char*) catses);
|
_categorie.add((const char*) catses);
|
||||||
|
_dataini = _msk->get_date(F_DATAINI);
|
||||||
|
_datafin = _msk->get_date(F_DATAFIN);
|
||||||
current_cursor()->set_filterfunction(filter_func_sospesi);
|
current_cursor()->set_filterfunction(filter_func_sospesi);
|
||||||
reset_print();
|
reset_print();
|
||||||
crea_intestazione();
|
crea_intestazione();
|
||||||
@ -284,6 +321,7 @@ bool TStampaSospesi::user_create()
|
|||||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||||
|
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||||
add_cursor(new TCursor(_rel,"", 3));
|
add_cursor(new TCursor(_rel,"", 3));
|
||||||
_msk = new TMask("at2100a");
|
_msk = new TMask("at2100a");
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
@ -299,6 +337,7 @@ bool TStampaSospesi::user_destroy()
|
|||||||
delete _msk;
|
delete _msk;
|
||||||
delete _rel;
|
delete _rel;
|
||||||
delete _form_eti;
|
delete _form_eti;
|
||||||
|
delete _contsan;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
at/at2100a.h
10
at/at2100a.h
@ -23,8 +23,14 @@
|
|||||||
#define F_CAT6 211
|
#define F_CAT6 211
|
||||||
#define F_D_CAT6 212
|
#define F_D_CAT6 212
|
||||||
|
|
||||||
#define F_TIPO 301
|
#define F_TIPO 301
|
||||||
#define F_D_TIPO 302
|
#define F_D_TIPO 302
|
||||||
|
#define F_PROSSTIPO 303
|
||||||
|
#define F_D_PROSSTIPO 304
|
||||||
|
#define F_DATAINI 305
|
||||||
|
#define F_DATAFIN 306
|
||||||
|
#define F_MOTIVO 307
|
||||||
|
#define F_D_MOTIVO 308
|
||||||
|
|
||||||
#define F_ELENCO 401
|
#define F_ELENCO 401
|
||||||
#define F_ETICHETTE 402
|
#define F_ETICHETTE 402
|
||||||
|
@ -1,5 +1,26 @@
|
|||||||
#include "at2100a.h"
|
#include "at2100a.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
|
BUTTON F_ELENCO 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -13 -11 "Elenco"
|
||||||
|
MESSAGE EXIT,F_ELENCO
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON F_ETICHETTE 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -23 -11 "Etichette"
|
||||||
|
MESSAGE EXIT,F_ETICHETTE
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 9 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -33 -11 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Stampa soggetti sospesi" -1 -1 78 20
|
PAGE "Stampa soggetti sospesi" -1 -1 78 20
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 4
|
GROUPBOX DLG_NULL 77 4
|
||||||
@ -244,14 +265,14 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 3
|
GROUPBOX DLG_NULL 77 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 10 "Tipo sospensione"
|
PROMPT 1 10 "Opzioni per la stampa"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_TIPO 2
|
STRING F_TIPO 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 11 ""
|
PROMPT 2 11 "Tipo sospensione "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE TCS SELECT S6="S"
|
USE TCS SELECT S6="S"
|
||||||
INPUT CODTAB F_TIPO
|
INPUT CODTAB F_TIPO
|
||||||
@ -266,30 +287,60 @@ END
|
|||||||
|
|
||||||
STRING F_D_TIPO 30
|
STRING F_D_TIPO 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 8 11 ""
|
PROMPT 27 11 ""
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 4
|
STRING F_PROSSTIPO 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 13 "Stampa"
|
PROMPT 2 12 "Prossimo tipo "
|
||||||
|
FLAGS "U"
|
||||||
|
USE TCS
|
||||||
|
INPUT CODTAB F_PROSSTIPO
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@30" S0
|
||||||
|
OUTPUT F_PROSSTIPO CODTAB
|
||||||
|
OUTPUT F_D_PROSSTIPO S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Prossimo tipo"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_ELENCO 9 2
|
STRING F_D_PROSSTIPO 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -13 14 "Elenco"
|
PROMPT 27 12 ""
|
||||||
MESSAGE EXIT,F_ELENCO
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_ETICHETTE 9 2
|
DATE F_DATAINI
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -23 14 "Etichette"
|
PROMPT 2 13 "Data pross. tipo dal "
|
||||||
MESSAGE EXIT,F_ETICHETTE
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 9 2
|
DATE F_DATAFIN
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -33 14 ""
|
PROMPT 34 13 "al "
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_MOTIVO 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 14 "Motivo "
|
||||||
|
FLAGS "U"
|
||||||
|
USE MTC
|
||||||
|
INPUT CODTAB F_MOTIVO
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@30" S0
|
||||||
|
OUTPUT F_MOTIVO CODTAB
|
||||||
|
OUTPUT F_D_MOTIVO S0
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "Codice non presente"
|
||||||
|
HELP "Motivo del controllo: vuoto = tutti"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_D_MOTIVO 30
|
||||||
|
BEGIN
|
||||||
|
PROMPT 27 14 ""
|
||||||
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user