Add allow sales change price permission (#2653)

This commit is contained in:
FrancescoUK
2020-01-25 17:22:26 +00:00
parent ba40783017
commit 99d861535e
6 changed files with 30 additions and 2 deletions

View File

@@ -1112,6 +1112,7 @@ class Sales extends Secure_Controller
}
$data['items_module_allowed'] = $this->Employee->has_grant('items', $this->Employee->get_logged_in_employee_info()->person_id);
$data['change_price'] = $this->Employee->has_grant('sales_change_price', $this->Employee->get_logged_in_employee_info()->person_id);
$invoice_format = $this->config->item('sales_invoice_format');
$data['invoice_format'] = $invoice_format;

View File

@@ -13,6 +13,7 @@ $lang["sales_cash"] = "Cash";
$lang["sales_cash_deposit"] = "Cash Deposit";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_change_due"] = "Change Due";
$lang["sales_change_price"] = "Change Selling Price";
$lang["sales_check"] = "Cheque";
$lang["sales_check_balance"] = "Cheque remainder";
$lang["sales_check_filter"] = "Cheque";

View File

@@ -13,13 +13,14 @@ $lang["sales_cash"] = "Cash";
$lang["sales_cash_deposit"] = "Cash Deposit";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_change_due"] = "Change Due";
$lang["sales_change_price"] = "Change Selling Price";
$lang["sales_check"] = "Check";
$lang["sales_check_balance"] = "Check remainder";
$lang["sales_check_filter"] = "Check";
$lang["sales_comment"] = "Comment";
$lang["sales_comments"] = "Comments";
$lang["sales_complete_sale"] = "Complete";
$lang["sales_confirm_cancel_sale"] = "Are you sure you want to clear this sale? All items will cleared.";
$lang["sales_confirm_cancel_sale"] = "Are you sure you want to clear this sale? All items will be cleared.";
$lang["sales_confirm_delete"] = "Are you sure you want to delete the selected Sale(s)?";
$lang["sales_confirm_restore"] = "Are you sure you want to restore the selected Sale(s)?";
$lang["sales_credit"] = "Credit Card";

View File

@@ -0,0 +1,20 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Migration_SalesChangePrice extends CI_Migration
{
public function __construct()
{
parent::__construct();
}
public function up()
{
execute_script(APPPATH . 'migrations/sqlscripts/3.3.2_saleschangeprice.sql');
}
public function down()
{
}
}
?>

View File

@@ -0,0 +1,5 @@
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
('sales_change_price', 'sales');
INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES
('sales_change_price', 1, '--');

View File

@@ -164,7 +164,7 @@ if(isset($success))
}
?>
<?php
if($items_module_allowed)
if($items_module_allowed && $change_price)
{
?>
<td><?php echo form_input(array('name'=>'price', 'class'=>'form-control input-sm', 'value'=>to_currency_no_money($item['price']), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();'));?></td>