mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 06:54:02 +00:00
Merge branch 'dillon/90-e-invoice-e' into vapor/production
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Bookings\Processors\RegenerateInvoiceBookingProcessor;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -34,7 +35,15 @@ class ProcessBookingForEInvoiceV2CommandJob implements ShouldQueue
|
||||
Log::info(Carbon::now() . ': Start job - Processing single booking for E-Invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
(App()->make(RegenerateInvoiceBookingProcessor::class))->execute($this->booking);
|
||||
$documents = $this->booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::INVOICE, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->get();
|
||||
|
||||
if ($documents->isEmpty()) {
|
||||
Log::info("Processing for E-Invoice, booking id : " . $this->booking->marking);
|
||||
(App()->make(RegenerateInvoiceBookingProcessor::class))->execute($this->booking);
|
||||
}
|
||||
else{
|
||||
Log::info("NO Processing for E-Invoice, booking id : " . $this->booking->marking);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
|
||||
Reference in New Issue
Block a user