mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?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 OneTimeProcessBookingForEInvoiceV2Command extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
|
|
protected $signature = 'one-time-process-booking-for-einvoice-command';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'One time batch process 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('marking', ['821671', '773802','106426'])->get();
|
|
|
|
$count = 0;
|
|
foreach ($bookings as $booking) {
|
|
ProcessBookingForEInvoiceV2CommandJob::dispatch($booking);
|
|
$count++;
|
|
Log::info('Processed: ' . $count);
|
|
Log::info('Booking ID: ' . $booking->marking . ' for E-Invoice ');
|
|
}
|
|
}
|
|
}
|