Patch level :2.2 170

Files correlati     :stampa rendiconto
Ricompilazione Demo : [ ]
Commento            :
Rivoluzione in corso d'opera! NON ancora terminata.


git-svn-id: svn://10.65.10.50/trunk@13323 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2005-09-01 18:04:42 +00:00
parent 4a9677a81e
commit 90e759a17e
7 changed files with 222 additions and 92 deletions

View File

@ -13,6 +13,8 @@ protected:
bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
void config_loader(TSheet_field& sf, const char* paragrafo);
void config_setter(TSheet_field& sf, const char* paragrafo);
TConf_mask(const TFilename& f);
virtual ~TConf_mask(){};
@ -20,7 +22,7 @@ public:
TConf_mask::TConf_mask(const TFilename& f) :TAutomask (f)
{
}
}
bool TConf_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
@ -90,6 +92,9 @@ public:
virtual bool user_create( );
virtual bool user_destroy( );
void config_loader(TSheet_field& sf, TConfig& config);
void config_setter(TSheet_field& sf, TConfig& config);
TConf_Analitica() : TConfig_application( CONFIG_DITTA ), _cm(NULL) { }
virtual ~TConf_Analitica( ){ }
};
@ -107,13 +112,56 @@ TMask* TConf_Analitica::create_mask(const TFilename& f)
return _cm;
}
void TConf_Analitica::config_loader(TSheet_field& sf, TConfig& config)
{
for (int i = 0;;i++)
{
TToken_string num_doc(config.get("ND", NULL, i));
if (num_doc.blank())
break;
TToken_string& row = sf.row(i);
row.add(num_doc.get(0));
row.add("");
row.add(num_doc.get(1));
row.add(num_doc.get(2));
row.add(num_doc.get(3));
sf.check_row(i);
}
}
void TConf_Analitica::config_setter(TSheet_field& sf, TConfig& config)
{
const int items = sf.items();
for (int i = items;;i++)
{
TToken_string num_doc(config.get("ND", NULL, i));
if (num_doc.blank())
break;
config.remove("ND", i);
}
FOR_EACH_SHEET_ROW (sf, j, row)
{
TToken_string num_doc;
num_doc.add(row->get(0));
num_doc.add(row->get(2));
num_doc.add(row->get(3));
num_doc.add(row->get(4));
config.set("ND", (const char*) num_doc, NULL, true, j); //setta i valori nel config
}
}
bool TConf_Analitica::preprocess_config (TMask& mask, TConfig& config)
{
config_loader(mask.sfield(F_RIGHE_NUM), config);
return true;
}
bool TConf_Analitica::postprocess_config (TMask& mask, TConfig& config)
{
config_setter(mask.sfield(F_RIGHE_NUM), config);
return true;
}

View File

@ -1,9 +1,9 @@
//campi maschera ca0300a.uml (configurazione Cintabilita' Analitica
#define F_DATAATTCA 101
#define F_LEVEL_1 102
#define F_LEVEL_2 103
#define F_ATTIVA_FASI 104
#define F_FATHER_FASI 105
//campi maschera ca0300a.uml (configurazione Contabilita' Analitica
#define F_DATAATTCA 151
#define F_LEVEL_1 152
#define F_LEVEL_2 153
#define F_ATTIVA_FASI 154
#define F_FATHER_FASI 155
#define F_CDC_1 106
#define F_CDC_2 107
@ -47,3 +47,13 @@
#define F_CMSREQ 141
#define F_FSCREQ 142
#define F_PDCREQ 143
//sheet delle numerazioni documenti
#define F_RIGHE_NUM 170
//elementi dello sheet dei documenti
#define SN_CODNUM 101
#define SN_DESCR 102
#define SN_EXCLUDE 103
#define SN_DASTATO 104
#define SN_ASTATO 105

View File

@ -406,4 +406,86 @@ END
ENDPAGE
ENDMASK
PAGE "Regole num. doc." -1 -1 78 20
SPREADSHEET F_RIGHE_NUM -1 -2
BEGIN
PROMPT 1 2 ""
ITEM "Numerazione"
ITEM "Descrizione@50"
ITEM "Da escludere"
ITEM "Da stato"
ITEM "A stato"
END
ENDPAGE
ENDMASK
PAGE "Riga Numerazione" -1 -1 78 8
STRING SN_CODNUM 4
BEGIN
PROMPT 1 1 "Codice numerazione "
USE %NUM
CHECKTYPE REQUIRED
INPUT CODTAB SN_CODNUM
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT SN_CODNUM CODTAB
OUTPUT SN_DESCR S0
KEY 1
FLAGS "UZ"
END
STRING SN_DESCR 50
BEGIN
PROMPT 1 3 "Descrizione "
USE %NUM KEY 2
INPUT S0 SN_DESCR
DISPLAY "Descrizione@50" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT SN_CODNUM
END
BOOLEAN SN_EXCLUDE
BEGIN
PROMPT 1 5 "Da escudere"
MESSAGE FALSE ENABLE,1@
MESSAGE TRUE CLEAR,1@
END
NUMBER SN_DASTATO 1
BEGIN
PROMPT 20 5 "Da stato "
CHECKTYPE REQUIRED
GROUP 1
END
NUMBER SN_ASTATO 1
BEGIN
PROMPT 35 5 "A stato "
CHECKTYPE REQUIRED
NUM_EXPR #SN_ASTATO>=#SN_DASTATO
WARNING "Lo stato iniziale non puo' essere > dello stato finale"
GROUP 1
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -193,7 +193,7 @@ void TPrint_rendiconto_ca_mask::create_sheet()
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
TConfig_anal ini;
const bool fsc_req = ini.get_bool("FscRequired");
// const bool fsc_req = ini.get_bool("FscRequired");
int y = 1;
short dlg = S_CDC1 + 100; // id del primo campo da generare
@ -204,7 +204,7 @@ void TPrint_rendiconto_ca_mask::create_sheet()
if (level == "CDC") // Crea centro di costo
{
if (fasinfo.parent() == LF_CDC)
create_sheet_fields(LF_FASI, y, dlg, fsc_req);
create_sheet_fields(LF_FASI, y, dlg, false); //fsc_req);
else
{
const bool cdc_req = ini.get_bool("CdcRequired");
@ -214,7 +214,7 @@ void TPrint_rendiconto_ca_mask::create_sheet()
if (level == "CMS") // Crea commessa
{
if (fasinfo.parent() == LF_COMMESSE)
create_sheet_fields(LF_FASI, y, dlg, fsc_req);
create_sheet_fields(LF_FASI, y, dlg, false); //fsc_req);
else
{
const bool cms_req = ini.get_bool("CmsRequired");
@ -224,7 +224,7 @@ void TPrint_rendiconto_ca_mask::create_sheet()
}
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0)
create_sheet_fields(LF_FASI, y, dlg, fsc_req);
create_sheet_fields(LF_FASI, y, dlg, false); //fsc_req);
for (short id = S_CDC12+100; id >= S_CDC1+100; id--)
{
@ -894,19 +894,33 @@ void TPrint_rendiconto_ca_recordset::crea_righe_da_rdoc(const TPrint_rendiconto_
//inizialmente il filtro di scansione delle righedoc coincide con quello sulle date
TString filtro = filtro_date;
//****DA MODIFICARE DOPO IL CAMBIO DELLA CONFIGURAZIONE
//deve filtrare i soli documenti con codnum NON presente nello sheet dei codnum
TSheet_field& sheet = msk.sfield(F_RIGHE_NUM);
FOR_EACH_SHEET_ROW(sheet, r, row)
TConfig_anal config;
bool update = false;
for (int i = 0;;i++)
{
const TString4 codnum(row->get(0)); //prende il codice numerazione sulla riga
//aggiunge al filtro il codice numerazione:
//NON vanno prese le righe dei doc con codnum indicato nello sheet!!
TToken_string num_doc(config.get("ND", NULL, i));
const TString4 codnum = num_doc.get(0);
if (codnum.blank())
break;
const bool exclude = num_doc.get_char(1) == 'X';
if (filtro.not_empty())
filtro << "&&";
filtro << "(CODNUM!=\"" << codnum << "\")";
} //FOR_EACH_SHEET_ROW
if (exclude)
{
filtro << "(CODNUM!=\"" << codnum << "\")";
}
else
{
filtro << "((CODNUM!=\"" << codnum << "\")";
filtro << "||((" << LF_DOC << "->STATO>=\"" << num_doc.get(2) << "\")";
filtro << "&&(" << LF_DOC << "->STATO<=\"" << num_doc.get(3) << "\")))";
update=true;
}
}
//poi deve aggiungere il filtro per cdc/cms/fas
if (_codcosto.not_empty())
@ -929,7 +943,10 @@ void TPrint_rendiconto_ca_recordset::crea_righe_da_rdoc(const TPrint_rendiconto_
}
//il filtro è completo;può eseguire la scansione
TCursor cur_rdoc(&rel_rdoc, filtro, 3, &dardoc, &ardoc);
TCursor cur_rdoc(&rel_rdoc, "", 3, &dardoc, &ardoc);
cur_rdoc.setfilter(filtro, update);
const long rdoc_items = cur_rdoc.items();
cur_rdoc.freeze();

View File

@ -46,8 +46,6 @@
//sheet di pagina 2
#define F_RIGHE 260
//sheet di pagina 3
#define F_RIGHE_NUM 270
//elementi dello sheet con CdC/Cms/Fas (pag.2)
#define S_CDC1 101
@ -63,9 +61,5 @@
#define S_CDC11 111
#define S_CDC12 112
//elementi dello sheet dei documenti (pag.3)
#define SN_CODNUM 101
#define SN_DESCR 102
#endif // __CA3700_H

View File

@ -130,17 +130,6 @@ END
ENDPAGE
PAGE "Num.doc. da escludere" -1 -1 78 20
SPREADSHEET F_RIGHE_NUM -1 -2
BEGIN
PROMPT 1 2 ""
ITEM "Numerazione"
ITEM "Descrizione@50"
END
ENDPAGE
ENDMASK
PAGE "Riga Analitica" -1 -1 78 19
@ -259,49 +248,3 @@ END
ENDPAGE
ENDMASK
PAGE "Riga Numerazione" -1 -1 78 5
STRING SN_CODNUM 4
BEGIN
PROMPT 1 1 "Codice numerazione "
USE %NUM
CHECKTYPE REQUIRED
INPUT CODTAB SN_CODNUM
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT SN_CODNUM CODTAB
OUTPUT SN_DESCR S0
KEY 1
FLAGS "UZ"
END
STRING SN_DESCR 50
BEGIN
PROMPT 1 2 "Descrizione "
USE %NUM KEY 2
INPUT S0 SN_DESCR
DISPLAY "Descrizione@50" S0
DISPLAY "Codice" CODTAB
COPY OUTPUT SN_CODNUM
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -160,19 +160,20 @@ MESSAGE RESET,F2.103</prescript>
<source>#PREVENTIVO</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<field x="1" type="Stringa" align="right" width="4" pattern="1">
<section type="Head" level="3">
<groupby>CODNUM+ANNO+NUMRD</groupby>
<field x="1" type="Stringa" hidden="1" align="right" width="4" pattern="1">
<source>CODNUM</source>
</field>
<field x="5" type="Testo" width="1" pattern="1" text="-" />
<field x="6" type="Numero" align="right" width="4" pattern="1">
<field x="6" type="Numero" hidden="1" align="right" width="4" pattern="1">
<source>ANNO</source>
</field>
<field x="10" type="Testo" width="1" pattern="1" text="-" />
<field x="11" type="Stringa" width="7" pattern="1">
<field x="11" type="Stringa" hidden="1" width="7" pattern="1">
<source>NUMRD</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<field x="20" type="Data" width="10" pattern="1">
<source>DATA</source>
</field>
@ -206,6 +207,37 @@ MESSAGE RESET,F2.103</prescript>
<source>IMPEGNATO</source>
<postscript description="B1.0 POSTSCRIPT">MESSAGE ADD,F2.103</postscript>
</field>
<field type="Numero" hidden="1" align="right" width="1" id="100" pattern="1">
<prescript description="B1.100 PRESCRIPT">#THIS @
0 &#3E;
IF
#101 DISABLE
#102 DISABLE
#103 DISABLE
#104 DISABLE
#105 DISABLE
ELSE
#101 ENABLE
#102 ENABLE
#103 ENABLE
#104 ENABLE
#105 ENABLE
THEN
#THIS @
1 +
#THIS !</prescript>
</field>
<field x="1" type="Stringa" align="right" width="4" id="101" pattern="1">
<source>CODNUM</source>
</field>
<field x="5" type="Testo" width="1" id="102" pattern="1" text="-" />
<field x="6" type="Numero" align="right" width="4" id="103" pattern="1">
<source>ANNO</source>
</field>
<field x="10" type="Testo" width="1" id="104" pattern="1" text="-" />
<field x="11" type="Stringa" width="7" id="105" pattern="1">
<source>NUMRD</source>
</field>
</section>
<section type="Foot" />
<section type="Foot" level="1" />
@ -239,5 +271,9 @@ MESSAGE RESET,F2.103</prescript>
<source>#H2.103-#103</source>
</field>
</section>
<section type="Foot" level="3">
<prescript description="F3 PRESCRIPT">0
#B1.100 !</prescript>
</section>
<sql>USE 1000</sql>
</report>