From d404380ee88b56bf29ff432638ccff207165b4e7 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 3 Oct 2025 18:02:56 +0200 Subject: [PATCH] wait #7774 @1 --- .../Services/PumaOperation.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/PumaOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/PumaOperation.php index 5d7b09006..c918f694f 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/PumaOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/PumaOperation.php @@ -16,18 +16,18 @@ trait PumaOperation protected function setupPumaRoutes($segment, $routeName, $controller) { foreach (['services', 's'] as $s) { - Route::get($s . '/puma/planogramme/{id}_{cid}/{references}/{format?}/{filename?}', $controller . '@pumaPlanogramme')->middleware([CORSMiddleware::class])->withoutMiddleware([CheckIfAdmin::class, Authenticate::class, VerifyCsrfToken::class]); + Route::get($s . '/puma/planogramme/{id}_{cid}/{references}/{format?}/{filename?}/{pa?}/{pvp?}', $controller . '@pumaPlanogramme')->middleware([CORSMiddleware::class])->withoutMiddleware([CheckIfAdmin::class, Authenticate::class, VerifyCsrfToken::class]); } } - protected function pumaPlanogramme($id, $cid, $references, $format = 'html', $filename = '') + protected function pumaPlanogramme($id, $cid, $references, $format = 'html', $filename = '', $pa = 1, $pvp = 1) { if ($format === 'pdf') { $tmp = Files::tempnam() . '.pdf'; $cl = new CommandLine('node'); $cl->setArg(null, resource_path('puma/planogramme/print.js')); - $cl->setArg('url', 'https://' . $_SERVER['HTTP_HOST'] . '/s/puma/planogramme/' . $id . '_' . $cid . '/' . rawurlencode($references)) . '/html/' . $filename; + $cl->setArg('url', 'https://' . $_SERVER['HTTP_HOST'] . '/s/puma/planogramme/' . $id . '_' . $cid . '/' . rawurlencode($references) . '/html/' . $filename . '/' . $pa . '/' . $pvp); $cl->setArg('output', $tmp); $cl->execute(); return response()->download($tmp, $filename . '.pdf')->deleteFileAfterSend(true); @@ -120,7 +120,19 @@ trait PumaOperation $html .= '

' . $reference . '

'; $html .= '
' . $product['Désignation'] ?? '' . '
'; $html .= '
' . $product['Color Name'] ?? '' . '
'; - $html .= '
PA : ' . number_format(floatval($product['Tarif'] ?? 0), 2, ',', ' ') . ' € / PVP : ' . number_format(floatval($product['PVC'] ?? 0), 2, ',', ' ') . ' €
'; + if ($pa || $pvp) { + $html .= '
'; + if ($pa) { + $html .= 'PA : ' . number_format(floatval($product['Tarif'] ?? 0), 2, ',', ' ') . ' € '; + } + if ($pa && $pvp) { + $html .= ' / '; + } + if ($pvp) { + $html .= 'PVP : ' . number_format(floatval($product['PVC'] ?? 0), 2, ',', ' ') . ' €'; + } + $html .= '
'; + } $html .= ''; $html .= ''; } -- 2.39.5