Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Giornaliero don./con.: sblocco automatico del sospeso che dona e possibilita' di cambiare la data donazione sulla riga del soggetto (altrimenti vale quella in testata)


git-svn-id: svn://10.65.10.50/trunk@7010 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1998-09-02 14:03:43 +00:00
parent c41b69bad8
commit e1c977f539
3 changed files with 56 additions and 40 deletions

View File

@ -26,6 +26,7 @@
#include "rconvoc.h" #include "rconvoc.h"
#define ALIAS_CTD 700 #define ALIAS_CTD 700
#define FINE_SOSPENSIONE "FS"
class TGiornalieroDC : public TApplication class TGiornalieroDC : public TApplication
{ {
@ -282,6 +283,7 @@ int TGiornalieroDC::read(TSheet_field& s)
row.add(""); row.add("");
row.add(donaz.get(DON_ETICHETTA)); row.add(donaz.get(DON_ETICHETTA));
row.add(donaz.get(DON_PRIMADON)); row.add(donaz.get(DON_PRIMADON));
row.add(""); // data donazione se diversa
if (err == NOERR) if (err == NOERR)
{ {
row.add(soggetti.get(SOG_DATANASC)); row.add(soggetti.get(SOG_DATANASC));
@ -323,6 +325,9 @@ int TGiornalieroDC::write(TSheet_field& s)
int err = sog.read(); int err = sog.read();
if (err == NOERR) if (err == NOERR)
{ {
TDate datadonazione = row.get(7);
if (!datadonazione.ok())
datadonazione = _datadon;
TString16 tipocon = row.get(4); TString16 tipocon = row.get(4);
if (tipocon.blank()) if (tipocon.blank())
tipocon = m.get(F_TIPOCON); tipocon = m.get(F_TIPOCON);
@ -330,7 +335,8 @@ int TGiornalieroDC::write(TSheet_field& s)
{ {
TRectype* recc = new TRectype(LF_CONTSAN); TRectype* recc = new TRectype(LF_CONTSAN);
recc->put(CON_CODICE, row.get(0)); recc->put(CON_CODICE, row.get(0));
recc->put(CON_DATACON, _datadon); //recc->put(CON_DATACON, _datadon);
recc->put(CON_DATACON, datadonazione);
recc->put(CON_TIPOCON, tipocon); recc->put(CON_TIPOCON, tipocon);
if (modstato_tcs(tipocon) == 'I') if (modstato_tcs(tipocon) == 'I')
{ {
@ -353,13 +359,13 @@ int TGiornalieroDC::write(TSheet_field& s)
{ {
const TRectype& riga = _scontrolli->row(r); const TRectype& riga = _scontrolli->row(r);
const TDate d = riga.get(CON_DATACON); const TDate d = riga.get(CON_DATACON);
if (_datadon==d) // esiste già un controllo in questa data if (datadonazione==d) // esiste già un controllo in questa data
{ {
exist=TRUE; exist=TRUE;
r=0; r=0;
} }
else else
if (_datadon > d) if (datadonazione > d)
{ {
recc->put(CON_PROGCON,r+1); recc->put(CON_PROGCON,r+1);
_scontrolli->insert_row(recc); _scontrolli->insert_row(recc);
@ -391,7 +397,7 @@ int TGiornalieroDC::write(TSheet_field& s)
_progins++; _progins++;
TRectype* rec = new TRectype(LF_DONAZ); TRectype* rec = new TRectype(LF_DONAZ);
rec->put(DON_CODICE, row.get(0)); rec->put(DON_CODICE, row.get(0));
rec->put(DON_DATADON, _datadon); rec->put(DON_DATADON, datadonazione);
TString16 tipodon = row.get(3); TString16 tipodon = row.get(3);
if (tipodon.blank()) if (tipodon.blank())
tipodon = _tipodon; tipodon = _tipodon;
@ -417,13 +423,13 @@ int TGiornalieroDC::write(TSheet_field& s)
{ {
const TRectype& riga = _sdonazioni->row(r); const TRectype& riga = _sdonazioni->row(r);
const TDate d = riga.get(DON_DATADON); const TDate d = riga.get(DON_DATADON);
if (_datadon==d) // esiste gia' una donazione in questa data if (datadonazione==d) // esiste gia' una donazione in questa data
{ {
exist=TRUE; exist=TRUE;
r=0; r=0;
} }
else else
if (_datadon > d) if (datadonazione > d)
{ {
rec->put(DON_PROGDON,r+1); rec->put(DON_PROGDON,r+1);
_sdonazioni->insert_row(rec); _sdonazioni->insert_row(rec);
@ -457,9 +463,9 @@ int TGiornalieroDC::write(TSheet_field& s)
int totdon = sog.get_int(SOG_TOTDON); int totdon = sog.get_int(SOG_TOTDON);
TDate dataultdon = sog.get_date(SOG_DATAULTDON); TDate dataultdon = sog.get_date(SOG_DATAULTDON);
sog.put(SOG_TOTDON,totdon+1); sog.put(SOG_TOTDON,totdon+1);
if (_datadon > dataultdon) if (datadonazione > dataultdon)
{ {
sog.put(SOG_DATAULTDON,_datadon); sog.put(SOG_DATAULTDON,datadonazione);
sog.put(SOG_TIPOULTDON,tipodon); sog.put(SOG_TIPOULTDON,tipodon);
} }
if (is_donaz(tipodon,IDON_SI)) if (is_donaz(tipodon,IDON_SI))
@ -467,19 +473,19 @@ int TGiornalieroDC::write(TSheet_field& s)
totdon = sog.get_int(SOG_TOTDONSI); totdon = sog.get_int(SOG_TOTDONSI);
sog.put(SOG_TOTDONSI,totdon+1); sog.put(SOG_TOTDONSI,totdon+1);
dataultdon = sog.get_date(SOG_DATAULTSI); dataultdon = sog.get_date(SOG_DATAULTSI);
if (_datadon>dataultdon) if (datadonazione>dataultdon)
sog.put(SOG_DATAULTSI,_datadon); sog.put(SOG_DATAULTSI,datadonazione);
} }
if (is_donaz(tipodon,IDON_AF)) if (is_donaz(tipodon,IDON_AF))
{ {
totdon = sog.get_int(SOG_TOTDONAF); totdon = sog.get_int(SOG_TOTDONAF);
sog.put(SOG_TOTDONAF,totdon+1); sog.put(SOG_TOTDONAF,totdon+1);
dataultdon = sog.get_date(SOG_DATAULTAF); dataultdon = sog.get_date(SOG_DATAULTAF);
if (_datadon>dataultdon) if (datadonazione>dataultdon)
sog.put(SOG_DATAULTAF,_datadon); sog.put(SOG_DATAULTAF,datadonazione);
} }
char modstato = ' '; char modstato = ' ';
const TString16 stato = sog.get(SOG_STATO); // stato attuale TString16 stato = sog.get(SOG_STATO); // stato attuale
const TString16 id1 = sog.get(SOG_IDON1); // idon. 1 const TString16 id1 = sog.get(SOG_IDON1); // idon. 1
const TString16 id2 = sog.get(SOG_IDON2); // idon. 2 const TString16 id2 = sog.get(SOG_IDON2); // idon. 2
const TString16 id3 = sog.get(SOG_IDON3); // idon. 3 const TString16 id3 = sog.get(SOG_IDON3); // idon. 3
@ -496,29 +502,32 @@ int TGiornalieroDC::write(TSheet_field& s)
bool id_af = FALSE; // il soggetto è idoneo per af? bool id_af = FALSE; // il soggetto è idoneo per af?
modstato = modstato_tcs(stato); modstato = modstato_tcs(stato);
/*
if (!(modstato == 'I' || modstato == 'F')) // il soggetto non è idoneo if (!(modstato == 'I' || modstato == 'F')) // il soggetto non è idoneo
{ {
TTable tcs("TCS"); TRectype* key = new TRectype(LF_CONTSAN);
tcs.put("CODTAB",stato); long codice = sog.get_long(SOG_CODICE);
if (tcs.read() == NOERR) key->put(CON_CODICE, codice);
{ int err = _scontrolli->read(key);
if (tcs.get("S7").not_empty()) int progcon = _scontrolli->rows()+1;
{ TRectype& reccon = _contsan->curr();
TRectype* keyc = new TRectype(LF_CONTSAN); reccon.zero();
keyc->put(CON_CODICE, row.get(0)); reccon.put(CON_CODICE, codice);
int err = _scontrolli->read(keyc); reccon.put(CON_PROGCON, progcon);
if (err == NOERR) reccon.put(CON_DATACON, datadonazione);
{ reccon.put(CON_TIPOCON, FINE_SOSPENSIONE);
int r=_scontrolli->rows(); TString80 resp = user();
TDate dataultid resp << " - HA DONATO OGGI";
while (r>=1 && reccon.put(CON_RESPONSAB, resp);
_scontrolli->add_row(reccon);
modstato = modstato_tcs(stato); _scontrolli->rewrite();
} TRectype* keyc = new TRectype(LF_IDONEITA);
} keyc->put(IDO_CODICE, row.get(0));
} err = _sidoneita->read(keyc);
*/ con_reord(sog.curr(),_scontrolli,_sidoneita);
sog.rewrite();
stato = sog.get(SOG_STATO); // stato attuale
modstato = modstato_tcs(stato);
}
if (modstato == 'I' || modstato == 'F') // il soggetto è idoneo if (modstato == 'I' || modstato == 'F') // il soggetto è idoneo
{ {
id_si = (is_idon(id1,id2,id3,id4,IDON_SI) && intsi != 0); // il soggetto è idoneo SI id_si = (is_idon(id1,id2,id3,id4,IDON_SI) && intsi != 0); // il soggetto è idoneo SI

View File

@ -21,12 +21,13 @@
#define F_S_TIPOCON 105 #define F_S_TIPOCON 105
#define F_S_ETICHETTA 106 #define F_S_ETICHETTA 106
#define F_S_PRIMADON 107 #define F_S_PRIMADON 107
#define F_S_DATANASC 108 #define F_S_DATADON 108
#define F_S_CODSEZ 109 #define F_S_DATANASC 109
#define F_S_CODSOT 110 #define F_S_CODSEZ 110
#define F_S_CATDON 111 #define F_S_CODSOT 111
#define F_S_TESSAVIS 112 #define F_S_CATDON 112
#define F_S_INTSI 113 #define F_S_TESSAVIS 113
#define F_S_INTSI 114
#define F_S_DENSEZ 151 #define F_S_DENSEZ 151
#define F_S_DENSOT 152 #define F_S_DENSOT 152

View File

@ -144,6 +144,7 @@ BEGIN
ITEM "Con." ITEM "Con."
ITEM "Et. sacca" ITEM "Et. sacca"
ITEM "1ø" ITEM "1ø"
ITEM "Data don."
ITEM "Nato il@10" ITEM "Nato il@10"
ITEM "Sez." ITEM "Sez."
ITEM "Sot." ITEM "Sot."
@ -284,6 +285,11 @@ BEGIN
PROMPT 60 16 "Prima donazione" PROMPT 60 16 "Prima donazione"
END END
DATE F_S_DATADON
BEGIN
PROMPT 2 17 "Data don. "
END
DATE F_S_DATANASC DATE F_S_DATANASC
BEGIN BEGIN
PROMPT 2 3 "Nato il " PROMPT 2 3 "Nato il "