diff --git a/index.php b/index.php index f1a7e70..5b3ac85 100644 --- a/index.php +++ b/index.php @@ -333,7 +333,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { foreach ($settings_res as $s) $app_settings[$s['key']] = $s['value']; $loyalty_enabled = ($app_settings['loyalty_enabled'] ?? '0') === '1'; $points_per_unit = (float)($app_settings['loyalty_points_per_unit'] ?? 1); - $allow_zero_stock = ($app_settings['allow_zero_stock_sell'] ?? '0') === '1'; + $allow_zero_stock = ($app_settings['allow_zero_stock_sell'] ?? '1') === '1'; if (empty($items)) { throw new Exception("Cart is empty"); @@ -3446,7 +3446,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System'; 0 ") . "ORDER BY name_en ASC"; + $sql = "SELECT * FROM stock_items ORDER BY name_en ASC"; $products_raw = db()->query($sql)->fetchAll(PDO::FETCH_ASSOC); $products = []; foreach ($products_raw as $p) { @@ -6190,7 +6190,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';