Bug fixes

This commit is contained in:
Hillel Coren 2014-05-25 21:38:40 +03:00
parent d4c31e3bbe
commit 0f5adbf62a
15 changed files with 43 additions and 19 deletions

View File

@ -8,11 +8,11 @@ class ActivityController extends \BaseController {
->join('clients', 'clients.id', '=', 'activities.client_id') ->join('clients', 'clients.id', '=', 'activities.client_id')
->where('clients.public_id', '=', $clientPublicId) ->where('clients.public_id', '=', $clientPublicId)
->where('activities.account_id', '=', Auth::user()->account_id) ->where('activities.account_id', '=', Auth::user()->account_id)
->select('activities.message', 'activities.created_at', 'clients.currency_id', 'activities.balance', 'activities.adjustment'); ->select('activities.id', 'activities.message', 'activities.created_at', 'clients.currency_id', 'activities.balance', 'activities.adjustment');
return Datatable::query($query) return Datatable::query($query)
//->addColumn('blank', function($model) { return ''; }) //->addColumn('blank', function($model) { return ''; })
->addColumn('created_at', function($model) { return Utils::timestampToDateTimeString(strtotime($model->created_at)); }) ->addColumn('id', function($model) { return Utils::timestampToDateTimeString(strtotime($model->created_at)); })
->addColumn('message', function($model) { return Utils::decodeActivity($model->message); }) ->addColumn('message', function($model) { return Utils::decodeActivity($model->message); })
->addColumn('balance', function($model) { return Utils::formatMoney($model->balance, $model->currency_id); }) ->addColumn('balance', function($model) { return Utils::formatMoney($model->balance, $model->currency_id); })
->addColumn('adjustment', function($model) { return $model->adjustment != 0 ? Utils::formatMoney($model->adjustment, $model->currency_id) : ''; }) ->addColumn('adjustment', function($model) { return $model->adjustment != 0 ? Utils::formatMoney($model->adjustment, $model->currency_id) : ''; })

View File

@ -99,7 +99,7 @@ class ClientController extends \BaseController {
'showBreadcrumbs' => false, 'showBreadcrumbs' => false,
'client' => $client, 'client' => $client,
'credit' => $client->getTotalCredit(), 'credit' => $client->getTotalCredit(),
'title' => '- ' . $client->getDisplayName(), 'title' => '- ' . trans('texts.view_client'),
'hasRecurringInvoices' => Invoice::scope()->where('is_recurring', '=', true)->whereClientId($client->id)->count() > 0 'hasRecurringInvoices' => Invoice::scope()->where('is_recurring', '=', true)->whereClientId($client->id)->count() > 0
); );
@ -142,7 +142,7 @@ class ClientController extends \BaseController {
'client' => $client, 'client' => $client,
'method' => 'PUT', 'method' => 'PUT',
'url' => 'clients/' . $publicId, 'url' => 'clients/' . $publicId,
'title' => '- ' . $client->name 'title' => '- ' . trans('texts.edit_client')
]; ];
$data = array_merge($data, self::getViewModel()); $data = array_merge($data, self::getViewModel());

View File

@ -120,10 +120,12 @@ class PaymentController extends \BaseController
$gateway->$function($val); $gateway->$function($val);
} }
/*
if (!Utils::isProd()) if (!Utils::isProd())
{ {
$gateway->setTestMode(true); $gateway->setTestMode(true);
} }
*/
return $gateway; return $gateway;
} }

View File

@ -360,6 +360,7 @@ return array(
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'view_client' => 'View Client',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',
'created_quote' => 'Successfully created quote', 'created_quote' => 'Successfully created quote',

View File

@ -374,6 +374,7 @@ return array(
'clone_quote' => 'Clone Quote', 'clone_quote' => 'Clone Quote',
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_client' => 'View Client',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',

View File

@ -358,6 +358,7 @@ return array(
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'view_client' => 'View Client',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',
'created_quote' => 'Successfully created quote', 'created_quote' => 'Successfully created quote',

View File

@ -360,6 +360,7 @@ return array(
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'view_client' => 'View Client',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',
'created_quote' => 'Successfully created quote', 'created_quote' => 'Successfully created quote',

View File

@ -360,6 +360,7 @@ return array(
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'view_client' => 'View Client',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',
'created_quote' => 'Successfully created quote', 'created_quote' => 'Successfully created quote',

View File

@ -361,6 +361,7 @@ return array(
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'view_client' => 'View Client',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',
'created_quote' => 'Successfully created quote', 'created_quote' => 'Successfully created quote',

View File

@ -349,6 +349,7 @@ return array(
'convert_to_invoice' => 'Convert to Invoice', 'convert_to_invoice' => 'Convert to Invoice',
'view_invoice' => 'View Invoice', 'view_invoice' => 'View Invoice',
'view_quote' => 'View Quote', 'view_quote' => 'View Quote',
'view_client' => 'View Client',
'updated_quote' => 'Successfully updated quote', 'updated_quote' => 'Successfully updated quote',
'created_quote' => 'Successfully created quote', 'created_quote' => 'Successfully created quote',

View File

@ -198,13 +198,24 @@ class InvoiceRepository
$invoice->client_id = $data['client_id']; $invoice->client_id = $data['client_id'];
$invoice->discount = Utils::parseFloat($data['discount']); $invoice->discount = Utils::parseFloat($data['discount']);
$invoice->invoice_number = trim($data['invoice_number']); $invoice->invoice_number = trim($data['invoice_number']);
$invoice->invoice_date = Utils::toSqlDate($data['invoice_date']);
$invoice->due_date = Utils::toSqlDate($data['due_date']);
$invoice->is_recurring = $data['is_recurring'] ? true : false; $invoice->is_recurring = $data['is_recurring'] ? true : false;
$invoice->invoice_date = Utils::toSqlDate($data['invoice_date']);
if ($invoice->is_recurring)
{
$invoice->frequency_id = $data['frequency_id'] ? $data['frequency_id'] : 0; $invoice->frequency_id = $data['frequency_id'] ? $data['frequency_id'] : 0;
$invoice->start_date = Utils::toSqlDate($data['start_date']); $invoice->start_date = Utils::toSqlDate($data['start_date']);
$invoice->end_date = Utils::toSqlDate($data['end_date']); $invoice->end_date = Utils::toSqlDate($data['end_date']);
$invoice->due_date = null;
}
else
{
$invoice->due_date = Utils::toSqlDate($data['due_date']);
$invoice->frequency_id = 0;
$invoice->start_date = null;
$invoice->end_date = null;
}
$invoice->terms = trim($data['terms']); $invoice->terms = trim($data['terms']);
$invoice->public_notes = trim($data['public_notes']); $invoice->public_notes = trim($data['public_notes']);
$invoice->po_number = trim($data['po_number']); $invoice->po_number = trim($data['po_number']);

View File

@ -126,8 +126,6 @@ Route::group(array('prefix' => 'api/v1', 'before' => 'auth.basic'), function()
Route::resource('clients', 'ClientApiController'); Route::resource('clients', 'ClientApiController');
}); });
// If you're self hosting set this to a value you think is fair
define('PRO_PLAN_PRICE', 50);
define('CONTACT_EMAIL', 'contact@invoiceninja.com'); define('CONTACT_EMAIL', 'contact@invoiceninja.com');
define('CONTACT_NAME', 'Invoice Ninja'); define('CONTACT_NAME', 'Invoice Ninja');
@ -217,7 +215,8 @@ define('NINJA_ACCOUNT_KEY', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h');
define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET); define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET);
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}'); define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
define('NINJA_URL', 'https://www.invoiceninja.com'); define('NINJA_URL', 'https://www.invoiceninja.com');
define('NINJA_VERSION', '1.1.0'); define('NINJA_VERSION', '1.2.0');
define('PRO_PLAN_PRICE', 50);
/* /*

View File

@ -74,8 +74,10 @@
} }
function gatewayLink(url) { function gatewayLink(url) {
//if (url.match('authorize')) var host = new URL(url).hostname;
openUrl(url, '/affiliate/' + new URL(url).hostname); if (host) {
openUrl(url, '/affiliate/' + host);
}
} }
$(document).ready(function() { $(document).ready(function() {

View File

@ -3,6 +3,9 @@
<head> <head>
<title>Invoice Ninja {{ isset($title) ? $title : ' - Free and Open-Source Online Invoicing' }}</title> <title>Invoice Ninja {{ isset($title) ? $title : ' - Free and Open-Source Online Invoicing' }}</title>
<!-- Source: https://github.com/hillelcoren/invoice-ninja -->
<!-- Version: {{ NINJA_VERSION }} -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta property="og:site_name" content="Invoice Ninja"></meta> <meta property="og:site_name" content="Invoice Ninja"></meta>
<meta property="og:url" content="https://www.invoiceninja.com"></meta> <meta property="og:url" content="https://www.invoiceninja.com"></meta>

View File

@ -430,7 +430,7 @@
<h3><img src="{{ asset('images/icon-secure-footer.png') }}" style="margin-right: 8px; margin-top: -5px;"></span>Safe & Secure</h3> <h3><img src="{{ asset('images/icon-secure-footer.png') }}" style="margin-right: 8px; margin-top: -5px;"></span>Safe & Secure</h3>
<img src="{{ asset('images/ssl-footer.png') }}"> <img src="{{ asset('images/ssl-footer.png') }}">
<hr> <hr>
<img src="{{ asset('images/opensource-footer.png') }}"> <a href="http://opensource.org/" target="_blank"><img src="{{ asset('images/opensource-footer.png') }}"></a>
</div> </div>
<!-- <!--