Topic: Restricting sales Invoice price edition for unauthorized users
A feature to restrict users, with no sales pricing edition permissions, from editing prices while creating a Sales Order/Delivery /Invoice is admirable. Here is the code:
File: sales/includes/ui/sales_order_ui.inc
Change function sales_order_item_controls as follows:
if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('units');
$Ajax->activate('qty');
$Ajax->activate('line_total');
$Ajax->activate('price_lbl');
$Ajax->activate('Disc_lbl');
}
label_cell($units, '', 'units');
if($_SESSION["wa_current_user"]->can_access('SA_SALESPRICE')){
amount_cells(null, 'price');
small_amount_cells(null, 'Disc', percent_format($_POST['Disc']), null, null, user_percent_dec());
} else {
amount_cell(input_num('price'),false,'','price_lbl');
hidden("price",$_POST['price']);
amount_cell(input_num('Disc'),false,'','Disc_lbl');
hidden("Disc",$_POST['Disc']);
}