38471-vm/patch_expenses.php
2026-02-25 17:48:02 +00:00

10 lines
429 B
PHP

<?php
$content = file_get_contents('index.php');
$search = "case 'expenses':\n \$where = [\"1=1\"];";
$replace = "case 'expenses':\n \$where = [\"1=1\"];\n if (isset(\$_SESSION['outlet_id'])) {\n \$where[] = \"e.outlet_id = \" . (int)\$_SESSION['outlet_id'];\n }";
$content = str_replace($search, $replace, $content);
file_put_contents('index.php', $content);
echo "Expenses patched.\n";