Migliorata gestione eventuali PART_NUMRIG = 0

git-svn-id: svn://10.65.10.50/branches/R_10_00@22733 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-09-24 08:31:10 +00:00
parent 713d97b122
commit 984998a2be

View File

@ -1713,8 +1713,12 @@ void TPartita::update_reg(long nreg, const TRectype& mov, TPartite_array& pa)
}
else
{
const int numrig = rig.get_int(PART_NUMRIG);
CHECK(numrig > 0, "Bad NUMRIG");
int numrig = rig.get_int(PART_NUMRIG);
if (numrig <= 0)
{
NFCHECK("Bad NUMRIG: %d", numrig);
rig.put(PART_NUMRIG, numrig = 1);
}
const TImporto imptotdoc = pa.importo_speso(nreg, numrig, false, 0x9);
rig.put(PART_IMPTOTDOC, imptotdoc.valore());