Ilości ujemne w zamówieniu (Ilość)
This commit is contained in:
@@ -45,6 +45,13 @@ try {
|
||||
$old_val = $stmt->fetchColumn();
|
||||
|
||||
if ((string)$old_val !== (string)$value) {
|
||||
if ($field === 'quantity') {
|
||||
$value = (int)$value;
|
||||
if ($value < 1) {
|
||||
die(json_encode(['success' => false, 'error' => 'Ilość musi być większa od zera.']));
|
||||
}
|
||||
}
|
||||
|
||||
if ($field === 'price_per_unit') {
|
||||
$value = (float)str_replace(',', '.', $value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user