Attribuzione benemerenze: se definitiva registra le ben. sul doggetto (prima
non lo faceva!) Patch level : Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@6242 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
21e1ff4c41
commit
f943fee58f
@ -37,6 +37,7 @@ class TAttribuzioneBenemerenze : public TPrintapp
|
|||||||
TAssoc_array _catdon;
|
TAssoc_array _catdon;
|
||||||
TAssoc_array _tabben;
|
TAssoc_array _tabben;
|
||||||
TString16 _gruppoazie, _oldben;
|
TString16 _gruppoazie, _oldben;
|
||||||
|
int _bonus;
|
||||||
TDate _dataela, _datapre;
|
TDate _dataela, _datapre;
|
||||||
bool _anchegruppi;
|
bool _anchegruppi;
|
||||||
bool _definitiva;
|
bool _definitiva;
|
||||||
@ -59,20 +60,50 @@ HIDDEN inline TAttribuzioneBenemerenze& app() { return (TAttribuzioneBenemerenze
|
|||||||
|
|
||||||
bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter)
|
bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
TRectype& recsog = current_cursor()->curr(LF_SOGGETTI);
|
if (file==LF_ATROPERA)
|
||||||
TString80 nome = recsog.get(SOG_COGNOME);
|
|
||||||
nome << " ";
|
|
||||||
nome << recsog.get(SOG_NOME);
|
|
||||||
_cognome_nome = nome;
|
|
||||||
// salto pagina se cambio benemerenza
|
|
||||||
const TString16 tipoben = current_cursor()->curr().get(ROP_S0);
|
|
||||||
if (tipoben!=_oldben)
|
|
||||||
{
|
{
|
||||||
if (_oldben != "**")
|
TRectype& recsog = current_cursor()->curr(LF_SOGGETTI);
|
||||||
printer().formfeed();
|
TString80 nome = recsog.get(SOG_COGNOME);
|
||||||
_oldben = tipoben;
|
nome << " ";
|
||||||
header_ben(tipoben);
|
nome << recsog.get(SOG_NOME);
|
||||||
}
|
_cognome_nome = nome;
|
||||||
|
// salto pagina se cambio benemerenza
|
||||||
|
const TString16 tipoben = current_cursor()->curr().get(ROP_S0);
|
||||||
|
if (tipoben!=_oldben)
|
||||||
|
{
|
||||||
|
if (_oldben != "**")
|
||||||
|
printer().formfeed();
|
||||||
|
_oldben = tipoben;
|
||||||
|
header_ben(tipoben);
|
||||||
|
}
|
||||||
|
if (app()._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);
|
||||||
|
if (err == NOERR)
|
||||||
|
{
|
||||||
|
int r = app()._sbenemerenze->rows();
|
||||||
|
TRectype& rec = app()._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, row.get(2));
|
||||||
|
//rec.put(BEN_BONUS, row.get());
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user