Patch level :10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :riporto da 5.0: modificate stampa sintetica e prospetto in modo che siano congruenti (devono tener conto dei cespiti alienati)


git-svn-id: svn://10.65.10.50/trunk@16568 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2008-05-05 14:41:32 +00:00
parent 2d75aa8409
commit 223868c2f7
4 changed files with 50 additions and 47 deletions

View File

@ -334,12 +334,12 @@ void TStampa_prospetto::aggiorna_totali(TCursor& curcespi, const int tipo, TTipo
{
// valori della riga 1 (dipendenti da tipo solo le rivgf/rivgc)
const TRectype& recsalce = curcespi.curr(LF_SALCE);
real csto = recsalce.get_real(SALCE_CSTO);
const real csto1 = recsalce.get_real(SALCE_CSTO);
const TRectype& cespi = curcespi.curr();
const bool leasing = cespi.get_bool(CESPI_LEASING);
_cat._tot_csto += csto;
_cat._tot_csto += csto1;
if (tipo == 2)
_cat._tot_csto -= recsalce.get_real(SALCE_VNONAMMC);
else
@ -404,24 +404,13 @@ void TStampa_prospetto::aggiorna_totali(TCursor& curcespi, const int tipo, TTipo
rivmovce += movce.get_real(MOVCE_RIV90);
rivmovce += movce.get_real(MOVCE_RIV91);
csto = movce.get_real(MOVCE_CSTO);
const real csto2 = movce.get_real(MOVCE_CSTO);
// inquietante modo di selezionare la rivg (rivgf o rivgc) in base al tipo senza usare una if else!
real rivg;
if (tipo == 1 || leasing)
rivg = movce.get_real(MOVCE_RIVGF); else
if (tipo == 2 && !leasing)
rivg = movce.get_real(MOVCE_RIVGC);
real vnonamm2;
if (tipo == 2)
vnonamm2 = recsalce.get_real(SALCE_VNONAMMC);
else
vnonamm2 = recsalce.get_real(SALCE_VNONAMM);
vnonamm2 += recsalce.get_real(SALCE_VNONAMM06);
//non si puo' avere un valore non ammortizzabile maggiore del costo prima delle
//rivalutazioni
if (vnonamm2 > csto)
vnonamm2 = csto;
real qmovam = movam.get_real(MOVAM_QNOR);
qmovam += movam.get_real(MOVAM_QACC);
@ -433,25 +422,21 @@ void TStampa_prospetto::aggiorna_totali(TCursor& curcespi, const int tipo, TTipo
_cat._tot_reinplus += movce.get_real(MOVCE_PLUSREIN) * signum; else
if (tmc == 'I' || (tmc <= ' ' && segno == '+'))
{
_cat._tot_acqincr += (csto - vnonamm2 + rivmovce + rivg) * signum;
_cat._tot_acqincr += (csto2 + rivmovce + rivg) * signum;
_cat._tot_incr += qmovam * signum;
} else
if (tmc == 'E' || (tmc <= ' ' && segno == '-'))
{
_cat._tot_cesselim2 += (csto - vnonamm2 + rivmovce + rivg) * (-signum);
_cat._tot_cesselim2 += (csto2 + rivmovce + rivg) * (-signum);
_cat._tot_cesselim3 += qmovam * (-signum);
}
// solo nei casi con tipo =2 e/o 3 viene preso l'ammortamento da ammmv (che verrá poi sommato nella riga 4, piú sotto, a quello
// viene preso l'ammortamento da ammmv (che verrá poi sommato nella riga 4, piú sotto, a quello
// preso da ammce); l'ammortamento viene preso qui in quanto é relativo ai movimenti che vengono qui scanditi
//if (tipo != 1)
{
amv_ammnor += (ammmv.get_real(AMMMV_QNOR)) /* * signum */;
amv_ammacc += (ammmv.get_real(AMMMV_QACC)) /* * signum */;
amv_ammant += (ammmv.get_real(AMMMV_QANT)) /* * signum */;
}
amv_ammnor += (ammmv.get_real(AMMMV_QNOR));
amv_ammacc += (ammmv.get_real(AMMMV_QACC));
amv_ammant += (ammmv.get_real(AMMMV_QANT));
} //fine controllo sulle date
} //fine scansione sui movimenti
}
@ -486,15 +471,12 @@ void TStampa_prospetto::aggiorna_totali(TCursor& curcespi, const int tipo, TTipo
_cat._tot_ammnor += ammce.get_real(AMMCE_QNOR);
_cat._tot_ammacc += ammce.get_real(AMMCE_QACC);
_cat._tot_ammant += ammce.get_real(AMMCE_QANT);
// se, mentre tpsaldo=2, ho anche tpamm =2 e/o 3,
// gli ammortamenti devono tenere conto anche di quelli sui movimenti, calcolati
// durante la scansione dei movimenti
// if (tipo != 1)
{
_cat._tot_ammnor += amv_ammnor;
_cat._tot_ammacc += amv_ammacc;
_cat._tot_ammant += amv_ammant;
}
_cat._tot_ammnor += amv_ammnor;
_cat._tot_ammacc += amv_ammacc;
_cat._tot_ammant += amv_ammant;
}
} // fine scansione sugli ammce

View File

@ -98,9 +98,12 @@ void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk)
{
const TString& dacat = msk.get(F_FROM_CAT);
const TString& acat = msk.get(F_TO_CAT);
TString query = "USE CESPI SELECT\n";
query << "((DTALIEN='')||(ANSI(DTALIEN)>=" << msk.get_date(F_DATAINIZIO).date2ansi() << "))";
query << "&&(ANSI(DTCOMP)<=" << msk.get_date(F_DATAFINE).date2ansi() << ")";
TString query = "USE CESPI\nSELECT ";
query << "(ANSI(DTCOMP)<=" << msk.get_date(F_DATAFINE).date2ansi() << ")";
//cespiti alienati esclusi?
if (msk.get_bool(F_EXCLUDE_ALIENS))
query << "&&((DTALIEN='')||(ANSI(DTALIEN)>=" << msk.get_date(F_DATAINIZIO).date2ansi() << "))";
if (dacat.full() || acat.full())
{
if (dacat == acat)
@ -151,16 +154,25 @@ void TStampa_sintetica_rep::set_filter(const TStampa_sintetica_mask& msk)
real TStampa_sintetica_rep::val_amm(const TRectype& rec_saldi) const
{
real valore = rec_saldi.get_real(SALCE_CSTO);
if (_tpamm == 2)
if (_tpamm == 1) //solo fiscale
valore -= rec_saldi.get_real(SALCE_VNONAMM06);
if (_tpamm == 2) //solo civilistico
{
valore -= rec_saldi.get_real(SALCE_VNONAMMC);
else
valore += rec_saldi.get_real(SALCE_RIVGC);
}
else //fiscale e/o gestionale
{
valore -= rec_saldi.get_real(SALCE_VNONAMM);
valore -= rec_saldi.get_real(SALCE_VNONAMM06);
valore += rec_saldi.get_real(SALCE_RIVGF);
}
valore += rec_saldi.get_real(SALCE_RIV75);
valore += rec_saldi.get_real(SALCE_RIV83);
valore += rec_saldi.get_real(SALCE_RIV90);
valore += rec_saldi.get_real(SALCE_RIV91);
valore += rec_saldi.get_real(SALCE_RIVGF);
if (valore < ZERO)
valore = ZERO;
@ -224,14 +236,17 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons
if (name == "#QAMM") //quote ammortamento esercizio corrente
{
const TRectype& rec_ammce = _cespite.amm_pro();
var = real(rec_ammce.get_real(AMMCE_QNOR) + rec_ammce.get_real(AMMCE_QACC) + rec_ammce.get_real(AMMCE_QANT));
var = real(rec_ammce.get_real(AMMCE_QNOR) + rec_ammce.get_real(AMMCE_QACC) + rec_ammce.get_real(AMMCE_QANT) +
rec_ammce.get_real(AMMCE_QPERSE) + rec_ammce.get_real(AMMCE_QPPRIVATE) + rec_ammce.get_real(AMMCE_FPRIVATO));
return true;
}
if (name == "#FAMM") //fondo ammortamento alla fine dell'esercizio precedente
{
//ragionamento fatto il 31/10/2007;non siamo sicuri che funzioni!
//ragionamento fatto il 05/05/2008;siamo abbastanza sicuri che funzioni!
const TRectype& rec_ammce = _cespite.amm_pro();
var = real(rec_ammce.get_real(AMMCE_QNORP) + rec_ammce.get_real(AMMCE_QACCP) + rec_ammce.get_real(AMMCE_QANTP));
const real fondo = _cespite.val_amm() - _cespite.res_amm();
var = fondo;
return true;
}
if (name == "#RESAMM") //residuo da ammortizzare

View File

@ -19,5 +19,6 @@
#define F_GROUP_CODIMP 117
#define F_GROUP_CODLOC 118
#define F_EXCLUDE_ALIENS 119
#define F_REPORT 119
#define F_REPORT 120

View File

@ -1,6 +1,6 @@
#include "ce3900.h"
TOOLBAR "topbar" 0 0 0 2
TOOLBAR "" 0 -3 0 3
BUTTON DLG_PRINT 10 2
BEGIN
@ -14,7 +14,7 @@ END
ENDPAGE
PAGE "Lista sintetica cespiti" 0 2 0 0
PAGE "Lista sintetica cespiti" -1 -1 78 6
GROUPBOX DLG_NULL 78 6
BEGIN
@ -164,14 +164,19 @@ END
BOOLEAN F_GROUP_CODIMP
BEGIN
PROMPT 2 14 "Raggruppa per impianto "
PROMPT 2 14 "Per impianto "
MESSAGE FALSE CLEAR,F_GROUP_CODLOC
MESSAGE TRUE ENABLE,F_GROUP_CODLOC
END
BOOLEAN F_GROUP_CODLOC
BEGIN
PROMPT 2 15 "Raggruppa per localita' "
PROMPT 2 15 "Per localita' "
END
BOOLEAN F_EXCLUDE_ALIENS
BEGIN
PROMPT 2 17 "Escludere i cespiti alienati"
END
ENDPAGE