Import - Export ⚙️ implementation for payroll
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
$migrationList = [];
|
||||
$migrationList[] = 'v20171003_200302_payroll_meta_export';
|
||||
$migrationList[] = 'v20171003_200301_add_deduction_group_payroll';
|
||||
$migrationList[] = 'v20171001_200201_update_attendance_out';
|
||||
$migrationList[] = 'v20170918_200000_add_attendance_image_out';
|
||||
$migrationList[] = 'v20170908_200000_payroll_group';
|
||||
|
||||
23
migrations/v20171003_200301_add_deduction_group_payroll.php
Normal file
23
migrations/v20171003_200301_add_deduction_group_payroll.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Classes\Migration;
|
||||
|
||||
class v20171003_200301_add_deduction_group_payroll extends AbstractMigration{
|
||||
|
||||
public function up(){
|
||||
|
||||
$sql = <<<'SQL'
|
||||
alter table PayrollColumns add column `deduction_group` bigint(20) NULL;
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
public function down(){
|
||||
$sql = <<<'SQL'
|
||||
alter table PayrollColumns drop column `deduction_group`;
|
||||
SQL;
|
||||
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
41
migrations/v20171003_200302_payroll_meta_export.php
Normal file
41
migrations/v20171003_200302_payroll_meta_export.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace Classes\Migration;
|
||||
|
||||
class v20171003_200302_payroll_meta_export extends AbstractMigration{
|
||||
|
||||
public function up(){
|
||||
|
||||
$sql = <<<'SQL'
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Payroll Meta Data Export', 'Export payroll module configurations',
|
||||
'[\r\n[ "deduction_group", {"label":"Calculation Group","type":"select2","allow-null":false,"remote-source":["DeductionGroup","id","name"]}],\r\n[ "payroll", {"label":"Sample Payroll","type":"select2","allow-null":false,"remote-source":["Payroll","id","name"]}]]',
|
||||
'PayrollDataExport',
|
||||
'["deduction_group","payroll"]', 'Class','Payroll','JSON');
|
||||
SQL;
|
||||
$this->executeQuery($sql);
|
||||
|
||||
|
||||
$sql = <<<'SQL'
|
||||
INSERT INTO `DataImport` (`name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
|
||||
('Payroll Data Import', 'PayrollDataImporter', '', '[]', '2016-08-14 02:51:56', '2016-08-14 02:51:56');
|
||||
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
public function down(){
|
||||
$sql = <<<'SQL'
|
||||
delete from Reports where name = 'Payroll Meta Data Export';
|
||||
SQL;
|
||||
|
||||
$this->executeQuery($sql);
|
||||
|
||||
$sql = <<<'SQL'
|
||||
delete from DataImport where name = 'Attendance Data Import';
|
||||
SQL;
|
||||
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user