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"
#define ALIAS_CTD 700
#define FINE_SOSPENSIONE "FS"
class TGiornalieroDC : public TApplication
{
@ -282,6 +283,7 @@ int TGiornalieroDC::read(TSheet_field& s)
row.add("");
row.add(donaz.get(DON_ETICHETTA));
row.add(donaz.get(DON_PRIMADON));
row.add(""); // data donazione se diversa
if (err == NOERR)
{
row.add(soggetti.get(SOG_DATANASC));
@ -323,6 +325,9 @@ int TGiornalieroDC::write(TSheet_field& s)
int err = sog.read();
if (err == NOERR)
{
TDate datadonazione = row.get(7);
if (!datadonazione.ok())
datadonazione = _datadon;
TString16 tipocon = row.get(4);
if (tipocon.blank())
tipocon = m.get(F_TIPOCON);
@ -330,7 +335,8 @@ int TGiornalieroDC::write(TSheet_field& s)
{
TRectype* recc = new TRectype(LF_CONTSAN);
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);
if (modstato_tcs(tipocon) == 'I')
{
@ -353,13 +359,13 @@ int TGiornalieroDC::write(TSheet_field& s)
{
const TRectype& riga = _scontrolli->row(r);
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;
r=0;
}
else
if (_datadon > d)
if (datadonazione > d)
{
recc->put(CON_PROGCON,r+1);
_scontrolli->insert_row(recc);
@ -391,7 +397,7 @@ int TGiornalieroDC::write(TSheet_field& s)
_progins++;
TRectype* rec = new TRectype(LF_DONAZ);
rec->put(DON_CODICE, row.get(0));
rec->put(DON_DATADON, _datadon);
rec->put(DON_DATADON, datadonazione);
TString16 tipodon = row.get(3);
if (tipodon.blank())
tipodon = _tipodon;
@ -417,13 +423,13 @@ int TGiornalieroDC::write(TSheet_field& s)
{
const TRectype& riga = _sdonazioni->row(r);
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;
r=0;
}
else
if (_datadon > d)
if (datadonazione > d)
{
rec->put(DON_PROGDON,r+1);
_sdonazioni->insert_row(rec);
@ -457,9 +463,9 @@ int TGiornalieroDC::write(TSheet_field& s)
int totdon = sog.get_int(SOG_TOTDON);
TDate dataultdon = sog.get_date(SOG_DATAULTDON);
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);
}
if (is_donaz(tipodon,IDON_SI))
@ -467,19 +473,19 @@ int TGiornalieroDC::write(TSheet_field& s)
totdon = sog.get_int(SOG_TOTDONSI);
sog.put(SOG_TOTDONSI,totdon+1);
dataultdon = sog.get_date(SOG_DATAULTSI);
if (_datadon>dataultdon)
sog.put(SOG_DATAULTSI,_datadon);
if (datadonazione>dataultdon)
sog.put(SOG_DATAULTSI,datadonazione);
}
if (is_donaz(tipodon,IDON_AF))
{
totdon = sog.get_int(SOG_TOTDONAF);
sog.put(SOG_TOTDONAF,totdon+1);
dataultdon = sog.get_date(SOG_DATAULTAF);
if (_datadon>dataultdon)
sog.put(SOG_DATAULTAF,_datadon);
if (datadonazione>dataultdon)
sog.put(SOG_DATAULTAF,datadonazione);
}
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 id2 = sog.get(SOG_IDON2); // idon. 2
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?
modstato = modstato_tcs(stato);
/*
if (!(modstato == 'I' || modstato == 'F')) // il soggetto non è idoneo
{
TTable tcs("TCS");
tcs.put("CODTAB",stato);
if (tcs.read() == NOERR)
{
if (tcs.get("S7").not_empty())
{
TRectype* keyc = new TRectype(LF_CONTSAN);
keyc->put(CON_CODICE, row.get(0));
int err = _scontrolli->read(keyc);
if (err == NOERR)
{
int r=_scontrolli->rows();
TDate dataultid
while (r>=1 &&
modstato = modstato_tcs(stato);
}
}
}
*/
TRectype* key = new TRectype(LF_CONTSAN);
long codice = sog.get_long(SOG_CODICE);
key->put(CON_CODICE, codice);
int err = _scontrolli->read(key);
int progcon = _scontrolli->rows()+1;
TRectype& reccon = _contsan->curr();
reccon.zero();
reccon.put(CON_CODICE, codice);
reccon.put(CON_PROGCON, progcon);
reccon.put(CON_DATACON, datadonazione);
reccon.put(CON_TIPOCON, FINE_SOSPENSIONE);
TString80 resp = user();
resp << " - HA DONATO OGGI";
reccon.put(CON_RESPONSAB, resp);
_scontrolli->add_row(reccon);
_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
{
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_ETICHETTA 106
#define F_S_PRIMADON 107
#define F_S_DATANASC 108
#define F_S_CODSEZ 109
#define F_S_CODSOT 110
#define F_S_CATDON 111
#define F_S_TESSAVIS 112
#define F_S_INTSI 113
#define F_S_DATADON 108
#define F_S_DATANASC 109
#define F_S_CODSEZ 110
#define F_S_CODSOT 111
#define F_S_CATDON 112
#define F_S_TESSAVIS 113
#define F_S_INTSI 114
#define F_S_DENSEZ 151
#define F_S_DENSOT 152

View File

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