Patch level : at2 at9 at0 at9600a.msk

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/branches/R_10_00@22598 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-03-06 13:46:10 +00:00
parent 76de617a65
commit 31c48b6884
8 changed files with 109 additions and 104 deletions

View File

@ -2348,7 +2348,7 @@ bool TGestioneSoggetti::controlli_notify(TSheet_field& s, int r, KEY k)
}
if (modified)
{
TSheet_field& i = (TSheet_field&)mask.field(F_IDONEITA);
TSheet_field& i = mask.sfield(F_IDONEITA);
c_reord(s, i);
}
return true;
@ -2397,7 +2397,7 @@ bool TGestioneSoggetti::idoneita_notify(TSheet_field& s, int r, KEY k)
}
if (modified)
{
TSheet_field& c = (TSheet_field&)mask.field(F_CONTROLLI);
TSheet_field& c = mask.sfield(F_CONTROLLI);
c_reord(c,s);
}
return true;

View File

@ -1,6 +1,7 @@
#include <form.h>
#include <mask.h>
#include <printapp.h>
#include <progind.h>
#include <utility.h>
#include "donaz.h"
@ -84,10 +85,10 @@ TRelation* TEti_freq_form::relation() const { return cursor()->relation(); }
void TFrequenza::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
const TString& sezini = _msk->get(F_SEZINI);
const TString& sotini = _msk->get(F_SOTINI);
const TString& sezfin = _msk->get(F_SEZFIN);
const TString& sotfin = _msk->get(F_SOTFIN);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -182,86 +183,86 @@ void TFrequenza::set_page(int file, int cnt)
bool TFrequenza::filter_func_freq(const TRelation* rel)
{
const TDate datanulla(NULLDATE);
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
if (rel->file().recno() % 100 == 0)
do_events();
const TRectype& sog = rel->curr();
const TFrequenza& a = app();
bool filtrato = true;
// filtro per sesso
if (app()._sesso != 'I')
filtrato = (sog.get(SOG_SESSO)[0] == app()._sesso);
if (a._sesso != 'I')
filtrato = sog.get(SOG_SESSO)[0] == a._sesso;
// filtro per nati all'estero
if (filtrato && app()._natiestero)
filtrato = (sog.get(SOG_COMNASC)[0] == 'Z');
if (filtrato && a._natiestero)
filtrato = sog.get_char(SOG_COMNASC) == 'Z';
// filtro per data nascita
if (filtrato)
{
if (app()._dnini != datanulla)
if (a._dnini.ok())
{
const TDate datanasc = sog.get_date(SOG_DATANASC);
filtrato = datanasc >= app()._dnini;
filtrato = datanasc >= a._dnini;
}
}
if (filtrato)
{
if (app()._dnfin != datanulla)
if (a._dnfin.ok())
{
const TDate datanasc = sog.get_date(SOG_DATANASC);
filtrato = datanasc <= app()._dnfin;
filtrato = datanasc <= a._dnfin;
}
}
// filtro per categorie
if (filtrato)
{
TAssoc_array& categorie = app()._categorie;
if (categorie.items() != 0)
const TAssoc_array& categorie = a._categorie;
if (!categorie.empty())
{
const TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat);
const TString& cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key(cat);
}
}
// filtro per numero donazioni nel periodo
if (filtrato)
{
int numdon = 0;
filtrato = FALSE;
if (app()._ctrltotale)
filtrato = false;
if (a._ctrltotale)
numdon = sog.get_int(SOG_TOTDON);
else
{
if (app()._dataini == datanulla)
if (!a._dataini.ok())
numdon = sog.get_int(SOG_DONPRECSI) + sog.get_int(SOG_DONPRECAF);
const long codice = sog.get_long(SOG_CODICE);
TRectype* key = new TRectype(LF_DONAZ);
key->put(DON_CODICE, codice);
int err = app()._sdonazioni->read(key);
int err = a._sdonazioni->read(key);
if (err == NOERR)
{
for (int r=1; r<=app()._sdonazioni->rows(); r++)
for (int r=1; r<=a._sdonazioni->rows(); r++)
{
const TRectype& riga = app()._sdonazioni->row(r);
TDate datadon = riga.get_date(DON_DATADON);
if ((datadon>=app()._dataini) && (datadon<=app()._datafin))
const TRectype& riga = a._sdonazioni->row(r);
const TDate datadon = riga.get_date(DON_DATADON);
if ((datadon>=a._dataini) && (datadon<=a._datafin))
{
TString16 tipodon = riga.get(DON_TIPODON);
if ((app()._tipodon.empty()) || (app()._tipodon1 == tipodon) || (app()._tipodon2 == tipodon) || (app()._tipodon3 == tipodon) || (app()._tipodon4 == tipodon) || (app()._tipodon5 == tipodon))
const TString& tipodon = riga.get(DON_TIPODON);
if ((a._tipodon.empty()) || (a._tipodon1 == tipodon) || (a._tipodon2 == tipodon) ||
(a._tipodon3 == tipodon) || (a._tipodon4 == tipodon) || (a._tipodon5 == tipodon))
numdon++;
}
}
}
}
switch (app()._condizione)
switch (a._condizione)
{
case 'A':
filtrato = (numdon >= app()._numdon);
break;
case 'E':
filtrato = (numdon == app()._numdon);
break;
case 'D':
filtrato = (numdon >= 1 && numdon <= app()._numdon);
break;
case 'A': filtrato = (numdon >= a._numdon); break;
case 'E': filtrato = (numdon == a._numdon); break;
case 'D': filtrato = (numdon >= 1 && numdon <= a._numdon); break;
default : break;
}
}
return filtrato;
@ -516,19 +517,20 @@ bool TFrequenza::set_print(int m)
TString256 chiave = "";
switch (ordina)
{
case 'A':
chiave << "90->CODSEZ|90->CODSOT|UPPER(90->COGNOME)|UPPER(90->NOME)";
break;
case 'C':
chiave << "90->DOM_CAP|UPPER(90->COGNOME)|UPPER(90->NOME)";
break;
case 'A': chiave << "90->CODSEZ|90->CODSOT|UPPER(90->COGNOME)|UPPER(90->NOME)"; break;
case 'C': chiave << "90->DOM_CAP|UPPER(90->COGNOME)|UPPER(90->NOME)"; break;
default : break;
}
((TSorted_cursor*) current_cursor())->change_order(chiave);
current_cursor()->set_filterfunction (filter_func_freq);
reset_print();
printer().footerlen(0);
crea_intestazione();
return TRUE;
TProgind pi(1, TR("Controllo donazioni per soggetto"), true, false);
*current_cursor() = 0L;
return true;
}
else
return FALSE;

View File

@ -57,8 +57,8 @@ void TControlloDonazioni::set_page(int file, int cnt)
set_row(1,"@11g@S", FLD(LF_DONAZ, DON_LUOGODON));
set_row(1,"@20g@S", FLD(LF_DONAZ,DON_TIPODON));
set_row(1,"@25g#a", &_cognome_nome);
set_row(1,"@76g@S", FLD(LF_SOGGETTI,SOG_CODSEZ));
set_row(1,"@79g@S", FLD(LF_SOGGETTI,SOG_CODSOT));
set_row(1,"@76g@S", FLD(LF_DONAZ,DON_CODSEZ));
set_row(1,"@79g@S", FLD(LF_DONAZ,DON_CODSOT));
set_row(1,"@82g@S", FLD(LF_SOGGETTI, SOG_GRUPPOAB0));
set_row(1,"@87g@S", FLD(LF_SOGGETTI, SOG_RHANTID));
set_row(1,"@91g@S", FLD(LF_SOGGETTI, SOG_FENOTIPORH));
@ -76,8 +76,8 @@ void TControlloDonazioni::set_page(int file, int cnt)
set_row(2,"@16g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(1,"@25g#a", &_cognome_nome);
set_row(2,"@25g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_CODSEZ));
set_row(2,"@64g@S", FLD(LF_SOGGETTI,SOG_CODSOT));
set_row(1,"@61g@S", FLD(LF_DONAZ,DON_CODSEZ));
set_row(2,"@64g@S", FLD(LF_DONAZ,DON_CODSOT));
set_row(1,"@64g@ld", FLD(LF_DONAZ,DON_DATADON));
set_row(2,"@64g@S", FLD(LF_DONAZ,DON_TIPODON));
set_row(1,"@75g@S", FLD(LF_SOGGETTI, SOG_GRUPPOAB0));
@ -93,8 +93,8 @@ void TControlloDonazioni::set_page(int file, int cnt)
set_row(1,"@26g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(1,"@34g#a", &_cognome_nome);
set_row(1,"@70g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@81g@S", FLD(LF_SOGGETTI,SOG_CODSEZ));
set_row(1,"@84g@S", FLD(LF_SOGGETTI,SOG_CODSOT));
set_row(1,"@81g@S", FLD(LF_DONAZ,DON_CODSEZ));
set_row(1,"@84g@S", FLD(LF_DONAZ,DON_CODSOT));
set_row(1,"@87g@ld", FLD(LF_DONAZ,DON_DATADON));
set_row(1,"@98g@S", FLD(LF_DONAZ,DON_TIPODON));
set_row(1,"@104g@S", FLD(LF_DONAZ, DON_LUOGODON));

View File

@ -563,6 +563,6 @@ bool TStampeSingole::user_destroy()
int at7300(int argc, char* argv[])
{
TStampeSingole a;
a.run(argc, argv, "Stampe singole");
a.run(argc, argv, TR("Stampe singole"));
return 0;
}

View File

@ -85,10 +85,8 @@ bool TEsporta_ON_recordset::set(unsigned int column, const TVariant& var)
return TCSV_recordset::set(column, TVariant(str));
}
TEsporta_ON_recordset::TEsporta_ON_recordset()
: TCSV_recordset("CSV(\"|\")")
{
}
TEsporta_ON_recordset::TEsporta_ON_recordset() : TCSV_recordset("CSV(\"|\")")
{ }
///////////////////////////////////////////////////////////
@ -105,29 +103,33 @@ protected:
const TString& find_comune(const TRecordset& soggetti) const;
const TString& find_dencom_nasc(const TString& codcom) const;
void crea_prima_riga(TEsporta_ON_recordset& csv, const TString& sezini, const TString& sezfin) const;
void crea_prima_riga(TEsporta_ON_recordset& csv, const TString& sezini, const TString& sezfin, TConfig& config) const;
public:
void esporta_soggetti(const TMask& msk) const;
};
void TEsporta_ON_app::crea_prima_riga(TEsporta_ON_recordset& csv, const TString& sezini, const TString& sezfin) const
void TEsporta_ON_app::crea_prima_riga(TEsporta_ON_recordset& csv, const TString& sezini, const TString& sezfin, TConfig& config) const
{
// query su sezioni per stabilire cosa scrivere nel primo record
// elenco delle sezioni trasferite separate da ','
TString querysez;
querysez << "USE SEZIONI\nSELECT CODSOT=''";
if (sezini.not_empty())
if (sezini.full())
querysez << "\nFROM CODSEZ=\"" << sezini << "\"";
if (sezini.not_empty())
if (sezfin.full())
querysez << "\nTO CODSEZ=\"" << sezfin << "\"";
TISAM_recordset sezioni(querysez);
// crea testata
TToken_string ts("", ',');
for (bool oks = sezioni.move_first(); oks; oks = sezioni.move_next())
ts.add(sezioni.get(SEZ_CODSEZ).as_string());
{
const TString& codsez = sezioni.get(SEZ_CODSEZ).as_string();
const TString& sez_on = config.get(codsez, "SEZIONI");
if (sez_on.full())
ts.add(sez_on);
}
csv.new_rec(ts);
}
@ -142,44 +144,49 @@ void TEsporta_ON_app::esporta_soggetti(const TMask& m) const
const TString4 sotfin = m.get(F_SOTFIN);
TEsporta_ON_recordset csv;
//crea la prima stupida riga
crea_prima_riga(csv, sezini, sezfin);
crea_prima_riga(csv, sezini, sezfin, config);
// query su soggetti
TString query;
query << "USE SOGGETTI KEY 3";
const TDate data = m.get_date(F_DATA);
if (sezini.not_empty())
if (sezini.full())
query << "\nFROM CODSEZ=\"" << sezini << "\"";
if (sezini.not_empty())
if (sezfin.full())
query << "\nTO CODSEZ=\"" << sezfin << "\"";
TISAM_recordset soggetti(query);
TFilename path = config.get("NOMEFILE", "GENERALE");
if (path.empty())
path = "file_on.txt";
TString msg;
msg << TR("Estrazione soggetti in ") << path;
const int items = soggetti.items();
TProgind pi(items, "Estrazione soggetti...", true, true);
TProgind pi(items, msg);
TString ws;
for (bool ok = soggetti.move_first(); ok; ok = soggetti.move_next())
{
if (!pi.addstatus(1))
break;
const TString4& catdon = soggetti.get(SOG_CATDON).as_string();
const TString4 catdon = soggetti.get(SOG_CATDON).as_string();
const TDate dataisc = soggetti.get(SOG_DATAISC).as_date();
const bool passa = config.get_bool(catdon, "CATEGORIE");
const TString4& codsez = soggetti.get(SOG_CODSEZ).as_string();
TString16 sez_on = config.get(codsez, "SEZIONI");
if (sez_on.empty())
sez_on = codsez;
//if ((catdon == "01" || catdon == "04") && (dataisc.empty() || dataisc <= data))
if (passa && (dataisc.empty() || dataisc <= data))
const TString& codsez = soggetti.get(SOG_CODSEZ).as_string();
const TString& sez_on = config.get(codsez, "SEZIONI");
if (sez_on.blank())
continue;
if (passa && (dataisc.empty() || dataisc <= data))
{
//creazione di un nuovo record di tipo soggetti
//creazione di un nuovo record di tipo soggetti
csv.new_rec("");
//..e successivo riempimento
csv.set(0, (TVariant) sez_on);
csv.set(0, sez_on);
csv.set(1, soggetti.get(SOG_TESSAVIS));
csv.set(2, soggetti.get(SOG_CF));
csv.set(3, soggetti.get(SOG_COGNOME));
@ -208,9 +215,6 @@ void TEsporta_ON_app::esporta_soggetti(const TMask& m) const
}
} //for(move_first()..
TString80 path = config.get("NOMEFILE", "GENERALE");
if (path.empty())
path = "file_on.txt";
csv.save_as(path, fmt_text);
#ifdef DBG
xvt_sys_goto_url(path, "open");

View File

@ -1,14 +1,10 @@
#include "at9600a.h"
TOOLBAR "" 0 0 0 2
#include <stdbar.h>
ENDPAGE
PAGE "Estrazione dati per Osservatorio Associativo" 0 2 0 0
PAGE "Estrazione dati per Osservatorio Associativo" -1 -1 80 6
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 0 "Scelta sezioni"
PROMPT 1 0 "@bScelta sezioni"
END
STRING F_SEZINI 2
@ -123,8 +119,14 @@ END
DATE F_DATA
BEGIN
PROMPT 2 6 "Situazione al "
PROMPT 2 4 "Situazione al "
END
ENDPAGE
TOOLBAR "" 0 0 0 2
#include <stdbar.h>
ENDPAGE
ENDMASK

View File

@ -16,21 +16,19 @@
#include "atlib.h"
#include "at9800a.h"
////////////////////////////
// Maschera
////////////////////////////
class TImporta_ct_rn_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TImporta_ct_rn_mask();
TImporta_ct_rn_mask() : TAutomask("at9800a") {}
};
TImporta_ct_rn_mask::TImporta_ct_rn_mask() : TAutomask("at9800a")
{
}
bool TImporta_ct_rn_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
{
switch (f.dlg())
@ -49,9 +47,7 @@ bool TImporta_ct_rn_mask::on_field_event(TOperable_field& f, TField_event e, lon
*row = name.name();
}
if (as.run() == K_ENTER)
{
f.set(as.row(as.selected()));
}
}
break;
default:
@ -130,7 +126,7 @@ public:
TObject* TDecode_c2a::key2obj(const char* key)
{
TString* str = new TString;
TString* str = new TString4;
TModule_table tabmod("AT548C2A");
tabmod.put("CODTAB", key);
@ -602,7 +598,7 @@ void TImporta_ct_rn::aggiunge_contsan(const TImporta_ct_rn_recordset& recset, co
contsan.zero();
contsan.put(CON_CODICE, sog_codice);
contsan.put(CON_PROGCON, next_contsan);
const TDate& dataesame = recset.get_date("DATADON");
const TDate dataesame = recset.get_date("DATADON");
contsan.put(CON_DATACON, dataesame);
const TString& tipopre = decode_prelievo(recset.get("TIPOPRE").as_string());
contsan.put(CON_TIPOCON, tipopre);
@ -625,7 +621,7 @@ void TImporta_ct_rn::aggiunge_donazione(const TImporta_ct_rn_recordset& recset,
donaz.zero();
donaz.put(DON_CODICE, sog_codice);
donaz.put(DON_PROGDON, next_donaz);
const TDate& dataesame = recset.get_date("DATADON");
const TDate dataesame = recset.get_date("DATADON");
donaz.put(DON_DATADON, dataesame);
const TString& tipopre = decode_prelievo(recset.get("TIPOPRE").as_string());
donaz.put(DON_TIPODON, tipopre);

View File

@ -1,3 +1,4 @@
#include <diction.h>
#include <tabutil.h>
#include "atlib.h"
@ -494,15 +495,15 @@ bool configura_stampante(TPrinter& p, const char* configurazione, const char* ti
p.set_printtype(winprinter);
if (p.set())
{
TString80 messaggio = "Stampante configurata per stampa ";
TString messaggio = TR("Stampante configurata per stampa ");
messaggio << tipostampa;
message_box(messaggio);
return TRUE;
}
else
{
TString80 messaggio = "Operazione di stampa ";
messaggio << tipostampa << " annullata";
TString messaggio = TR("Operazione di stampa ");
messaggio << tipostampa << TR(" annullata");
message_box(messaggio);
return FALSE;
}