Show useful error message when attempting to finish a transaction with no items

This commit is contained in:
Skylar Ittner 2018-06-23 14:55:40 -06:00
parent cddc06972b
commit b8b04199d4
2 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,11 @@ switch ($VARS['action']) {
$database->action(function ($database) {
global $VARS, $binstack, $error, $oktx;
if (empty($VARS['items'])) {
$error = lang("no items", false);
return false;
}
$items = $VARS['items'];
$payments = $VARS['payments'];
$customer = $VARS['customer'];

View File

@ -137,4 +137,5 @@ define("STRINGS", [
"card x added" => "Gift card #{arg} added.",
"card x saved" => "Gift card #{arg} updated.",
"open drawer" => "Open Drawer",
"no items" => "No items in transaction.",
]);