customer_list_cells(_("Select a customer: "), 'customer_id', null, _('New customer'), true, check_value('show_inactive')); check_cells(_("Show inactive:"), 'show_inactive', null, true); end_row(); end_table(); if (get_post('_show_inactive_update')) { $Ajax->activate('customer_id'); set_focus('customer_id'); } } else { hidden('customer_id'); } if (!$selected_id) { unset($_POST['_tabs_sel']); } // force settings tab for new customer tabbed_content_start('tabs', array('settings' => array(_('&General settings'), $selected_id), 'contacts' => array(_('&Contacts'), $selected_id), 'transactions' => array(_('&Transactions'), $selected_id), 'orders' => array(_('Sales &Orders'), $selected_id))); switch (get_post('_tabs_sel')) { default: case 'settings': customer_settings($selected_id); break; case 'contacts': $contacts = new contacts('contacts', $selected_id, 'customer'); $contacts->show(); break; case 'transactions': $_GET['customer_id'] = $selected_id; $_GET['popup'] = 1; include_once $path_to_root . "/sales/inquiry/customer_inquiry.php"; break; case 'orders':
supplier_list_cells(_("Select a supplier: "), 'supplier_id', null, _('New supplier'), true, check_value('show_inactive')); check_cells(_("Show inactive:"), 'show_inactive', null, true); end_row(); end_table(); if (get_post('_show_inactive_update')) { $Ajax->activate('supplier_id'); set_focus('supplier_id'); } } else { hidden('supplier_id', get_post('supplier_id')); } if (!$supplier_id) { unset($_POST['_tabs_sel']); } // force settings tab for new customer tabbed_content_start('tabs', array('settings' => array(_('&General settings'), $supplier_id), 'contacts' => array(_('&Contacts'), $supplier_id), 'transactions' => array(_('&Transactions'), $supplier_id), 'orders' => array(_('Purchase &Orders'), $supplier_id))); switch (get_post('_tabs_sel')) { default: case 'settings': supplier_settings($supplier_id); break; case 'contacts': $contacts = new contacts('contacts', $supplier_id, 'supplier'); $contacts->show(); break; case 'transactions': $_GET['supplier_id'] = $supplier_id; $_GET['popup'] = 1; include_once $path_to_root . "/purchasing/inquiry/supplier_inquiry.php"; break; case 'orders':
$num_branches = db_customer_has_branches($_POST['customer_id']); $sql = get_sql_for_customer_branches(); //------------------------------------------------------------------------------------------------ if ($num_branches) { $cols = array('branch_code' => 'skip', _("Short Name"), _("Name"), _("Contact"), _("Sales Person"), _("Area"), _("Phone No"), _("Fax No"), _("E-mail") => 'email', _("Tax Group"), _("Inactive") => 'inactive', ' ' => array('insert' => true, 'fun' => 'select_link'), array('insert' => true, 'fun' => 'edit_link'), array('insert' => true, 'fun' => 'del_link')); if (!@$_REQUEST['popup']) { $cols[' '] = 'skip'; } $table =& new_db_pager('branch_tbl', $sql, $cols, 'cust_branch'); $table->set_inactive_ctrl('cust_branch', 'branch_code'); //$table->width = "85%"; display_db_pager($table); } else { display_note(_("The selected customer does not have any branches. Please create at least one branch.")); } tabbed_content_start('tabs', array('settings' => array(_('&General settings'), $selected_id != -1), 'contacts' => array(_('&Contacts'), $selected_id != -1))); switch (get_post('_tabs_sel')) { default: case 'settings': branch_settings($selected_id); break; case 'contacts': $contacts = new contacts('contacts', $selected_id, 'cust_branch'); $contacts->show(); break; case 'orders': } hidden('branch_code'); hidden('selected_id', $selected_id); br(); tabbed_content_end();
end_row(); end_table(); if (get_post('_show_inactive_update')) { $Ajax->activate('stock_id'); set_focus('stock_id'); } } else { hidden('stock_id', get_post('stock_id')); } div_start('details'); $stock_id = get_post('stock_id'); if (!$stock_id) { unset($_POST['_tabs_sel']); } // force settings tab for new customer tabbed_content_start('tabs', array('settings' => array(_('&General settings'), $stock_id), 'author' => array(_('Authors && Payments'), $stock_id), 'sales_pricing' => array(_('S&ales Pricing'), $stock_id), 'purchase_pricing' => array(_('&Purchasing Pricing'), $stock_id), 'standard_cost' => array(_('Standard &Costs'), $stock_id), 'reorder_level' => array(_('&Reorder Levels'), is_inventory_item($stock_id) ? $stock_id : null), 'movement' => array(_('&Transactions'), $stock_id), 'status' => array(_('&Status'), $stock_id))); switch (get_post('_tabs_sel')) { default: case 'settings': item_settings($stock_id); break; case 'sales_pricing': $_GET['stock_id'] = $stock_id; $_GET['popup'] = 1; include_once $path_to_root . "/inventory/prices.php"; break; case 'purchase_pricing': $_GET['stock_id'] = $stock_id; $_GET['popup'] = 1; include_once $path_to_root . "/inventory/purchasing_data.php"; break;
$client = $_POST['br_id']; $gross = $_POST['gross']; $tax = $_POST['tax']; $commission = $_POST['provision']; $date = $_POST['date']; $discount = $_POST['discount']; $net_commission = abs($_POST['total']); $return = $_POST['returns']; if (can_process()) { insert_comm_voucher($sm, $invoice, $client, $gross, $commission, $tax, $return, $discount, $net_commission, $date); meta_forward($_SERVER['PHP_SELF'], "AddedID={$invoice}"); } } //-------------------------------------------------------------------------------------------- if (!$imc) { unset($_POST['_tabs_sel']); } tabbed_content_start('tabs', array('settings' => array(_('&Commission Voucher'), $_POST['imc']))); switch (get_post('_tabs_sel')) { default: case 'comp': voucher_details(); break; } br(); tabbed_content_end(); //-------------------------------------------------------------------------------------------- hidden('popup', @$_REQUEST['popup']); //What is this? end_form(); end_page(@$_REQUEST['popup']);