mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-29 17:34:02 +00:00
E-Invoice - Receipt Voucher
This commit is contained in:
@@ -24,6 +24,12 @@ class BookingResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$eInvoice = false;
|
||||
$eInvoiceStartDate = Carbon::parse(env('E_INVOICE_START_DATE', '2025-07-01 00:00:00'));
|
||||
$bookingCreatedDate = Carbon::parse($this->created_at);
|
||||
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $this->company->e_invoice === 1) {
|
||||
$eInvoice = true;
|
||||
}
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'company' => new CompanyResource($this->company),
|
||||
@@ -76,7 +82,8 @@ class BookingResource extends JsonResource
|
||||
});
|
||||
});
|
||||
})->latest()->get())
|
||||
])
|
||||
]),
|
||||
'einvoice' => $eInvoice,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user