Patch level : AT
Files correlati : Ricompilazione Demo : [ ] Commento : ultima versione di AVIS git-svn-id: svn://10.65.10.50/trunk@11386 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
65eb669bfb
commit
eb4f2b7e4e
@ -2054,6 +2054,12 @@ void TGestioneSoggetti::c_reord(TSheet_field& s, TSheet_field& si)
|
|||||||
mask.set(F_DATASTATO,datastatoaf);
|
mask.set(F_DATASTATO,datastatoaf);
|
||||||
else
|
else
|
||||||
mask.set(F_DATASTATO,datastatosi);
|
mask.set(F_DATASTATO,datastatosi);
|
||||||
|
const TString16 catcoll = cache().get("TCS",stato).get("S7");
|
||||||
|
if (catcoll.not_empty())
|
||||||
|
{
|
||||||
|
mask.set(F_CATDON,catcoll);
|
||||||
|
mask.field(F_CATDON).on_key(K_TAB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d_datepross(s);
|
d_datepross(s);
|
||||||
|
@ -223,6 +223,11 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
|
|||||||
long codice = recsog.get_long(SOG_CODICE);
|
long codice = recsog.get_long(SOG_CODICE);
|
||||||
key->put(CON_CODICE, codice);
|
key->put(CON_CODICE, codice);
|
||||||
int err = _scontrolli->read(key);
|
int err = _scontrolli->read(key);
|
||||||
|
|
||||||
|
TRectype* key1 = new TRectype(LF_IDONEITA);
|
||||||
|
key1->put(IDO_CODICE, codice);
|
||||||
|
err = _sidoneita->read(key1);
|
||||||
|
|
||||||
int progcon = _scontrolli->rows()+1;
|
int progcon = _scontrolli->rows()+1;
|
||||||
TRectype& reccon = _contsan->curr();
|
TRectype& reccon = _contsan->curr();
|
||||||
reccon.zero();
|
reccon.zero();
|
||||||
@ -306,37 +311,37 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter)
|
|||||||
_sidoneita->add_row(recido);
|
_sidoneita->add_row(recido);
|
||||||
_sidoneita->rewrite();
|
_sidoneita->rewrite();
|
||||||
}
|
}
|
||||||
con_reord(recsog, _scontrolli, _sidoneita);
|
}
|
||||||
const TDate oggi(TODAY);
|
con_reord(recsog, _scontrolli, _sidoneita);
|
||||||
recsog.put(SOG_DATAULTAGG,oggi);
|
const TDate oggi(TODAY);
|
||||||
recsog.put(SOG_UTENULTAGG,user());
|
recsog.put(SOG_DATAULTAGG,oggi);
|
||||||
|
recsog.put(SOG_UTENULTAGG,user());
|
||||||
|
|
||||||
TString16 catdon = recsog.get(SOG_CATDON);
|
TString16 catdon = recsog.get(SOG_CATDON);
|
||||||
const TRectype& ctd = cache().get("CTD", catdon);
|
const TRectype& ctd = cache().get("CTD", catdon);
|
||||||
const int totdon = recsog.get_int(SOG_TOTDON);
|
const int totdon = recsog.get_int(SOG_TOTDON);
|
||||||
if (ctd.get_bool("B0"))
|
if (ctd.get_bool("B0"))
|
||||||
{
|
{
|
||||||
const TString16 catcoll = ctd.get("S6");
|
const TString16 catcoll = ctd.get("S6");
|
||||||
if (catcoll.not_empty())
|
if (catcoll.not_empty())
|
||||||
{
|
|
||||||
recsog.put(SOG_CATDON, catcoll);
|
|
||||||
recsog.put(SOG_DATADIM,NULLDATE);
|
|
||||||
catdon = catcoll;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty())
|
|
||||||
{
|
{
|
||||||
recsog.put(SOG_CATDON, _catfin1);
|
recsog.put(SOG_CATDON, catcoll);
|
||||||
catdon = _catfin1;
|
recsog.put(SOG_DATADIM,NULLDATE);
|
||||||
|
catdon = catcoll;
|
||||||
}
|
}
|
||||||
bool tstampata = recsog.get_bool(SOG_T_STAMPATA);
|
}
|
||||||
if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata))
|
if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty())
|
||||||
{
|
{
|
||||||
recsog.put(SOG_CATDON, _catfin2);
|
recsog.put(SOG_CATDON, _catfin1);
|
||||||
catdon = _catfin2;
|
catdon = _catfin1;
|
||||||
}
|
}
|
||||||
current_cursor()->file().rewrite();
|
bool tstampata = recsog.get_bool(SOG_T_STAMPATA);
|
||||||
}
|
if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata))
|
||||||
|
{
|
||||||
|
recsog.put(SOG_CATDON, _catfin2);
|
||||||
|
catdon = _catfin2;
|
||||||
|
}
|
||||||
|
current_cursor()->file().rewrite();
|
||||||
}
|
}
|
||||||
// salto pagina se cambio sezione
|
// salto pagina se cambio sezione
|
||||||
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
const TString16 codsez = recsog.get(SOG_CODSEZ);
|
||||||
|
@ -69,6 +69,7 @@ class TStampeSingole : public TPrintapp
|
|||||||
TString80 _note, _intest1, _intest2, _intest3, _intest4;
|
TString80 _note, _intest1, _intest2, _intest3, _intest4;
|
||||||
bool _usomodo, _usasez;
|
bool _usomodo, _usasez;
|
||||||
int _etlarghezza, _etcolonne, _schxpag, _lenpage;
|
int _etlarghezza, _etcolonne, _schxpag, _lenpage;
|
||||||
|
int _contaschede;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
@ -227,6 +228,7 @@ void TStampeSingole::set_page(int file, int cnt)
|
|||||||
TPrint_section& corpo = _form_sch->get_body();
|
TPrint_section& corpo = _form_sch->get_body();
|
||||||
corpo.update_and_print(printmode_normal, TRUE);
|
corpo.update_and_print(printmode_normal, TRUE);
|
||||||
force_setpage(TRUE);
|
force_setpage(TRUE);
|
||||||
|
_contaschede++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case donazioni:
|
case donazioni:
|
||||||
@ -320,7 +322,7 @@ bool TStampeSingole::set_print(int m)
|
|||||||
break;
|
break;
|
||||||
case F_SCHEDE:
|
case F_SCHEDE:
|
||||||
_tipostampa=schede;
|
_tipostampa=schede;
|
||||||
if (_schxpag > 1)
|
if (_schxpag > 1)
|
||||||
printer().formlen(_lenpage/_schxpag);
|
printer().formlen(_lenpage/_schxpag);
|
||||||
break;
|
break;
|
||||||
case F_ETICHETTE:
|
case F_ETICHETTE:
|
||||||
@ -334,6 +336,7 @@ bool TStampeSingole::set_print(int m)
|
|||||||
{
|
{
|
||||||
if (_tipostampa == cartoline)
|
if (_tipostampa == cartoline)
|
||||||
dati_cartolina();
|
dati_cartolina();
|
||||||
|
_contaschede = 0;
|
||||||
reset_files();
|
reset_files();
|
||||||
add_file(LF_SOGGETTI);
|
add_file(LF_SOGGETTI);
|
||||||
_asoggetti.destroy();
|
_asoggetti.destroy();
|
||||||
|
754
at/at8100.cpp
754
at/at8100.cpp
@ -1,76 +1,159 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <execp.h>
|
#include <filetext.h>
|
||||||
|
#include <form.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <msksheet.h>
|
|
||||||
#include <mailbox.h>
|
|
||||||
#include <prefix.h>
|
|
||||||
#include <progind.h>
|
|
||||||
#include <recarray.h>
|
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <urldefid.h>
|
#include <printer.h>
|
||||||
#include <validate.h>
|
#include <progind.h>
|
||||||
#include <lffiles.h>
|
#include <recarray.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
#include "at8.h"
|
#include "at8.h"
|
||||||
|
#include "at8100a.h"
|
||||||
// nomi campi maschera
|
|
||||||
#include "atlib.h"
|
#include "atlib.h"
|
||||||
|
|
||||||
// nomi dei campi
|
|
||||||
#include "soggetti.h"
|
|
||||||
#include "donaz.h"
|
|
||||||
#include "contsan.h"
|
#include "contsan.h"
|
||||||
|
#include "donaz.h"
|
||||||
#include "idoneita.h"
|
#include "idoneita.h"
|
||||||
|
#include "soggetti.h"
|
||||||
|
#include "convoc.h"
|
||||||
#include "rconvoc.h"
|
#include "rconvoc.h"
|
||||||
|
#include "storico.h"
|
||||||
|
|
||||||
class TCTStato2AT : public TApplication
|
#define ATFILENAME "pippo.txt"
|
||||||
{
|
|
||||||
TMask* _msk;
|
|
||||||
TRelation* _rel;
|
|
||||||
|
|
||||||
TLocalisamfile* _soggetti;
|
////////////////////////////////////////////////////////
|
||||||
TLocalisamfile* _donaz;
|
// Classe TCtrn2at_file customizzata dalla TFile_text //
|
||||||
TLocalisamfile* _contsan;
|
////////////////////////////////////////////////////////
|
||||||
TLocalisamfile* _idoneita;
|
|
||||||
TRecord_array* _sdonazioni;
|
class TCtrn2at_file: public TFile_text
|
||||||
TRecord_array* _scontrolli;
|
{
|
||||||
TRecord_array* _sidoneita;
|
|
||||||
// parametri di sezione
|
|
||||||
int _intsi_f1, _intsi_f2, _intsi_m, _intaf_m, _etadonne;
|
|
||||||
int _numdon1, _numdon2;
|
|
||||||
TString16 _catini1, _catfin1, _catini2, _catfin2, _motivoid;
|
|
||||||
bool _sttess2, _dataisc, _nomessage, _autoid;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool create();
|
virtual void validate(TCursor& cur,TRecord_text &rec, TToken_string &val, TString& str);
|
||||||
virtual bool destroy();
|
|
||||||
virtual bool menu(MENU_TAG m);
|
|
||||||
virtual TMask& get_mask() { return *_msk; }
|
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
|
||||||
|
|
||||||
int write(TSheet_field& s);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TCTStato2AT() {}
|
virtual int autosave(TRelation& rel, const TRecord_text& rec);
|
||||||
|
|
||||||
|
TCtrn2at_file(const TString& file_name, const TString& config_name);
|
||||||
|
virtual ~TCtrn2at_file() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
HIDDEN inline TCTStato2AT& app() { return (TCTStato2AT&) main_app(); }
|
TCtrn2at_file::TCtrn2at_file(const TString& file_name, const TString& config_name)
|
||||||
|
: TFile_text(file_name, config_name)
|
||||||
bool TCTStato2AT::create()
|
|
||||||
{
|
{
|
||||||
TApplication::create();
|
}
|
||||||
_msk = new TMask("at8100a");
|
|
||||||
_rel = new TRelation(LF_SOGGETTI);
|
int TCtrn2at_file::autosave(TRelation& rel, const TRecord_text& rec)
|
||||||
//_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
{
|
||||||
_donaz = new TLocalisamfile(LF_DONAZ);
|
const TString& type = rec.type();//prendo il tracciato record del tipo del record_text
|
||||||
_contsan = new TLocalisamfile(LF_CONTSAN);
|
TTracciato_record& tr = *t_rec(type);
|
||||||
_idoneita = new TLocalisamfile(LF_IDONEITA);
|
|
||||||
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
TArray& a_tc = tr.tracciati_campo();
|
||||||
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
|
const int items = a_tc.items();
|
||||||
_sidoneita = new TRecord_array(LF_IDONEITA,IDO_PROGIDO);
|
TString valore;
|
||||||
|
for (int i = 0; i < items; i++)
|
||||||
|
{
|
||||||
|
const TTracciato_campo& tc = tr.get(i);
|
||||||
|
TFieldref field(tc.field());
|
||||||
|
if (field.name().not_empty())
|
||||||
|
{
|
||||||
|
if (field.file()==0)
|
||||||
|
field.set_file(rel.lfile().num());
|
||||||
|
valore = rec.row(i);
|
||||||
|
// formatta il campo del file di testo secondo le specifiche del campo su file isam
|
||||||
|
preformat_field(field,valore,rel,tr.type());
|
||||||
|
const TRectype& rel_rec = rel.curr(field.file());
|
||||||
|
TFieldtypes tipo_campo = rel_rec.type(field.name());
|
||||||
|
bool vuoto = valore.blank();
|
||||||
|
if (valore[0] == '@') //se trovo il carattere @ -> azzero il campo
|
||||||
|
valore.cut(0);
|
||||||
|
switch(tipo_campo) //in base al tipo di campo formatta i valori seguendo le specifiche del tracciato
|
||||||
|
{
|
||||||
|
case _datefld: //tipo data...
|
||||||
|
{
|
||||||
|
if (real::is_null(valore))
|
||||||
|
{
|
||||||
|
valore.cut(0);
|
||||||
|
vuoto = TRUE;
|
||||||
|
}
|
||||||
|
TDate data(valore);
|
||||||
|
format_date(data, fpicture(tc), valore);//formatta la data secondo le specifiche del tracciato
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case _realfld: //tipi numerici
|
||||||
|
case _intfld:
|
||||||
|
case _longfld:
|
||||||
|
{
|
||||||
|
const real numero(valore);
|
||||||
|
vuoto = numero.is_zero();
|
||||||
|
|
||||||
|
valore = numero.string(fpicture(tc));//formatta il numero secondo le specifiche del tracciato
|
||||||
|
|
||||||
|
int length = flength(tc,rel_rec);
|
||||||
|
if (falign(tc) == 'L')
|
||||||
|
valore.left_just(length, ffiller(tc));
|
||||||
|
else
|
||||||
|
valore.right_just(length, ffiller(tc)); }
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
valore = format_field(tc, rel.lfile().num(), valore);//formatta il campo secondo le specifiche del record
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!vuoto && rel.exist(field.file()))
|
||||||
|
field.write(valore, rel);//faccio una write sulla relazione del fieldref
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int err = NOERR;
|
||||||
|
if (pre_writerel(rel,rec))
|
||||||
|
{
|
||||||
|
err= rel.write();
|
||||||
|
if (err == _isdupkey || err ==_isreinsert)
|
||||||
|
err = rel.rewrite();
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
// Classe TCtrn2at: applicazione principale //
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TCtrn2at: public TSkeleton_application
|
||||||
|
{
|
||||||
|
TMask* _msk;
|
||||||
|
TCtrn2at_file* _trasfile;
|
||||||
|
int _numdon1, _numdon2;
|
||||||
|
TString16 _catini1, _catfin1, _catini2, _catfin2;
|
||||||
|
bool _sttess2, _dataisc;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual bool create(void);
|
||||||
|
virtual void main_loop();
|
||||||
|
virtual bool destroy(void) ;
|
||||||
|
void transfer(void);
|
||||||
|
void inizializza_file(void);
|
||||||
|
static bool annulla_handler(TMask_field& f, KEY k);
|
||||||
|
bool test_donation(TRectype& recsog, const char* tipo, const TDate& datadon, const TString& luogodon);
|
||||||
|
bool test_inter(TRectype& recsog, const char* tipo, const TDate& datadon, int inter);
|
||||||
|
void calcola_categoria(TRectype& recsog);
|
||||||
|
public:
|
||||||
|
const TMask& msk() const { return *_msk; }
|
||||||
|
TCtrn2at() {}
|
||||||
|
virtual ~TCtrn2at() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// restituisce un riferimento all' applicazione
|
||||||
|
inline TCtrn2at& app() { return (TCtrn2at&) main_app();}
|
||||||
|
|
||||||
|
// creazione dell'applicazione
|
||||||
|
bool TCtrn2at::create()
|
||||||
|
{
|
||||||
|
open_files(LF_SOGGETTI, LF_DONAZ, LF_CONTSAN, LF_IDONEITA, LF_CONVOC, LF_RCONVOC, LF_STORICO, 0);
|
||||||
|
_msk = new TMask("at8100a");
|
||||||
|
_msk->set(F_FILENAME,ATFILENAME);
|
||||||
|
_trasfile = NULL;
|
||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
_numdon1 = config.get_int("NumDon1");
|
_numdon1 = config.get_int("NumDon1");
|
||||||
_numdon2 = config.get_int("NumDon2");
|
_numdon2 = config.get_int("NumDon2");
|
||||||
@ -80,296 +163,289 @@ bool TCTStato2AT::create()
|
|||||||
_catfin2 = config.get("CatFin2");
|
_catfin2 = config.get("CatFin2");
|
||||||
_sttess2 = config.get_bool("StTess2");
|
_sttess2 = config.get_bool("StTess2");
|
||||||
_dataisc = config.get_bool("DataIsc");
|
_dataisc = config.get_bool("DataIsc");
|
||||||
_nomessage = config.get_bool("NoMessage");
|
return TSkeleton_application::create();
|
||||||
_etadonne = config.get_int("EtaDonne");
|
|
||||||
_intsi_f1 = config.get_int("IntSI_F1");
|
|
||||||
_intsi_f2 = config.get_int("IntSI_F2");
|
|
||||||
_intsi_m = config.get_int("IntSI_M");
|
|
||||||
_intaf_m = config.get_int("IntAF_M");
|
|
||||||
dispatch_e_menu(BAR_ITEM(1));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TCTStato2AT::destroy()
|
|
||||||
{
|
|
||||||
delete _sidoneita;
|
|
||||||
delete _scontrolli;
|
|
||||||
delete _sdonazioni;
|
|
||||||
delete _idoneita;
|
|
||||||
delete _contsan;
|
|
||||||
delete _donaz;
|
|
||||||
delete _rel;
|
|
||||||
delete _msk;
|
|
||||||
return TApplication::destroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TCTStato2AT::menu(MENU_TAG m)
|
// distruzione dell'applicazione
|
||||||
|
bool TCtrn2at::destroy()
|
||||||
|
{
|
||||||
|
delete _msk;
|
||||||
|
return TSkeleton_application::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
// carica la maschera
|
||||||
|
void TCtrn2at::main_loop()
|
||||||
{
|
{
|
||||||
KEY tasto = _msk->run();
|
// Preimposta gli eventuali valori specificati sulla riga di comando
|
||||||
if (tasto == K_ENTER)
|
//error_box("Attenzione: manca la configurazione del trasferimento!");
|
||||||
{
|
KEY key = K_ENTER;
|
||||||
_rel->lfile().setkey(2);
|
while (key != K_QUIT)
|
||||||
bool modificato = FALSE;
|
{
|
||||||
bool modifanagr = FALSE;
|
key = _msk->run();
|
||||||
TDate oggi(TODAY);
|
if (key == K_ENTER)
|
||||||
TRectype recsog = _rel->curr();
|
transfer();
|
||||||
TExternisamfile* f = new TExternisamfile("$ctdon");
|
}
|
||||||
TProgind *pi;
|
}
|
||||||
pi = new TProgind(f->eod(),"Aggiornamento stato soggetti da CT", FALSE, TRUE, 10);
|
|
||||||
pi->setstatus(1);
|
bool TCtrn2at::test_donation(TRectype& recsog, const char* tipo, const TDate& datadon, const TString& luogodon)
|
||||||
for(f->first(); !f->eof(); f->next())
|
{
|
||||||
{
|
//ricostruisce le donazioni del soggetto in esame
|
||||||
pi->addstatus(1);
|
TRectype* key = new TRectype(LF_DONAZ);
|
||||||
modificato = FALSE;
|
key->put(DON_CODICE, recsog.get(SOG_CODICE));
|
||||||
modifanagr = FALSE;
|
TRecord_array donazioni(LF_DONAZ,DON_PROGDON);
|
||||||
const TString80 cognome = f->get("COGNOME");
|
donazioni.read(key);
|
||||||
const TString80 nome = f->get("NOME");
|
// verificare se ha fatto una donazione di tipo <tipo> con data successiva all'ultima donazione
|
||||||
const TDate datanasc = f->get_date("DATANASC");
|
const int r=donazioni.last_row();
|
||||||
const donaz_anno = f->get_int("DONAZ_ANNO");
|
if (r > 0)
|
||||||
recsog.zero();
|
{
|
||||||
recsog.put(SOG_COGNOME, cognome);
|
const TRectype& lastdon = donazioni[r];
|
||||||
recsog.put(SOG_NOME, nome);
|
if (lastdon.get_date(DON_DATADON) >= datadon)
|
||||||
recsog.put(SOG_DATANASC, datanasc);
|
return FALSE;
|
||||||
if (recsog.read(_rel->lfile())==NOERR)
|
}
|
||||||
{
|
|
||||||
// aggiorna anagrafica soggetto
|
//aggiunge la nuova donazione
|
||||||
TString16 tel_casa = f->get("TEL_CASA");
|
// compila i dati della donazione in esame
|
||||||
TString16 tel_lavoro = f->get("TEL_LAVORO");
|
TRectype* rec = new TRectype(LF_DONAZ);
|
||||||
if (tel_casa.not_empty())
|
rec->put(DON_CODICE, recsog.get(SOG_CODICE));
|
||||||
{
|
rec->put(DON_PROGDON,r+1);
|
||||||
recsog.put(SOG_TELABI,tel_casa);
|
rec->put(DON_DATADON, datadon);
|
||||||
modifanagr = TRUE;
|
rec->put(DON_TIPODON, tipo);
|
||||||
}
|
rec->put(DON_CODSEZ,recsog.get(SOG_CODSEZ));
|
||||||
if (tel_lavoro.not_empty())
|
rec->put(DON_CODSOT,recsog.get(SOG_CODSOT));
|
||||||
{
|
rec->put(DON_LUOGODON, luogodon);
|
||||||
recsog.put(SOG_TELLAV,tel_lavoro);
|
if (r == 0) //puó essere una prima donazione...
|
||||||
modifanagr = TRUE;
|
rec->put(DON_PRIMADON,"X");
|
||||||
}
|
|
||||||
TString16 stato = f->get("STATO");
|
donazioni.insert_row(rec);
|
||||||
TString16 statoavis = recsog.get(SOG_STATO);
|
donazioni.write(TRUE);
|
||||||
TDate dataini = f->get_date("DATAINI");
|
calcola_donazioni_lib(recsog, &donazioni); // questo metodo sistema tutto!!!
|
||||||
TDate datafin = f->get_date("DATAFIN");
|
calcola_categoria(recsog);
|
||||||
TString16 idon = "";
|
// aggiorno data e utente ultimo aggiornamento
|
||||||
if ((stato=="08") || (stato=="03") || (stato=="09"))
|
const TDate oggi(TODAY);
|
||||||
{
|
recsog.put(SOG_DATAULTAGG,oggi);
|
||||||
if (statoavis != "DE")
|
recsog.put(SOG_UTENULTAGG,"WINSIT");
|
||||||
{
|
return TRUE;
|
||||||
TRectype* key = new TRectype(LF_CONTSAN);
|
}
|
||||||
key->put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
_scontrolli->read(key);
|
void TCtrn2at::calcola_categoria(TRectype& recsog)
|
||||||
int progcon = _scontrolli->rows()+1;
|
{
|
||||||
TRectype& reccon = _contsan->curr();
|
TTable ctd("CTD");
|
||||||
reccon.zero();
|
TString16 catdon = recsog.get(SOG_CATDON);
|
||||||
reccon.put(CON_CODICE, recsog.get(SOG_CODICE));
|
const int totdon = recsog.get_int(SOG_TOTDON);
|
||||||
reccon.put(CON_PROGCON, progcon);
|
ctd.put("CODTAB",catdon);
|
||||||
if (dataini.ok())
|
if (ctd.read() == NOERR)
|
||||||
reccon.put(CON_DATACON, dataini);
|
{
|
||||||
else
|
bool dimissione = ctd.get_bool("B0");
|
||||||
reccon.put(CON_DATACON, oggi);
|
if (dimissione)
|
||||||
reccon.put(CON_TIPOCON, "DE");
|
{
|
||||||
if (datafin.ok())
|
const TString& cat_coll = ctd.get("S6");
|
||||||
{
|
if (cat_coll.not_empty())
|
||||||
reccon.put(CON_PROSSTIPO, "FS");
|
{
|
||||||
reccon.put(CON_PROSSDATA, datafin);
|
catdon = cat_coll;
|
||||||
}
|
recsog.put(SOG_CATDON, catdon);
|
||||||
TString80 resp = "AGGIORNAMENTO DA CENTRO TRASF.";
|
}
|
||||||
reccon.put(CON_RESPONSAB, resp);
|
}
|
||||||
//reccon.put(IDO_MOTIVO, _motivoid);
|
if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty())
|
||||||
modificato = TRUE;
|
{
|
||||||
_scontrolli->insert_row(reccon);
|
recsog.put(SOG_CATDON, _catfin1);
|
||||||
_scontrolli->write(TRUE);
|
catdon = _catfin1;
|
||||||
}
|
}
|
||||||
}
|
bool tstampata = recsog.get_bool(SOG_T_STAMPATA);
|
||||||
if (stato=="05")
|
if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata))
|
||||||
{
|
{
|
||||||
if (statoavis != "E")
|
recsog.put(SOG_CATDON, _catfin2);
|
||||||
{
|
catdon = _catfin2;
|
||||||
TRectype* key = new TRectype(LF_CONTSAN);
|
}
|
||||||
key->put(CON_CODICE, recsog.get(SOG_CODICE));
|
}
|
||||||
int err = _scontrolli->read(key);
|
|
||||||
int progcon = _scontrolli->rows()+1;
|
|
||||||
TRectype& reccon = _contsan->curr();
|
|
||||||
reccon.zero();
|
|
||||||
reccon.put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
reccon.put(CON_PROGCON, progcon);
|
|
||||||
if (dataini.ok())
|
|
||||||
reccon.put(CON_DATACON, dataini);
|
|
||||||
else
|
|
||||||
reccon.put(CON_DATACON, oggi);
|
|
||||||
reccon.put(CON_TIPOCON, "E");
|
|
||||||
if (datafin.ok())
|
|
||||||
{
|
|
||||||
reccon.put(CON_PROSSTIPO, "FS");
|
|
||||||
reccon.put(CON_PROSSDATA, datafin);
|
|
||||||
}
|
|
||||||
TString80 resp = "AGGIORNAMENTO DA CENTRO TRASF.";
|
|
||||||
reccon.put(CON_RESPONSAB, resp);
|
|
||||||
//reccon.put(IDO_MOTIVO, _motivoid);
|
|
||||||
modificato = TRUE;
|
|
||||||
_scontrolli->insert_row(reccon);
|
|
||||||
_scontrolli->write(TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((stato=="022") || (stato=="04"))
|
|
||||||
{
|
|
||||||
if (modstato_tcs(statoavis) != 'S')
|
|
||||||
{
|
|
||||||
TRectype* key = new TRectype(LF_CONTSAN);
|
|
||||||
key->put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
int err = _scontrolli->read(key);
|
|
||||||
int progcon = _scontrolli->rows()+1;
|
|
||||||
TRectype& reccon = _contsan->curr();
|
|
||||||
reccon.zero();
|
|
||||||
reccon.put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
reccon.put(CON_PROGCON, progcon);
|
|
||||||
if (dataini.ok())
|
|
||||||
reccon.put(CON_DATACON, dataini);
|
|
||||||
else
|
|
||||||
reccon.put(CON_DATACON, oggi);
|
|
||||||
reccon.put(CON_TIPOCON, "SO");
|
|
||||||
if (datafin.ok())
|
|
||||||
{
|
|
||||||
reccon.put(CON_PROSSTIPO, "FS");
|
|
||||||
reccon.put(CON_PROSSDATA, datafin);
|
|
||||||
}
|
|
||||||
TString80 resp = "AGGIORNAMENTO DA CENTRO TRASF.";
|
|
||||||
reccon.put(CON_RESPONSAB, resp);
|
|
||||||
//reccon.put(IDO_MOTIVO, _motivoid);
|
|
||||||
modificato = TRUE;
|
|
||||||
_scontrolli->insert_row(reccon);
|
|
||||||
_scontrolli->write(TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (stato=="021")
|
|
||||||
{
|
|
||||||
const char modstato = modstato_tcs(statoavis);
|
|
||||||
bool id_soloaf = ((recsog.get(SOG_STATOSI)!="ID") && (recsog.get(SOG_STATOAF)=="ID"));
|
|
||||||
if ((modstato != 'I') && (modstato != 'F') && (!id_soloaf) )
|
|
||||||
{
|
|
||||||
TRectype* key = new TRectype(LF_CONTSAN);
|
|
||||||
key->put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
_scontrolli->read(key);
|
|
||||||
int progcon = _scontrolli->rows()+1;
|
|
||||||
TRectype& reccon = _contsan->curr();
|
|
||||||
reccon.zero();
|
|
||||||
reccon.put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
reccon.put(CON_PROGCON, progcon);
|
|
||||||
reccon.put(CON_DATACON, oggi);
|
|
||||||
reccon.put(CON_TIPOCON, "PI");
|
|
||||||
reccon.put(CON_IDON1, "PL");
|
|
||||||
if (recsog.get_int(SOG_INTAF)==0)
|
|
||||||
reccon.put(CON_INTAF, _intaf_m);
|
|
||||||
else
|
|
||||||
reccon.put(CON_INTAF, recsog.get_int(SOG_INTAF));
|
|
||||||
TString80 resp = "AGGIORNAMENTO DA CENTRO TRASF.";
|
|
||||||
reccon.put(CON_RESPONSAB, resp);
|
|
||||||
//reccon.put(IDO_MOTIVO, _motivoid);
|
|
||||||
modificato = TRUE;
|
|
||||||
_scontrolli->insert_row(reccon);
|
|
||||||
_scontrolli->write(TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((stato=="02") || (stato=="01") || (stato=="011"))
|
|
||||||
{
|
|
||||||
if ((modstato_tcs(statoavis) != 'I') && (modstato_tcs(statoavis) != 'F'))
|
|
||||||
{
|
|
||||||
TRectype* key = new TRectype(LF_CONTSAN);
|
|
||||||
key->put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
_scontrolli->read(key);
|
|
||||||
int progcon = _scontrolli->rows()+1;
|
|
||||||
TRectype& reccon = _contsan->curr();
|
|
||||||
reccon.zero();
|
|
||||||
reccon.put(CON_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
reccon.put(CON_PROGCON, progcon);
|
|
||||||
reccon.put(CON_DATACON, oggi);
|
|
||||||
reccon.put(CON_TIPOCON, "PI");
|
|
||||||
reccon.put(CON_IDON1, "SI");
|
|
||||||
if (donaz_anno==0)
|
|
||||||
{
|
|
||||||
if (recsog.get_int(SOG_INTSI)==0)
|
|
||||||
{
|
|
||||||
const TString16 sesso = recsog.get(SOG_SESSO);
|
|
||||||
if (sesso == "2")
|
|
||||||
{
|
|
||||||
TDate datanasc = recsog.get_date(SOG_DATANASC);
|
|
||||||
int eta = oggi.year() - datanasc.year();
|
|
||||||
if(eta <= _etadonne)
|
|
||||||
reccon.put(CON_INTSI, _intsi_f1);
|
|
||||||
else
|
|
||||||
reccon.put(CON_INTSI, _intsi_f2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
reccon.put(CON_INTSI, _intsi_m);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
reccon.put(CON_INTSI, recsog.get_int(SOG_INTSI));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const int intsi = (360/donaz_anno);
|
|
||||||
reccon.put(CON_INTSI, intsi);
|
|
||||||
}
|
|
||||||
TString80 resp = "AGGIORNAMENTO DA CENTRO TRASF.";
|
|
||||||
reccon.put(CON_RESPONSAB, resp);
|
|
||||||
//reccon.put(IDO_MOTIVO, _motivoid);
|
|
||||||
modificato = TRUE;
|
|
||||||
_scontrolli->insert_row(reccon);
|
|
||||||
_scontrolli->write(TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (modificato)
|
|
||||||
{
|
|
||||||
TRectype* key = new TRectype(LF_IDONEITA);
|
|
||||||
key->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
_sidoneita->read(key);
|
|
||||||
con_reord(recsog,_scontrolli,_sidoneita);
|
|
||||||
const TDate dataprossi = recsog.get_date(SOG_DATAPROSSI);
|
|
||||||
const TDate dataconv = recsog.get_date(SOG_DATACONV);
|
|
||||||
const char stato = modstato_tcs(recsog.get(SOG_STATO));
|
|
||||||
const TString16 statosi = recsog.get(SOG_STATOSI);
|
|
||||||
if ((stato == 'S') || (statosi == SOSPENSIONE) || (dataprossi > dataconv) || !dataprossi.ok())
|
|
||||||
{
|
|
||||||
TLocalisamfile rconvoc(LF_RCONVOC);
|
|
||||||
rconvoc.setkey(3);
|
|
||||||
rconvoc.zero();
|
|
||||||
rconvoc.put(RCV_CODICE, recsog.get(SOG_CODICE));
|
|
||||||
rconvoc.put(RCV_DATACONV, recsog.get(SOG_DATACONV));
|
|
||||||
if (rconvoc.read() == NOERR)
|
|
||||||
{
|
|
||||||
rconvoc.put(RCV_ANNULLATO, TRUE);
|
|
||||||
int err = rconvoc.write();
|
|
||||||
}
|
|
||||||
const TDate datanulla(NULLDATE);
|
|
||||||
recsog.put(SOG_DATACONV, datanulla);
|
|
||||||
recsog.put(SOG_DATAULTSOL, datanulla);
|
|
||||||
const int numzero = 0;
|
|
||||||
recsog.put(SOG_NUMCONV,numzero);
|
|
||||||
}
|
|
||||||
modifanagr = TRUE;
|
|
||||||
}
|
|
||||||
if (modifanagr)
|
|
||||||
{
|
|
||||||
recsog.put(SOG_DATAULTAGG, oggi);
|
|
||||||
recsog.put(SOG_UTENULTAGG, "CT");
|
|
||||||
recsog.rewrite(_rel->lfile());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete pi;
|
|
||||||
delete f;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TCtrn2at::test_inter(TRectype& recsog, const char* tipo, const TDate& datadon, int inter)
|
||||||
|
{
|
||||||
|
const char* tipoido = stricmp(tipo, "SI") != 0 ? "AF" : "SI";
|
||||||
|
int intervallo = 0;
|
||||||
|
|
||||||
int TCTStato2AT::write(TSheet_field& s)
|
TRectype* key_cont = new TRectype(LF_CONTSAN);
|
||||||
{
|
key_cont->put(CON_CODICE, recsog.get(SOG_CODICE));
|
||||||
return NOERR;
|
TRecord_array controlli(LF_CONTSAN,CON_PROGCON);
|
||||||
|
controlli.read(key_cont);
|
||||||
|
|
||||||
|
TRectype* key = new TRectype(LF_IDONEITA);
|
||||||
|
key->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
||||||
|
TRecord_array idoneita(LF_IDONEITA,IDO_PROGIDO);
|
||||||
|
idoneita.read(key);
|
||||||
|
|
||||||
|
TString16 stato;
|
||||||
|
if (tipo == "SI")
|
||||||
|
{
|
||||||
|
stato = recsog.get(SOG_STATOSI);
|
||||||
|
intervallo = recsog.get_int(SOG_INTSI);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stato = recsog.get(SOG_STATOAF);
|
||||||
|
intervallo = recsog.get_int(SOG_INTAF);
|
||||||
|
}
|
||||||
|
if (stato.empty())
|
||||||
|
stato = recsog.get(SOG_STATO);
|
||||||
|
if (modstato_tcs(stato) != 'S' && stato.not_empty() && intervallo == inter)
|
||||||
|
return FALSE;
|
||||||
|
const int r = idoneita.last_row(); //se trova una data idoneita >= di quella in esame, quest'ultima viene ignorata
|
||||||
|
if (r > 0)
|
||||||
|
{
|
||||||
|
const TRectype& lastido = idoneita[r];
|
||||||
|
if ((lastido.get_date(IDO_DATAIDO) >= datadon) && (tipoido == lastido.get(IDO_TIPOIDO)))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRectype* rec = new TRectype(LF_IDONEITA);
|
||||||
|
rec->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
||||||
|
//rec->put(IDO_PROGIDO, r+1);
|
||||||
|
rec->put(IDO_DATAIDO, datadon);
|
||||||
|
rec->put(IDO_TIPOIDO, tipoido); // Il mondo è bello perchè c'é l'AVIS (tutte le donaz. non SI sono AF! mah?!)
|
||||||
|
rec->put(IDO_IDO_SOS, "ID");
|
||||||
|
rec->put(IDO_INTERVALLO, inter);
|
||||||
|
// aggiunto da cristina il 18/09/2002 altrimenti non so che quella riga é stata aggiunta da CT
|
||||||
|
rec->put(IDO_RESPONSAB, "TRASF. DA CT");
|
||||||
|
idoneita.add_row(rec);
|
||||||
|
idoneita.write();
|
||||||
|
|
||||||
|
con_reord(recsog, &controlli, &idoneita);
|
||||||
|
// verifico se occorre azzerare numero convocazioni e data ultima convocazione
|
||||||
|
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
||||||
|
if ((datadon - dataultdon) > 730)
|
||||||
|
{
|
||||||
|
recsog.put(SOG_DATACONV, NULLDATE);
|
||||||
|
recsog.put(SOG_NUMCONV, 0);
|
||||||
|
}
|
||||||
|
// aggiorno data e utente ultimo aggiornamento (Cristina 18/09/2002)
|
||||||
|
const TDate oggi(TODAY);
|
||||||
|
recsog.put(SOG_DATAULTAGG,oggi);
|
||||||
|
recsog.put(SOG_UTENULTAGG,"WINSIT");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// trasferimento dati da file CT su programma avis
|
||||||
|
void TCtrn2at::transfer()
|
||||||
|
{
|
||||||
|
TFilename ctboini = "at8100a.ini";
|
||||||
|
|
||||||
|
_trasfile = new TCtrn2at_file(_msk->get(F_FILENAME), ctboini);
|
||||||
|
inizializza_file();
|
||||||
|
const long dimension = fsize(_msk->get(F_FILENAME));
|
||||||
|
TProgind pi(dimension,"Acquisizione in corso...");
|
||||||
|
|
||||||
|
TRelation rel(LF_SOGGETTI);
|
||||||
|
TRectype& sogg = rel.curr();
|
||||||
|
|
||||||
|
TString8 str; // Stringa jolly di lavoro
|
||||||
|
TRecord_text curr;
|
||||||
|
while (_trasfile->read(curr) == NOERR)
|
||||||
|
{
|
||||||
|
pi.setstatus(_trasfile->read_file()->tellg());
|
||||||
|
//controlla se il donatore é AVIS oppure un cane sciolto o, peggio ancora, un adepto della
|
||||||
|
//concorrenza!!!(ovviamente si va a stringhe fisse e non a tabelle! roba da avis.....)
|
||||||
|
str = curr.get(31); //donatore della concorrenza -> lo salta
|
||||||
|
str.trim();
|
||||||
|
if (str == "ADVS")
|
||||||
|
continue;
|
||||||
|
if (str == "NOASS") //se il donatore é un cane sciolto -> va in sezione NI ed in categoria NI
|
||||||
|
{
|
||||||
|
curr.add("NI",0);
|
||||||
|
curr.add("@",1);
|
||||||
|
sogg.put(SOG_CATDON,"NI");
|
||||||
|
}
|
||||||
|
|
||||||
|
str = curr.get(2);
|
||||||
|
sogg.put(SOG_CODICE, atol(str));
|
||||||
|
if (rel.read(_isequal) != NOERR)
|
||||||
|
sogg.zero();
|
||||||
|
//controlla se il donatore ha cambiato sezione spostandosi da Bologna in provincia;
|
||||||
|
//in questo caso gli deve cancellare il sottogruppo (veramente un procedimento da
|
||||||
|
//galera, ma se l'avis e winsit vogliono cosí.....)
|
||||||
|
str = curr.get(0);
|
||||||
|
str.trim();
|
||||||
|
TString8 str1;
|
||||||
|
str1 = curr.get(1);
|
||||||
|
str1.trim();
|
||||||
|
if (str != sogg.get(SOG_CODSEZ) && str != "01" && str1 == "")
|
||||||
|
curr.add("@",1);
|
||||||
|
|
||||||
|
//esegue l'effettivo passaggio dati basandosi sulla formattazione del file .ini
|
||||||
|
_trasfile->autosave(rel, curr);
|
||||||
|
|
||||||
|
const char* tipo[] = { "SI", "PL", "PI", "PP" };
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
bool update = FALSE;
|
||||||
|
TDate datadon(TODAY);
|
||||||
|
str = curr.get(23+i);
|
||||||
|
if (!str.blank())
|
||||||
|
{
|
||||||
|
datadon = TDate(str);
|
||||||
|
str = curr.get(32);
|
||||||
|
str.trim();
|
||||||
|
//cambio codice del punto di prelievo per casi speciali (sarebbe necessaria una tabella,
|
||||||
|
//ma con l'AVIS é tempo sprecato....)
|
||||||
|
if (str == "UROM")
|
||||||
|
str = "013"; else
|
||||||
|
if (str == "UROB")
|
||||||
|
str = "O.BE"; else
|
||||||
|
if (str == "IMOLA")
|
||||||
|
str = "70";
|
||||||
|
update |= test_donation(sogg, tipo[i], datadon, str);
|
||||||
|
}
|
||||||
|
str = curr.get(27+i);
|
||||||
|
if (!real::is_null(str))
|
||||||
|
update |= test_inter(sogg, tipo[i], datadon, atoi(str));
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
calcola_categoria(sogg);
|
||||||
|
rel.rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_trasfile->close();
|
||||||
|
message_box("Operazione terminata");
|
||||||
|
}
|
||||||
|
|
||||||
|
//inizializza il file di testo su cui emettere i dati
|
||||||
|
void TCtrn2at::inizializza_file()
|
||||||
|
{
|
||||||
|
TFilename filect = _msk->get(F_FILENAME); //aggiungere lettura automatica nomi file
|
||||||
|
_trasfile->open(filect,'r');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// handler per gestire la conferma dell'annullamento dei dati inseriti
|
||||||
|
// nella maschera
|
||||||
|
bool TCtrn2at::annulla_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
TMask &m = f.mask();
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
if (yesno_box("Vuoi veramente annullare i dati inseriti"))
|
||||||
|
m.reset();
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// gestione dei messaggi estesi nei campi
|
||||||
|
void TCtrn2at_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TString& str)
|
||||||
|
{
|
||||||
|
const TString code(s.get(0));
|
||||||
|
TString valore;
|
||||||
|
if (code == "_UPPERCASE")
|
||||||
|
{
|
||||||
|
valore.upper();
|
||||||
|
}
|
||||||
|
else NFCHECK("Macro non definita: %s", (const char *)code);
|
||||||
|
str = valore;
|
||||||
|
}
|
||||||
|
|
||||||
int at8100(int argc, char* argv[])
|
int at8100(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
TCTStato2AT a;
|
TCtrn2at a ;
|
||||||
a.run(argc, argv, "Aggiorna stato donatori da CT");
|
a.run(argc, argv, "Acquisizione dati da Eliot - CT");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -275,19 +275,22 @@ bool TCtbo2at::test_inter(TRectype& recsog, const char* tipo, const TDate& datad
|
|||||||
idoneita.read(key);
|
idoneita.read(key);
|
||||||
|
|
||||||
TString16 stato;
|
TString16 stato;
|
||||||
|
TDate datapross;
|
||||||
if (tipo == "SI")
|
if (tipo == "SI")
|
||||||
{
|
{
|
||||||
stato = recsog.get(SOG_STATOSI);
|
stato = recsog.get(SOG_STATOSI);
|
||||||
intervallo = recsog.get_int(SOG_INTSI);
|
intervallo = recsog.get_int(SOG_INTSI);
|
||||||
|
datapross = recsog.get_int(SOG_DATAPROSSI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stato = recsog.get(SOG_STATOAF);
|
stato = recsog.get(SOG_STATOAF);
|
||||||
intervallo = recsog.get_int(SOG_INTAF);
|
intervallo = recsog.get_int(SOG_INTAF);
|
||||||
|
datapross = recsog.get_int(SOG_DATAPROSAF);
|
||||||
}
|
}
|
||||||
if (stato.empty())
|
if (stato.empty())
|
||||||
stato = recsog.get(SOG_STATO);
|
stato = recsog.get(SOG_STATO);
|
||||||
if (modstato_tcs(stato) != 'S' && stato.not_empty() && intervallo == inter)
|
if (modstato_tcs(stato) != 'S' && stato.not_empty() && intervallo == inter && !datapross.empty())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
const int r = idoneita.last_row(); //se trova una data idoneita >= di quella in esame, quest'ultima viene ignorata
|
const int r = idoneita.last_row(); //se trova una data idoneita >= di quella in esame, quest'ultima viene ignorata
|
||||||
if (r > 0)
|
if (r > 0)
|
||||||
@ -299,7 +302,10 @@ bool TCtbo2at::test_inter(TRectype& recsog, const char* tipo, const TDate& datad
|
|||||||
|
|
||||||
TRectype* rec = new TRectype(LF_IDONEITA);
|
TRectype* rec = new TRectype(LF_IDONEITA);
|
||||||
rec->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
rec->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
||||||
//rec->put(IDO_PROGIDO, r+1);
|
if (idoneita.rows() == 0)
|
||||||
|
rec->put(IDO_PROGIDO, 1);
|
||||||
|
else
|
||||||
|
rec->put(IDO_PROGIDO, r+1);
|
||||||
rec->put(IDO_DATAIDO, datadon);
|
rec->put(IDO_DATAIDO, datadon);
|
||||||
rec->put(IDO_TIPOIDO, tipoido); // Il mondo è bello perchè c'é l'AVIS (tutte le donaz. non SI sono AF! mah?!)
|
rec->put(IDO_TIPOIDO, tipoido); // Il mondo è bello perchè c'é l'AVIS (tutte le donaz. non SI sono AF! mah?!)
|
||||||
rec->put(IDO_IDO_SOS, "ID");
|
rec->put(IDO_IDO_SOS, "ID");
|
||||||
|
@ -837,7 +837,7 @@ bool TCtpr2at::update_record(TRectype& record_at, TAssoc_array& record_ct)
|
|||||||
if ((elab == "CELLULARE") && ((str[0]!='0') && (str.len()>9)))
|
if ((elab == "CELLULARE") && ((str[0]!='0') && (str.len()>9)))
|
||||||
record_at.put(campo, str);
|
record_at.put(campo, str);
|
||||||
else
|
else
|
||||||
if ((elab == "NOCELLULARE") && !((str[0]!='0') && (str.len()>9)))
|
if ((elab == "NOCELLULARE") && (str[0]=='0'))
|
||||||
record_at.put(campo, str);
|
record_at.put(campo, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1289,7 +1289,7 @@ bool TCtpr2at::sacca(const TString& istruzione)
|
|||||||
}
|
}
|
||||||
calcola_donazioni_lib(recsog, _sdonazioni); // questo metodo sistema tutto!!!
|
calcola_donazioni_lib(recsog, _sdonazioni); // questo metodo sistema tutto!!!
|
||||||
calcola_categoria(recsog); // modificato per dare i messaggi al posto dei veri cambiamenti
|
calcola_categoria(recsog); // modificato per dare i messaggi al posto dei veri cambiamenti
|
||||||
print_line();
|
//print_line(); // tolto perchè altrimenti stampa alcuni fogli vuoti
|
||||||
// aggiorno data e utente ultimo aggiornamento
|
// aggiorno data e utente ultimo aggiornamento
|
||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
recsog.put(SOG_DATAULTAGG, oggi);
|
recsog.put(SOG_DATAULTAGG, oggi);
|
||||||
|
@ -203,10 +203,10 @@ void con_reord(TRectype& soggetto, TRecord_array* controlli, TRecord_array* idon
|
|||||||
if (tipoido == IDON_AF)
|
if (tipoido == IDON_AF)
|
||||||
if ((intervallo != 0) && (intaf == 0))
|
if ((intervallo != 0) && (intaf == 0))
|
||||||
soggetto.put(SOG_INTAF, intervallo);
|
soggetto.put(SOG_INTAF, intervallo);
|
||||||
if (dataido >= dataultstato)
|
if ((dataido >= dataultstato) || (ultstato) == 'F')
|
||||||
{
|
{
|
||||||
if (tipoido == IDON_SI)
|
if (tipoido == IDON_SI)
|
||||||
{
|
{
|
||||||
soggetto.put(SOG_DATASI,dataido);
|
soggetto.put(SOG_DATASI,dataido);
|
||||||
soggetto.put(SOG_STATOSI,ido_sos);
|
soggetto.put(SOG_STATOSI,ido_sos);
|
||||||
soggetto.put(SOG_FINESOSSI,finesos);
|
soggetto.put(SOG_FINESOSSI,finesos);
|
||||||
@ -262,15 +262,11 @@ void con_reord(TRectype& soggetto, TRecord_array* controlli, TRecord_array* idon
|
|||||||
char modstato = modstato_tcs(stato);
|
char modstato = modstato_tcs(stato);
|
||||||
const char tipostatosi = modstato_tcs(statosi);
|
const char tipostatosi = modstato_tcs(statosi);
|
||||||
const char tipostatoaf = modstato_tcs(statoaf);
|
const char tipostatoaf = modstato_tcs(statoaf);
|
||||||
//if ((statosi == IDONEITA) || (statoaf == IDONEITA))
|
|
||||||
if ((tipostatosi == 'I') || (tipostatoaf == 'I'))
|
if ((tipostatosi == 'I') || (tipostatoaf == 'I'))
|
||||||
if ((modstato != 'I') || (modstato != 'F'))
|
if ((modstato != 'I') || (modstato != 'F'))
|
||||||
stato = IDONEITA;
|
stato = IDONEITA;
|
||||||
//if ((statosi == SOSPENSIONE || statosi.empty()) && (statoaf == SOSPENSIONE || statoaf.empty()))
|
|
||||||
//if ((statosi == SOSPENSIONE) && (statoaf == SOSPENSIONE))
|
|
||||||
if ((tipostatosi == 'S') && (tipostatoaf == 'S'))
|
if ((tipostatosi == 'S') && (tipostatoaf == 'S'))
|
||||||
if (modstato != 'S')
|
if (modstato != 'S')
|
||||||
//stato = SOSPENSIONE;
|
|
||||||
stato == statosi;
|
stato == statosi;
|
||||||
char statocalcolato = modstato_tcs(stato);
|
char statocalcolato = modstato_tcs(stato);
|
||||||
if (modstato != statocalcolato)
|
if (modstato != statocalcolato)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// tabella di conversione CT Parma- AVIS per stato trasfusionale
|
// tabella di conversione CT Rimini- AVIS per stato trasfusionale
|
||||||
#define F_TABPR1_CODTAB 100
|
#define F_TABPR1_CODTAB 100
|
||||||
#define F_TABPR1_DESCR 101
|
#define F_TABPR1_DESCR 101
|
||||||
#define F_TABPR1_OPERAZIONE 102
|
#define F_TABPR1_OPERAZIONE 102
|
||||||
|
@ -4,7 +4,7 @@ TOOLBAR "" 0 20 0 2
|
|||||||
#include <toolbar.h>
|
#include <toolbar.h>
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Tabella conversione stato trasfusionale" -1 -1 78 18
|
PAGE "Tabella conversione stato trasfusionale CETRAPLUS" -1 -1 78 18
|
||||||
|
|
||||||
STRING F_TABPR1_CODTAB 3
|
STRING F_TABPR1_CODTAB 3
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
96
|
96
|
||||||
1
|
1
|
||||||
%sezioni|0|0|469|17|Sezioni AVIS|||
|
%sezioni|0|0|519|17|Sezioni AVIS|||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user