Import - Export ⚙️ implementation for payroll

This commit is contained in:
gamonoid
2017-10-08 19:31:27 +02:00
parent ddb46d8443
commit 088817172f
11 changed files with 619 additions and 35 deletions

View File

@@ -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';

View 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);
}
}

View 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);
}
}