diff --git a/ve/sconti.cpp b/ve/sconti.cpp index 3b00ed945..c7e5bff44 100755 --- a/ve/sconti.cpp +++ b/ve/sconti.cpp @@ -619,7 +619,6 @@ void TCond_vendita::ricerca(bool load_um_only, bool load_scagl_only) break; } - TString16 codric; if (_riga && _riga->id2pos(FR_PERCPROV) >= 0 && _riga->field(FR_PERCPROV).active()) { const TString & codage = _testa->get(F_CODAG); @@ -643,16 +642,20 @@ void TCond_vendita::ricerca(bool load_um_only, bool load_scagl_only) _load_mask |= load_scagl_only && cv_um; for (i = 0; percprovv.is_zero() && seqric[i] != '\0' && seqric[i] != '-'; i++) { + TString16 codric; + if (isdigit(seqric[i])) - const TString codric = age.get(format("CODRICPR%d", i+1)); + codric = age.get(format("CODRICPR%d", i+1)); percprovv = get_percprovv(seqric[i], codric, true, age); } real percalt; seqric = age.get(AGE_SEQALT); for (i = 0; percalt.is_zero() && seqric[i] != '\0' && seqric[i] != '-'; i++) { + TString16 codric; + if (isdigit(seqric[i])) - const TString & codric = age.get(format("CODALTPR%d", i+1)); + codric = age.get(format("CODALTPR%d", i+1)); percalt = get_percprovv(seqric[i], codric, true, age); } percprovv += percalt; @@ -683,16 +686,20 @@ void TCond_vendita::ricerca(bool load_um_only, bool load_scagl_only) _load_mask |= load_scagl_only && cv_um; for (i = 0; percprovv.is_zero() && seqric[i] != '\0' && seqric[i] != '-'; i++) { - if (isdigit(seqric[i])) - const TString & codric = age.get(format("CODRICPR%d", i+1)); + TString16 codric; + + if (isdigit(seqric[i])) + codric = age.get(format("CODRICPR%d", i+1)); percprovv = get_percprovv(seqric[i], codric, false, age); } real percalt; seqric = age.get(AGE_SEQALT); for (i = 0; percalt.is_zero() && seqric[i] != '\0' && seqric[i] != '-'; i++) { - if (isdigit(seqric[i])) - const TString & codric = age.get(format("CODALTPR%d", i+1)); + TString16 codric; + + if (isdigit(seqric[i])) + codric = age.get(format("CODALTPR%d", i+1)); percalt = get_percprovv(seqric[i], codric, false, age); } percprovv += percalt;