Changeset View
Changeset View
Standalone View
Standalone View
src/app/Documents/Receipt.php
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | protected function build() | ||||
if ($vatRate > 0) { | if ($vatRate > 0) { | ||||
$amount = round($amount * ((100 - $vatRate) / 100)); | $amount = round($amount * ((100 - $vatRate) / 100)); | ||||
$totalVat += $item->amount - $amount; | $totalVat += $item->amount - $amount; | ||||
} | } | ||||
$total += $amount; | $total += $amount; | ||||
if ($item->type == PaymentProvider::TYPE_REFUND) { | $type = $item->type ?? null; | ||||
if ($type == PaymentProvider::TYPE_REFUND) { | |||||
$description = \trans('documents.receipt-refund'); | $description = \trans('documents.receipt-refund'); | ||||
} elseif ($item->type == PaymentProvider::TYPE_CHARGEBACK) { | } elseif ($type == PaymentProvider::TYPE_CHARGEBACK) { | ||||
$description = \trans('documents.receipt-chargeback'); | $description = \trans('documents.receipt-chargeback'); | ||||
} else { | } else { | ||||
$description = \trans('documents.receipt-item-desc', ['site' => $appName]); | $description = \trans('documents.receipt-item-desc', ['site' => $appName]); | ||||
} | } | ||||
return [ | return [ | ||||
'amount' => $this->wallet->money($amount), | 'amount' => $this->wallet->money($amount), | ||||
'description' => $description, | 'description' => $description, | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |