forked from Wavyzz/dolibarr
FIX: better error management at product selling price update
This commit is contained in:
@@ -534,7 +534,14 @@ class ProductCombination
|
||||
$new_price += $variation_price;
|
||||
}
|
||||
|
||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
||||
$ret = $child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
||||
|
||||
if ($ret < 0) {
|
||||
$this->db->rollback();
|
||||
$this->error = $child->error;
|
||||
$this->errors = $child->errors;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -556,7 +563,14 @@ class ProductCombination
|
||||
$new_price += $this->variation_price;
|
||||
}
|
||||
|
||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, 1, $new_npr, $new_psq);
|
||||
$ret = $child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, 1, $new_npr, $new_psq);
|
||||
|
||||
if ($ret < 0) {
|
||||
$this->db->rollback();
|
||||
$this->error = $child->error;
|
||||
$this->errors = $child->errors;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
@@ -565,6 +579,8 @@ class ProductCombination
|
||||
}
|
||||
|
||||
$this->db->rollback();
|
||||
$this->error = $child->error;
|
||||
$this->errors = $child->errors;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user