mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for displaying negative numbers
This commit is contained in:
parent
8247ff41e4
commit
be88aa356a
@ -13,7 +13,6 @@
|
||||
namespace App\Services\PdfMaker;
|
||||
|
||||
use App\Models\Credit;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Quote;
|
||||
use App\Services\PdfMaker\Designs\Utilities\BaseDesign;
|
||||
use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
|
||||
|
@ -201,6 +201,8 @@ class Number
|
||||
public static function formatMoneyNoRounding($value, $entity) :string
|
||||
{
|
||||
$currency = $entity->currency();
|
||||
|
||||
$_value = $value;
|
||||
|
||||
$thousand = $currency->thousand_separator;
|
||||
$decimal = $currency->decimal_separator;
|
||||
@ -247,6 +249,12 @@ class Number
|
||||
} elseif ($swapSymbol) {
|
||||
return "{$value} ".trim($symbol);
|
||||
} elseif ($entity->getSetting('show_currency_code') === false) {
|
||||
|
||||
if ($_value < 0) {
|
||||
$value = substr($value, 1);
|
||||
$symbol = "-{$symbol}";
|
||||
}
|
||||
|
||||
return "{$symbol}{$value}";
|
||||
} else {
|
||||
return self::formatValue($value, $currency);
|
||||
|
Loading…
x
Reference in New Issue
Block a user