Fix comparisons in constant substitution of magic numbers (#1450)

This commit is contained in:
FrancescoUK
2017-08-07 20:10:45 +01:00
parent 0f8c7f52cd
commit 8e86fbdc2a
5 changed files with 16 additions and 16 deletions

View File

@@ -610,7 +610,7 @@ class Sale extends CI_Model
$this->db->insert('sales_items', $sales_items_data);
if($cur_item_info->stock_type === HAS_STOCK && $sale_status === COMPLETED)
if($cur_item_info->stock_type == HAS_STOCK && $sale_status == COMPLETED)
{
// Update stock quantity if item type is a standard stock item and the sale is a standard sale
$item_quantity = $this->Item_quantity->get_item_quantity($item['item_id'], $item['item_location']);
@@ -811,7 +811,7 @@ class Sale extends CI_Model
{
$cur_item_info = $this->Item->get_info($item['item_id']);
if($cur_item_info->stock_type === HAS_STOCK) {
if($cur_item_info->stock_type == HAS_STOCK) {
// create query to update inventory tracking
$inv_data = array(
'trans_date' => date('Y-m-d H:i:s'),

View File

@@ -67,7 +67,7 @@ class Specific_discount extends Report
}
elseif($inputs['sale_type'] == 'quotes')
{
$this->db->where('sale_status = '. SUSPENDED .' and quote_number IS NOT NULL');
$this->db->where('sale_status = ' . SUSPENDED . ' and quote_number IS NOT NULL');
}
elseif($inputs['sale_type'] == 'returns')
{

View File

@@ -92,11 +92,11 @@ abstract class Summary_report extends Report
if($inputs['sale_type'] == 'sales')
{
$this->db->where('sale_status = '. COMPLETED . ' and quantity_purchased > 0');
$this->db->where('sale_status = ' . COMPLETED . ' and quantity_purchased > 0');
}
elseif($inputs['sale_type'] == 'all')
{
$this->db->where('sale_status = '. COMPLETED);
$this->db->where('sale_status = ' . COMPLETED);
}
elseif($inputs['sale_type'] == 'quotes')
{

View File

@@ -59,7 +59,7 @@
'type'=>'radio',
'id'=>'price_option',
'value'=>0,
'checked'=>$item_kit_info->price_option === PRICE_ALL)
'checked'=>$item_kit_info->price_option == PRICE_ALL)
); ?> <?php echo $this->lang->line('item_kits_kit_and_components'); ?>
</label>
<label class="radio-inline">
@@ -68,7 +68,7 @@
'type'=>'radio',
'id'=>'price_option',
'value'=>1,
'checked'=>$item_kit_info->price_option === PRICE_KIT)
'checked'=>$item_kit_info->price_option == PRICE_KIT)
); ?> <?php echo $this->lang->line('item_kits_kit_only'); ?>
</label>
<label class="radio-inline">
@@ -77,7 +77,7 @@
'type'=>'radio',
'id'=>'price_option',
'value'=>2,
'checked'=>$item_kit_info->price_option === PRICE_ITEMS)
'checked'=>$item_kit_info->price_option == PRICE_ITEMS)
); ?> <?php echo $this->lang->line('item_kits_kit_and_stock'); ?>
</label>
@@ -93,7 +93,7 @@
'type'=>'radio',
'id'=>'print_option',
'value'=>0,
'checked'=>$item_kit_info->print_option === PRINT_ALL)
'checked'=>$item_kit_info->print_option == PRINT_ALL)
); ?> <?php echo $this->lang->line('item_kits_all'); ?>
</label>
<label class="radio-inline">
@@ -102,7 +102,7 @@
'type'=>'radio',
'id'=>'print_option',
'value'=>1,
'checked'=>$item_kit_info->print_option === PRINT_PRICED)
'checked'=>$item_kit_info->print_option == PRINT_PRICED)
); ?> <?php echo $this->lang->line('item_kits_priced_only'); ?>
</label>
<label class="radio-inline">
@@ -111,7 +111,7 @@
'type'=>'radio',
'id'=>'print_option',
'value'=>2,
'checked'=>$item_kit_info->print_option === PRINT_KIT)
'checked'=>$item_kit_info->print_option == PRINT_KIT)
); ?> <?php echo $this->lang->line('item_kits_kit_only'); ?>
</label>
@@ -258,4 +258,4 @@ function delete_item_kit_row(link)
return false;
}
</script>
</script>

View File

@@ -56,7 +56,7 @@
'type'=>'radio',
'id'=>'stock_type',
'value'=>0,
'checked'=>$item_info->stock_type === HAS_STOCK)
'checked'=>$item_info->stock_type == HAS_STOCK)
); ?> <?php echo $this->lang->line('items_stock'); ?>
</label>
<label class="radio-inline">
@@ -65,7 +65,7 @@
'type'=>'radio',
'id'=>'stock_type',
'value'=>1,
'checked'=>$item_info->stock_type === HAS_NO_STOCK)
'checked'=>$item_info->stock_type == HAS_NO_STOCK)
); ?> <?php echo $this->lang->line('items_nonstock'); ?>
</label>
</div>
@@ -80,7 +80,7 @@
'type'=>'radio',
'id'=>'item_type',
'value'=>0,
'checked'=>$item_info->item_type === ITEM)
'checked'=>$item_info->item_type == ITEM)
); ?> <?php echo $this->lang->line('items_standard'); ?>
</label>
<label class="radio-inline">
@@ -89,7 +89,7 @@
'type'=>'radio',
'id'=>'item_type',
'value'=>1,
'checked'=>$item_info->item_type === ITEM_KIT)
'checked'=>$item_info->item_type == ITEM_KIT)
); ?> <?php echo $this->lang->line('items_kit'); ?>
</label>
</div>