Patch level :10.698

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
modifiche a stampa mastrini (filtro per date funzionante meglio e ad alta velocità) e bilancio di commessa (reimmesso il calcolo detrazioni come consuntivi opzionale)


git-svn-id: svn://10.65.10.50/trunk@20300 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2010-03-31 11:09:30 +00:00
parent 7640483af1
commit 42f0551460
8 changed files with 104 additions and 23 deletions

View File

@ -225,6 +225,18 @@ bool TPrint_mastrini_ca_recordset::valid_record(const TRelation& rel) const
if (_adata.ok() && datareg > _adata)
return false;
}
else
{
const TDate datacomp = mov.get_date(MOVANA_DATACOMP);
if (_dadata.ok() && datacomp < _dadata)
return false;
if (_adata.ok() && datacomp > _adata)
return false;
const TDate datafcomp = mov.get_date(MOVANA_DATAFCOMP);
if (datafcomp.ok() && _dadata.ok() && datafcomp < _dadata)
return false;
}
//..poi le righe (devono comparire solo le righe con cdc/cms/fsc che appaiono nello sheet)
const TRectype& rmov = rel.curr(LF_RMOVANA);
@ -344,6 +356,7 @@ void TPrint_mastrini_ca_recordset::set_filter(const TPrint_mastrini_ca_mask& msk
_aconto << msk.get(F_CDC1_FIN+i);
}
_anno = msk.get_int(F_ANNO);
_dadata = msk.get_date(F_DATAINI);
_adata = msk.get_date(F_DATAFIN);
@ -622,17 +635,39 @@ void TPrint_mastrini_ca::print_or_preview(const bool stampa)
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
{
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
//stabilisce quale è il primo livello (tra CDC e CMS)..
const TMultilevel_code_info& liv1 = *ca_multilevel_code_info_by_index(0);
const int logic1 = liv1.logic();
TAssoc_array codici_buoni;
TString query;
query << "USE RMOVANA KEY 2\n";
query << "FROM CODCONTO=#DACONTO\n";
query << "TO CODCONTO=#ACONTO";
TISAM_recordset rmovana(query);
TString80 daconto, aconto;
for (int i = 0; _mask->id2pos(F_CDC1_INI+i) > 0; i++)
{
daconto << _mask->get(F_CDC1_INI+i);
aconto << _mask->get(F_CDC1_FIN+i);
}
rmovana.set_var("#DACONTO", daconto);
rmovana.set_var("#ACONTO", aconto);
for (bool ok = rmovana.move_first(); ok; ok = rmovana.move_next())
{
const TString& codice = rmovana.get(logic1 == LF_COMMESSE ? RMOVANA_CODCMS : RMOVANA_CODCCOSTO).as_string();
codici_buoni.add(codice);
}
TISAM_recordset set(logic1 == LF_CDC ? "USE CDC" : "USE COMMESSE"); //..e di conseguenza scrive la use giusta
bool skip_closed = false;
if (logic1 == LF_COMMESSE)
skip_closed = !yesno_box(TR("E' stata richiesta la stampa di tutte le commesse:\n"
"Si desidera includere anche le commesse chiuse?"));
TProgind pi(set.items(), video_string, true, true);
for (bool sok = set.move_first(); sok; sok = set.move_next()) //fighissimo metodo per scandire un file in 1 riga!
{
@ -643,6 +678,8 @@ void TPrint_mastrini_ca::print_or_preview(const bool stampa)
continue;
row = set.get(0u).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
if (!codici_buoni.is_key(row))
continue;
//completa la stringa da visualizzare sulla progind
video_string.cut(0) << row << '\n' << set.get(1u);

View File

@ -104,11 +104,16 @@ RADIOBUTTON F_TIPOSTIMA 1 30
BEGIN
PROMPT 45 9 "Tipo di stima Costi\Ricavi"
ITEM "T|C prev.\R prev. (Tempo)"
MESSAGE CLEAR,F_INCLUDE_DOCUMENTI
MESSAGE SHOW,F_DETR_CONS|ENABLE,F_DETR_CONS|CLEAR,F_INCLUDE_DOCUMENTI
ITEM "C|C cons.\R prev."
MESSAGE ENABLE,F_INCLUDE_DOCUMENTI
MESSAGE SHOW,F_DETR_CONS|ENABLE,F_DETR_CONS|ENABLE,F_INCLUDE_DOCUMENTI
ITEM "R|C cons.\R cons."
MESSAGE ENABLE,F_INCLUDE_DOCUMENTI
MESSAGE CLEAR,F_DETR_CONS|HIDE,F_DETR_CONS|ENABLE,F_INCLUDE_DOCUMENTI
END
BOOLEAN F_DETR_CONS
BEGIN
PROMPT 1 11 "Utilizzare consuntivi per le detrazioni "
END
GROUPBOX F_PRE0 76 5

View File

@ -61,6 +61,17 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list>
</field>
<field x="130" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="148" y="3" type="Array" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source>
<list>
<li Value="Preventivi" Code=" " />
<li Value="Consuntivi" Code="X" />
</list>
</field>
<field x="7" y="4.25" type="Testo" width="20" pattern="1" text="Include esercizi successivi">
<font italic="1" face="Arial Narrow" size="9" />
</field>

View File

@ -49,6 +49,17 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list>
</field>
<field x="120" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="145" y="3" type="Array" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source>
<list>
<li Value="Preventivi" Code=" " />
<li Value="Consuntivi" Code="X" />
</list>
</field>
<field x="120" y="4" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
<font italic="1" face="Arial Narrow" size="9" />
</field>
@ -140,10 +151,9 @@
<source>#RICAVI-#COSTI</source>
<postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F3.169</postscript>
</field>
<field x="61.5" type="Numero" align="right" width="4" id="170" pattern="1" text="####">
<font italic="1" face="Arial Narrow" size="8" />
<prescript description="B1.170 PRESCRIPT">
#RICAVI @
<field x="61.5" type="Numero" align="right" width="4" id="170" pattern="1" text="####">
<font italic="1" face="Arial Narrow" size="8" />
<prescript description="B1.170 PRESCRIPT">#RICAVI @
EMPTY= IF
0
ELSE
@ -163,8 +173,8 @@
THEN
#THIS !
</prescript>
</field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</section>
<section type="Foot">
<field border="1" x="1" y="0.25" type="Linea" width="169" height="0" pattern="1" />

View File

@ -49,6 +49,17 @@
<li Value="COSTI Consuntivi \ RICAVI Consuntivi" Code="R" />
</list>
</field>
<field x="120" y="3" type="Testo" width="20" pattern="1" text="Detrazioni calcolate come">
<font italic="1" face="Arial Narrow" size="9" />
</field>
<field x="145" y="3" type="Array" width="10" pattern="1">
<font face="Arial Narrow" bold="1" size="9" />
<source>DETRCONS</source>
<list>
<li Value="Preventivi" Code=" " />
<li Value="Consuntivi" Code="X" />
</list>
</field>
<field x="120" y="4" type="Testo" width="25" pattern="1" text="Profondita' della struttura in esame">
<font italic="1" face="Arial Narrow" size="9" />
</field>
@ -140,10 +151,9 @@
<source>#RICAVI-#COSTI</source>
<postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F3.169</postscript>
</field>
<field x="61.5" type="Numero" align="right" width="4" id="170" pattern="1" text="####">
<font italic="1" face="Arial Narrow" size="8" />
<prescript description="B1.170 PRESCRIPT">
#RICAVI @
<field x="61.5" type="Numero" align="right" width="4" id="170" pattern="1" text="####">
<font italic="1" face="Arial Narrow" size="8" />
<prescript description="B1.170 PRESCRIPT">#RICAVI @
EMPTY= IF
0
ELSE
@ -163,7 +173,7 @@
THEN
#THIS !
</prescript>
</field>
</field>
<field x="65.5" type="Testo" align="center" width="2" id="171" pattern="1" text="%" />
</section>
<section type="Foot">

View File

@ -187,7 +187,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in
switch (_tipostima)
{
case 'R': //CostiConsuntivi RicaviConsuntivi (Cc/Rc)
case 'R': //CostiConsuntivi RicaviConsuntivi (Cc/Rc) (le detrazioni saranno ovviamente sempre e solo consuntive)
{
const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO));
if (!imp_saldo.is_zero())
@ -208,15 +208,15 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in
case 'C': //CostiConsuntivi RicaviPreventivi (Cc/Rp)
{
if (indbil == 3) //costi (sempre e solo consuntivi, sia righe commessa che detrazione)
if (indbil == 3) //costi: sempre e solo consuntivi, sia righe commessa che detrazione
{
const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO));
saldo = imp_saldo;
flag |= saldo.is_zero() ? 0 : 1;
saldo = imp_saldo;
flag |= saldo.is_zero() ? 0 : 1;
}
else //indbil=4 ricavi (preventivi per righe commessa, consuntivi per detrazioni)
else //indbil=4 ricavi: preventivi per righe commessa, consuntivi o preventivi per detrazioni (dipende da scelta utente)
{
if (cms_detraz)
if (cms_detraz && _detrazioni_consuntive)
{
const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO));
saldo = imp_saldo;
@ -236,7 +236,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in
case 'T': //CostiPreventivi RicaviPreventivi (Cc/Rp) = Tempo
//nel caso stia calcolando le detrazioni di anni precedenti (cms_detraz) va sempre preso il consuntivo!!
if (cms_detraz)
if (cms_detraz && _detrazioni_consuntive)
{
const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO));
saldo = imp_saldo;
@ -1530,6 +1530,11 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const
var.set(_depth);
}
else
if (strcmp(column_name, "DETRCONS") == 0)
{
var.set(_detrazioni_consuntive == true ? "X" : "");
}
else
if (strcmp(column_name, "VITAINTERA") == 0)
{
var.set(_vitaintera == true ? "SI" : "NO");
@ -1679,6 +1684,7 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_
_include_documenti = msk.get_bool(F_INCLUDE_DOCUMENTI);
_depth = msk.get_int(F_DEPTH);
_tipostampa = msk.get_int(F_TIPOSTAMPA);
_detrazioni_consuntive = msk.get_bool(F_DETR_CONS);
//in base al tipo di stampa selezionata setta un po' di parametri
switch (_tipostampa)

View File

@ -78,6 +78,7 @@ class TPrint_saldana_recordset : public TRecordset
int _tipostampa;
bool _vitaintera;
bool _detrazioni_consuntive;
bool _include_documenti;
bool _forza_maturato;

View File

@ -14,6 +14,7 @@
#define F_CDC 111
#define F_DEPTH 112
#define F_TIPOSTAMPA 113
#define F_DETR_CONS 114
#define F_FORZA_MATURATO 115
#define F_INCLUDE_DOCUMENTI 116