<?xml version="1.0" encoding="UTF-8" ?>
<report name="ca3300a" orientation="2" lpi="8" command="ca3 -2" class="ca3300a">
 <description>Bilancio normale di verifica (raffronto)</description>
 <font face="Courier New" size="8" />
 <section type="Head">
  <font face="Arial" bold="1" size="8" />
  <field border="1" x="1" y="0.25" type="Linea" width="168" height="0" pattern="1" />
  <field x="84.5" y="0.5" type="Testo" align="center" width="25" pattern="1" text="SALDO INIZIALE" />
  <field x="112" y="0.5" type="Testo" align="center" width="27" pattern="1" text="MOVIMENTI DEL PERIODO" />
  <field x="142" y="0.5" type="Testo" align="center" width="25" pattern="1" text="SALDO FINALE" />
  <field x="1" y="1.25" type="Testo" width="10" pattern="1" text="Conto" />
  <field x="31" y="1.25" type="Testo" width="15" pattern="1" text="Descrizione" />
  <field x="78" y="1.75" type="Testo" align="right" width="13" pattern="1" text="Dare" />
  <field x="92" y="1.75" type="Testo" align="right" width="13" pattern="1" text="Avere" />
  <field x="107" y="1.75" type="Testo" align="right" width="13" pattern="1" text="Dare" />
  <field x="121" y="1.75" type="Testo" align="right" width="13" pattern="1" text="Avere" />
  <field x="136" y="1.75" type="Testo" align="right" width="13" pattern="1" text="Dare" />
  <field x="150" y="1.75" type="Testo" align="right" width="13" pattern="1" text="Avere" />
  <field border="1" x="1" y="2.75" type="Linea" width="168" height="0" pattern="1" />
 </section>
 <section type="Head" level="1">
  <font face="Arial" bold="1" size="9" />
  <prescript description="H1 PRESCRIPT">"F1" AZZERA_TOTALI</prescript>
  <field border="1" radius="100" x="40.34" y="0.66" type="Rettangolo" shade_offset="25" width="80" height="3.5" />
  <field x="53.5" y="1.5" type="Testo" valign="center" width="35" height="2" pattern="1" text="BILANCIO DI VERIFICA">
   <font face="Arial" bold="1" size="14" />
  </field>
  <field x="88.5" y="1.5" type="Testo" valign="center" width="20" height="2" pattern="1" text="RAFFRONTO">
   <font face="Arial" bold="1" size="14" />
   <source>#TIPOSTAMPA</source>
  </field>
  <field x="1" y="4.75" type="Stringa" width="50" height="1.25" pattern="1">
   <source>#SYSTEM.RAGSOC</source>
  </field>
  <field x="71" y="5" type="Testo" width="20" height="1.25" pattern="1" text="Data di stampa:">
   <font face="Arial" size="9" />
  </field>
  <field x="91" y="5" type="Data" width="15" height="1.25" pattern="1">
   <source>#SYSTEM.DATE</source>
  </field>
  <field x="1" y="6.25" type="Testo" width="20" pattern="1" text="Movimenti dal:">
   <font face="Arial" size="9" />
   <prescript description="H1.0 PRESCRIPT">MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DESCRIZ</prescript>
  </field>
  <field x="21.19" y="6.25" type="Data" width="15" pattern="1">
   <source>#DATA_INIZIALE</source>
  </field>
  <field x="38.19" y="6.25" type="Testo" width="4" pattern="1" text="al:">
   <font face="Arial" size="9" />
  </field>
  <field x="43.19" y="6.25" type="Data" width="15" pattern="1">
   <source>#DATA_FINALE</source>
  </field>
  <field x="1.19" y="7.5" type="Testo" width="20" pattern="1" text="Centro di costo:">
   <font face="Arial" size="9" />
  </field>
  <field x="21.19" y="7.5" type="Stringa" width="24" pattern="1">
   <source>#COSTO</source>
  </field>
  <field x="46.19" y="7.5" type="Stringa" width="70" pattern="1">
   <prescript>MESSAGE ISAMREAD,CDC,CODCOSTO=#COSTO,DESCRIZ</prescript>
  </field>
  <field x="1.19" y="8.75" type="Testo" width="20" pattern="1" text="Commessa:">
   <font face="Arial" size="9" />
  </field>
  <field x="21.19" y="8.75" type="Stringa" width="24" pattern="1">
   <source>#COMMESSA</source>
  </field>
  <field x="46.19" y="8.75" type="Stringa" width="70" pattern="1">
   <prescript>MESSAGE ISAMREAD,COMMESSE,CODCMS=#COMMESSA,DESCRIZ</prescript>
  </field>
  <field x="1.19" y="10" type="Testo" width="20" pattern="1" text="Fase:">
   <font face="Arial" size="9" />
  </field>
  <field x="21.19" y="10" type="Stringa" width="13" pattern="1">
   <source>#FASE</source>
  </field>
  <field x="46.19" y="10" type="Stringa" width="70" pattern="1">
   <prescript>MESSAGE ISAMREAD,FASI,CODCMSFAS=#CMSCDC!CODFASE=#FASE,DESCRIZ</prescript>
  </field>
 </section>
 <section type="Head" level="2">
  <condition>CODCONTO:2!=""</condition>
  <groupby>CODCONTO:1</groupby>
  <prescript description="H2 PRESCRIPT">"CODCONTO:1" @
"F2.101" !
"DESCR:1" @
"F2.102" !

"F2" AZZERA_TOTALI
</prescript>
 </section>
 <section type="Head" level="3">
  <condition>CODCONTO:3!=""</condition>
  <groupby>CODCONTO:2</groupby>
  <prescript description="H3 PRESCRIPT">"CODCONTO:2" @
"F3.101" !
"DESCR:2" @
"F3.102" !

"F3" AZZERA_TOTALI</prescript>
 </section>
 <section type="Head" level="4">
  <condition>CODCONTO:4 != ""</condition>
  <groupby>CODCONTO:3</groupby>
  <prescript description="H4 PRESCRIPT">"CODCONTO:3" @
"F4.101" !    \ Copia il codice conto nel footer
"DESCR:3" @
"F4.102" !

"F4" AZZERA_TOTALI</prescript>
 </section>
 <section type="Body" />
 <section type="Body" level="1">
  <font face="Arial" size="8" />
  <field type="Stringa" width="24" id="101" pattern="1">
   <source>CODCONTO</source>
   <prescript description="B1.101 PRESCRIPT">CA_FORMAT_CONTO</prescript>
  </field>
  <field x="25" type="Stringa" width="50" id="102" pattern="1">
   <source>DESCR</source>
  </field>
  <field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:INI_DAREP</source>
   <postscript description="B1.103 POSTSCRIPT">MESSAGE ADD,F2.103|ADD,F3.103|ADD,F4.103
</postscript>
  </field>
  <field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:INI_AVEREP</source>
   <postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F2.104|ADD,F3.104|ADD,F4.104</postscript>
  </field>
  <field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:MOV_DAREP</source>
   <postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F2.105|ADD,F3.105|ADD,F4.105</postscript>
  </field>
  <field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:MOV_AVEREP</source>
   <postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F2.106|ADD,F3.106|ADD,F4.106</postscript>
  </field>
  <field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:FIN_DAREP</source>
   <postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F2.107|ADD,F3.107|ADD,F4.107</postscript>
  </field>
  <field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:FIN_AVEREP</source>
   <postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F2.108|ADD,F3.108|ADD,F4.108</postscript>
  </field>
  <field x="78" y="1" type="Valuta" align="right" width="13" id="203" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:INI_DAREC</source>
   <postscript description="B1.203 POSTSCRIPT">MESSAGE ADD,F2.103|ADD,F3.103|ADD,F4.103
</postscript>
  </field>
  <field x="92" y="1" type="Valuta" align="right" width="13" id="204" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:INI_AVEREC</source>
   <postscript description="B1.204 POSTSCRIPT">MESSAGE ADD,F2.104|ADD,F3.104|ADD,F4.104</postscript>
  </field>
  <field x="107" y="1" type="Valuta" align="right" width="13" id="205" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:MOV_DAREC</source>
   <postscript description="B1.205 POSTSCRIPT">MESSAGE ADD,F2.105|ADD,F3.105|ADD,F4.105</postscript>
  </field>
  <field x="121" y="1" type="Valuta" align="right" width="13" id="206" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:MOV_AVEREC</source>
   <postscript description="B1.206 POSTSCRIPT">MESSAGE ADD,F2.106|ADD,F3.106|ADD,F4.106</postscript>
  </field>
  <field x="136" y="1" type="Valuta" align="right" width="13" id="207" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:FIN_DAREC</source>
   <postscript description="B1.207 POSTSCRIPT">MESSAGE ADD,F2.107|ADD,F3.107|ADD,F4.107</postscript>
  </field>
  <field x="150" y="1" type="Valuta" align="right" width="13" id="208" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>SALDO:FIN_AVEREC</source>
   <postscript description="B1.208 POSTSCRIPT">MESSAGE ADD,F2.108|ADD,F3.108|ADD,F4.108</postscript>
  </field>
  <field x="78" y="2" type="Valuta" align="right" width="13" id="303" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>#103 + #203</source>
   <prescript description="B1.303 PRESCRIPT">303 DARE_AVERE</prescript>
   <postscript description="B1.303 POSTSCRIPT">MESSAGE ADD,F2.303|ADD,F3.303|ADD,F4.303
</postscript>
  </field>
  <field x="92" y="2" type="Valuta" align="right" width="13" id="304" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>#104 + #204</source>
   <postscript description="B1.304 POSTSCRIPT">MESSAGE ADD,F2.304|ADD,F3.304|ADD,F4.304</postscript>
  </field>
  <field x="107" y="2" type="Valuta" align="right" width="13" id="305" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>#105 + #205</source>
   <prescript description="B1.305 PRESCRIPT">305 DARE_AVERE</prescript>
   <postscript description="B1.305 POSTSCRIPT">MESSAGE ADD,F2.305|ADD,F3.305|ADD,F4.305</postscript>
  </field>
  <field x="121" y="2" type="Valuta" align="right" width="13" id="306" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>#106 + #206</source>
   <postscript description="B1.306 POSTSCRIPT">MESSAGE ADD,F2.306|ADD,F3.306|ADD,F4.306</postscript>
  </field>
  <field x="136" y="2" type="Valuta" align="right" width="13" id="307" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>#107 + #207</source>
   <prescript description="B1.307 PRESCRIPT">307 DARE_AVERE</prescript>
   <postscript description="B1.307 POSTSCRIPT">MESSAGE ADD,F2.307|ADD,F3.307|ADD,F4.307</postscript>
  </field>
  <field x="150" y="2" type="Valuta" align="right" width="13" id="308" pattern="1" hide_zero="1" text="###.###.###,@@">
   <source>#108 + #208</source>
   <postscript description="B1.308 POSTSCRIPT">MESSAGE ADD,F2.308|ADD,F3.308|ADD,F4.308</postscript>
  </field>
 </section>
 <section type="Foot">
  <font face="Arial" size="8" />
  <field border="1" x="1" y="0.5" type="Linea" width="167" height="0" pattern="1" />
  <field x="140" y="1.25" type="Testo" width="5" pattern="1" text="Pag." />
  <field x="145.19" y="1.25" type="Numero" align="right" width="4" pattern="1">
   <source>#REPORT.PAGE</source>
  </field>
 </section>
 <section type="Foot" level="1" />
 <section type="Foot" level="2">
  <condition>#101 != ""</condition>
  <font face="Arial" bold="1" size="8" />
  <field type="Stringa" width="23" id="101" pattern="1">
   <prescript description="F2.101 PRESCRIPT">CA_FORMAT_CONTO</prescript>
  </field>
  <field x="25" type="Stringa" width="50" id="102" pattern="1" />
  <field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>103 DARE_AVERE</prescript>
  </field>
  <field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>107 DARE_AVERE</prescript>
  </field>
  <field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="78" y="1" type="Valuta" align="right" width="13" id="203" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>103 DARE_AVERE</prescript>
  </field>
  <field x="92" y="1" type="Valuta" align="right" width="13" id="204" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" y="1" type="Valuta" align="right" width="13" id="205" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" y="1" type="Valuta" align="right" width="13" id="206" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" y="1" type="Valuta" align="right" width="13" id="207" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>107 DARE_AVERE</prescript>
  </field>
  <field x="150" y="1" type="Valuta" align="right" width="13" id="208" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="78" y="2" type="Valuta" align="right" width="13" id="303" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>103 DARE_AVERE</prescript>
  </field>
  <field x="92" y="2" type="Valuta" align="right" width="13" id="304" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" y="2" type="Valuta" align="right" width="13" id="305" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" y="2" type="Valuta" align="right" width="13" id="306" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" y="2" type="Valuta" align="right" width="13" id="307" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>107 DARE_AVERE</prescript>
  </field>
  <field x="150" y="2" type="Valuta" align="right" width="13" id="308" pattern="1" hide_zero="1" text="###.###.###,@@" />
 </section>
 <section type="Foot" level="3">
  <condition>#101 != ""</condition>
  <font face="Arial" bold="1" size="8" />
  <field type="Stringa" width="23" id="101" pattern="1">
   <prescript description="F3.101 PRESCRIPT">CA_FORMAT_CONTO</prescript>
  </field>
  <field x="25" type="Stringa" width="50" id="102" pattern="1" />
  <field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>103 DARE_AVERE</prescript>
  </field>
  <field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>107 DARE_AVERE</prescript>
  </field>
  <field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="78" y="1" type="Valuta" align="right" width="13" id="203" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>103 DARE_AVERE</prescript>
  </field>
  <field x="92" y="1" type="Valuta" align="right" width="13" id="204" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" y="1" type="Valuta" align="right" width="13" id="205" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" y="1" type="Valuta" align="right" width="13" id="206" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" y="1" type="Valuta" align="right" width="13" id="207" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>107 DARE_AVERE</prescript>
  </field>
  <field x="150" y="1" type="Valuta" align="right" width="13" id="208" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="78" y="2" type="Valuta" align="right" width="13" id="303" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>103 DARE_AVERE</prescript>
  </field>
  <field x="92" y="2" type="Valuta" align="right" width="13" id="304" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" y="2" type="Valuta" align="right" width="13" id="305" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" y="2" type="Valuta" align="right" width="13" id="306" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" y="2" type="Valuta" align="right" width="13" id="307" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript>107 DARE_AVERE</prescript>
  </field>
  <field x="150" y="2" type="Valuta" align="right" width="13" id="308" pattern="1" hide_zero="1" text="###.###.###,@@" />
 </section>
 <section type="Foot" level="4">
  <condition>#101 != ""</condition>
  <font face="Arial" bold="1" size="8" />
  <field type="Stringa" width="23" id="101" pattern="1">
   <prescript description="F4.101 PRESCRIPT">CA_FORMAT_CONTO</prescript>
  </field>
  <field x="25" type="Stringa" width="50" id="102" pattern="1" />
  <field x="78" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript description="F4.103 PRESCRIPT">103 DARE_AVERE</prescript>
  </field>
  <field x="92" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript description="F4.107 PRESCRIPT">107 DARE_AVERE</prescript>
  </field>
  <field x="150" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="78" y="1" type="Valuta" align="right" width="13" id="203" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript description="F4.203 PRESCRIPT">103 DARE_AVERE</prescript>
  </field>
  <field x="92" y="1" type="Valuta" align="right" width="13" id="204" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" y="1" type="Valuta" align="right" width="13" id="205" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" y="1" type="Valuta" align="right" width="13" id="206" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" y="1" type="Valuta" align="right" width="13" id="207" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript description="F4.207 PRESCRIPT">107 DARE_AVERE</prescript>
  </field>
  <field x="150" y="1" type="Valuta" align="right" width="13" id="208" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="78" y="2" type="Valuta" align="right" width="13" id="303" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript description="F4.303 PRESCRIPT">103 DARE_AVERE</prescript>
  </field>
  <field x="92" y="2" type="Valuta" align="right" width="13" id="304" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="107" y="2" type="Valuta" align="right" width="13" id="305" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="121" y="2" type="Valuta" align="right" width="13" id="306" pattern="1" hide_zero="1" text="###.###.###,@@" />
  <field x="136" y="2" type="Valuta" align="right" width="13" id="307" pattern="1" hide_zero="1" text="###.###.###,@@">
   <prescript description="F4.307 PRESCRIPT">107 DARE_AVERE</prescript>
  </field>
  <field x="150" y="2" type="Valuta" align="right" width="13" id="308" pattern="1" hide_zero="1" text="###.###.###,@@" />
 </section>
 <sql>USE PCONANA</sql>
 <prescript description="PRESCRIPT">: AZZERA_TOTALI ( ID_SEC - )
109 103 DO
  DUP      \ Duplica codice sezione
  "." +    \ Aggiunge punto
  I +      \ Aggiunge codice campo 
  0 SWAP ! \ Lo azzera
LOOP
DROP
;

: DARE_AVERE ( ID_DARE -- )
VARIABLE _DARE
VARIABLE _AVERE
DUP
_DARE !
1 + _AVERE !

_DARE @ @    \ DARE
_AVERE @ @   \ AVERE
-            \ DARE-AVERE
DUP
0 &#3C; IF       \ Se negativo
  -1 *       \ Cambia segno
  _AVERE @ !   \ Setta AVERE
  0 _DARE @ !  \ Azzera DARE
ELSE
  _DARE @ !    \ Setta DARE
  0 _AVERE @ ! \ Azzera AVERE
THEN
;
</prescript>
</report>