Browse Source

fix stampe font-size varianti

marcofalabretti 1 month ago
parent
commit
60353e287a

+ 3
- 0
app/Services/Stampa/CreaComandaCucina.php View File

188
             }
188
             }
189
             if($riga->has_variante->isNotEmpty()){
189
             if($riga->has_variante->isNotEmpty()){
190
                 foreach($riga->has_variante as $variante){
190
                 foreach($riga->has_variante as $variante){
191
+                    $printer->setTextSize(1, 2);
191
                     $printer->text(">> ".$variante->variante_piatto->label."\n");
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 View File

110
         foreach ($ordine->righe_ordine as $riga) {
110
         foreach ($ordine->righe_ordine as $riga) {
111
             $nome = $riga->piatto?->nome ?? 'Voce';
111
             $nome = $riga->piatto?->nome ?? 'Voce';
112
             $q = max(1, (int) ($riga->quantita ?? 1));
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
             $amount = $this->moneyShort($lineTotal);
115
             $amount = $this->moneyShort($lineTotal);
115
             $nameLines = $this->wrapText($this->sanitizeLine($nome), $itemWidth);
116
             $nameLines = $this->wrapText($this->sanitizeLine($nome), $itemWidth);
116
 
117
 
162
     {
163
     {
163
         $printer->text($this->separator());
164
         $printer->text($this->separator());
164
         $printer->setEmphasis(true);
165
         $printer->setEmphasis(true);
165
-        $printer->text("TOTALE ORDINE\n");
166
         $printer->setTextSize(2, 2);
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
         $printer->setTextSize(1, 1);
171
         $printer->setTextSize(1, 1);
169
         $printer->setEmphasis(false);
172
         $printer->setEmphasis(false);
170
         $printer->text("\n");
173
         $printer->text("\n");

Loading…
Cancel
Save