Update Framework, Invoices

This commit is contained in:
Kevin Adametz 2022-04-14 13:14:36 +02:00
parent cc5c147c27
commit 9b0b5feb7e
174 changed files with 28356 additions and 8093 deletions

View file

@ -10,10 +10,8 @@ use App\Models\ShippingCountry;
class Util
{
private static $postRoute = 'base.';
public static function getToken()
{
return hash_hmac('sha256', str_random(40), config('app.key'));
@ -57,15 +55,30 @@ class Util
}
public static function _thousands_separator(){
return \App::getLocale() === "en" ? ',' : '.';
}
public static function _decimal_separator(){
return \App::getLocale() === "en" ? '.' : ',';
}
public static function reFormatNumber($value){
return (float) str_replace(',', '.', self::_format_number($value));
}
public static function formatNumber($value, $dec=2){
if(\App::getLocale() === "en"){
return number_format($value, $dec, '.', ',');
return number_format($value, $dec, self::_decimal_separator(), self::_thousands_separator());
}
public static function cleanNumberFormat($num = 0, $dec = 2, $fullzero = false){
if($fullzero && $num == 0){
return number_format($num, $dec, self::_decimal_separator(), self::_thousands_separator());
}
return number_format($value, $dec, ',', '.');
return rtrim(rtrim(number_format($num, $dec, self::_decimal_separator(), self::_thousands_separator()),'0'), self::_decimal_separator());
}
public static function utf8ize( $mixed ) {