mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Fix an issue normal invoice not appearing for previous transfer after customer opted in for einvoice
This commit is contained in:
@@ -166,7 +166,8 @@ class CreateInvoiceTransactionV2Processor
|
||||
$eInvoice = false;
|
||||
$eInvoiceStartDate = Carbon::parse(env('E_INVOICE_START_DATE', '2025-07-01 00:00:00'));
|
||||
$bookingCreatedDate = Carbon::parse($booking->created_at);
|
||||
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $supplier->e_invoice === 1) {
|
||||
$eInvoiceRequestedDate = Carbon::parse($supplier->e_invoice_requested_at);
|
||||
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->isAfter($eInvoiceRequestedDate) && $supplier->e_invoice === 1) {
|
||||
$eInvoice = true;
|
||||
}
|
||||
$kvp = $booking->attributesKVP()->where('key', KVPKey::BOOKING_EINVOICE_ELIGIBLE)->first();
|
||||
|
||||
@@ -13,6 +13,7 @@ use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class BookingResource extends JsonResource
|
||||
{
|
||||
@@ -30,7 +31,7 @@ class BookingResource extends JsonResource
|
||||
$bookingCreatedDate = Carbon::parse($this->created_at);
|
||||
$eInvoiceRequestedDate = Carbon::parse($this->company->e_invoice_requested_at);
|
||||
//cief todo: 90 - for testing
|
||||
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $this->company->e_invoice === 1) { //&& $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 480 cief todo: 90
|
||||
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->isAfter($eInvoiceRequestedDate) && $this->company->e_invoice === 1) { //&& $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 480 cief todo: 90
|
||||
$eInvoice = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user