Corrazione al calcolo
git-svn-id: svn://10.65.10.50/trunk@2437 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a833d830d8
commit
c27648c433
@ -1084,7 +1084,7 @@ word TPagamento::change_value_uguali(int row, real user_val, bool is_perc)
|
|||||||
if (_tpr < 4)
|
if (_tpr < 4)
|
||||||
{
|
{
|
||||||
first_imp = is_perc ? perc_rata(0) : tpay_rata(0);
|
first_imp = is_perc ? perc_rata(0) : tpay_rata(0);
|
||||||
if (_tpr > 0) first_imp -= _secndr;
|
if (_tpr > 0 && !is_perc) first_imp -= _secndr;
|
||||||
}
|
}
|
||||||
real div = (to_share - first_imp)/user_val;
|
real div = (to_share - first_imp)/user_val;
|
||||||
if (div < real(1.0)) return P_TROP;
|
if (div < real(1.0)) return P_TROP;
|
||||||
@ -1246,7 +1246,8 @@ void TPagamento::adjust_perc_imp(bool is_perc, int rdiff)
|
|||||||
TDistrib dt(toshare, is_perc ? _round : 2);
|
TDistrib dt(toshare, is_perc ? _round : 2);
|
||||||
const int first = _tpr > 3 ? 1 : 0;
|
const int first = _tpr > 3 ? 1 : 0;
|
||||||
|
|
||||||
for (int j = first; j < _rate.items(); j++)
|
// for (int j = first; j < _rate.items(); j++)
|
||||||
|
for (int j = _rate.items() - 1 ; j >= first; j--)
|
||||||
{
|
{
|
||||||
real rvl = is_perc ? perc_rata(j) : tpay_rata(j);
|
real rvl = is_perc ? perc_rata(j) : tpay_rata(j);
|
||||||
// togli pezxo di troppo
|
// togli pezxo di troppo
|
||||||
@ -1256,7 +1257,8 @@ void TPagamento::adjust_perc_imp(bool is_perc, int rdiff)
|
|||||||
dt.add(zpx); // * cento???
|
dt.add(zpx); // * cento???
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = first; j < n_rate(); j++)
|
// for (j = first; j < n_rate(); j++)
|
||||||
|
for (j = n_rate() - 1 ; j >= first; j--)
|
||||||
{
|
{
|
||||||
real rfirst(0.0);
|
real rfirst(0.0);
|
||||||
TToken_string& tr = rata(j);
|
TToken_string& tr = rata(j);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user