mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-04 15:13:40 -04:00
* Improve code style and PSR-12 compliance - refactored code formatting to adhere to PSR-12 guidelines - standardized coding conventions across the codebase - added missing framework files and reverted markup changes - reformatted arrays for enhanced readability - updated language files for consistent styling and clarity - minor miscellaneous improvements
33 lines
894 B
PHP
33 lines
894 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class Migration_fix_empty_reports extends Migration
|
|
{
|
|
/**
|
|
* Perform a migration step.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
$builder = $this->db->table('stock_locations');
|
|
$builder->select('location_name');
|
|
$builder->where('location_id', 1);
|
|
$builder->limit(1);
|
|
$location_name = $builder->get()->getResultArray()[0]['location_name'];
|
|
|
|
$location_name = str_replace(' ', '_', $location_name);
|
|
$builder = $this->db->table('permissions');
|
|
$builder->set('location_id', 1);
|
|
$builder->where('permission_id', 'receivings_' . $location_name);
|
|
$builder->orWhere('permission_id', 'sales_' . $location_name);
|
|
$builder->update();
|
|
}
|
|
|
|
/**
|
|
* Revert a migration step.
|
|
*/
|
|
public function down(): void {}
|
|
}
|