fix: allow saving list-price's price seuil if seuil is unset or 0
This commit is contained in:
@@ -46,12 +46,23 @@ class PriceListValues
|
|||||||
{
|
{
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
$value['price_list_id'] = $price_list_id;
|
$value['price_list_id'] = $price_list_id;
|
||||||
if ($value['price']) {
|
if (self::hasPrice($value)) {
|
||||||
self::store($value);
|
self::store($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static function hasPrice($value): bool
|
||||||
|
{
|
||||||
|
if (! array_key_exists('price', $value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$price = $value['price'];
|
||||||
|
|
||||||
|
return $price !== null && $price !== '';
|
||||||
|
}
|
||||||
|
|
||||||
public static function getModel()
|
public static function getModel()
|
||||||
{
|
{
|
||||||
return PriceListValue::query();
|
return PriceListValue::query();
|
||||||
|
|||||||
Reference in New Issue
Block a user