Sistemato saldaconto
git-svn-id: svn://10.65.10.50/trunk@682 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
91f21eef2a
commit
8bcb52a949
@ -253,7 +253,7 @@ void TPrimanota_application::aggiorna_scadenzario(const TMask& m)
|
||||
{
|
||||
pag.zap_rate();
|
||||
|
||||
for (int rata = 1; ; i++)
|
||||
for (int i = 0; ; i++)
|
||||
{
|
||||
// cerca rata
|
||||
scadenza.zero();
|
||||
@ -309,7 +309,7 @@ void TPrimanota_application::aggiorna_scadenzario(const TMask& m)
|
||||
|
||||
set_app_data(&sh);
|
||||
|
||||
if (ms.run() == K_ENTER)
|
||||
if (ms.run() == K_SAVE)
|
||||
{
|
||||
// se modificato riaggiusta partite e scadenze
|
||||
if (pag.dirty() || new_part)
|
||||
|
@ -254,12 +254,14 @@ TToken_string& Pagamento::set_rata(int index, real howmuch,
|
||||
// calcola percentuali e scadenze a partire dagli importi
|
||||
bool nwr = FALSE;
|
||||
TToken_string* tt = (TToken_string*)_rate.objptr(index);
|
||||
if (nwr = (tt == NULL)) tt = new TToken_string(16);
|
||||
if (nwr = (tt == NULL))
|
||||
tt = new TToken_string(16);
|
||||
|
||||
TDate oldd = index > 0 ? data_rata(index -1) : _inizio;
|
||||
int day = date - oldd;
|
||||
real toshare(_tpr == 0 ? _firstr : _secndr);
|
||||
real perc = _tpr > 0 ? 0.0 : howmuch/toshare;
|
||||
real perc = (_tpr > 0 && index == 0) ? 0.0 : howmuch/toshare;
|
||||
perc *= real(100.0);
|
||||
perc.round(2);
|
||||
|
||||
tt->add(day,0); // scadenza
|
||||
@ -273,10 +275,10 @@ TToken_string& Pagamento::set_rata(int index, real howmuch,
|
||||
if (!nwr)
|
||||
{
|
||||
if (index > _rate.items())
|
||||
{
|
||||
error_box("Rate non contigue");
|
||||
delete tt;
|
||||
}
|
||||
{
|
||||
error_box("Rate non contigue");
|
||||
delete tt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user