|
|
@@ -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");
|