Patch level : 4.0 451
Files correlati : Ricompilazione Demo : [ ] Commento : Corrretto il meccanismo di proposta delle spese automatiche per cliente git-svn-id: svn://10.65.10.50/trunk@14189 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
450707883d
commit
c4de2fc47b
@ -606,6 +606,7 @@ class TDocumento : public TMultiple_rectype // velib03
|
|||||||
TRiga_documento * _esenzione; // Riga per l' esenzione iva
|
TRiga_documento * _esenzione; // Riga per l' esenzione iva
|
||||||
|
|
||||||
bool _dirty_deny;
|
bool _dirty_deny;
|
||||||
|
bool _spese_updated;
|
||||||
|
|
||||||
static TAssoc_array _tipi;
|
static TAssoc_array _tipi;
|
||||||
static TAssoc_array _numerazioni;
|
static TAssoc_array _numerazioni;
|
||||||
@ -650,6 +651,8 @@ public:
|
|||||||
TCodgiac_livelli & livelli() const ;
|
TCodgiac_livelli & livelli() const ;
|
||||||
void dirty_fields();
|
void dirty_fields();
|
||||||
|
|
||||||
|
bool & spese_updated() { return _spese_updated;}
|
||||||
|
|
||||||
TAssoc_array & tabella_iva() { update_tabella_iva(); return _tabella_iva; }
|
TAssoc_array & tabella_iva() { update_tabella_iva(); return _tabella_iva; }
|
||||||
TCli_for & clifor() const;
|
TCli_for & clifor() const;
|
||||||
TOccasionale & occas() const;
|
TOccasionale & occas() const;
|
||||||
|
@ -167,7 +167,8 @@ void TDocumento::init()
|
|||||||
|
|
||||||
_sconto = _esenzione = NULL;
|
_sconto = _esenzione = NULL;
|
||||||
_stato_originale = ' ';
|
_stato_originale = ' ';
|
||||||
_dirty_deny = FALSE;
|
_dirty_deny = false;
|
||||||
|
_spese_updated = false;
|
||||||
|
|
||||||
check_modules();
|
check_modules();
|
||||||
|
|
||||||
@ -673,6 +674,7 @@ int TDocumento::read(TBaseisamfile& f, word op, word lockop)
|
|||||||
if (is_fattura())
|
if (is_fattura())
|
||||||
set_riga_esenzione();
|
set_riga_esenzione();
|
||||||
_stato_originale = stato();
|
_stato_originale = stato();
|
||||||
|
_spese_updated = get_bool(DOC_SPESEUPD);
|
||||||
|
|
||||||
if (err == NOERR && tipo_valido() && tipo().statistiche() && _has_stat_ven)
|
if (err == NOERR && tipo_valido() && tipo().statistiche() && _has_stat_ven)
|
||||||
{
|
{
|
||||||
@ -864,7 +866,8 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
|||||||
|
|
||||||
if (!doc_bloccato)
|
if (!doc_bloccato)
|
||||||
{
|
{
|
||||||
if(tipo().spese_aut() && !get_bool(DOC_SPESEUPD))
|
myself.put(DOC_SPESEUPD, _spese_updated);
|
||||||
|
if(tipo().spese_aut() && !_spese_updated)
|
||||||
{
|
{
|
||||||
TString16 name("CODSP0");
|
TString16 name("CODSP0");
|
||||||
TString_array spese;
|
TString_array spese;
|
||||||
@ -879,7 +882,6 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
|
|||||||
}
|
}
|
||||||
myself.update_spese_aut(spese);
|
myself.update_spese_aut(spese);
|
||||||
}
|
}
|
||||||
|
|
||||||
myself.update_conai();
|
myself.update_conai();
|
||||||
myself.set_row_ids();
|
myself.set_row_ids();
|
||||||
// const int rows = physical_rows();
|
// const int rows = physical_rows();
|
||||||
@ -2166,6 +2168,7 @@ TDocumento & TDocumento::copy(const TDocumento & d)
|
|||||||
reset_fields(*this);
|
reset_fields(*this);
|
||||||
set_fields(*this);
|
set_fields(*this);
|
||||||
put(DOC_SPESEUPD, d.get(DOC_SPESEUPD));
|
put(DOC_SPESEUPD, d.get(DOC_SPESEUPD));
|
||||||
|
_spese_updated = d._spese_updated;
|
||||||
for (int i = physical_rows(); i > 0; i--)
|
for (int i = physical_rows(); i > 0; i--)
|
||||||
{
|
{
|
||||||
TRiga_documento & r = row(i);
|
TRiga_documento & r = row(i);
|
||||||
@ -2229,8 +2232,7 @@ TRecord_array& TDocumento::body(int logicnum) const
|
|||||||
|
|
||||||
void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field * sh)
|
void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field * sh)
|
||||||
{
|
{
|
||||||
const bool updated = get_bool(DOC_SPESEUPD);
|
if (_spese_updated)
|
||||||
if (updated)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const bool interactive = sh != NULL;
|
const bool interactive = sh != NULL;
|
||||||
@ -2324,7 +2326,7 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
put(DOC_SPESEUPD, true);
|
_spese_updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
real TDocumento::calc_conai_qta(int type)
|
real TDocumento::calc_conai_qta(int type)
|
||||||
|
@ -196,9 +196,7 @@ const TString_array& TTipo_documento::sheet_columns() const
|
|||||||
{
|
{
|
||||||
TFilename pn; profile_name(pn);
|
TFilename pn; profile_name(pn);
|
||||||
TConfig prof(pn, "SHEET");
|
TConfig prof(pn, "SHEET");
|
||||||
TString8 col;
|
for (int i = 0; i < MAX_COLUMNS; i++)
|
||||||
const int ncols = prof.get_int("NCOLS");
|
|
||||||
for (int i = 1; i <= ncols; i++)
|
|
||||||
{
|
{
|
||||||
const TString& id = prof.get("Col", NULL, i);
|
const TString& id = prof.get("Col", NULL, i);
|
||||||
if (atoi(id) <= 0)
|
if (atoi(id) <= 0)
|
||||||
|
@ -925,7 +925,7 @@ void TDocumento_mask::spese2mask()
|
|||||||
spese.add(s);
|
spese.add(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
doc().put("SPESEUPD", false);
|
doc().put(DOC_SPESEUPD, false);
|
||||||
doc().put(DOC_CODVAL, get(F_CODVAL));
|
doc().put(DOC_CODVAL, get(F_CODVAL));
|
||||||
doc().put(DOC_CAMBIO, get(F_CAMBIO));
|
doc().put(DOC_CAMBIO, get(F_CAMBIO));
|
||||||
doc().put(DOC_CONTROEURO, get(F_CONTROEURO));
|
doc().put(DOC_CONTROEURO, get(F_CONTROEURO));
|
||||||
@ -1446,7 +1446,7 @@ bool TDocumento_mask::clifo_handler( TMask_field& f, KEY key )
|
|||||||
return f.error_box( "Il codice '%ld' e' sospeso e non puo' essere utilizzato", atol(f.get()));
|
return f.error_box( "Il codice '%ld' e' sospeso e non puo' essere utilizzato", atol(f.get()));
|
||||||
|
|
||||||
if (f.focusdirty())
|
if (f.focusdirty())
|
||||||
d.put(DOC_SPESEUPD, false);
|
d.spese_updated() = false;
|
||||||
|
|
||||||
m.cli2mask();
|
m.cli2mask();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user