Bug fixes

This commit is contained in:
Hillel Coren 2015-11-18 23:37:11 +02:00
parent 947b9690d6
commit 4a0906a92c
7 changed files with 21 additions and 12 deletions

View File

@ -124,7 +124,7 @@ class InvoiceController extends BaseController
Session::put('invitation_key', $invitationKey); // track current invitation
$account->loadLocalizationSettings($client);
$invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date);
$invoice->due_date = Utils::fromSqlDate($invoice->due_date);
$invoice->is_pro = $account->isPro();

View File

@ -104,6 +104,8 @@ class StartupCheck
} elseif (Auth::check()) {
$locale = Auth::user()->account->language ? Auth::user()->account->language->locale : DEFAULT_LOCALE;
App::setLocale($locale);
} elseif (session(SESSION_LOCALE)) {
App::setLocale(session(SESSION_LOCALE));
}
// Make sure the account/user localization settings are in the session

View File

@ -394,7 +394,6 @@ if (!defined('CONTACT_EMAIL')) {
define('DEFAULT_DATE_PICKER_FORMAT', 'M d, yyyy');
define('DEFAULT_DATETIME_FORMAT', 'F j, Y g:i a');
define('DEFAULT_DATETIME_MOMENT_FORMAT', 'MMM D, YYYY h:mm:ss a');
define('DEFAULT_QUERY_CACHE', 120); // minutes
define('DEFAULT_LOCALE', 'en');
define('DEFAULT_MAP_ZOOM', 10);

View File

@ -232,7 +232,7 @@ class Utils
return floatval($value);
}
public static function formatMoney($value, $currencyId = false)
public static function formatMoney($value, $currencyId = false, $showSymbol = true)
{
if (!$currencyId) {
$currencyId = Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY);
@ -252,9 +252,11 @@ class Utils
$value = 0;
}
Cache::add('currency', $currency, DEFAULT_QUERY_CACHE);
return $currency->symbol.number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator);
$str = '';
if ($showSymbol) {
$str .= $currency->symbol;
}
return $str . number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator);
}
public static function pluralize($string, $count)

View File

@ -939,6 +939,8 @@ return array(
'user_unregistered' => 'Please register your account to send emails',
'user_unconfirmed' => 'Please confirm your account to send emails',
'invalid_contact_email' => 'Invalid contact email',
]
],
'client_portal' => 'Client Portal',
);

View File

@ -1,8 +1,13 @@
<!DOCTYPE html>
<html lang="{{App::getLocale()}}">
<head>
<title>{{ isset($title) ? ($title . ' | Invoice Ninja') : ('Invoice Ninja | ' . trans('texts.app_title')) }}</title>
<meta name="description" content="{{ isset($description) ? $description : trans('texts.app_description') }}" />
@if (isset($hideLogo) && $hideLogo)
<title>{{ trans('texts.client_portal') }}</title>
@else
<title>{{ isset($title) ? ($title . ' | Invoice Ninja') : ('Invoice Ninja | ' . trans('texts.app_title')) }}</title>
<meta name="description" content="{{ isset($description) ? $description : trans('texts.app_description') }}" />
<link href="{{ asset('favicon.png') }}" rel="shortcut icon">
@endif
<!-- Source: https://github.com/hillelcoren/invoice-ninja -->
<!-- Version: {{ NINJA_VERSION }} -->
@ -21,7 +26,6 @@
<link href="//fonts.googleapis.com/css?family=Roboto:400,700,900,100&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Roboto+Slab:400,300,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="{{ asset('favicon.png?test') }}" rel="shortcut icon">
<link rel="canonical" href="{{ NINJA_APP_URL }}/{{ Request::path() }}" />
<script src="{{ asset('js/built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>

View File

@ -180,7 +180,7 @@ header h3 em {
<header>
@if ($client)
<h2>{{ $client->getDisplayName() }}</h2>
<h3>{{ trans('texts.invoice') . ' ' . $invoiceNumber }}<span>|&nbsp; {{ trans('texts.amount_due') }}: <em>{{ Utils::formatMoney($amount, $currencyId) }} {{ $currencyCode }}</em></span></h3>
<h3>{{ trans('texts.invoice') . ' ' . $invoiceNumber }}<span>|&nbsp; {{ trans('texts.amount_due') }}: <em>{{ Utils::formatMoney($amount, $currencyId, false) }} {{ $currencyCode }}</em></span></h3>
@elseif ($paymentTitle)
<h2>{{ $paymentTitle }}<br/><small>{{ $paymentSubtitle }}</small></h2>
@endif
@ -359,7 +359,7 @@ header h3 em {
<div class="row">
<div class="col-md-4 col-md-offset-4">
{!! Button::success(strtoupper(trans('texts.pay_now') . ' - ' . Utils::formatMoney($amount, $currencyId) ))->submit()->block()->large() !!}
{!! Button::success(strtoupper(trans('texts.pay_now') . ' - ' . Utils::formatMoney($amount, $currencyId, false) . ' ' . $currencyCode ))->submit()->block()->large() !!}
</div>
</div>