if (isset($_GET['Item'])) {
    $_POST['stock_id'] = $_GET['Item'];
}
if (!isset($_POST['curr_abrev'])) {
    $_POST['curr_abrev'] = get_company_currency();
}
//---------------------------------------------------------------------------------------------------
if (!@$_GET['popup']) {
    start_form();
}
if (!isset($_POST['stock_id'])) {
    $_POST['stock_id'] = get_global_stock_item();
}
if (!@$_GET['popup']) {
    echo "<center>" . _("Item:") . "&nbsp;";
    echo sales_items_list('stock_id', $_POST['stock_id'], false, true, '', array('editable' => false));
    echo "<hr></center>";
} else {
    br(2);
}
set_global_stock_item($_POST['stock_id']);
//----------------------------------------------------------------------------------------------------
function can_process()
{
    if (strlen($_POST['royalty_percentage']) == 0) {
        display_error(_("Percentage cannot be empty."));
        set_focus('royalty_percentage');
        return false;
    }
    return true;
}
 function sales_local_items_list_row($label, $name, $selected_id = null, $all_option = false, $submit_on_change = false)
 {
     View::get()->layoutHintRow();
     $controls = sales_items_list($name, $selected_id, $all_option, $submit_on_change, 'local', array('cells' => false, 'editable' => false));
     View::get()->addComboControls($label, $controls);
 }