Patch level : 12.00 1280
Files correlati : cg2.exe Commento : Errore di registrazione fatture forniitori con saldaconto
This commit is contained in:
parent
9a31c00732
commit
e361350c95
@ -66,6 +66,13 @@ TPrimanota_application::TPrimanota_application()
|
||||
memset(_msk, 0, sizeof(_msk));
|
||||
}
|
||||
|
||||
HIDDEN bool key_handler(TMask& m, KEY k)
|
||||
{
|
||||
if (k == K_SHIFT + K_F12)
|
||||
app().calcola_saldo();
|
||||
return true;
|
||||
}
|
||||
|
||||
TMask* TPrimanota_application::load_mask(int n)
|
||||
{
|
||||
if (_msk[n] != nullptr)
|
||||
@ -244,7 +251,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
CHECKD(0, "Che ca$$o di maschera è la ", n);
|
||||
break;
|
||||
}
|
||||
|
||||
m->set_handler(key_handler);
|
||||
_msk[n] = m;
|
||||
return m;
|
||||
}
|
||||
|
@ -1055,7 +1055,6 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
||||
}
|
||||
for (int i = new_rate; i < nrate; i++)
|
||||
((real &)ant[new_rate - 1]) += partita.rata(i + 1).get_real(SCAD_IMPORTOANT);
|
||||
|
||||
partita.elimina_rata(-1); // Elimina tutte le rate eventuali
|
||||
for (i = 0; i < ps.items(); i++)
|
||||
{
|
||||
@ -1235,6 +1234,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
if (old_riga >= 0)
|
||||
{
|
||||
const bool empty = sub_cgs_imp(old_riga, old_importo);
|
||||
|
||||
if (empty && (new_importo.is_zero() || new_conto != old_conto))
|
||||
sheet.destroy(old_riga);
|
||||
}
|
||||
|
@ -846,7 +846,7 @@ bool TRiga_scadenze::elimina_pagamento(int p)
|
||||
old_pag.zero(PAGSCA_RITENUTE);
|
||||
old_pag.zero(PAGSCA_RITSOC);
|
||||
TValuta val;
|
||||
return partita().modifica_pagamento(old_pag, val, true);
|
||||
return partita().modifica_pagamento(old_pag, val, true, false);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -896,9 +896,11 @@ void TRiga_partite::elimina_rata(int r)
|
||||
for (r = to; r >= from; r--) // E' necessario andare all'indietro perche'
|
||||
{ // il metodo rate() funzioni sempre correttamente
|
||||
TRiga_scadenze& scad = rata(r);
|
||||
for (int p = scad.last(); p > 0; p = scad.pred(p))
|
||||
TRiga_scadenze scad_app = rata(r); // scad vien distrutta
|
||||
|
||||
for (int p = scad_app.last(); p > 0; p = scad_app.pred(p))
|
||||
scad.elimina_pagamento(p); // Elimina pagamento
|
||||
rows_array().destroy_row(r); // Elimina rata
|
||||
rows_array().destroy_row(r); // Elimina rata
|
||||
}
|
||||
}
|
||||
|
||||
@ -2093,7 +2095,7 @@ bool TPartita::elimina_pagamento(int nriga, int nrata, int nrigp)
|
||||
old_pag.zero(PAGSCA_RITENUTE);
|
||||
old_pag.zero(PAGSCA_RITSOC);
|
||||
const TValuta val;
|
||||
modifica_pagamento(old_pag, val, true);
|
||||
modifica_pagamento(old_pag, val, true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2451,7 +2453,7 @@ bool TPartita::utilizzata(int nrigp) const
|
||||
bool TPartita::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta,
|
||||
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
|
||||
char& new_ap, TImporto& new_abb, TImporto& new_diffcam,
|
||||
bool update)
|
||||
bool update, bool del)
|
||||
{
|
||||
const int nriga = new_pag.get_int(PAGSCA_NRIGA);
|
||||
const int nrata = new_pag.get_int(PAGSCA_NRATA);
|
||||
@ -2486,20 +2488,21 @@ bool TPartita::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta
|
||||
old_abb = new_abb = old_diffcam = new_diffcam = TImporto('D', ZERO);
|
||||
}
|
||||
|
||||
if (empty && !utilizzata(nrigp))
|
||||
if (del && empty && !utilizzata(nrigp))
|
||||
rimuovi_riga(nrigp);
|
||||
|
||||
return empty;
|
||||
}
|
||||
|
||||
|
||||
bool TPartita::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta, bool update)
|
||||
bool TPartita::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta, bool update, bool del)
|
||||
{
|
||||
char old_ap, new_ap;
|
||||
TImporto old_abbuono, new_abbuono, old_diffcam, new_diffcam;
|
||||
|
||||
return modifica_pagamento(new_pag, valuta,
|
||||
old_ap, old_abbuono, old_diffcam,
|
||||
new_ap, new_abbuono, new_diffcam, update);
|
||||
new_ap, new_abbuono, new_diffcam, update, del);
|
||||
}
|
||||
|
||||
|
||||
|
@ -319,8 +319,8 @@ public:
|
||||
bool modifica_pagamento(const TRectype& new_pag, const TValuta& valuta,
|
||||
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
|
||||
char& new_ap, TImporto& new_abb, TImporto& new_diffcam,
|
||||
bool update);
|
||||
bool modifica_pagamento(const TRectype& new_pag, const TValuta& valuta, bool update);
|
||||
bool update, bool del = true);
|
||||
bool modifica_pagamento(const TRectype& new_pag, const TValuta& valuta, bool update, bool del = true);
|
||||
bool elimina_pagamento(int nriga, int nrata, int nrigp);
|
||||
|
||||
static void carica_allineamento();
|
||||
|
Loading…
x
Reference in New Issue
Block a user