folivaresrios / chileanvacation
该包允许根据智利法律计算按比例递增的假期
1.2
2018-02-19 04:01 UTC
Requires
- php: >= 7.0.0
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2024-09-29 04:43:02 UTC
README
ChileanVacation 允许根据智利法律计算按比例递增的假期
要求
主分支具有以下要求
- PHP 7.0.0 或更高版本。
如何安装?
[使用 Composer]
将包添加到 composer.json - 如下所示
{ "require": { "folivaresrios/chileanvacation": "^1.0" } }
或通过命令行
composer require folivaresrios/chileanvacation
如何使用?
有 5 个不同的类:Person、Vacation、Holidays、Certificate、Job。为了使包具有灵活性,其中 4 个类具有接口,以便如果您已经在项目中实现了这些接口,则只需实现方法。
必须创建一个对象 Certificate,其中包含根据 afp 文件确定的认可年份以及该文件的交付日期。
new Certificate($quotedYears, $documentDeliveryDate);
还必须创建一个对象 Holiday,传递包含相应节假日日期的数组。
new Holiday($holidays);
Job 对象包含开始日期和结束日期,以及额外的节假日。
new Job(string $startDate, string $endDate = null, ChileanHoliday $holiday, Document $certificate = null)
最后是 Person 对象,它包含 Job。我们将使用最后一个对象进行操作并计算假期。
new Person(Employment $job)
方法被“封装”在 Vacation 类中。
new Vacation (string $requestedDate = null, int $requestedDays = 0, int $vacationDaysTaken = 0, int $progressiveDaysTaken = 0)
getReturnDate($holiday)
获取所请求假期的返回日期。
$this->getReturnDate(Holiday $holiday);
getProportionalDays($person)
获取所请求假期的返回日期。
$this->getProportionalDays(NaturalPerson $person);
getWorkedDays($person)
获取在该公司工作的天数。
$this->getWorkedDays(NaturalPerson $person)
getProgressiveVacations($person)
获取到该日期为止获得的按比例假期天数。
$this->getProgressiveVacations(NaturalPErson $person)
getRemainingProgressiveVacations($person)
获取到该日期为止剩余的按比例假期天数。
$this->getRemainingProgressiveVacations(NaturalPErson $person)
getRemainingProgressiveVacations($person)
获取到该日期为止剩余的递增假期天数。
$this->getRemainingVacations(NaturalPErson $person)
报告错误
如果您在使用 ChileanVacation 时遇到问题,请向 GitHub 提交“问题”。
贡献
如果您想为 ChileanVacation 做贡献,创建了一些您想添加的内容,请发送一个 pull requests 或在 issues 中打开一个。