M3 Integration fixes

This commit is contained in:
Mark Gregory
2026-09-22 11:08:39 +01:00
parent e4213d1fd6
commit dc97598278
7 changed files with 158 additions and 136 deletions
@@ -27,7 +27,20 @@ class FillBOL2Controller extends Controller
// # $bOL = BOL::findOrFail($request);
$bOL = $request;
$data = [
$data = $this->bolData($request, $bOL);
try {
$filledPdf = $this->bolService->fillBillOfLading($data);
return response()->download($filledPdf)->deleteFileAfterSend(true);
} catch (\Exception $e) {
return response()->json(['error' => $e->getMessage()], 500);
}
}
private function bolData(Request $request, Request $bOL): array
{
return [
'bol_number' => $request->input('BOL_number') ?? '1234567890',
'shipper_no' => $request->input('shipper_no') ?? '1234567890',
'date' => now()->format('m/d/Y') ?? '01/01/2000',
@@ -213,14 +226,6 @@ Line 5',
'NUMDROPS' => '',
];
try {
$filledPdf = $this->bolService->fillBillOfLading($data);
return response()->download($filledPdf)->deleteFileAfterSend(true);
} catch (\Exception $e) {
return response()->json(['error' => $e->getMessage()], 500);
}
}
}