debug do email to vt

This commit is contained in:
omair saleh
2021-12-12 22:02:53 +08:00
parent 04eca9c88e
commit 40f71c0a34
+2 -2
View File
@@ -66,13 +66,13 @@ class EmailDoToVTCommand extends Command
$zip = new ZipArchive();
if ($zip->open($attachment, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) {
echo 'yes';
$bookings = \App\Models\Booking::where('status', ApprovalStatus::COMPLETED)->whereDate('updated_at', Carbon::yesterday())
->whereHas('transactions', function ($query){
return $query->where('type', TransactionType::BILL)->where('issuer', 2);
})->get();
if(!$bookings){ return; }
if(!count($bookings)){ return; }
foreach ($bookings as $booking) {
$file = $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();