Skip to content

Commit

Permalink
many improvement and bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3n committed Nov 9, 2017
1 parent d31b0fa commit 1cdcae3
Show file tree
Hide file tree
Showing 34 changed files with 1,089 additions and 205 deletions.
33 changes: 21 additions & 12 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

### SEMARTHRIS CONFIGURATIONS ###

### GLOBAL CONFIG
SEMART_APP_NAME="SemartHRIS"
SEMART_APP_API_DESCRIPTION="SemartHRIS API Endpoint"
SEMART_APP_DEFAULT_PASSWORD="1234567890"
SEMART_PROFILE_IMAGE_UPLOAD_PATH="/images/profiles"
SEMART_UPLOAD_DESTINATION="/uploads"
SEMART_PROFILE_IMAGE_UPLOAD_PATH="/images/profiles"
SEMART_DATE_FORMAT="d-m-Y"
SEMART_DATE_FORMAT_LONG="dd-mm-yyyy"
SEMART_DATE_FORMAT_INTL="dd-MM-yyyy"
Expand All @@ -19,25 +21,32 @@ SEMART_LAST_DATE_FORMAT="t-m-Y"
SEMART_DATE_TIME_FORMAT="${SEMART_DATE_FORMAT} ${SEMART_TIME_FORMAT}"
SEMART_WORKDAY_PER_WEEK="6"
SEMART_OFFDAY_PER_WEEK="7"
SEMART_ATTENDANCE_UPLOAD_PATH="/attendances"
SEMART_ATTENDANCE_CUT_OFF_DATE="-1"
SEMART_ATTENDANCE_DEFAULT_ABSENT_REASON_CODE="ABS"
SEMART_OVERTIME_AUTO_APPROVED="true"
SEMART_OVERTIME_INVALID_MESSAGE="semarthris.invalid_data"
SEMART_OVERTIME_UPLOAD_PATH="/overtimes"
SEMART_RECORD_PER_PAGE="17"
SEMART_MAX_RECORD_PER_PAGE="99"
SEMART_CERTIFICATE_KEY_PATH="/config/key"
SEMART_CURRENCY_PREFIX="Rp."
SEMART_CURRENCY_SURFIX=""
SEMART_DECIMAL_PRECISION="2"
SEMART_DECIMAL_POINT=","
SEMART_THOUSAND_SEPARATOR="."

### DATABASE CONFIG
SEMART_DB_DRIVER="mysql"
SEMART_DB_USER="root"
SEMART_DB_PASSWORD="password"
SEMART_DB_HOST="localhost"
SEMART_DB_PORT="3306"
SEMART_DB_NAME="semarthris"
SEMART_CERTIFICATE_KEY_PATH="/config/key"
SEMART_CURRENCY_PREFIX="Rp."
SEMART_DECIMAL_PRECISION="2"
SEMART_DECIMAL_POINT=","
SEMART_THOUSAND_SEPARATOR="."

### ATTENDANCE CONFIG
SEMART_ATTENDANCE_UPLOAD_PATH="/attendances"
SEMART_ATTENDANCE_CUT_OFF_DATE="-1"
SEMART_ATTENDANCE_DEFAULT_ABSENT_REASON_CODE="ABS"

### OVERTIME CONFIG
SEMART_OVERTIME_AUTO_APPROVED="true"
SEMART_OVERTIME_INVALID_MESSAGE="semarthris.invalid_data"
SEMART_OVERTIME_UPLOAD_PATH="/overtimes"

###> symfony/framework-bundle ###
APP_ENV=dev
Expand Down
2 changes: 1 addition & 1 deletion .php_cs.cache

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SemartHris

SemartHris adalah Human Resources Information System (HRIS) yang dapat digunakan untuk membantu memudahkan tugas HRD Perusahaan.
SemartHris adalah Enterprise Grade Human Resources Information System (HRIS) yang dapat digunakan untuk membantu memudahkan tugas HRD Perusahaan.

## Tahap Pengembangan

Expand Down
1 change: 1 addition & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Hal ini dilakukan agar SemartHRIS dikembangkan dengan tetap mengutamakan stabili
- [ ] Perbaikan API
- [ ] Perbaikan Tampilan
- [ ] Translating Menu, Label, etc
- [ ] Simple Cache Management

### Fase V

Expand Down
6 changes: 4 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@
- [X] Komponen Gaji
- [X] Periode Penggajian
- [X] Benefit dan Pemotongan
- [ ] remove sticky session is exist (Company and Employee)
- [ ] Halaman Proses Gaji
- [X] Remove sticky session is exist (Company and Employee)
- [ ] Security for Processing Attendance and Overtime
- [X] Halaman Proses Gaji
- [ ] Proses Penggajian
- [ ] Summary Absensi
- [ ] Security Per Action
- [ ] Created and Updated Log in List
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 15 additions & 10 deletions config/admin/company.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ easy_admin:
role: 'ROLE_HRSTAFF'
class: 'KejawenLab\Application\SemartHris\Entity\CompanyDepartment'
controller: 'KejawenLab\Application\SemartHris\Controller\Admin\CompanyDepartmentController'
disabled_actions: ['search']
templates:
list: 'app/company/department.html.twig'
new:
title: 'Tambah Departemen Perusahaan'
title: 'Tambah Departemen'
edit:
title: 'Edit Departemen Perusahaan'
title: 'Edit Departemen'
search:
title: 'Departemen'
form:
fields:
- { type: 'group', css_class: 'col-sm-6' }
Expand All @@ -101,13 +104,13 @@ easy_admin:
- { type: 'group', css_class: 'col-sm-6' }
- { property: 'department', label: 'Departemen' }
show:
title: 'Detil Departemen Perusahaan'
title: 'Detil Departemen'
fields:
- { property: 'company', label: 'Perusahaan' }
- { property: 'department', label: 'Departemen' }
list:
role: 'ROLE_HRSTAFF'
title: 'Departemen Perusahaan'
title: 'Departemen'
fields:
- { property: 'company', label: 'Perusahaan' }
- { property: 'department', label: 'Departemen' }
Expand All @@ -119,11 +122,13 @@ easy_admin:
templates:
new: 'app/address/new.html.twig'
edit: 'app/address/edit.html.twig'
list: 'app/address/list.html.twig'
list: 'app/company/address.html.twig'
new:
title: 'Tambah Alamat Perusahaan'
title: 'Tambah Alamat'
edit:
title: 'Edit Alamat Perusahaan'
title: 'Edit Alamat'
search:
title: 'Alamat'
form:
fields:
- { type: 'group', css_class: 'col-sm-12' }
Expand All @@ -143,7 +148,7 @@ easy_admin:
- { type: 'group', css_class: 'col-sm-4' }
- { property: 'faxNumber', label: 'No. Fax' }
show:
title: 'Detil Alamat Perusahaan'
title: 'Detil Alamat'
fields:
- { property: 'company', label: 'Perusahaan' }
- { property: 'address', label: 'Alamat' }
Expand All @@ -155,7 +160,7 @@ easy_admin:
- { property: 'defaultAddress', label: 'Set Default' }
list:
role: 'ROLE_HRSTAFF'
title: 'Alamat Perusahaan'
title: 'Alamat'
fields:
- { property: 'company', label: 'Perusahaan' }
- { property: 'address', label: 'Alamat' }
Expand Down
10 changes: 5 additions & 5 deletions config/admin/employee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ easy_admin:
templates:
new: 'app/address/new.html.twig'
edit: 'app/address/edit.html.twig'
list: 'app/employee_address/list.html.twig'
list: 'app/employee/address.html.twig'
new:
title: 'Tambah Alamat Karyawan'
title: 'Tambah Alamat'
edit:
title: 'Edit Alamat Karyawan'
title: 'Edit Alamat'
form:
fields:
- { type: 'group', css_class: 'col-sm-12' }
Expand All @@ -130,7 +130,7 @@ easy_admin:
- { type: 'group', css_class: 'col-sm-4' }
- { property: 'faxNumber', label: 'No. Fax' }
show:
title: 'Detil Alamat Karyawan'
title: 'Detil Alamat'
fields:
- { property: 'employee', label: 'Karyawan' }
- { property: 'address', label: 'Alamat' }
Expand All @@ -142,7 +142,7 @@ easy_admin:
- { property: 'defaultAddress', label: 'Set Default' }
list:
role: 'ROLE_HRSTAFF'
title: 'Alamat Karyawan'
title: 'Alamat'
fields:
- { property: 'employee', label: 'Karyawan' }
- { property: 'address', label: 'Alamat' }
Expand Down
2 changes: 1 addition & 1 deletion config/admin/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ easy_admin:
icon: 'money'
children:
- { entity: 'SalaryComponent', label: 'Komponen Gaji', icon: 'hand-o-right', params: { sortField: 'createdAt', sortDirection: 'DESC' } }
- { entity: 'PayrollPeriod', label: 'Periode Penggajian', icon: 'hand-o-right', params: { sortField: 'createdAt', sortDirection: 'DESC' } }
- { entity: 'SalaryBenefit', label: 'Tunjangan/Potongan', icon: 'hand-o-right', params: { sortField: 'createdAt', sortDirection: 'DESC' } }
- { entity: 'PayrollPeriod', label: 'Penggajian', icon: 'hand-o-right', params: { sortField: 'createdAt', sortDirection: 'DESC' } }
- label: 'Alamat'
role: 'ROLE_HRSTAFF'
icon: 'id-card-o'
Expand Down
9 changes: 6 additions & 3 deletions config/admin/payroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ easy_admin:
class: 'KejawenLab\Application\SemartHris\Entity\PayrollPeriod'
controller: 'KejawenLab\Application\SemartHris\Controller\Admin\AdminController'
disabled_actions: ['show', 'new', 'edit', 'delete']
templates:
list: 'app/payroll/list.html.twig'
search:
title: 'Period Penggajian'
title: 'Penggajian'
fields: ['code', 'name']
list:
role: 'ROLE_HRSTAFF'
title: 'Period Penggajian'
title: 'Penggajian'
fields:
- { property: 'month', label: 'Bulan' }
- { property: 'company', label: 'Perusahaan' }
- { property: 'year', label: 'Tahun' }
- { property: 'month', label: 'Bulan' }
- { property: 'closed', label: 'Ditutup?' }

SalaryBenefit:
Expand Down
1 change: 1 addition & 0 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ twig:
time_format: '%env(string:SEMART_TIME_FORMAT)%'
hour_format: '%env(string:SEMART_HOUR_FORMAT)%'
currency_prefix: '%env(string:SEMART_CURRENCY_PREFIX)%'
currency_surfix: '%env(string:SEMART_CURRENCY_SURFIX)%'
decimal_precision: '%env(int:SEMART_DECIMAL_PRECISION)%'
decimal_point: '%env(string:SEMART_DECIMAL_POINT)%'
thousand_separator: '%env(string:SEMART_THOUSAND_SEPARATOR)%'
6 changes: 6 additions & 0 deletions config/semart/twig_extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ services:
- '@KejawenLab\Application\SemartHris\Repository\HolidayRepository'
tags:
- { name: 'twig.extension' }

KejawenLab\Application\SemartHris\Twig\EmployeeExtension:
arguments:
- '@KejawenLab\Application\SemartHris\Repository\EmployeeRepository'
tags:
- { name: 'twig.extension' }
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ interface AttendanceRepositoryInterface
* @param string|null $companyId
* @param string|null $departmentId
* @param string|null $shiftmentId
* @param string|null $employeeId
* @param array $sorts
*
* @return QueryBuilder
*/
public function getFilteredAttendance(\DateTimeInterface $startDate, \DateTimeInterface $endDate, string $companyId = null, string $departmentId = null, string $shiftmentId = null, array $sorts = []): QueryBuilder;
public function getFilteredAttendance(\DateTimeInterface $startDate, \DateTimeInterface $endDate, string $companyId = null, string $departmentId = null, string $shiftmentId = null, string $employeeId = null, array $sorts = []): QueryBuilder;

/**
* @param EmployeeInterface $employee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ interface OvertimeRepositoryInterface
* @param string|null $companyId
* @param string|null $departmentId
* @param string|null $shiftmentId
* @param string|null $employeeId
* @param array $sorts
*
* @return QueryBuilder
*/
public function getFilteredOvertime(\DateTimeInterface $startDate, \DateTimeInterface $endDate, string $companyId = null, string $departmentId = null, string $shiftmentId = null, array $sorts = []): QueryBuilder;
public function getFilteredOvertime(\DateTimeInterface $startDate, \DateTimeInterface $endDate, string $companyId = null, string $departmentId = null, string $shiftmentId = null, string $employeeId = null, array $sorts = []): QueryBuilder;

/**
* @param EmployeeInterface $employee
Expand Down
20 changes: 16 additions & 4 deletions src/Component/Salary/Model/PayrollPeriodInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace KejawenLab\Application\SemartHris\Component\Salary\Model;

use KejawenLab\Application\SemartHris\Component\Company\Model\CompanyInterface;

/**
* @author Muhamad Surya Iksanudin <surya.iksanudin@kejawenlab.com>
*/
Expand All @@ -13,14 +15,14 @@ interface PayrollPeriodInterface
public function getId(): string;

/**
* @return int|null
* @return CompanyInterface|null
*/
public function getMonth(): int;
public function getCompany(): ? CompanyInterface;

/**
* @param int|null $month
* @param CompanyInterface|null $company
*/
public function setMonth(int $month): void;
public function setCompany(CompanyInterface $company = null): void;

/**
* @return int|null
Expand All @@ -32,6 +34,16 @@ public function getYear(): int;
*/
public function setYear(int $year): void;

/**
* @return int|null
*/
public function getMonth(): int;

/**
* @param int|null $month
*/
public function setMonth(int $month): void;

/**
* @return bool
*/
Expand Down
13 changes: 7 additions & 6 deletions src/Controller/Admin/AttendanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public function processUploadAction(Request $request)
*/
public function processAction(Request $request)
{
$month = (int) $request->get('month', date('n'));
$month = (int) $request->request->get('month', date('n'));
$employeeRepository = $this->container->get(EmployeeRepository::class);
if ($ids = $request->get('employees')) {
if ($ids = $request->request->get('employees')) {
$employees = $employeeRepository->finds($ids);
} else {
$employees = $employeeRepository->findAll();
Expand Down Expand Up @@ -204,11 +204,12 @@ protected function createListQueryBuilder($entityClass, $sortDirection, $sortFie
{
$startDate = \DateTime::createFromFormat(SettingUtil::get(SettingUtil::DATE_FORMAT), $this->request->query->get('startDate', date(SettingUtil::get(SettingUtil::FIRST_DATE_FORMAT))));
$endDate = \DateTime::createFromFormat(SettingUtil::get(SettingUtil::DATE_FORMAT), $this->request->query->get('endDate', date(SettingUtil::get(SettingUtil::LAST_DATE_FORMAT))));
$companyId = $this->request->get('company');
$departmentId = $this->request->get('department');
$shiftmentId = $this->request->get('shiftment');
$companyId = $this->request->query->get('company');
$departmentId = $this->request->query->get('department');
$shiftmentId = $this->request->query->get('shiftment');
$employeeId = $this->request->query->get('employeeId');

return $this->container->get(AttendanceRepository::class)->getFilteredAttendance($startDate, $endDate, $companyId, $departmentId, $shiftmentId, [$sortField => $sortDirection]);
return $this->container->get(AttendanceRepository::class)->getFilteredAttendance($startDate, $endDate, $companyId, $departmentId, $shiftmentId, $employeeId, [$sortField => $sortDirection]);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Admin/CompanyAddressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function addressPerCompanyAction(Request $request)
if ($company) {
$session = $this->get('session');
$session->set('companyId', $company->getId());
$session->set('companyCode', $company->getCode());
}

return $this->redirectToRoute('easyadmin', array(
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/Admin/CompanyDepartmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function departmentPerCompanyAction(Request $request)

$session = $this->get('session');
$session->set('companyId', $company->getId());
$session->set('companyCode', $company->getCode());

return $this->redirectToRoute('easyadmin', array(
'action' => 'list',
Expand Down Expand Up @@ -111,6 +112,6 @@ protected function createListQueryBuilder($entityClass, $sortDirection, $sortFie
*/
protected function createSearchQueryBuilder($entityClass, $searchQuery, array $searchableFields, $sortField = null, $sortDirection = null, $dqlFilter = null)
{
return $this->container->get(CompanyRepository::class)->createCompanyDepartmentQueryBuilder($sortField, $sortDirection, $dqlFilter);
return $this->container->get(CompanyRepository::class)->createSearchCompanyDepartmentQueryBuilder($searchQuery, $sortField, $sortDirection, $dqlFilter);
}
}
Loading

0 comments on commit 1cdcae3

Please sign in to comment.