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