Patch level :4.0 490

Files correlati     :ca3.exe ca3800a.rep
Ricompilazione Demo : [ ]
Commento            :stampa bilancio di commessa per esercizio pronta ad essere testata


git-svn-id: svn://10.65.10.50/trunk@14328 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2006-09-18 14:03:00 +00:00
parent 044d7c6d2d
commit 37236df11d
2 changed files with 50 additions and 20 deletions

View File

@ -310,6 +310,10 @@ void TPrint_bilancio_cms_recordset::aggiorna_importo(TAssoc_array& riga_array,
const char sezione = indbil == 3 ? 'D' : 'A';
TImporto imp(sezione, real(*str_imp));
//ci sono tutti i tipi di saldo, ma solo quelli che rientrano nei parametri iniziali..
//..verranno considerati (_tipostima,indbil)
const TImporto imp_saldo(saldana.get(SALDANA_SEZIONE).as_string()[0],
saldana.get(SALDANA_SALDO).as_real());
const TImporto imp_saldop(saldana.get(SALDANA_SEZIONEP).as_string()[0],
saldana.get(SALDANA_SALDOP).as_real());
const TImporto imp_saldov(saldana.get(SALDANA_SEZIONEV).as_string()[0],
@ -317,13 +321,23 @@ void TPrint_bilancio_cms_recordset::aggiorna_importo(TAssoc_array& riga_array,
if (inverti)
{
imp -= imp_saldop;
imp -= imp_saldov;
if (_tipostima == 'C' && indbil == 3) //stima Costi e indbil=Costo
imp -= imp_saldo;
if (_tipostima == 'T' || (_tipostima == 'C' && indbil == 4)) //stima Tempo o (Costi e indbil=ricavo)
{
imp -= imp_saldop;
imp -= imp_saldov;
}
}
else
{
imp += imp_saldop;
imp += imp_saldov;
if (_tipostima == 'C' && indbil == 3)
imp += imp_saldo;
if (_tipostima == 'T' || (_tipostima == 'C' && indbil == 4))
{
imp += imp_saldop;
imp += imp_saldov;
}
}
imp.normalize(sezione);
@ -397,10 +411,17 @@ void TPrint_bilancio_cms_recordset::requery()
//solo i Costi(3) ed i Ricavi(4) devono essere considerati per la stampa
if (indbil == 3 || indbil == 4)
{
//solo i record di tipo Preventivo(P) o Variazione(V) devono essere considerati
const real saldop = saldana.get(SALDANA_SALDOP).as_real();
const real saldov = saldana.get(SALDANA_SALDOV).as_real();
if (saldop != ZERO || saldov != ZERO)
//solo i record con saldi non nulli devono essere considerati
const bool has_saldop = (saldana.get(SALDANA_SALDOP).as_real() +
saldana.get(SALDANA_SALDOV).as_real()) != ZERO;
const bool has_saldo = saldana.get(SALDANA_SALDO).as_real() != ZERO;
//se stima per Tempo -> usa solo saldop e saldov
//se stima per Costi -> se costi -> usa solo saldo
//se stima per Costi -> se ricavi -> usa solo saldop e saldov
if ((_tipostima == 'T' && has_saldop)||
(_tipostima == 'C' && indbil == 3 && has_saldo)||
(_tipostima == 'C' && indbil == 4 && has_saldop))
{
const TString& codcms = saldana.get(SALDANA_COMMESSA).as_string();
const TString& fase = saldana.get(SALDANA_FASE).as_string();

View File

@ -25,9 +25,9 @@
<li Value="COSTI" Code="C" />
</list>
</field>
<field x="80" y="2.75" type="Testo" align="center" width="60" pattern="1" text="Costi" />
<field x="63" y="2.75" type="Testo" align="right" width="8" pattern="1" text="RICAVI" />
<field x="80" y="2.75" type="Testo" align="center" width="60" pattern="1" text="COSTI" />
<field x="155" y="2.75" type="Testo" align="right" width="8" pattern="1" text="Margine" />
<field x="63" y="3.25" type="Testo" align="right" width="8" pattern="1" text="Ricavi" />
<field x="153" y="3.5" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " />
<field x="52.5" y="3.75" type="Testo" width="6" pattern="1" text="% Av." />
<field x="72" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Lavoro" />
@ -39,7 +39,7 @@
<field border="1" x="1" y="4.75" type="Linea" width="169" height="0" pattern="1" />
<field x="1" y="3.5" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
</section>
<section type="Head" level="1" height="5">
<section type="Head" level="1" height="4">
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
MESSAGE RESET,F1.102
MESSAGE RESET,F1.103
@ -51,14 +51,7 @@ MESSAGE RESET,F1.108</prescript>
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="BILANCIO DI COMMESSA PER ESERCIZIO">
<font face="Courier New" bold="1" size="16" />
</field>
<field x="1" y="3" type="Testo" width="12" pattern="1" text="Esercizio">
<font italic="1" face="Arial Narrow" bold="1" size="10" />
</field>
<field x="13" y="3" type="Numero" align="right" width="5" pattern="1">
<font italic="1" face="Arial Narrow" bold="1" size="10" />
<source>ANNO</source>
</field>
<field border="2" x="1" y="4.5" type="Linea" width="169" height="0" pattern="1" />
<field border="2" x="1" y="3.5" type="Linea" width="169" height="0" pattern="1" />
</section>
<section type="Head" level="2" height="1.5" page_break="1">
<groupby>LEVEL &#3C; 2</groupby>
@ -169,7 +162,23 @@ MESSAGE RESET,F3.108</prescript>
</field>
<field x="163" type="Numero" align="right" width="4" id="109" pattern="1">
<font italic="1" face="Arial Narrow" size="8" />
<source>ROUND((1-#COS&#2F;#RIC)*100,0)</source>
<prescript description="B1.109 PRESCRIPT">#RIC @
0
=
IF
0
ELSE
1
#COS @
#RIC @
&#2F;
-
100
*
0
ROUND
THEN
#THIS !</prescript>
</field>
</section>
<section type="Foot" />