Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : stampa registro sintetico cespiti con filtro analitico funzionante (ma secondo me inutile) git-svn-id: svn://10.65.10.50/trunk@20556 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
877eeb1880
commit
6bc84c0a2e
@ -105,9 +105,11 @@ TStampa_sintetica_mask::TStampa_sintetica_mask() : TAutomask("ce3900"), _preview
|
||||
///////////////////////////////////////////////////////////////
|
||||
// RECORDSET
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
class TStampa_sintetica_recordset : public TISAM_recordset
|
||||
{
|
||||
protected:
|
||||
virtual void set_custom_filter(TCursor& cursor) const;
|
||||
|
||||
public:
|
||||
void set_filter(const TStampa_sintetica_mask& msk);
|
||||
TStampa_sintetica_recordset(const TString& sql) : TISAM_recordset(sql) { }
|
||||
@ -115,6 +117,43 @@ public:
|
||||
|
||||
static const TStampa_sintetica_recordset* myself = NULL;
|
||||
|
||||
static bool percutil_func(const TRelation* rel)
|
||||
{
|
||||
const long dacat = myself->get_var("#DACAT").as_int();
|
||||
const long acat = myself->get_var("#ACAT").as_int();
|
||||
if (dacat > 0L || acat > 0L)
|
||||
{
|
||||
const long cespi_cat = rel->curr().get_long(CESPI_CODCAT);
|
||||
if (cespi_cat < dacat || (acat > 0L && cespi_cat > acat))
|
||||
return false;
|
||||
}
|
||||
const TString16 idcespite = rel->curr().get(CESPI_IDCESPITE);
|
||||
const int codes = myself->get_var("#CODES").as_int();
|
||||
const TString& codcdc = myself->get_var("#CODCDC").as_string();
|
||||
const TString& codcms = myself->get_var("#CODCMS").as_string();
|
||||
const TString& codfase = myself->get_var("#CODFASE").as_string();
|
||||
|
||||
const real percutil = ceca_percutil(idcespite, codes, codcdc, codcms, codfase);
|
||||
return percutil > ZERO;
|
||||
}
|
||||
|
||||
void TStampa_sintetica_recordset::set_custom_filter(TCursor& cursor) const
|
||||
{
|
||||
const TString& codcdc = get_var("#CODCDC").as_string();
|
||||
const TString& codcms = get_var("#CODCMS").as_string();
|
||||
const TString& codfase = get_var("#CODFASE").as_string();
|
||||
if (codcdc.full() || codcms.full() || codfase.full())
|
||||
{
|
||||
myself = this;
|
||||
cursor.set_filterfunction(percutil_func);
|
||||
}
|
||||
else
|
||||
{
|
||||
myself = NULL;
|
||||
cursor.set_filterfunction(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
//metodo per caricare i valori nel recordset dalla maschera...fighissimo!!
|
||||
void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk)
|
||||
{
|
||||
@ -133,32 +172,10 @@ void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk)
|
||||
if (dacat.full() || acat.full())
|
||||
{
|
||||
if (dacat == acat)
|
||||
query << "&&(CODCAT==" << dacat << ")";
|
||||
query << "&&(STR(CODCAT==#DACAT))";
|
||||
else
|
||||
query << "&&(BETWEEN(CODCAT," << dacat << ',' << acat << "))";
|
||||
query << "&&(STR(BETWEEN(CODCAT,#DACAT,#ACAT)))";
|
||||
}
|
||||
|
||||
//parte analitica
|
||||
const TString& codcdc = msk.get(F_CODCDC);
|
||||
const TString& codcms = msk.get(F_CODCMS);
|
||||
const TString& codfase = msk.get(F_CODFASE);
|
||||
if (codcdc.full() || codcms.full() || codfase.full())
|
||||
{
|
||||
query << "&&";
|
||||
|
||||
if (codcdc.full())
|
||||
query << "(BETWEEN(SALCECMS.CODCDC,#CODCDC,#CODCDC))&&";
|
||||
|
||||
if (codcms.full())
|
||||
query << "(BETWEEN(SALCECMS.CODCMS,#CODCMS,#CODCMS))&&";
|
||||
|
||||
if (codfase.full())
|
||||
query << "(BETWEEN(SALCECMS.CODFASE,#CODFASE,#CODFASE))&&";
|
||||
|
||||
query.rtrim(2);
|
||||
query << "\nJOIN SALCECMS INTO IDCESPITE=IDCESPITE";
|
||||
}
|
||||
|
||||
//ordinamenti
|
||||
query << "\nBY CODCAT|CODIMP|CODLOC|IDCESPITE";
|
||||
|
||||
@ -169,13 +186,20 @@ void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk)
|
||||
if (exclude_aliens)
|
||||
set_var("#DATAINIZIO", msk.get_date(F_DATAINIZIO).date2ansi());
|
||||
|
||||
//set var condizionali in analitica
|
||||
//parte analitica
|
||||
const int codes = msk.get_int(F_ESERCIZIO);
|
||||
const TString& codcdc = msk.get(F_CODCDC);
|
||||
const TString& codcms = msk.get(F_CODCMS);
|
||||
const TString& codfase = msk.get(F_CODFASE);
|
||||
set_var("#CODES", long(codes), true);
|
||||
set_var("#DACAT", dacat, true);
|
||||
set_var("#ACAT", acat, true);
|
||||
if (codcdc.full())
|
||||
set_var("#CODCDC", codcdc);
|
||||
set_var("#CODCDC", codcdc, true);
|
||||
if (codcms.full())
|
||||
set_var("#CODCMS", codcms);
|
||||
set_var("#CODCMS", codcms, true);
|
||||
if (codfase.full())
|
||||
set_var("#CODFASE", codfase);
|
||||
set_var("#CODFASE", codfase, true);
|
||||
|
||||
}
|
||||
|
||||
@ -226,7 +250,9 @@ void TStampa_sintetica_rep::set_filter(const TStampa_sintetica_mask& msk)
|
||||
_codcms = msk.get(F_CODCMS);
|
||||
_codfase = msk.get(F_CODFASE);
|
||||
|
||||
((TStampa_sintetica_recordset*) recordset())->set_filter(msk);
|
||||
TStampa_sintetica_recordset* rs = new TStampa_sintetica_recordset(EMPTY_STRING);
|
||||
set_recordset(rs);
|
||||
rs->set_filter(msk);
|
||||
}
|
||||
|
||||
real TStampa_sintetica_rep::val_amm(const TRectype& rec_saldi) const
|
||||
|
214
ce/ce3900a.rep
214
ce/ce3900a.rep
@ -2,29 +2,29 @@
|
||||
<report name="ce3900a" orientation="2" lpi="6">
|
||||
<description>Registro cespiti sintetico</description>
|
||||
<font face="Arial Narrow" size="8" />
|
||||
<section type="Head">
|
||||
<section type="Head" pattern="1">
|
||||
<font face="Arial Narrow" bold="1" size="8" />
|
||||
<field x="18.5" y="0.5" type="Testo" align="center" width="10" text="Date" />
|
||||
<field x="83" y="0.5" type="Testo" align="center" width="8" text="Valori" />
|
||||
<field x="124" y="0.5" type="Testo" width="20" text="Fondo Ammortamento" />
|
||||
<field x="157" y="0.75" type="Testo" align="right" width="12" text="Residuo da" />
|
||||
<field x="1" y="1.5" type="Testo" width="10" text="Codice" />
|
||||
<field x="11" y="1.5" type="Testo" width="10" text="Alienazione" />
|
||||
<field x="21" y="1.5" type="Testo" width="10" text="Acquisto" />
|
||||
<field x="31" y="1.5" type="Testo" width="10" text="Entr. Funz." />
|
||||
<field x="41" y="1.5" type="Testo" width="28" text="Descrizione" />
|
||||
<field x="66" y="1.5" type="Testo" align="right" width="12" text="Iniziale" />
|
||||
<field x="78" y="1.5" type="Testo" align="right" width="12" text="Variazione" />
|
||||
<field x="90" y="1.5" type="Testo" align="right" width="12" text="Finale" />
|
||||
<field x="102.5" y="1.5" type="Testo" align="right" width="6" text="%Amm" />
|
||||
<field x="109" y="1.5" type="Testo" align="right" width="12" text="Es. corr." />
|
||||
<field x="121" y="1.5" type="Testo" align="right" width="12" text="Fine es.prec" />
|
||||
<field x="133" y="1.5" type="Testo" align="right" width="12" text="Cessioni" />
|
||||
<field x="145" y="1.5" type="Testo" align="right" width="12" text="Totale" />
|
||||
<field x="157" y="1.5" type="Testo" align="right" width="12" text="ammortizzare" />
|
||||
<field border="1" x="1" y="2.5" type="Linea" width="168" height="0" />
|
||||
<field x="18.5" y="0.5" type="Testo" align="center" width="10" pattern="1" text="Date" />
|
||||
<field x="83" y="0.5" type="Testo" align="center" width="8" pattern="1" text="Valori" />
|
||||
<field x="124" y="0.5" type="Testo" width="20" pattern="1" text="Fondo Ammortamento" />
|
||||
<field x="157" y="0.75" type="Testo" align="right" width="12" pattern="1" text="Residuo da" />
|
||||
<field x="1" y="1.5" type="Testo" width="10" pattern="1" text="Codice" />
|
||||
<field x="11" y="1.5" type="Testo" width="10" pattern="1" text="Alienazione" />
|
||||
<field x="21" y="1.5" type="Testo" width="10" pattern="1" text="Acquisto" />
|
||||
<field x="31" y="1.5" type="Testo" width="10" pattern="1" text="Entr. Funz." />
|
||||
<field x="41" y="1.5" type="Testo" width="28" pattern="1" text="Descrizione" />
|
||||
<field x="66" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Iniziale" />
|
||||
<field x="78" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Variazione" />
|
||||
<field x="90" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Finale" />
|
||||
<field x="102.5" y="1.5" type="Testo" align="right" width="6" pattern="1" text="%Amm" />
|
||||
<field x="109" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Es. corr." />
|
||||
<field x="121" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Fine es.prec" />
|
||||
<field x="133" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Cessioni" />
|
||||
<field x="145" y="1.5" type="Testo" align="right" width="12" pattern="1" text="Totale" />
|
||||
<field x="157" y="1.5" type="Testo" align="right" width="12" pattern="1" text="ammortizzare" />
|
||||
<field border="1" x="1" y="2.5" type="Linea" width="168" height="0" pattern="1" />
|
||||
</section>
|
||||
<section type="Head" level="1">
|
||||
<section type="Head" level="1" pattern="1">
|
||||
<font face="Arial" size="8" />
|
||||
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.103
|
||||
MESSAGE RESET,F1.102
|
||||
@ -36,26 +36,26 @@ MESSAGE RESET,F1.107</prescript>
|
||||
<field border="1" radius="100" x="12" y="0.5" type="Testo" valign="center" align="center" shade_offset="25" width="148" height="2.5" pattern="2" text="REGISTRO CESPITI SINTETICO">
|
||||
<font face="Times New Roman" bold="1" size="16" />
|
||||
</field>
|
||||
<field border="2" x="1" y="4" type="Linea" width="168" height="0" />
|
||||
<field x="1" y="4.5" type="Stringa" width="50">
|
||||
<field border="2" x="1" y="4" type="Linea" width="168" height="0" pattern="1" />
|
||||
<field x="1" y="4.5" type="Stringa" width="50" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SYSTEM.RAGSOC</source>
|
||||
</field>
|
||||
<field x="58.5" y="4.5" type="Testo" width="14" text="Data stampa:">
|
||||
<field x="58.5" y="4.5" type="Testo" width="14" pattern="1" text="Data stampa:">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="72.5" y="4.5" type="Data" width="11">
|
||||
<field x="72.5" y="4.5" type="Data" width="11" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SYSTEM.DATE</source>
|
||||
</field>
|
||||
<field x="93" y="4.5" type="Testo" width="7" text="Anno:">
|
||||
<field x="93" y="4.5" type="Testo" width="7" pattern="1" text="Anno:">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="100" y="4.5" type="Numero" align="right" width="5">
|
||||
<field x="100" y="4.5" type="Numero" align="right" width="5" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#ANNO</source>
|
||||
</field>
|
||||
<field x="117" y="4.5" type="Array" width="25">
|
||||
<field x="117" y="4.5" type="Array" width="25" pattern="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<source>#SITUAZIONE</source>
|
||||
<list>
|
||||
@ -64,24 +64,24 @@ MESSAGE RESET,F1.107</prescript>
|
||||
<li Value="Situazione Gestionale" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="1" y="6.5" type="Testo" width="12" text="Centro di costo">
|
||||
<field x="1" y="6.5" type="Testo" width="12" pattern="1" text="Centro di costo">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="13" y="6.5" type="Stringa" width="15">
|
||||
<field x="13" y="6.5" type="Stringa" width="15" pattern="1">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
<source>#CODCDC</source>
|
||||
</field>
|
||||
<field x="35" y="6.5" type="Testo" width="10" text="Commessa">
|
||||
<field x="35" y="6.5" type="Testo" width="10" pattern="1" text="Commessa">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="45" y="6.5" type="Stringa" width="15">
|
||||
<field x="45" y="6.5" type="Stringa" width="15" pattern="1">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
<source>#CODCMS</source>
|
||||
</field>
|
||||
<field x="67.5" y="6.5" type="Testo" width="4" text="Fase">
|
||||
<field x="67.5" y="6.5" type="Testo" width="4" pattern="1" text="Fase">
|
||||
<font italic="1" face="Arial" size="8" />
|
||||
</field>
|
||||
<field x="72.5" y="6.5" type="Stringa" width="15">
|
||||
<field x="72.5" y="6.5" type="Stringa" width="15" pattern="1">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
<source>#CODFASE</source>
|
||||
</field>
|
||||
@ -96,12 +96,12 @@ MESSAGE RESET,F2.104
|
||||
MESSAGE RESET,F2.105
|
||||
MESSAGE RESET,F2.106
|
||||
MESSAGE RESET,F2.107</prescript>
|
||||
<field x="1" y="0.25" type="Testo" txt_color="#FFFFFF" width="12" text="Categoria:" />
|
||||
<field x="18" y="0.25" type="Stringa" txt_color="#FFFFFF" width="70" id="98">
|
||||
<field x="1" y="0.25" type="Testo" txt_color="#FFFFFF" width="12" pattern="1" text="Categoria:" />
|
||||
<field x="18" y="0.25" type="Stringa" txt_color="#FFFFFF" width="70" id="98" pattern="1">
|
||||
<source>#DESCAT</source>
|
||||
<postscript description="H2.98 POSTSCRIPT">MESSAGE COPY,F2.98</postscript>
|
||||
</field>
|
||||
<field x="14" y="0.25" type="Numero" align="right" txt_color="#FFFFFF" width="2" id="101">
|
||||
<field x="14" y="0.25" type="Numero" align="right" txt_color="#FFFFFF" width="2" id="101" pattern="1">
|
||||
<source>CODCAT</source>
|
||||
<postscript description="H2.101 POSTSCRIPT">MESSAGE COPY,F2.97</postscript>
|
||||
</field>
|
||||
@ -125,15 +125,15 @@ MESSAGE RESET,F3.104
|
||||
MESSAGE RESET,F3.105
|
||||
MESSAGE RESET,F3.106
|
||||
MESSAGE RESET,F3.107</postscript>
|
||||
<field x="4" type="Testo" width="12" text="Impianto:">
|
||||
<field x="4" type="Testo" width="12" pattern="1" text="Impianto:">
|
||||
<font face="Arial" bold="1" size="9" />
|
||||
</field>
|
||||
<field x="16.5" type="Stringa" align="right" width="12" id="97">
|
||||
<field x="16.5" type="Stringa" align="right" width="12" id="97" pattern="1">
|
||||
<font face="Arial" bold="1" size="9" />
|
||||
<source>CODIMP</source>
|
||||
<postscript description="H3.97 POSTSCRIPT">MESSAGE COPY,F3.97</postscript>
|
||||
</field>
|
||||
<field x="30.5" type="Stringa" width="70" id="98">
|
||||
<field x="30.5" type="Stringa" width="70" id="98" pattern="1">
|
||||
<font face="Arial" bold="1" size="9" />
|
||||
<prescript description="H3.98 PRESCRIPT">MESSAGE TABLEREAD,CIM,CODIMP,S0</prescript>
|
||||
<postscript description="H3.98 POSTSCRIPT">MESSAGE COPY,F3.98</postscript>
|
||||
@ -158,172 +158,172 @@ MESSAGE RESET,F4.104
|
||||
MESSAGE RESET,F4.105
|
||||
MESSAGE RESET,F4.106
|
||||
MESSAGE RESET,F4.107</postscript>
|
||||
<field x="7" type="Testo" width="8" text="Localita':" />
|
||||
<field x="15" type="Stringa" align="right" width="12" id="97">
|
||||
<field x="7" type="Testo" width="8" pattern="1" text="Localita':" />
|
||||
<field x="15" type="Stringa" align="right" width="12" id="97" pattern="1">
|
||||
<source>CODLOC</source>
|
||||
<postscript description="H4.97 POSTSCRIPT">MESSAGE COPY,F4.97</postscript>
|
||||
</field>
|
||||
<field x="29" type="Stringa" width="70" id="98">
|
||||
<field x="29" type="Stringa" width="70" id="98" pattern="1">
|
||||
<prescript description="H4.98 PRESCRIPT">MESSAGE TABLEREAD,LOC,CODLOC,S0</prescript>
|
||||
<postscript description="H4.98 POSTSCRIPT">MESSAGE COPY,F4.98</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Body" />
|
||||
<section type="Body" level="1">
|
||||
<field x="1" type="Stringa" width="10">
|
||||
<section type="Body" pattern="1" />
|
||||
<section type="Body" level="1" pattern="1">
|
||||
<field x="1" type="Stringa" width="10" pattern="1">
|
||||
<source>IDCESPITE</source>
|
||||
</field>
|
||||
<field x="11" type="Data" width="10">
|
||||
<field x="11" type="Data" width="10" pattern="1">
|
||||
<source>DTALIEN</source>
|
||||
</field>
|
||||
<field x="21" type="Data" width="10">
|
||||
<field x="21" type="Data" width="10" pattern="1">
|
||||
<source>DTCOMP</source>
|
||||
</field>
|
||||
<field x="31" type="Data" width="10">
|
||||
<field x="31" type="Data" width="10" pattern="1">
|
||||
<source>DTFUNZ</source>
|
||||
</field>
|
||||
<field x="41" type="Stringa" dynamic_height="1" width="25" height="2">
|
||||
<field x="41" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
|
||||
<source>DESC</source>
|
||||
</field>
|
||||
<field x="102.5" type="Numero" align="right" width="6" text="##@,@@">
|
||||
<field x="102.5" type="Numero" align="right" width="6" pattern="1" text="##@,@@">
|
||||
<source>#PERCAMM</source>
|
||||
</field>
|
||||
<field x="66" type="Valuta" align="right" width="12" id="101" text="#########,@@">
|
||||
<field x="66" type="Valuta" align="right" width="12" id="101" pattern="1" text="#########,@@">
|
||||
<source>#COSTOINI</source>
|
||||
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F2.101
|
||||
MESSAGE ADD,F3.101
|
||||
MESSAGE ADD,F4.101</postscript>
|
||||
</field>
|
||||
<field x="90" type="Valuta" align="right" width="12" id="102" text="#########,@@">
|
||||
<field x="90" type="Valuta" align="right" width="12" id="102" pattern="1" text="#########,@@">
|
||||
<source>#COSTOFIN</source>
|
||||
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F2.102
|
||||
MESSAGE ADD,F3.102
|
||||
MESSAGE ADD,F4.102</postscript>
|
||||
</field>
|
||||
<field x="78" type="Valuta" align="right" width="12" id="103" text="#########,@@">
|
||||
<field x="78" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@">
|
||||
<source>#102-#101</source>
|
||||
<postscript description="B1.103 POSTSCRIPT">MESSAGE ADD,F2.103
|
||||
MESSAGE ADD,F3.103
|
||||
MESSAGE ADD,F4.103</postscript>
|
||||
</field>
|
||||
<field x="109" type="Valuta" align="right" width="12" id="104" text="#########,@@">
|
||||
<field x="109" type="Valuta" align="right" width="12" id="104" pattern="1" text="#########,@@">
|
||||
<source>#QAMM+#QAMMMV</source>
|
||||
<postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F2.104
|
||||
MESSAGE ADD,F3.104
|
||||
MESSAGE ADD,F4.104</postscript>
|
||||
</field>
|
||||
<field x="121" type="Valuta" align="right" width="12" id="105" text="#########,@@">
|
||||
<field x="121" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@">
|
||||
<source>#FAMM</source>
|
||||
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F2.105
|
||||
MESSAGE ADD,F3.105
|
||||
MESSAGE ADD,F4.105</postscript>
|
||||
</field>
|
||||
<field x="133" type="Valuta" align="right" width="12" id="106" text="#########,@@">
|
||||
<field x="133" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@">
|
||||
<source>#CESSELIM+#QAMMMV</source>
|
||||
<postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F2.106
|
||||
MESSAGE ADD,F3.106
|
||||
MESSAGE ADD,F4.106</postscript>
|
||||
</field>
|
||||
<field x="145" type="Valuta" align="right" width="12" id="107" text="#########,@@">
|
||||
<field x="145" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@">
|
||||
<source>#104+#105-#106</source>
|
||||
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F2.107
|
||||
MESSAGE ADD,F3.107
|
||||
MESSAGE ADD,F4.107</postscript>
|
||||
</field>
|
||||
<field x="157" type="Valuta" align="right" width="12" id="108" text="#########,@@">
|
||||
<field x="157" type="Valuta" align="right" width="12" id="108" pattern="1" text="#########,@@">
|
||||
<source>#RESAMM-#QAMM</source>
|
||||
<postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F2.108
|
||||
MESSAGE ADD,F3.108
|
||||
MESSAGE ADD,F4.108</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot">
|
||||
<field border="1" type="Linea" width="182" height="0" />
|
||||
<field x="170" y="0.25" type="Testo" width="5" text="Pag.">
|
||||
<section type="Foot" pattern="1">
|
||||
<field border="1" x="1" type="Linea" width="168" height="0" pattern="1" />
|
||||
<field x="140" y="0.25" type="Testo" width="5" pattern="1" text="Pag.">
|
||||
<font italic="1" face="Courier New" size="9" />
|
||||
</field>
|
||||
<field x="176" y="0.25" type="Numero" align="right" width="3">
|
||||
<field x="146" y="0.25" type="Numero" align="right" width="3" pattern="1">
|
||||
<font italic="1" face="Courier New" bold="1" size="9" />
|
||||
<source>#REPORT.PAGE</source>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" level="1" bg_color="#000000" height="1.5" pattern="2">
|
||||
<font italic="1" face="Arial" bold="1" size="9" />
|
||||
<field border="2" x="1" y="0.25" type="Linea" fg_color="#FFFFFF" width="168" height="0" />
|
||||
<field x="1" y="0.5" type="Testo" txt_color="#FFFFFF" width="25" text="Totali generali" />
|
||||
<field x="66" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="101" text="#########,@@" />
|
||||
<field x="90" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="102" text="#########,@@" />
|
||||
<field x="78" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="103" text="#########,@@" />
|
||||
<field x="109" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="104" text="#########,@@" />
|
||||
<field x="121" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="105" text="#########,@@" />
|
||||
<field x="133" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="106" text="#########,@@" />
|
||||
<field x="145" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="107" text="#########,@@" />
|
||||
<field x="157" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="108" text="#########,@@" />
|
||||
<field border="2" x="1" y="0.25" type="Linea" fg_color="#FFFFFF" width="168" height="0" pattern="1" />
|
||||
<field x="1" y="0.5" type="Testo" txt_color="#FFFFFF" width="25" pattern="1" text="Totali generali" />
|
||||
<field x="66" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="101" pattern="1" text="#########,@@" />
|
||||
<field x="90" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="102" pattern="1" text="#########,@@" />
|
||||
<field x="78" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="103" pattern="1" text="#########,@@" />
|
||||
<field x="109" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="104" pattern="1" text="#########,@@" />
|
||||
<field x="121" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="105" pattern="1" text="#########,@@" />
|
||||
<field x="133" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="106" pattern="1" text="#########,@@" />
|
||||
<field x="145" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="107" pattern="1" text="#########,@@" />
|
||||
<field x="157" y="0.5" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="108" pattern="1" text="#########,@@" />
|
||||
</section>
|
||||
<section type="Foot" level="2" bg_color="#000000" height="1.5" pattern="10" sh_angle="90">
|
||||
<font face="Arial" bold="1" size="9" />
|
||||
<field x="1" y="0.25" type="Testo" txt_color="#FFFFFF" width="15" text="Totale Categoria" />
|
||||
<field x="17" y="0.25" type="Stringa" txt_color="#FFFFFF" width="2" id="97" />
|
||||
<field x="20" y="0.25" type="Stringa" txt_color="#FFFFFF" width="30" id="98">
|
||||
<field x="1" y="0.25" type="Testo" txt_color="#FFFFFF" width="15" pattern="1" text="Totale Categoria" />
|
||||
<field x="17" y="0.25" type="Stringa" txt_color="#FFFFFF" width="2" id="97" pattern="1" />
|
||||
<field x="20" y="0.25" type="Stringa" txt_color="#FFFFFF" width="30" id="98" pattern="1">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="9" />
|
||||
</field>
|
||||
<field x="66" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="101" text="#########,@@">
|
||||
<field x="66" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="101" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
|
||||
</field>
|
||||
<field x="90" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="102" text="#########,@@">
|
||||
<field x="90" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="102" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
|
||||
</field>
|
||||
<field x="78" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="103" text="#########,@@">
|
||||
<field x="78" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="103" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.103 POSTSCRIPT">MESSAGE ADD,F1.103</postscript>
|
||||
</field>
|
||||
<field x="109" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="104" text="#########,@@">
|
||||
<field x="109" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="104" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.104 POSTSCRIPT">MESSAGE ADD,F1.104</postscript>
|
||||
</field>
|
||||
<field x="121" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="105" text="#########,@@">
|
||||
<field x="121" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="105" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.105 POSTSCRIPT">MESSAGE ADD,F1.105</postscript>
|
||||
</field>
|
||||
<field x="133" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="106" text="#########,@@">
|
||||
<field x="133" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="106" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.106 POSTSCRIPT">MESSAGE ADD,F1.106</postscript>
|
||||
</field>
|
||||
<field x="145" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="107" text="#########,@@">
|
||||
<field x="145" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="107" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.107 POSTSCRIPT">MESSAGE ADD,F1.107</postscript>
|
||||
</field>
|
||||
<field x="157" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="108" text="#########,@@">
|
||||
<field x="157" y="0.25" type="Valuta" align="right" txt_color="#FFFFFF" width="12" id="108" pattern="1" text="#########,@@">
|
||||
<postscript description="F2.108 POSTSCRIPT">MESSAGE ADD,F1.108</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" level="3" hidden="1" bg_color="#808080" sh_color="#C0C0C0" height="1.5" pattern="10" sh_angle="90">
|
||||
<font italic="1" face="Arial" bold="1" size="9" />
|
||||
<field x="4" y="0.25" type="Testo" width="15" text="Totale impianto" />
|
||||
<field border="2" x="1" y="1.25" type="Linea" width="168" height="0" />
|
||||
<field x="20" y="0.25" type="Stringa" width="12" id="97" />
|
||||
<field x="32.5" y="0.25" type="Stringa" width="30" id="98">
|
||||
<field x="4" y="0.25" type="Testo" width="15" pattern="1" text="Totale impianto" />
|
||||
<field border="2" x="1" y="1.25" type="Linea" width="168" height="0" pattern="1" />
|
||||
<field x="20" y="0.25" type="Stringa" width="12" id="97" pattern="1" />
|
||||
<field x="32.5" y="0.25" type="Stringa" width="30" id="98" pattern="1">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="9" />
|
||||
</field>
|
||||
<field x="66" y="0.25" type="Valuta" align="right" width="12" id="101" text="#########,@@" />
|
||||
<field x="90" y="0.25" type="Valuta" align="right" width="12" id="102" text="#########,@@" />
|
||||
<field x="78" y="0.25" type="Valuta" align="right" width="12" id="103" text="#########,@@" />
|
||||
<field x="109" y="0.25" type="Valuta" align="right" width="12" id="104" text="#########,@@" />
|
||||
<field x="121" y="0.25" type="Valuta" align="right" width="12" id="105" text="#########,@@" />
|
||||
<field x="133" y="0.25" type="Valuta" align="right" width="12" id="106" text="#########,@@" />
|
||||
<field x="145" y="0.25" type="Valuta" align="right" width="12" id="107" text="#########,@@" />
|
||||
<field x="157" y="0.25" type="Valuta" align="right" width="12" id="108" text="#########,@@" />
|
||||
<field x="66" y="0.25" type="Valuta" align="right" width="12" id="101" pattern="1" text="#########,@@" />
|
||||
<field x="90" y="0.25" type="Valuta" align="right" width="12" id="102" pattern="1" text="#########,@@" />
|
||||
<field x="78" y="0.25" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@" />
|
||||
<field x="109" y="0.25" type="Valuta" align="right" width="12" id="104" pattern="1" text="#########,@@" />
|
||||
<field x="121" y="0.25" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@" />
|
||||
<field x="133" y="0.25" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@" />
|
||||
<field x="145" y="0.25" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@" />
|
||||
<field x="157" y="0.25" type="Valuta" align="right" width="12" id="108" pattern="1" text="#########,@@" />
|
||||
</section>
|
||||
<section type="Foot" level="4" hidden="1" bg_color="#C0C0C0" sh_color="#FFFFFF" pattern="10" sh_angle="90">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<field x="7" type="Testo" width="15" text="Totale localit&#E0;" />
|
||||
<field x="23.5" type="Stringa" width="12" id="97" />
|
||||
<field x="36.5" type="Stringa" width="20" id="98">
|
||||
<field x="7" type="Testo" width="15" pattern="1" text="Totale localit&#E0;" />
|
||||
<field x="23.5" type="Stringa" width="12" id="97" pattern="1" />
|
||||
<field x="36.5" type="Stringa" width="20" id="98" pattern="1">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
</field>
|
||||
<field x="66" type="Valuta" align="right" width="12" id="101" text="#########,@@" />
|
||||
<field x="90" type="Valuta" align="right" width="12" id="102" text="#########,@@" />
|
||||
<field x="78" type="Valuta" align="right" width="12" id="103" text="#########,@@" />
|
||||
<field x="109" type="Valuta" align="right" width="12" id="104" text="#########,@@" />
|
||||
<field x="121" type="Valuta" align="right" width="12" id="105" text="#########,@@" />
|
||||
<field x="133" type="Valuta" align="right" width="12" id="106" text="#########,@@" />
|
||||
<field x="145" type="Valuta" align="right" width="12" id="107" text="#########,@@" />
|
||||
<field x="157" type="Valuta" align="right" width="12" id="108" text="#########,@@" />
|
||||
<field x="66" type="Valuta" align="right" width="12" id="101" pattern="1" text="#########,@@" />
|
||||
<field x="90" type="Valuta" align="right" width="12" id="102" pattern="1" text="#########,@@" />
|
||||
<field x="78" type="Valuta" align="right" width="12" id="103" pattern="1" text="#########,@@" />
|
||||
<field x="109" type="Valuta" align="right" width="12" id="104" pattern="1" text="#########,@@" />
|
||||
<field x="121" type="Valuta" align="right" width="12" id="105" pattern="1" text="#########,@@" />
|
||||
<field x="133" type="Valuta" align="right" width="12" id="106" pattern="1" text="#########,@@" />
|
||||
<field x="145" type="Valuta" align="right" width="12" id="107" pattern="1" text="#########,@@" />
|
||||
<field x="157" type="Valuta" align="right" width="12" id="108" pattern="1" text="#########,@@" />
|
||||
</section>
|
||||
<sql>USE CESPI KEY 2</sql>
|
||||
</report>
|
25
ce/celib.cpp
25
ce/celib.cpp
@ -441,6 +441,13 @@ bool null_fields(const TRectype& rec, const char* fld0, const char* fld1, const
|
||||
real ceca_percutil(const TString& idcespite, int anno,
|
||||
const TString& cdc, const TString& cms, const TString& fase)
|
||||
{
|
||||
TLocalisamfile salcecms(LF_SALCECMS);
|
||||
salcecms.put(SALCECMS_IDCESPITE, idcespite);
|
||||
salcecms.put(SALCECMS_CODES, anno);
|
||||
salcecms.put(SALCECMS_NRIGA, 1);
|
||||
if (salcecms.read() != NOERR)
|
||||
return ZERO;
|
||||
|
||||
TString query;
|
||||
query << "USE SALCECMS";
|
||||
//se c'è almeno un filtro su cdc/cms/fase scatta la select analitica!
|
||||
@ -456,7 +463,7 @@ real ceca_percutil(const TString& idcespite, int anno,
|
||||
query.rtrim(2);
|
||||
}
|
||||
else //se non si è scelto alcun parametro analitico -> la percentuale è 100% comunque!
|
||||
return 1;
|
||||
return UNO;
|
||||
|
||||
query << "\nFROM IDCESPITE=#IDCESPITE CODES=#CODES";
|
||||
query << "\nTO IDCESPITE=#IDCESPITE CODES=#CODES";
|
||||
@ -473,15 +480,17 @@ real ceca_percutil(const TString& idcespite, int anno,
|
||||
if (fase.full())
|
||||
recset.set_var("#CODFASE", fase);
|
||||
|
||||
const long items = recset.items();
|
||||
|
||||
real percutil = ZERO;
|
||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||
const long items = recset.items();
|
||||
if (items > 0)
|
||||
{
|
||||
real perc = recset.get(SALCECMS_PERCUTIL).as_real();
|
||||
percutil += perc;
|
||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||
{
|
||||
real perc = recset.get(SALCECMS_PERCUTIL).as_real();
|
||||
percutil += perc;
|
||||
}
|
||||
percutil /= CENTO;
|
||||
}
|
||||
|
||||
percutil /= CENTO;
|
||||
|
||||
return percutil;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user