function create_cart($type, $trans_no) { global $Refs; if (!$_SESSION['SysPrefs']->db_ok) { // create_cart is called before page() where the check is done return; } processing_start(); if (isset($_GET['NewQuoteToSalesOrder'])) { $trans_no = $_GET['NewQuoteToSalesOrder']; $doc = new Cart(ST_SALESQUOTE, $trans_no, true); $doc->Comments = _("Sales Quotation") . " # " . $trans_no; $_SESSION['Items'] = $doc; } elseif ($type != ST_SALESORDER && $type != ST_SALESQUOTE && $trans_no != 0) { // this is template $doc = new Cart(ST_SALESORDER, array($trans_no)); $doc->trans_type = $type; $doc->trans_no = 0; $doc->document_date = new_doc_date(); if ($type == ST_SALESINVOICE) { $doc->due_date = get_invoice_duedate($doc->payment, $doc->document_date); $doc->pos = get_sales_point(user_pos()); } else { $doc->due_date = $doc->document_date; } $doc->reference = $Refs->get_next($doc->trans_type); //$doc->Comments=''; foreach ($doc->line_items as $line_no => $line) { $doc->line_items[$line_no]->qty_done = 0; } $_SESSION['Items'] = $doc; } else { $_SESSION['Items'] = new Cart($type, array($trans_no)); } copy_from_cart(); }
$_POST['language'] = $myrow["language"]; $_POST['print_profile'] = $myrow["print_profile"]; $_POST['rep_popup'] = $myrow["rep_popup"]; $_POST['pos'] = $myrow["pos"]; } hidden('selected_id', $selected_id); hidden('user_id'); start_row(); label_row(_("User login:"******"User Login:"******"user_id", null, 22, 20); $_POST['language'] = user_language(); $_POST['print_profile'] = user_print_profile(); $_POST['rep_popup'] = user_rep_popup(); $_POST['pos'] = user_pos(); } $_POST['password'] = ""; password_row(_("Password:"******"Enter a new password to change, leave empty to keep current.")); } text_row_ex(_("Full Name") . ":", 'real_name', 50); text_row_ex(_("Telephone No.:"), 'phone', 30); email_row_ex(_("Email Address:"), 'email', 50); security_roles_list_row(_("Access Level:"), 'role_id', null); languages_list_row(_("Language:"), 'language', null); pos_list_row(_("User's POS") . ':', 'pos', null); print_profiles_list_row(_("Printing profile") . ':', 'print_profile', null, _('Browser printing support')); check_row(_("Use popup window for reports:"), 'rep_popup', $_POST['rep_popup'], false, _('Set this option to on if your browser directly supports pdf files')); end_table(1);