mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-20 15:27:53 -05:00
Merge pull request #2490 from opensourcepos/3.3.0_patch_empty_reports
fix empty reports
This commit is contained in:
30
application/migrations/20190712150200_fix_empty_reports.php
Normal file
30
application/migrations/20190712150200_fix_empty_reports.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Migration_fix_empty_reports extends CI_Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->db->select('location_name');
|
||||
$this->db->from('stock_locations');
|
||||
$this->db->where('location_id', 1);
|
||||
$this->db->limit(1);
|
||||
$location_name = $this->db->get()->result_array()[0]['location_name'];
|
||||
|
||||
$location_name = str_replace(' ', '_', $location_name);
|
||||
$this->db->set('location_id',1);
|
||||
$this->db->where('permission_id','receivings_' . $location_name);
|
||||
$this->db->or_where('permission_id', 'sales_' . $location_name);
|
||||
$this->db->update('permissions');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -70,7 +70,7 @@ if(isset($error))
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (!empty($stock_locations) && count($stock_locations) > 1)
|
||||
if (!empty($stock_locations) && count($stock_locations) > 2)
|
||||
{
|
||||
?>
|
||||
<div class="form-group form-group-sm">
|
||||
|
||||
Reference in New Issue
Block a user