function bill_select()
{
    /*
    name:
    bill_select()
    returns:
    0 - no error
    1 - generic dish with no price found
    2 - internal error clearing prices
    3 - 
    other - mysql error number
    */
    global $tpl;
    if (!bill_orders_to_print($_SESSION['sourceid'])) {
        printing_choose(true);
        return 0;
    }
    $tpl->set_waiter_template_file('bill_select');
    $tmp = navbar_form('form_type', 'orders.php?command=printing_choose');
    $tpl->assign('navbar', $tmp);
    $_SESSION['bill_printed'] = 0;
    if (order_found_generic_not_priced($_SESSION['sourceid'])) {
        return ERR_GENERIC_ORDER_NOT_PRICED_FOUND;
    }
    $keep_separated = bill_check_keep_separated();
    if ($err = bill_clear_prices($_SESSION['sourceid'])) {
        return $err;
    }
    if ($err = bill_save_session($_SESSION['sourceid'])) {
        return $err;
    }
    $tmp = bill_method_selector();
    $tpl->assign('method', $tmp);
    $tmp = bill_type_selection($_SESSION['sourceid']);
    $tpl->assign('type', $tmp);
    $tmp = discount_form_javascript($_SESSION['sourceid']);
    $tpl->assign('discount', $tmp);
    $tmp = bill_show_list();
    $tpl->assign('orders', $tmp);
    return 0;
}
Example #2
0
     } else {
         printing_choose();
     }
     break;
 case 'print_category':
     $category = (int) $start_data['category'];
     $err = print_category($category);
     status_report('CATEGORY_PRINT', $err);
     if (!$err) {
         orders_list();
     } else {
         printing_choose();
     }
     break;
 case 'printing_choose':
     printing_choose();
     break;
 case 'reopen_confirm':
     table_reopen_confirm();
     break;
 case 'reopen':
     $err = table_reopen($_SESSION['sourceid']);
     status_report('REOPEN', $err);
     orders_list();
     break;
 case 'close_confirm':
     table_ask_close();
     break;
 case 'close':
     $err = table_close($_SESSION['sourceid']);
     status_report('CLOSE', $err);