mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 04:23:59 +00:00
big commit
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Models\Company;
|
||||
use App\Models\CompanyConnections;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Http\Request;
|
||||
use Barryvdh\DomPDF\PDF;
|
||||
|
||||
class OrderController
|
||||
{
|
||||
@@ -26,8 +27,8 @@ class OrderController
|
||||
$order->company_id = $company->id;
|
||||
$order->order_number = $generatesUniqueOrderNumber->execute();
|
||||
$order->forwarder_id = 1;
|
||||
$order->address_id = $company->addresses()->first()->id;
|
||||
$order->contact_id = $company->contacts()->first()->id;
|
||||
$order->address_id = $company->addresses->first()->id;
|
||||
$order->contact_id = $company->contacts->first()->id;
|
||||
$order->current_step = 'MS_WAREHOUSE_RECEIVING';
|
||||
$order->multiple_batch = false;
|
||||
$order->complete = false;
|
||||
@@ -59,7 +60,7 @@ class OrderController
|
||||
HttpStatus::OK_WITH_MESSAGE, json_decode(OrderResource::collection($orders)->response()->getContent(), true)))->handler();
|
||||
}
|
||||
|
||||
public function download(String $orderId){
|
||||
public function download(String $orderId, PDF $pdf){
|
||||
/** @var Order $order */
|
||||
$order = order::findOrFail($orderId);
|
||||
/** @var Company $warehouse */
|
||||
@@ -78,7 +79,7 @@ class OrderController
|
||||
|
||||
return view('pages.pdf.qr', $data);
|
||||
|
||||
return $this->pdf->loadView('pages.pdf.qr', $data)->stream();
|
||||
return $pdf->loadView('pages.pdf.qr', $data)->download();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user