Feat: Shipping functionalities redesign, elta courier integration, commenting out acs since no integration can happen, flow updates
This commit is contained in:
1 parent
f411dec1da
commit
49ec4333af
63 files changed
+3143
-347
No files matched your search
@@ -45,11 +45,21 @@ class DownloadShipmentLabelController extends Controller
|
||||
|
||||
$service = app(CarrierFulfillmentInterface::class, ['carrier' => $shipment->carrier]);
|
||||
|
||||
// Manual carriers, typed-in vouchers and synced ones have no
|
||||
// carrier label to print.
|
||||
if (! $service || ! $shipment->hasCarrierLabel()) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$bytes = $service->printLabel($shipment);
|
||||
|
||||
// Printing may have just issued the voucher number (ELTA pending
|
||||
// vouchers), so name the file after the refreshed record.
|
||||
$name = $shipment->refresh()->tracking_reference ?? $shipment->id;
|
||||
|
||||
return response($bytes, 200, [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="shipment-'.$shipment->tracking_reference.'.pdf"',
|
||||
'Content-Disposition' => 'inline; filename="shipment-'.$name.'.pdf"',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user