Show useful error message when attempting to finish a transaction with no items
This commit is contained in:
parent
cddc06972b
commit
b8b04199d4
@ -38,6 +38,11 @@ switch ($VARS['action']) {
|
|||||||
$database->action(function ($database) {
|
$database->action(function ($database) {
|
||||||
global $VARS, $binstack, $error, $oktx;
|
global $VARS, $binstack, $error, $oktx;
|
||||||
|
|
||||||
|
if (empty($VARS['items'])) {
|
||||||
|
$error = lang("no items", false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$items = $VARS['items'];
|
$items = $VARS['items'];
|
||||||
$payments = $VARS['payments'];
|
$payments = $VARS['payments'];
|
||||||
$customer = $VARS['customer'];
|
$customer = $VARS['customer'];
|
||||||
|
@ -137,4 +137,5 @@ define("STRINGS", [
|
|||||||
"card x added" => "Gift card #{arg} added.",
|
"card x added" => "Gift card #{arg} added.",
|
||||||
"card x saved" => "Gift card #{arg} updated.",
|
"card x saved" => "Gift card #{arg} updated.",
|
||||||
"open drawer" => "Open Drawer",
|
"open drawer" => "Open Drawer",
|
||||||
|
"no items" => "No items in transaction.",
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user