]> _ Git - bastide-resah.git/commitdiff
wait #6906 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 May 2024 08:06:53 +0000 (10:06 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 May 2024 08:06:53 +0000 (10:06 +0200)
app/Http/Controllers/FluidbookController.php
resources/views/order.blade.php

index 1ced1c87777ff4ccffcfa5af7a37a4aa5e582108..4ba1e06f8ddad2821831d853f0a8f8e91e3ed28f 100644 (file)
@@ -126,13 +126,19 @@ class FluidbookController extends Controller
             $jd = [];
             $jt = [];
             foreach ($p as $k => $v) {
-                if (!$k || !$v) {
+
+                if (!$k) {
+                    continue;
+                }
+                $jt[] = $k;
+                $jd[] = $v;
+                if (!$v) {
                     continue;
                 }
 
                 $d[] = $k . " : " . $v;
-                $jd[] = $v;
-                $jt[] = $k;
+
+
             }
             $d[] = '--';
             $d[] = 'QUANTITE : ' . $i['quantity'];
@@ -154,7 +160,6 @@ class FluidbookController extends Controller
 
         $details_json['totals'] = ['TOTAL HT' => self::formatNumber($total),
             'TVA' => self::formatNumber($cumul_tva),
-            'ECOTAXE' => self::formatNumber($cumul_ecotaxe),
             'TOTAL TTC' => self::formatNumber($total + $cumul_tva),
         ];
         $details_json['titles'] = $jt;
index f026b9ece100ed6d98ded950024cfbf14bbff4fc..47383cba6cf4032c71a33ad26e0216ce63bf593f 100644 (file)
@@ -1,4 +1,8 @@
-<!DOCTYPE html>
+@php
+    $titlesReplace=['CONDITIONNEMENT'=>'COND.','QUANTITE'=>'QTÉ']
+@endphp
+
+    <!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="utf-8">
@@ -8,7 +12,8 @@
     <title></title>
 
     <!-- Fonts -->
-    <link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap" rel="stylesheet" type="text/css">
+    <link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
+          rel="stylesheet" type="text/css">
 
     <!-- Styles -->
     <style>
                 margin: 1cm;
             }
         }
+
         html, body {
             background-color: #fff;
             color: #000000;
             font-family: 'Source Sans 3', sans-serif;
             font-weight: 400;
             margin: 0;
-            font-size: 3mm;
+            font-size: 2.75mm;
         }
 
         main {
         }
 
-        table{
+        table {
             width: 100%;
             margin-top: 30px;
         }
 
-        td, th{
+        td, th {
             text-align: left;
         }
+
+        [data-title="DESIGNATION"] {
+            width: 8cm;
+        }
+
+
     </style>
 </head>
 <body>
 <main>
     <div style="position: absolute;top:0;right:0"><img style="width: 3cm" src="/images/logo-bastide.svg"></div>
     <div>
-        <h3>Demande # {{$order->id}} effectuée le {{(new DateTime($order->created_at))->setTimezone(new DateTimeZone('Europe/Paris'))->format('d/m/y à H:i')}}</h3>
+        <h3>Demande # {{$order->id}} effectuée
+            le {{(new DateTime($order->created_at))->setTimezone(new DateTimeZone('Europe/Paris'))->format('d/m/y à H:i')}}</h3>
         {{$client->firstname}} {{$client->name}}<br>
         {{$client->hospital}}<br><br>
         Numéro FINESS : <b>{{$client->finess}}</b><br>
     <table>
         <tr>
             @foreach($details->titles as $title)
-                <th>{{$title}}</th>
+                <th data-title="{{$title}}">{{$titlesReplace[$title]??$title}}</th>
             @endforeach
         </tr>
         @foreach($details->lines as $line)
             <tr>
-                @foreach($line as $cell)
-                    <td>{{$cell}}</td>
+                @foreach($line as $k=>$cell)
+                    <td data-title="{{$details->titles[$k]}}">{{$cell}}</td>
                 @endforeach
             </tr>
         @endforeach
-        <tr><td style="height:30px;border-bottom: 1px solid #000" colspan="{{count($details->titles)}}"></td></tr>
-        <tr><td style="height:30px;" colspan="{{count($details->titles)}}"></td></tr>
+        <tr>
+            <td style="height:30px;border-bottom: 1px solid #000" colspan="{{count($details->titles)}}"></td>
+        </tr>
+        <tr>
+            <td style="height:30px;" colspan="{{count($details->titles)}}"></td>
+        </tr>
         @foreach($details->totals as $k=>$v)
             <tr>
-                <td colspan="{{count($details->titles)-2}}"></td><td>{{$k}}</td><td><b>{{$v}}</b></td>
+                <td colspan="{{count($details->titles)-4}}"></td>
+                <td colspan="2" style="text-align: right;white-space: nowrap;">{{$k}}</td>
+                <td></td>
+                <td style="text-align: left;white-space: nowrap;"><b>{{$v}}</b></td>
             </tr>
         @endforeach
     </table>