mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Fix some issues reported by Mira on E-Invoice
This commit is contained in:
+4
-1
@@ -92,7 +92,10 @@ class BatchBookingsGenerateEInvoiceLogic extends AbstractControllerLogic
|
||||
|
||||
foreach ($bookings as $booking) {
|
||||
// Log::info('Booking ID: ' . $booking->marking);
|
||||
ProcessBookingForEInvoiceV2CommandJob::dispatch($booking);
|
||||
// if($booking->marking === '833065'){ //798334, 833065
|
||||
ProcessBookingForEInvoiceV2CommandJob::dispatch($booking);
|
||||
// }
|
||||
|
||||
}
|
||||
$this->processedCount = count($bookings);
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\V2;
|
||||
|
||||
|
||||
use App\Classes\Jobs\Commands\V2\OneTimeBatchProcessEInvoicesV2CommandJob;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessBookingForEInvoiceV2CommandJob;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Booking;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class RegenerateInvoiceEInvoiceV2Comman extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $signature = 'regenerate-invoice-einvoice-command';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Regenerate Invoice E-Invoices';
|
||||
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$bookings = Booking::whereIn('invoice_status', [ApprovalStatus::APPROVED])->whereIn('status', [ApprovalStatus::APPROVED])->get();
|
||||
|
||||
$count = 0;
|
||||
foreach ($bookings as $booking) {
|
||||
$count++;
|
||||
$start = Carbon::parse('2026-03-05 04:00:00');
|
||||
$end = Carbon::parse('2026-03-05 05:00:00');
|
||||
|
||||
if ($booking->updated_at->between($start, $end)) {
|
||||
Log::info('Processed: ' . $count . ', Booking ID: ' . $booking->marking . ', Booking updated: ' . $booking->updated_at);
|
||||
$booking->status = 3;
|
||||
$booking->save();
|
||||
}
|
||||
Log::info('Processed: ' . $count . ', Booking ID: ' . $booking->marking . ', Booking ID: ' . $booking->marking);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user