ソースを参照

fix stampe font-size varianti

marcofalabretti 1ヶ月前
コミット
60353e287a
2個のファイルの変更9行の追加3行の削除
  1. 3
    0
      app/Services/Stampa/CreaComandaCucina.php
  2. 6
    3
      app/Services/Stampa/CreaScontrino.php

+ 3
- 0
app/Services/Stampa/CreaComandaCucina.php ファイルの表示

@@ -188,7 +188,10 @@ class CreaComandaCucina
188 188
             }
189 189
             if($riga->has_variante->isNotEmpty()){
190 190
                 foreach($riga->has_variante as $variante){
191
+                    $printer->setTextSize(1, 2);
191 192
                     $printer->text(">> ".$variante->variante_piatto->label."\n");
193
+                    $printer->setTextSize(1, 1);
194
+               
192 195
                 }
193 196
             }
194 197
 

+ 6
- 3
app/Services/Stampa/CreaScontrino.php ファイルの表示

@@ -110,7 +110,8 @@ class CreaScontrino
110 110
         foreach ($ordine->righe_ordine as $riga) {
111 111
             $nome = $riga->piatto?->nome ?? 'Voce';
112 112
             $q = max(1, (int) ($riga->quantita ?? 1));
113
-            $lineTotal = (float) ($riga->prezzo ?? 0);
113
+            $lineTotal = (float) ($riga->piatto->prezzo*$q ?? 0);
114
+            // $lineTotal = (float) ($riga->prezzo ?? 0);
114 115
             $amount = $this->moneyShort($lineTotal);
115 116
             $nameLines = $this->wrapText($this->sanitizeLine($nome), $itemWidth);
116 117
 
@@ -162,9 +163,11 @@ class CreaScontrino
162 163
     {
163 164
         $printer->text($this->separator());
164 165
         $printer->setEmphasis(true);
165
-        $printer->text("TOTALE ORDINE\n");
166 166
         $printer->setTextSize(2, 2);
167
-        $printer->text($this->money($totale)."\n");
167
+        $printer->text(
168
+            str_pad('TOTALE', self::LINE_WIDTH - self::COL_TOTAL_WIDTH) .
169
+            str_pad($this->money($totale), self::COL_TOTAL_WIDTH, ' ', STR_PAD_LEFT) . "\n"
170
+        );
168 171
         $printer->setTextSize(1, 1);
169 172
         $printer->setEmphasis(false);
170 173
         $printer->text("\n");

読み込み中…
キャンセル
保存