Patch level : 10.0

Files correlati     : ca1.exe ca1100a.rep
Ricompilazione Demo : [ ]
Commento            :
Aggiunto livello di stampa legato alla cofigurazione dei centri di costo


git-svn-id: svn://10.65.10.50/branches/R_10_00@22569 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-02-06 15:40:25 +00:00
parent 8654b733ea
commit 76ef9b8e9f
2 changed files with 260 additions and 30 deletions

View File

@ -3,14 +3,66 @@
#include <reprint.h>
#include "ca1.h"
#include "calib01.h"
#include "calib02.h"
///////////////////////////////////////////////////////////
// TEthero_rep
///////////////////////////////////////////////////////////
class TEthero_rep : public TAnal_report
{
protected:
virtual bool use_mask() { return true; }
virtual bool get_usr_val(const TString& name, TVariant& var) const;
};
bool TEthero_rep::get_usr_val(const TString& name, TVariant& var) const
{
// Ricava informazioni sulla struttura dei livelli di analitica
// es. CA_LEVEL_CDC_LEN_1 ricava la lunghezza del primo livello dei centri di costo
if (name.starts_with("#CA_INFO_"))
{
TToken_string tok(name, '_');
TString8 filename; tok.get(2, filename);
const int logicnum = table2logic(filename);
TString16 info; tok.get(3, info);
int level = 1; tok.get(4, level);
if (level > 0) level--;
const TMultilevel_code_info& code = ca_multilevel_code_info(logicnum);
if (info.starts_with("TOTAL"))
{
var.set(code.total_len(level));
return true;
} else
if (info.starts_with("LEN"))
{
var.set(code.len(level));
return true;
}
} else
if (name.starts_with("CODCCOSTO_1")) // shortcut for CODCCOSTO[1,#CA_LEVEL_CDC_LEN_1]
{
if (get_record_field("CODCCOSTO", var))
{
const TMultilevel_code_info& code = ca_multilevel_code_info(LF_CDC);
const TString& cdc = var.as_string().left(code.len(0));
var.set(cdc);
return true;
}
}
return TAnal_report::get_usr_val(name, var);
}
///////////////////////////////////////////////////////////
// TPrint_ca
///////////////////////////////////////////////////////////
class TPrint_ca : public TSkeleton_application
{
protected:
@ -24,7 +76,7 @@ void TPrint_ca::print_rep(const TFilename& n) const
{
TEthero_rep rep;
if (rep.load(n))
rep.print_or_preview();
while(rep.print_or_preview());
}
void TPrint_ca::main_loop()

View File

@ -5,12 +5,11 @@
<section type="Head" level="1" pattern="1">
<font face="Arial" bold="1" size="16" />
<field border="3" type="Stringa" valign="center" align="center" width="162" height="3" pattern="1">
<font face="Arial" bold="1" size="16" />
<source>"BILANCIO " + YEAR(#DATAFIN) + " - SITUAZIONE AL " + #DATASTA</source>
</field>
</section>
<section repeat="1" type="Head" level="2" page_break="1" pattern="1">
<groupby>CODCCOSTO</groupby>
<groupby>CODCCOSTO_1</groupby>
<font face="Arial" bold="1" size="8" />
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2</prescript>
<field border="3" x="63" type="Linea" height="4" pattern="1" />
@ -34,16 +33,35 @@
<field x="158" y="2.25" type="Testo" align="center" width="3" pattern="1" text="%" />
<field border="3" y="3.5" type="Linea" width="162" height="0" pattern="1" />
<field type="Stringa" valign="center" width="20" height="2" id="101" pattern="1">
<font face="Courier New" bold="1" size="10" />
<source>CODCCOSTO</source>
<font face="Arial" bold="1" size="10" />
<source>CODCCOSTO_1</source>
</field>
<field x="20" type="Stringa" valign="center" width="43" height="2" id="102" pattern="1">
<field x="21" type="Stringa" valign="center" width="42" height="2" id="102" pattern="1">
<prescript description="H2.102 PRESCRIPT">MESSAGE ISAMREAD,CDC,CODCOSTO=CODCCOSTO,DESCRIZ</prescript>
</field>
</section>
<section type="Head" level="3" pattern="1">
<groupby>CODCONTO</groupby>
<groupby>CODCCOSTO</groupby>
<prescript description="H3 PRESCRIPT">MESSAGE RESET,F3</prescript>
<field border="2" x="20.5" type="Linea" height="2" pattern="1" />
<field border="3" x="63" type="Linea" height="2" pattern="1" />
<field border="2" x="78" type="Linea" height="2" pattern="1" />
<field border="2" x="94" type="Linea" height="2" pattern="1" />
<field border="3" x="112" type="Linea" height="2" pattern="1" />
<field border="2" x="128" type="Linea" height="2" pattern="1" />
<field border="2" x="144" type="Linea" height="2" pattern="1" />
<field type="Stringa" valign="center" width="20" height="2" id="101" pattern="1">
<font face="Arial" bold="1" size="10" />
<source>CODCCOSTO</source>
</field>
<field x="21" type="Stringa" valign="center" width="42" height="2" id="102" pattern="1">
<font face="Arial" bold="1" size="8" />
<prescript description="H3.102 PRESCRIPT">MESSAGE ISAMREAD,CDC,CODCOSTO=CODCCOSTO,DESCRIZ</prescript>
</field>
</section>
<section type="Head" level="4" pattern="1">
<groupby>CODCONTO</groupby>
<prescript description="H4 PRESCRIPT">MESSAGE RESET,F4</prescript>
<field type="Stringa" hidden="1" width="20" id="101" pattern="1">
<source>CODCONTO</source>
</field>
@ -62,8 +80,8 @@ ELSE
#THIS ! \ al campo corrente
THEN
#THIS @ \ Prende il valore attuale con segno
"F3." #THIS GET_ID + \ Costruisce la stringa F3.101
+! \ Somma il campo corrente al corrispondente in F3
"F4." #THIS GET_ID + \ Costruisce la stringa F4.101
+! \ Somma il campo corrente al corrispondente in F4
THEN
</postscript>
</field>
@ -82,8 +100,8 @@ ELSE
#THIS ! \ al campo corrente
THEN
#THIS @ \ Prende il valore attuale con segno
"F3." #THIS GET_ID + \ Costruisce la stringa F3.101
+! \ Somma il campo corrente al corrispondente in F3
"F4." #THIS GET_ID + \ Costruisce la stringa F4.101
+! \ Somma il campo corrente al corrispondente in F4
THEN
</postscript>
</field>
@ -102,8 +120,8 @@ ELSE
#THIS ! \ al campo corrente
THEN
#THIS @ \ Prende il valore attuale con segno
"F3." #THIS GET_ID + \ Costruisce la stringa F3.101
+! \ Somma il campo corrente al corrispondente in F3
"F4." #THIS GET_ID + \ Costruisce la stringa F4.101
+! \ Somma il campo corrente al corrispondente in F4
THEN
</postscript>
</field>
@ -122,8 +140,8 @@ ELSE
#THIS ! \ al campo corrente
THEN
#THIS @ \ Prende il valore attuale con segno
"F3." #THIS GET_ID + \ Costruisce la stringa F3.101
+! \ Somma il campo corrente al corrispondente in F3
"F4." #THIS GET_ID + \ Costruisce la stringa F4.101
+! \ Somma il campo corrente al corrispondente in F4
THEN
</postscript>
</field>
@ -268,7 +286,7 @@ THEN
<field border="2" x="144" type="Linea" height="2" pattern="1" />
<field border="2" x="144" type="Linea" height="2" pattern="1" />
<field border="3" y="0.25" type="Linea" width="162" height="0" pattern="1" />
<field y="0.5" type="Stringa" width="20" id="101" pattern="1">
<field type="Stringa" valign="center" width="20" height="2" id="101" pattern="1">
<source>#H2.101</source>
</field>
<field x="21" type="Stringa" valign="center" width="42" height="2" id="102" pattern="1">
@ -416,6 +434,7 @@ THEN
</field>
</section>
<section type="Foot" level="3" pattern="1">
<font face="Arial" bold="1" size="8" />
<field border="2" x="20.5" type="Linea" pattern="1" />
<field border="3" x="63" type="Linea" pattern="1" />
<field border="2" x="78" type="Linea" pattern="1" />
@ -428,11 +447,10 @@ THEN
<source>#H3.101</source>
</field>
<field x="21" type="Stringa" width="42" id="102" pattern="1">
<source>#H3.101</source>
<prescript description="F3.102 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
<source>#H3.102</source>
</field>
<field x="63" type="Valuta" align="right" width="12" id="201" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F3.201 PRESCRIPT">#THIS @ 0 &#3C; IF
<prescript>#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
@ -448,7 +466,7 @@ ELSE
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F3.201 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
<postscript>#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
@ -458,7 +476,7 @@ THEN
</field>
<field x="76" type="Stringa" width="1.5" id="202" pattern="1" />
<field x="79" type="Valuta" align="right" width="12" id="203" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F3.203 PRESCRIPT">#THIS @ 0 &#3C; IF
<prescript>#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
@ -474,7 +492,7 @@ ELSE
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F3.203 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
<postscript>#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
@ -485,12 +503,12 @@ THEN
</field>
<field x="92" type="Stringa" width="1.5" id="204" pattern="1" />
<field x="95" type="Valuta" align="right" width="12" id="205" pattern="1" text="###.###.###,@@">
<prescript description="F3.205 PRESCRIPT">201 @
<prescript>201 @
203 @
- .</prescript>
</field>
<field x="108" type="Numero" align="right" width="3" id="206" pattern="1">
<prescript description="F3.206 PRESCRIPT">201 @
<prescript>201 @
0 = IF
0
ELSE
@ -503,7 +521,7 @@ THEN
</prescript>
</field>
<field x="113" type="Valuta" align="right" width="12" id="301" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F3.301 PRESCRIPT">#THIS @ 0 &#3C; IF
<prescript>#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
@ -519,7 +537,7 @@ ELSE
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F3.301 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
<postscript>#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
@ -530,7 +548,7 @@ THEN
</field>
<field x="126" type="Stringa" width="1.5" id="302" pattern="1" />
<field x="129" type="Valuta" align="right" width="12" id="303" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F3.303 PRESCRIPT">#THIS @ 0 &#3C; IF
<prescript>#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
@ -546,7 +564,7 @@ ELSE
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F3.303 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
<postscript>#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
@ -557,12 +575,172 @@ THEN
</field>
<field x="142" type="Stringa" width="1.5" id="304" pattern="1" />
<field x="145" type="Valuta" align="right" width="12" id="305" pattern="1" text="###.###.###,@@">
<prescript description="F3.305 PRESCRIPT">301 @
<prescript>301 @
303 @
- .</prescript>
</field>
<field x="158" type="Numero" align="right" width="3" id="306" pattern="1">
<prescript description="F3.306 PRESCRIPT">301 @
<prescript>301 @
0 = IF
0
ELSE
305 @
301 @
&#2F; 100 *
0 ROUND
THEN
.
</prescript>
</field>
</section>
<section type="Foot" level="4" pattern="1">
<field border="2" x="20.5" type="Linea" pattern="1" />
<field border="3" x="63" type="Linea" pattern="1" />
<field border="2" x="78" type="Linea" pattern="1" />
<field border="2" x="94" type="Linea" pattern="1" />
<field border="3" x="112" type="Linea" pattern="1" />
<field border="2" x="128" type="Linea" pattern="1" />
<field border="2" x="144" type="Linea" pattern="1" />
<field border="2" x="144" type="Linea" pattern="1" />
<field type="Stringa" width="20" id="101" pattern="1">
<source>#H4.101</source>
</field>
<field x="21" type="Stringa" width="42" id="102" pattern="1">
<source>#H4.101</source>
<prescript description="F4.102 PRESCRIPT">CA_FORMAT_CONTO_DESCR</prescript>
</field>
<field x="63" type="Valuta" align="right" width="12" id="201" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F4.201 PRESCRIPT">#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
#THIS GET_ID_NEXT
"A"
ELSE
#THIS @
0 = IF
""
ELSE
"D"
THEN
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F4.201 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
THEN
"F3." #THIS GET_ID + \ Costruisce la stringa F3.201
+! \ Somma il valore corrente al corrispondente in F3</postscript>
</field>
<field x="76" type="Stringa" width="1.5" id="202" pattern="1" />
<field x="79" type="Valuta" align="right" width="12" id="203" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F4.203 PRESCRIPT">#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
#THIS GET_ID_NEXT
"A"
ELSE
#THIS @
0 = IF
""
ELSE
"D"
THEN
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F4.203 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
THEN
"F3." #THIS GET_ID + \ Costruisce la stringa F3.203
+! \ Somma il valore corrente al corrispondente in F3
</postscript>
</field>
<field x="92" type="Stringa" width="1.5" id="204" pattern="1" />
<field x="95" type="Valuta" align="right" width="12" id="205" pattern="1" text="###.###.###,@@">
<prescript>201 @
203 @
- .</prescript>
</field>
<field x="108" type="Numero" align="right" width="3" id="206" pattern="1">
<prescript>201 @
0 = IF
0
ELSE
205 @
201 @
&#2F; 100 *
0 ROUND
THEN
.
</prescript>
</field>
<field x="113" type="Valuta" align="right" width="12" id="301" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F4.301 PRESCRIPT">#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
#THIS GET_ID_NEXT
"A"
ELSE
#THIS @
0 = IF
""
ELSE
"D"
THEN
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F4.301 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
THEN
"F3." #THIS GET_ID + \ Costruisce la stringa F3.301
+! \ Somma il valore corrente al corrispondente in F3
</postscript>
</field>
<field x="126" type="Stringa" width="1.5" id="302" pattern="1" />
<field x="129" type="Valuta" align="right" width="12" id="303" pattern="1" hide_zero="1" text="###.###.###,@@">
<prescript description="F4.303 PRESCRIPT">#THIS @ 0 &#3C; IF
#THIS @
-1 *
#THIS !
#THIS GET_ID_NEXT
"A"
ELSE
#THIS @
0 = IF
""
ELSE
"D"
THEN
THEN
#THIS GET_ID_NEXT !
</prescript>
<postscript description="F4.303 POSTSCRIPT">#THIS @ \ Legge il valore del campo corrente
#THIS GET_ID_NEXT @ \ Legge la sezione dal campo successivo
"A" = IF \ Se vale Avere
-1 * \ Cambia segno
THEN
"F3." #THIS GET_ID + \ Costruisce la stringa F3.303
+! \ Somma il valore corrente al corrispondente in F3
</postscript>
</field>
<field x="142" type="Stringa" width="1.5" id="304" pattern="1" />
<field x="145" type="Valuta" align="right" width="12" id="305" pattern="1" text="###.###.###,@@">
<prescript>301 @
303 @
- .</prescript>
</field>
<field x="158" type="Numero" align="right" width="3" id="306" pattern="1">
<prescript>301 @
0 = IF
0
ELSE