-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/inikoo/aiku into main
- Loading branch information
Showing
9 changed files
with
301 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/* | ||
* Author: Raul Perusquia <raul@inikoo.com> | ||
* Created: Thu, 25 Jul 2024 14:54:12 Malaysia Time, Kuala Lumpur, Malaysia | ||
* Copyright (c) 2024, Raul A Perusquia Flores | ||
*/ | ||
|
||
namespace App\Actions\HumanResources\Timesheet\Pdf; | ||
|
||
use App\Actions\Traits\WithExportData; | ||
use App\Models\SysAdmin\Organisation; | ||
use Lorisleiva\Actions\ActionRequest; | ||
use Lorisleiva\Actions\Concerns\AsAction; | ||
use Lorisleiva\Actions\Concerns\WithAttributes; | ||
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf as PDF; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class PdfTimesheet | ||
{ | ||
use AsAction; | ||
use WithAttributes; | ||
use WithExportData; | ||
|
||
/** | ||
* @throws \Mpdf\MpdfException | ||
*/ | ||
public function handle(Organisation $organisation) | ||
{ | ||
$filename = __('Timesheets - ') . $organisation->name . '.pdf'; | ||
$config = [ | ||
'title' => $filename, | ||
'margin_left' => 8, | ||
'margin_right' => 8, | ||
'margin_top' => 2, | ||
'margin_bottom' => 2, | ||
'auto_page_break' => true, | ||
'auto_page_break_margin' => 10 | ||
]; | ||
|
||
return PDF::chunkLoadView('<html-separator/>', 'hr.timesheets', [ | ||
'filename' => $filename, | ||
'organisation' => $organisation, | ||
'employees' => $organisation->employees()->limit(10)->get(), | ||
], [], $config)->stream($filename); | ||
} | ||
|
||
/** | ||
* @throws \Mpdf\MpdfException | ||
*/ | ||
public function asController(Organisation $organisation, ActionRequest $request): Response | ||
{ | ||
return $this->handle($organisation); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/Http/Resources/Fulfilment/NewStoredItemDeltasInProcessForPalletResource.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* author Arya Permana - Kirin | ||
* created on 21-02-2025-15h-04m | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
<html> | ||
<head> | ||
<title>{{ $filename }}</title> | ||
<style> | ||
@page { | ||
size: 8.27in 11.69in; /* <length>{1,2} | auto | portrait | landscape */ | ||
/* 'em' 'ex' and % are not allowed; length values are width height */ | ||
margin-top: 15%; /* <any of the usual CSS values for margins> */ | ||
/*(% of page-box width for LR, of height for TB) */ | ||
margin-bottom: 13%; | ||
margin-right: 8%; | ||
margin-left: 8%; | ||
margin-header: 1mm; /* <any of the usual CSS values for margins> */ | ||
margin-footer: 5mm; /* <any of the usual CSS values for margins> */ | ||
marks: 'cross'; /*crop | cross | none*/ | ||
header: myheader; | ||
footer: myfooter; | ||
/* background: ... | ||
background-image: ... | ||
background-position ... | ||
background-repeat ... | ||
background-color ... | ||
background-gradient: ... */ | ||
} | ||
body { | ||
font-family: sans-serif; | ||
font-size: 10pt; | ||
} | ||
p { | ||
margin: 0pt; | ||
} | ||
h1 { | ||
font-size: 14pt | ||
} | ||
td { | ||
vertical-align: top; | ||
} | ||
.items td { | ||
border-left: 0.1mm solid #000000; | ||
border-right: 0.1mm solid #000000; | ||
border-bottom: 0.1mm solid #cfcfcf; | ||
padding-bottom: 4px; | ||
padding-top: 5px; | ||
} | ||
.items tbody.out_of_stock td { | ||
color: #777; | ||
font-style: italic | ||
} | ||
.items tbody.totals td { | ||
text-align: right; | ||
border: 0.1mm solid #222; | ||
} | ||
.items tr.total_net td { | ||
border-top: 0.3mm solid #000; | ||
} | ||
.items tr.total td { | ||
border-top: 0.3mm solid #000; | ||
border-bottom: 0.3mm solid #000; | ||
} | ||
.items tr.last td { | ||
border-bottom: 0.1mm solid #000000; | ||
} | ||
table thead td, table tr.title td { | ||
background-color: #EEEEEE; | ||
text-align: center; | ||
border: 0.1mm solid #000000; | ||
} | ||
.items td.blanktotal { | ||
background-color: #FFFFFF; | ||
border: 0mm none #000000; | ||
border-top: 0.1mm solid #000000; | ||
border-right: 0.1mm solid #000000; | ||
} | ||
div.inline { | ||
float: left; | ||
} | ||
.clearBoth { | ||
clear: both; | ||
} | ||
.hide { | ||
display: none | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<htmlpageheader name="myheader"> | ||
<br><br> | ||
<table width="100%" style="font-size: 9pt;"> | ||
<tr> | ||
<td style="width:250px;padding-left:10px;"> | ||
{{$organisation->name}} | ||
<div style="font-size:7pt"> | ||
{{$organisation->name}} | ||
</div> | ||
<div style="font-size:7pt"> | ||
{{$organisation->address->address_line_1}} | ||
</div> | ||
<div style="font-size:7pt"> | ||
{{$organisation->address->address_line_2}} | ||
</div> | ||
<div style="font-size:7pt"> | ||
{{$organisation->address->locality}} {{$organisation->address->postal_code}} | ||
</div> | ||
<div style="font-size:7pt"> | ||
www.{{$organisation->email}} | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
</htmlpageheader> | ||
|
||
<sethtmlpageheader name="myheader" value="on" show-this-page="1"/> | ||
<sethtmlpagefooter name="myfooter" value="on"/> | ||
|
||
@foreach($employees as $employee) | ||
<table width="100%" style="font-family: sans-serif; margin-top: 20px" cellpadding="0"> | ||
<tr> | ||
<td width="50%" style="vertical-align:bottom;border: 0mm solid #888888;"> | ||
<div> | ||
<div> | ||
{{ __('Employee') }}</b> | ||
({{ $employee->contact_name }}) | ||
</div> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
<br> | ||
<table class="items" width="100%" style="font-size: 9pt; border-collapse: collapse;" cellpadding="8"> | ||
<thead> | ||
<tr> | ||
<td style="width:14%;text-align:left">{{ __('Date') }}</td> | ||
<td style="text-align:left">{{ __('Start At') }}</td> | ||
<td style="text-align:left">{{ __('End At') }}</td> | ||
<td style="text-align:left;width:20% ">{{ __('Break Duration') }}</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
@foreach($employee->timesheets as $timesheet) | ||
<tr class="@if($loop->last) last @endif"> | ||
<td style="text-align:left">{{ $timesheet->date?->format('Y-m-d') }}</td> | ||
<td style="text-align:left">{{ $timesheet->start_at?->format('Y-m-d H:i') }}</td> | ||
<td style="text-align:right">{{ $timesheet->end_at?->format('Y-m-d H:i') }}</td> | ||
<td style="text-align:right">{{ Carbon\CarbonInterval::seconds($timesheet->breaks_duration)->cascade()->forHumans() }}</td> | ||
</tr> | ||
@endforeach | ||
|
||
</tbody> | ||
</table> | ||
<br> | ||
@endforeach | ||
<htmlpagefooter name="myfooter"> | ||
<div> | ||
|
||
</div> | ||
</htmlpagefooter> | ||
</body> | ||
</html> |
Oops, something went wrong.