1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Add variable for invoices

This commit is contained in:
David Bomba 2022-02-09 19:09:41 +11:00
parent 6f5145a049
commit b06343c647
2 changed files with 17 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class GatewayType extends StaticModel
case self::FPX:
return ctrans('texts.fpx');
default:
return 'Undefined.';
return ' ';
break;
}
}

View File

@ -14,11 +14,13 @@ namespace App\Utils;
use App\Models\Country;
use App\Models\CreditInvitation;
use App\Models\GatewayType;
use App\Models\InvoiceInvitation;
use App\Models\QuoteInvitation;
use App\Models\RecurringInvoiceInvitation;
use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
use App\Utils\Ninja;
use App\Utils\Number;
use App\Utils\Traits\MakesDates;
use App\Utils\transformTranslations;
use Exception;
@ -512,6 +514,20 @@ class HtmlEngine
$data['$entity_images'] = ['value' => $this->generateEntityImagesMarkup(), 'label' => ''];
$data['$payments'] = ['value' => '', 'label' => ctrans('texts.payments')];
if ($this->entity_string == 'invoice' && $this->entity->payments()->exists()) {
$payment_list = '<br><br>';
foreach ($this->entity->payments as $payment) {
$payment_list .= ctrans('texts.payment_subject') . ": " . $this->formatDate($payment->date, $this->client->date_format()) . " :: " . Number::formatMoney($payment->amount, $this->client) ." :: ". GatewayType::getAlias($payment->gateway_type_id) . "<br>";
}
$data['$payments'] = ['value' => $payment_list, 'label' => ctrans('texts.payments')];
}
$arrKeysLength = array_map('strlen', array_keys($data));
array_multisort($arrKeysLength, SORT_DESC, $data);