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']);
        }

Re: Restricting sales Invoice price edition for unauthorized users

@joe: Does this warrant a commit? Is the hidden price field safe as is? The patch is attached for current repo.

Post's attachments

Patch_and_files.zip 40.2 kb, 4 downloads since 2021-01-10 

You don't have the permssions to download the attachments of this post.

Re: Restricting sales Invoice price edition for unauthorized users

I will ask Janusz to take a look at thisl

/Joe

Re: Restricting sales Invoice price edition for unauthorized users

Any Updates?