Patch level : 10.0
Files correlati : fe0.exe Ricompilazione Demo : [ ] Commento : Corretta gestione note di variazione relative all'anno precedente git-svn-id: svn://10.65.10.50/branches/R_10_00@22567 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ddf51381c8
commit
ed1fcf7995
@ -134,23 +134,38 @@ TExclusion_mode TDati_rilevanti_array::add(const TRectype& alleg, bool send_all,
|
||||
|
||||
if (fe_is_nota_variazione(alleg))
|
||||
{
|
||||
const TString8 numrett = alleg.get(ALL_NUMRETT);
|
||||
// Ignora le note di variazione non collegate e di importo non rilevante
|
||||
if (!send_all && ignora == em_incluso)
|
||||
TRectype& a = (TRectype&)alleg; // Triste necessità
|
||||
|
||||
if (!send_all && ignora <= em_importo_limite)
|
||||
{
|
||||
const int anno = alleg.get_int(ALL_ANNO);
|
||||
const real importo = abs(alleg.get_real(ALL_IMPORTO));
|
||||
if (importo < fe_importo_limite(anno))
|
||||
{
|
||||
ignora = segnala_riga(alleg, em_importo_limite, log);
|
||||
a.put(ALL_IGNORA, ignora);
|
||||
}
|
||||
}
|
||||
|
||||
if (ignora == em_incluso)
|
||||
{
|
||||
TDate datarett = a.get(ALL_DATARETT);
|
||||
if (datarett.ok())
|
||||
{
|
||||
if (datarett.year() < 2010)
|
||||
ignora = segnala_riga(alleg, em_data_limite, log);
|
||||
}
|
||||
else
|
||||
{
|
||||
const TDate datarett = alleg.get(ALL_DATARETT);
|
||||
if (datarett.year() != anno)
|
||||
return segnala_riga(alleg, em_data_limite, log); // Non posso fare la add con DATARETT errata
|
||||
|
||||
if (numrett.blank() || numrett == INVALID_NUMDOC)
|
||||
return segnala_riga(alleg, em_altro, log); // Non posso fare la add in assenza di NUMRETT
|
||||
const int anno = alleg.get_int(ALL_ANNO) - 1;
|
||||
a.put(ALL_DATARETT, TDate(31, 12, anno));
|
||||
if (anno < 2010)
|
||||
ignora = segnala_riga(alleg, em_data_limite, log);
|
||||
}
|
||||
|
||||
const TString& numrett = a.get(ALL_NUMRETT);
|
||||
if (numrett == INVALID_NUMDOC || !datarett.ok())
|
||||
a.zero(ALL_NUMRETT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -168,9 +183,7 @@ TExclusion_mode TDati_rilevanti_array::add(const TRectype& alleg, bool send_all,
|
||||
new_mode = (imp < fe_importo_limite(anno)) ? em_importo_limite : em_incluso;
|
||||
}
|
||||
if (ignora != new_mode)
|
||||
{
|
||||
((TRectype&)alleg).put(ALL_IGNORA, ignora = new_mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1005,11 +1018,12 @@ bool TDati_rilevanti_msk::recall_alleg() const
|
||||
|
||||
void TDati_rilevanti_msk::build_outname(TFilename& n) const
|
||||
{
|
||||
const int anno = get_int(F_ANNO);
|
||||
n = get(F_OUTFOLDER);
|
||||
if (n.blank())
|
||||
n.tempdir();
|
||||
|
||||
TString16 f; f.format("Spesometro%05d", prefix().get_codditta());
|
||||
|
||||
TString f; f.format("Spesometro%04d_%05d", anno, prefix().get_codditta());
|
||||
n.add(f);
|
||||
n.ext("txt");
|
||||
}
|
||||
@ -1201,10 +1215,13 @@ void TDati_rilevanti_msk::alleg_sort(TSheet_field& s) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j >= 0 && j < tot && i != j+1) // L'ho trovata
|
||||
if (j >= 0 && j < tot) // L'ho trovata
|
||||
{
|
||||
swapped = true;
|
||||
s.move_row(i, j+1);
|
||||
if (i != j+1)
|
||||
{
|
||||
swapped = true;
|
||||
s.move_row(i, j+1);
|
||||
}
|
||||
if (*s.cell(j, c_numrett) <= ' ')
|
||||
s.set_back_and_fore_color(REQUIRED_BACK_COLOR, NORMAL_COLOR, j, c_numdoc);
|
||||
s.set_back_and_fore_color(REQUIRED_BACK_COLOR, NORMAL_COLOR, j+1, c_numrett);
|
||||
|
@ -888,7 +888,7 @@ TDati_rilevanti_set::TDati_rilevanti_set(const TFilename& file)
|
||||
init();
|
||||
if (load_file(file) && move_first())
|
||||
{
|
||||
const int anno = get(18).as_int();
|
||||
const int anno = get(17).as_int();
|
||||
if (anno > 2010)
|
||||
_anno = anno;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user