diff --git a/application/migrations/20190712150200_fix_empty_reports.php b/application/migrations/20190712150200_fix_empty_reports.php new file mode 100644 index 000000000..ed067329c --- /dev/null +++ b/application/migrations/20190712150200_fix_empty_reports.php @@ -0,0 +1,30 @@ +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() + { + + } +} +?> diff --git a/application/views/reports/date_input.php b/application/views/reports/date_input.php index 979375bb7..75219aaa4 100644 --- a/application/views/reports/date_input.php +++ b/application/views/reports/date_input.php @@ -70,7 +70,7 @@ if(isset($error)) ?> 1) + if (!empty($stock_locations) && count($stock_locations) > 2) { ?>