Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Attribuzione ben.: possibile ora l'attribuzione per gruppi aziendali complessiva, corretto la registrazione dell'ente che ha effettuato la attribuzione (sez. o gruppo), corretto il calcolo delle don. tenendo conto anche delle precedenti minori di zero (es. -1)


git-svn-id: svn://10.65.10.50/trunk@7261 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1998-10-16 14:15:16 +00:00
parent 094d82d8c8
commit fc42bcbfbd
3 changed files with 52 additions and 42 deletions

View File

@ -39,7 +39,7 @@ class TAttribuzioneBenemerenze : public TPrintapp
TString16 _gruppoazie, _oldben;
int _bonus;
TDate _dataela, _datapre;
bool _anchegruppi;
bool _attgruppi,_anchegruppi;
bool _definitiva;
TParagraph_string _cognome_nome;
int _contatore;
@ -76,31 +76,34 @@ bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter)
_oldben = tipoben;
header_ben(tipoben);
}
if (app()._definitiva)
if (_definitiva)
{
const long codice = recsog.get_long(SOG_CODICE);
TRectype* key = new TRectype(LF_BENEM);
key->put(BEN_CODICE, codice);
int err = app()._sbenemerenze->read(key);
int err = _sbenemerenze->read(key);
if (err == NOERR)
{
int r = app()._sbenemerenze->rows();
TRectype& rec = app()._sbenemerenze->row(r+1,TRUE);
int r = _sbenemerenze->rows();
TRectype& rec = _sbenemerenze->row(r+1,TRUE);
TString16 codsez = recsog.get(SOG_CODSEZ);
TString16 codsot = recsog.get(SOG_CODSOT);
TString16 gruppoazie = recsog.get(SOG_GRUPPOAZIE);
rec.put(BEN_TIPOBEN, tipoben);
rec.put(BEN_DATAMAT, recsog.get(SOG_DATAULTDON));
rec.put(BEN_BONUS, recsog.get(SOG_TOTDON));
rec.put(BEN_DATABEN, app()._dataela);
rec.put(BEN_DATACON, app()._datapre);
//rec.put(BEN_RITIRATA, row.get());
rec.put(BEN_CODSEZ, codsez);
rec.put(BEN_CODSOT, codsot);
rec.put(BEN_GRUPPOAZIE, gruppoazie);
int err = app()._sbenemerenze->rewrite();
rec.put(BEN_TIPOBEN, tipoben);
rec.put(BEN_DATAMAT, recsog.get(SOG_DATAULTDON));
rec.put(BEN_BONUS, recsog.get(SOG_TOTDON));
rec.put(BEN_DATABEN, _dataela);
rec.put(BEN_DATACON, _datapre);
if (_attgruppi)
rec.put(BEN_GRUPPOAZIE, gruppoazie);
else
{
rec.put(BEN_CODSEZ, codsez);
rec.put(BEN_CODSOT, codsot);
}
int err = _sbenemerenze->rewrite();
}
}
}
@ -148,6 +151,7 @@ bool TAttribuzioneBenemerenze::set_print(int)
_contatore = 0;
_dataela = _msk->get(F_DATAELA);
_datapre = _msk->get(F_DATAPRE);
_attgruppi = _msk->get_bool(F_ATTGRUPPI);
_gruppoazie = _msk->get(F_GRUPPOAZIE);
_anchegruppi = _msk->get_bool(F_ANCHEGRUPPI);
_definitiva = _msk->get_bool(F_DEFINITIVA);
@ -180,8 +184,13 @@ bool TAttribuzioneBenemerenze::set_print(int)
_tabben.add((const char*)codben, (TObject*) oggetto);
}
TString80 filtro = "";
if (_gruppoazie.not_empty())
filtro.format("(90->GRUPPOAZIE == \"%s\")",(const char*)_gruppoazie);
if (_attgruppi)
{
if (_gruppoazie.not_empty())
filtro.format("(90->GRUPPOAZIE == \"%s\")",(const char*)_gruppoazie);
else
filtro.format("(90->GRUPPOAZIE != \"\")");
}
else
if (!_anchegruppi)
filtro.format("(90->GRUPPOAZIE == \"\")");
@ -208,6 +217,7 @@ bool TAttribuzioneBenemerenze::set_print(int)
atopera.put(OPE_DATA1,_dataela);
atopera.put(OPE_DATA2,_datapre);
atopera.put(OPE_FLAG1,_anchegruppi);
atopera.put(OPE_FLAG2,_attgruppi);
atopera.put(OPE_UTENTE,user());
atopera.write();
TLocalisamfile atropera(LF_ATROPERA);
@ -239,11 +249,12 @@ bool TAttribuzioneBenemerenze::set_print(int)
{
int precsi = sog.get_int(SOG_DONPRECSI);
int precaf = sog.get_int(SOG_DONPRECAF);
int numdon = 0;
if (precsi>0)
numdon = numdon+precsi;
if (precaf>0)
numdon = numdon+precaf;
//int numdon = 0;
//if (precsi!=0)
//numdon = numdon+precsi;
//if (precaf!=0)
// numdon = numdon+precaf;
int numdon = precsi + precaf;
for (int r=1; r<=_sdonazioni->rows(); r++)
{
const TRectype& riga = _sdonazioni->row(r);

View File

@ -5,10 +5,6 @@
#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_CAT1 201
#define F_D_CAT1 202
@ -25,17 +21,11 @@
#define F_DATAELA 309
#define F_DATAPRE 310
#define F_GRUPPOAZIE 311
#define F_D_GRUPPOAZIE 312
#define F_ANCHEGRUPPI 313
//#define F_TIPOBEN 314
//#define F_D_TIPOBEN 315
#define F_DEFINITIVA 314
#define F_ATTGRUPPI 311
#define F_GRUPPOAZIE 312
#define F_D_GRUPPOAZIE 313
#define F_ANCHEGRUPPI 314
#define F_DEFINITIVA 315
#define F_O_CODSEZ 401
#define F_O_CODSOT 402
//#define F_O_GRUPPOAZIE 403
//#define F_O_DATA1 404
//#define F_O_DATA2 405
//#define F_O_FLAG1 406
//#define F_O_UTENTE 407

View File

@ -201,7 +201,7 @@ BEGIN
FLAGS "D"
END
GROUPBOX DLG_NULL 77 7
GROUPBOX DLG_NULL 77 8
BEGIN
PROMPT 1 9 "Opzioni per l'attribuzione"
END
@ -219,9 +219,16 @@ BEGIN
HELP "Data di prevista consegna"
END
BOOLEAN F_ATTGRUPPI
BEGIN
PROMPT 2 12 "Attribuzione fatta dai gruppi aziendali"
MESSAGE TRUE ENABLE,1@|RESET,F_ANCHEGRUPPI|DISABLE,F_ANCHEGRUPPI
MESSAGE FALSE RESET,1@|DISABLE,1@|ENABLE,F_ANCHEGRUPPI
END
STRING F_GRUPPOAZIE 4
BEGIN
PROMPT 2 12 "Gruppo az. che attribuisce "
PROMPT 2 13 "Gruppo az. che attribuisce "
FLAGS "U"
USE GAZ
INPUT CODTAB F_GRUPPOAZIE
@ -234,11 +241,12 @@ BEGIN
MESSAGE EMPTY ENABLE,F_ANCHEGRUPPI
WARNING "Codice gruppo aziendale non presente"
HELP "Gruppo aziendale di appartenenza"
GROUP 1
END
STRING F_D_GRUPPOAZIE 30
BEGIN
PROMPT 37 12 ""
PROMPT 37 13 ""
FLAGS "U"
USE GAZ KEY 2
INPUT S0 F_D_GRUPPOAZIE
@ -248,16 +256,17 @@ BEGIN
CHECKTYPE NORMAL
WARNING "Gruppo aziendale non presente"
HELP "Gruppo aziendale di appartenenza"
GROUP 1
END
BOOLEAN F_ANCHEGRUPPI
BEGIN
PROMPT 2 13 "Includi soggetti appartenenti a gruppi aziendali"
PROMPT 2 14 "Includi soggetti appartenenti a gruppi aziendali"
END
BOOLEAN F_DEFINITIVA
BEGIN
PROMPT 2 14 "Attribuzione definitiva"
PROMPT 2 15 "Attribuzione definitiva"
HELP "Se attribuzione definitiva, le benemerenze stampate verranno registrate"
END