1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Razi KAntorp 2014-04-02 11:45:52 +02:00
commit 43198e47f7
14 changed files with 216 additions and 100 deletions

View File

@ -167,9 +167,9 @@ class AccountController extends \BaseController {
private function export() private function export()
{ {
$output = fopen("php://output",'w') or die("Can't open php://output"); $output = fopen('php://output','w') or Utils::fatalError();
header("Content-Type:application/csv"); header('Content-Type:application/csv');
header("Content-Disposition:attachment;filename=export.csv"); header('Content-Disposition:attachment;filename=export.csv');
$clients = Client::scope()->get(); $clients = Client::scope()->get();
AccountController::exportData($output, $clients->toArray()); AccountController::exportData($output, $clients->toArray());
@ -303,14 +303,21 @@ class AccountController extends \BaseController {
Activity::createClient($client); Activity::createClient($client);
} }
$message = Utils::pluralize('Successfully created ? client', $count); $message = Utils::pluralize('created_client', $count);
Session::flash('message', $message); Session::flash('message', $message);
return Redirect::to('clients'); return Redirect::to('clients');
} }
private function mapFile() private function mapFile()
{ {
$file = Input::file('file'); $file = Input::file('file');
if ($file == null)
{
Session::flash('error', trans('texts.select_file'));
return Redirect::to('company/import_export');
}
$name = $file->getRealPath(); $name = $file->getRealPath();
require_once(app_path().'/includes/parsecsv.lib.php'); require_once(app_path().'/includes/parsecsv.lib.php');
@ -320,7 +327,8 @@ class AccountController extends \BaseController {
if (count($csv->data) + Client::scope()->count() > MAX_NUM_CLIENTS) if (count($csv->data) + Client::scope()->count() > MAX_NUM_CLIENTS)
{ {
Session::flash('error', "Sorry, this wll exceed the limit of " . MAX_NUM_CLIENTS . " clients"); $message = Utils::pluralize('limit_clients', MAX_NUM_CLIENTS);
Session::flash('error', $message);
return Redirect::to('company/import_export'); return Redirect::to('company/import_export');
} }
@ -424,7 +432,7 @@ class AccountController extends \BaseController {
$user->notify_paid = Input::get('notify_paid'); $user->notify_paid = Input::get('notify_paid');
$user->save(); $user->save();
Session::flash('message', 'Successfully updated settings'); Session::flash('message', trans('texts.updated_settings'));
return Redirect::to('company/notifications'); return Redirect::to('company/notifications');
} }
@ -474,7 +482,7 @@ class AccountController extends \BaseController {
$account->account_gateways()->save($accountGateway); $account->account_gateways()->save($accountGateway);
} }
Session::flash('message', 'Successfully updated settings'); Session::flash('message', trans('texts.updated_settings'));
return Redirect::to('company/payments'); return Redirect::to('company/payments');
} }
} }
@ -533,7 +541,7 @@ class AccountController extends \BaseController {
Event::fire('user.refresh'); Event::fire('user.refresh');
Session::flash('message', 'Successfully updated details'); Session::flash('message', trans('texts.updated_settings'));
return Redirect::to('company/details'); return Redirect::to('company/details');
} }
} }
@ -542,7 +550,7 @@ class AccountController extends \BaseController {
File::delete('logo/' . Auth::user()->account->account_key . '.jpg'); File::delete('logo/' . Auth::user()->account->account_key . '.jpg');
Session::flash('message', 'Successfully removed logo'); Session::flash('message', trans('texts.removed_logo'));
return Redirect::to('company/details'); return Redirect::to('company/details');
} }

View File

@ -229,17 +229,16 @@ class ClientController extends \BaseController {
if ($publicId) if ($publicId)
{ {
Session::flash('message', 'Successfully updated client'); Session::flash('message', trans('texts.updated_client'));
} }
else else
{ {
Activity::createClient($client); Activity::createClient($client);
Session::flash('message', 'Successfully created client'); Session::flash('message', trans('texts.created_client'));
} }
return Redirect::to('clients/' . $client->public_id); return Redirect::to('clients/' . $client->public_id);
} }
} }
public function bulk() public function bulk()
@ -248,7 +247,7 @@ class ClientController extends \BaseController {
$ids = Input::get('id') ? Input::get('id') : Input::get('ids'); $ids = Input::get('id') ? Input::get('id') : Input::get('ids');
$count = $this->clientRepo->bulk($ids, $action); $count = $this->clientRepo->bulk($ids, $action);
$message = Utils::pluralize('Successfully '.$action.'d ? client', $count); $message = Utils::pluralize($action.'d_client', $count);
Session::flash('message', $message); Session::flash('message', $message);
return Redirect::to('clients'); return Redirect::to('clients');

View File

@ -121,7 +121,7 @@ class CreditController extends \BaseController {
{ {
$this->creditRepo->save($publicId, Input::all()); $this->creditRepo->save($publicId, Input::all());
$message = $publicId ? 'Successfully updated credit' : 'Successfully created credit'; $message = trans('texts.created_credit');
Session::flash('message', $message); Session::flash('message', $message);
return Redirect::to('clients/' . Input::get('client')); return Redirect::to('clients/' . Input::get('client'));
} }
@ -135,7 +135,7 @@ class CreditController extends \BaseController {
if ($count > 0) if ($count > 0)
{ {
$message = Utils::pluralize('Successfully '.$action.'d ? credit', $count); $message = Utils::pluralize($action.'d_credit', $count);
Session::flash('message', $message); Session::flash('message', $message);
} }

View File

@ -89,6 +89,11 @@ return array(
'notifications' => 'Notifications', 'notifications' => 'Notifications',
'import_export' => 'Import/Export', 'import_export' => 'Import/Export',
'done' => 'Done', 'done' => 'Done',
'save' => 'Save',
'create' => 'Create',
'upload' => 'Upload',
'import' => 'Import',
'download' => 'Download',
'cancel' => 'Cancel', 'cancel' => 'Cancel',
'provide_email' => 'Please provide a valid email address', 'provide_email' => 'Please provide a valid email address',
'powered_by' => 'Powered by', 'powered_by' => 'Powered by',
@ -151,4 +156,88 @@ return array(
'select' => 'Select', 'select' => 'Select',
'edit_client' => 'Edit Client', 'edit_client' => 'Edit Client',
'edit_invoice' => 'Edit Invoice', 'edit_invoice' => 'Edit Invoice',
// client view page
'create_invoice' => 'Create Invoice',
'enter_credit' => 'Enter Credit',
'last_logged_in' => 'Last logged in',
'details' => 'Details',
'standing' => 'Standing',
'credit' => 'Credit',
'activity' => 'Activity',
'date' => 'Date',
'message' => 'Message',
'adjustment' => 'Adjustment',
'are_you_sure' => 'Are you sure?',
// new payment page
'payment_type_id' => 'Payment type',
'amount' => 'Amount',
// account/company pages
'work_email' => 'Email',
'language_id' => 'Language',
'timezone_id' => 'Timezone',
'date_format_id' => 'Date format',
'datetime_format_id' => 'Date/Time Format',
'users' => 'Users',
'localization' => 'Localization',
'remove_logo' => 'Remove logo',
'logo_help' => 'Supported: JPEG, GIF and PNG. Recommended height: 120px',
'payment_gateway' => 'Payment Gateway',
'gateway_id' => 'Provider',
'email_notifications' => 'Email Notifications',
'email_sent' => 'Email me when an invoice is <b>sent</b>',
'email_viewed' => 'Email me when an invoice is <b>viewed</b>',
'email_paid' => 'Email me when an invoice is <b>paid</b>',
'site_updates' => 'Site Updates',
'custom_messages' => 'Custom Messages',
'default_invoice_terms' => 'Set default invoice terms',
'default_email_footer' => 'Set default email signature',
'import_clients' => 'Import Client Data',
'csv_file' => 'Select CSV file',
'export_clients' => 'Export Client Data',
'select_file' => 'Please select a file',
'first_row_headers' => 'Use first row as headers',
'column' => 'Column',
'sample' => 'Sample',
'import_to' => 'Import to',
'client_will_create' => 'client will be created',
'clients_will_create' => 'clients will be created',
// application messages
'created_client' => 'Successfully created client',
'created_clients' => 'Successfully created ? clients',
'limit_clients' => 'Sorry, this will exceed the limit of ? clients',
'updated_settings' => 'Successfully updated settings',
'removed_logo' => 'Successfully removed logo',
'updated_client' => 'Successfully updated client',
'created_client' => 'Successfully created client',
'archived_client' => 'Successfully archived client',
'archived_clients' => 'Successfully archived ? clients',
'deleted_client' => 'Successfully deleted client',
'deleted_clients' => 'Successfully deleted ? clients',
'updated_invoice' => 'Successfully updated invoice',
'created_invoice' => 'Successfully created invoice',
'archived_invoice' => 'Successfully archived credit',
'archived_invoices' => 'Successfully archived ? credits',
'deleted_invoice' => 'Successfully deleted credit',
'deleted_invoices' => 'Successfully deleted ? credits',
'created_payment' => 'Successfully created payment',
'archived_payment' => 'Successfully archived payment',
'archived_payments' => 'Successfully archived ? payments',
'deleted_payment' => 'Successfully deleted payment',
'deleted_payments' => 'Successfully deleted ? payments',
'created_credit' => 'Successfully created credit',
'archived_credit' => 'Successfully archived credit',
'archived_credits' => 'Successfully archived ? credits',
'deleted_credit' => 'Successfully deleted credit',
'deleted_credits' => 'Successfully deleted ? credits',
); );

View File

@ -35,7 +35,7 @@ class Utils
{ {
if (!$message) if (!$message)
{ {
$message = "An error occurred, please try again later"; $message = "An error occurred, please try again later.";
} }
static::logError($message . ' ' . $exception); static::logError($message . ' ' . $exception);
@ -122,9 +122,10 @@ class Utils
public static function pluralize($string, $count) public static function pluralize($string, $count)
{ {
$field = $count == 1 ? $string : $string . 's';
$string = trans("texts.$field");
$string = str_replace('?', $count, $string); $string = str_replace('?', $count, $string);
$field = $count == 1 ? $string : $string . 's'; return $string;
return trans("texts.$field");
} }
public static function toArray($data) public static function toArray($data)

View File

@ -423,7 +423,7 @@ class Activity extends Eloquent
} }
$activity = Activity::getBlank(); $activity = Activity::getBlank();
$activity->client_id = $client->id; $activity->client_id = $credit->client_id;
$activity->credit_id = $credit->id; $activity->credit_id = $credit->id;
$activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_CREDIT; $activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_CREDIT;
$activity->message = Utils::encodeActivity(Auth::user(), 'archived ' . Utils::formatMoney($credit->balance, $credit->client->currency_id) . ' credit'); $activity->message = Utils::encodeActivity(Auth::user(), 'archived ' . Utils::formatMoney($credit->balance, $credit->client->currency_id) . ' credit');

View File

@ -161,7 +161,7 @@ HTML::macro('breadcrumbs', function() {
$crumb = trim($crumbs[$i]); $crumb = trim($crumbs[$i]);
if (!$crumb) continue; if (!$crumb) continue;
if ($crumb == 'company') return ''; if ($crumb == 'company') return '';
$name = ucwords($crumb); $name = trans("texts.$crumb");
if ($i==count($crumbs)-1) if ($i==count($crumbs)-1)
{ {
$str .= "<li class='active'>$name</li>"; $str .= "<li class='active'>$name</li>";

View File

@ -25,53 +25,53 @@
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-5">
{{ Former::legend('Details') }} {{ Former::legend('details') }}
{{ Former::text('name') }} {{ Former::text('name') }}
{{ Former::text('work_email')->label('Email') }} {{ Former::text('work_email') }}
{{ Former::text('work_phone')->label('Phone') }} {{ Former::text('work_phone') }}
{{ Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp('Supported: JPEG, GIF and PNG. Recommended height: 120px') }} {{ Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp(trans('texts.logo_help')) }}
@if (file_exists($account->getLogoPath())) @if (file_exists($account->getLogoPath()))
<center> <center>
{{ HTML::image($account->getLogoPath(), "Logo") }} &nbsp; {{ HTML::image($account->getLogoPath(), "Logo") }} &nbsp;
<a href="#" onclick="deleteLogo()">Remove logo</a> <a href="#" onclick="deleteLogo()">{{ trans('texts.remove_logo') }}</a>
</center><br/> </center><br/>
@endif @endif
{{ Former::select('size_id')->addOption('','')->label('Size') {{ Former::select('size_id')->addOption('','')
->fromQuery($sizes, 'name', 'id') }} ->fromQuery($sizes, 'name', 'id') }}
{{ Former::select('industry_id')->addOption('','')->label('Industry') {{ Former::select('industry_id')->addOption('','')
->fromQuery($industries, 'name', 'id') }} ->fromQuery($industries, 'name', 'id') }}
{{ Former::legend('Address') }} {{ Former::legend('address') }}
{{ Former::text('address1')->label('Street') }} {{ Former::text('address1') }}
{{ Former::text('address2')->label('Apt/Suite') }} {{ Former::text('address2') }}
{{ Former::text('city') }} {{ Former::text('city') }}
{{ Former::text('state')->label('State/Province') }} {{ Former::text('state') }}
{{ Former::text('postal_code') }} {{ Former::text('postal_code') }}
{{ Former::select('country_id')->addOption('','')->label('Country') {{ Former::select('country_id')->addOption('','')
->fromQuery($countries, 'name', 'id') }} ->fromQuery($countries, 'name', 'id') }}
</div> </div>
<div class="col-md-5 col-md-offset-1"> <div class="col-md-5 col-md-offset-1">
{{ Former::legend('Users') }} {{ Former::legend('users') }}
{{ Former::text('first_name') }} {{ Former::text('first_name') }}
{{ Former::text('last_name') }} {{ Former::text('last_name') }}
{{ Former::text('email') }} {{ Former::text('email') }}
{{ Former::text('phone') }} {{ Former::text('phone') }}
{{ Former::legend('Localization') }} {{ Former::legend('localization') }}
{{ Former::select('language_id')->addOption('','')->label('Language') {{ Former::select('language_id')->addOption('','')
->fromQuery($languages, 'name', 'id') }} ->fromQuery($languages, 'name', 'id') }}
{{ Former::select('currency_id')->addOption('','')->label('Currency') {{ Former::select('currency_id')->addOption('','')
->fromQuery($currencies, 'name', 'id') }} ->fromQuery($currencies, 'name', 'id') }}
{{ Former::select('timezone_id')->addOption('','')->label('Timezone') {{ Former::select('timezone_id')->addOption('','')
->fromQuery($timezones, 'location', 'id') }} ->fromQuery($timezones, 'location', 'id') }}
{{ Former::select('date_format_id')->addOption('','')->label('Date Format') {{ Former::select('date_format_id')->addOption('','')
->fromQuery($dateFormats, 'label', 'id') }} ->fromQuery($dateFormats, 'label', 'id') }}
{{ Former::select('datetime_format_id')->addOption('','')->label('Date/Time Format') {{ Former::select('datetime_format_id')->addOption('','')
->fromQuery($datetimeFormats, 'label', 'id') }} ->fromQuery($datetimeFormats, 'label', 'id') }}
@ -79,7 +79,7 @@
</div> </div>
<center> <center>
{{ Button::lg_success_submit('Save')->append_with_icon('floppy-disk') }} {{ Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk') }}
</center> </center>
{{ Former::close() }} {{ Former::close() }}
@ -95,7 +95,7 @@
}); });
function deleteLogo() { function deleteLogo() {
if (confirm('Are you sure?')) { if (confirm("{{ trans('texts.are_you_sure') }}")) {
$('.removeLogoForm').submit(); $('.removeLogoForm').submit();
} }
} }

View File

@ -4,14 +4,14 @@
@parent @parent
{{ Former::open_for_files('company/import_map')->addClass('col-md-9 col-md-offset-1') }} {{ Former::open_for_files('company/import_map')->addClass('col-md-9 col-md-offset-1') }}
{{ Former::legend('Import Client Data') }} {{ Former::legend('import_clients') }}
{{ Former::file('file')->label('Select CSV file') }} {{ Former::file('file')->label(trans('texts.csv_file')) }}
{{ Former::actions( Button::lg_info_submit('Upload')->append_with_icon('open') ) }} {{ Former::actions( Button::lg_info_submit(trans('texts.upload'))->append_with_icon('open') ) }}
{{ Former::close() }} {{ Former::close() }}
{{ Former::open('company/export')->addClass('col-md-9 col-md-offset-1') }} {{ Former::open('company/export')->addClass('col-md-9 col-md-offset-1') }}
{{ Former::legend('Export Client Data') }} {{ Former::legend('export_clients') }}
{{ Former::actions( Button::lg_primary_submit('Download')->append_with_icon('download-alt') ) }} {{ Former::actions( Button::lg_primary_submit(trans('texts.download'))->append_with_icon('download-alt') ) }}
{{ Former::close() }} {{ Former::close() }}
@stop @stop

View File

@ -4,20 +4,20 @@
@parent @parent
{{ Former::open('company/import_export') }} {{ Former::open('company/import_export') }}
{{ Former::legend('Import Clients') }} {{ Former::legend('import_clients') }}
@if ($headers) @if ($headers)
<label for="header_checkbox"> <label for="header_checkbox">
<input type="checkbox" name="header_checkbox" id="header_checkbox" {{ $hasHeaders ? 'CHECKED' : '' }}> Use first row as headers <input type="checkbox" name="header_checkbox" id="header_checkbox" {{ $hasHeaders ? 'CHECKED' : '' }}> {{ trans('texts.first_row_headers') }}
</label> </label>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Column</th> <th>{{ trans('texts.column') }}</th>
<th class="col_sample">Sample</th> <th class="col_sample">{{ trans('texts.sample') }}</th>
<th>Import To</th> <th>{{ trans('texts.import_to') }}</th>
</tr> </tr>
</thead> </thead>
@for ($i=0; $i<count($headers); $i++) @for ($i=0; $i<count($headers); $i++)
@ -33,7 +33,7 @@
@endif @endif
{{ Former::actions( Button::lg_primary_submit('Import'), '&nbsp;|&nbsp;', link_to('company/import', 'Cancel') ) }} {{ Former::actions( Button::lg_primary_submit(trans('texts.import')), '&nbsp;|&nbsp;', link_to('company/import', trans('texts.cancel')) ) }}
{{ Former::close() }} {{ Former::close() }}
<script type="text/javascript"> <script type="text/javascript">
@ -55,11 +55,11 @@
{ {
if (num == 1) if (num == 1)
{ {
$('#numClients').html('1 client will be created'); $('#numClients').html("1 {{ trans('texts.client_will_create') }}");
} }
else else
{ {
$('#numClients').html(num + ' clients will be created'); $('#numClients').html(num + " {{ trans('texts.clients_will_create') }}");
} }
} }

View File

@ -9,12 +9,12 @@
{{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }} {{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }}
{{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }} {{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }}
{{ Former::legend('Email Notifications') }} {{ Former::legend('email_notifications') }}
{{ Former::checkbox('notify_sent')->label('&nbsp;')->text('Email me when an invoice is <b>sent</b>') }} {{ Former::checkbox('notify_sent')->label('&nbsp;')->text(trans('texts.email_sent')) }}
{{ Former::checkbox('notify_viewed')->label('&nbsp;')->text('Email me when an invoice is <b>viewed</b>') }} {{ Former::checkbox('notify_viewed')->label('&nbsp;')->text(trans('texts.email_viewed')) }}
{{ Former::checkbox('notify_paid')->label('&nbsp;')->text('Email me when an invoice is <b>paid</b>') }} {{ Former::checkbox('notify_paid')->label('&nbsp;')->text(trans('texts.email_paid')) }}
{{ Former::legend('Site Updates') }} {{ Former::legend('site_updates') }}
<div class="form-group"> <div class="form-group">
<label for="invoice_terms" class="control-label col-lg-4 col-sm-4"></label> <label for="invoice_terms" class="control-label col-lg-4 col-sm-4"></label>
@ -36,11 +36,11 @@
</div></div> </div></div>
{{ Former::legend('Custom Messages') }} {{ Former::legend('custom_messages') }}
{{ Former::textarea('invoice_terms')->label('Set default invoice terms') }} {{ Former::textarea('invoice_terms')->label(trans('texts.default_invoice_terms')) }}
{{ Former::textarea('email_footer')->label('Set default email signature') }} {{ Former::textarea('email_footer')->label(trans('texts.default_email_footer')) }}
{{ Former::actions( Button::lg_success_submit('Save')->append_with_icon('floppy-disk') ) }} {{ Former::actions( Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk') ) }}
{{ Former::close() }} {{ Former::close() }}
@stop @stop

View File

@ -11,13 +11,13 @@
{{ Former::text('id')->value($client->public_id) }} {{ Former::text('id')->value($client->public_id) }}
</div> </div>
{{ DropdownButton::normal('Edit Client', {{ DropdownButton::normal(trans('texts.edit_client'),
Navigation::links( Navigation::links(
[ [
['Edit Client', URL::to('clients/' . $client->public_id . '/edit')], [trans('texts.edit_client'), URL::to('clients/' . $client->public_id . '/edit')],
[Navigation::DIVIDER], [Navigation::DIVIDER],
['Archive Client', "javascript:onArchiveClick()"], [trans('texts.archive_client'), "javascript:onArchiveClick()"],
['Delete Client', "javascript:onDeleteClick()"], [trans('texts.delete_client'), "javascript:onDeleteClick()"],
] ]
) )
, ['id'=>'normalDropDown'])->split(); }} , ['id'=>'normalDropDown'])->split(); }}
@ -25,9 +25,9 @@
{{ DropdownButton::primary('Create Invoice', {{ DropdownButton::primary('Create Invoice',
Navigation::links( Navigation::links(
[ [
['Create Invoice', URL::to('invoices/create/' . $client->public_id )], [trans('texts.create_invoice'), URL::to('invoices/create/' . $client->public_id )],
['Enter Payment', URL::to('payments/create/' . $client->public_id )], [trans('texts.enter_payment'), URL::to('payments/create/' . $client->public_id )],
['Enter Credit', URL::to('credits/create/' . $client->public_id )], [trans('texts.enter_credit'), URL::to('credits/create/' . $client->public_id )],
] ]
) )
, ['id'=>'primaryDropDown'])->split(); }} , ['id'=>'primaryDropDown'])->split(); }}
@ -39,43 +39,43 @@
<h2>{{ $client->getDisplayName() }}</h2> <h2>{{ $client->getDisplayName() }}</h2>
@if ($client->last_login > 0) @if ($client->last_login > 0)
<h3 style="margin-top:0px"><small> <h3 style="margin-top:0px"><small>
Last logged in {{ Utils::timestampToDateTimeString(strtotime($client->last_login)); }} {{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)); }}
</small></h3> </small></h3>
@endif @endif
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<h3>Details</h3> <h3>{{ trans('texts.details') }}</h3>
<p>{{ $client->getAddress() }}</p> <p>{{ $client->getAddress() }}</p>
<p>{{ $client->getPhone() }}</p> <p>{{ $client->getPhone() }}</p>
<p>{{ $client->getNotes() }}</p> <p>{{ $client->getNotes() }}</p>
<p>{{ $client->getIndustry() }}</p> <p>{{ $client->getIndustry() }}</p>
<p>{{ $client->getWebsite() }}</p> <p>{{ $client->getWebsite() }}</p>
<p>{{ $client->payment_terms ? "Payment terms: Net " . $client->payment_terms : '' }}</p> <p>{{ $client->payment_terms ? trans('texts.payment_terms') . ": Net " . $client->payment_terms : '' }}</p>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<h3>Contacts</h3> <h3>{{ trans('texts.contacts') }}</h3>
@foreach ($client->contacts as $contact) @foreach ($client->contacts as $contact)
{{ $contact->getDetails() }} {{ $contact->getDetails() }}
@endforeach @endforeach
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<h3>Standing <h3>{{ trans('texts.standing') }}
<table class="table" style="width:300px"> <table class="table" style="width:300px">
<tr> <tr>
<td><small>Paid to Date</small></td> <td><small>{{ trans('texts.paid_to_date') }}</small></td>
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->currency_id); }}</td> <td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->currency_id); }}</td>
</tr> </tr>
<tr> <tr>
<td><small>Balance</small></td> <td><small>{{ trans('texts.balance') }}</small></td>
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->currency_id); }}</td> <td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->currency_id); }}</td>
</tr> </tr>
@if ($credit > 0) @if ($credit > 0)
<tr> <tr>
<td><small>Credit</small></td> <td><small>{{ trans('texts.credit') }}</small></td>
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->currency_id); }}</td> <td style="text-align: right">{{ Utils::formatMoney($credit, $client->currency_id); }}</td>
</tr> </tr>
@endif @endif
@ -88,10 +88,10 @@
<p>&nbsp;</p> <p>&nbsp;</p>
<ul class="nav nav-tabs nav-justified"> <ul class="nav nav-tabs nav-justified">
{{ HTML::tab_link('#activity', 'Activity', true) }} {{ HTML::tab_link('#activity', trans('texts.activity'), true) }}
{{ HTML::tab_link('#invoices', 'Invoices') }} {{ HTML::tab_link('#invoices', trans('texts.invoices')) }}
{{ HTML::tab_link('#payments', 'Payments') }} {{ HTML::tab_link('#payments', trans('texts.payments')) }}
{{ HTML::tab_link('#credits', 'Credits') }} {{ HTML::tab_link('#credits', trans('texts.credits')) }}
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@ -99,7 +99,11 @@
<div class="tab-pane active" id="activity"> <div class="tab-pane active" id="activity">
{{ Datatable::table() {{ Datatable::table()
->addColumn('Date', 'Message', 'Balance', 'Adjustment') ->addColumn(
trans('texts.date'),
trans('texts.message'),
trans('texts.balance'),
trans('texts.adjustment'))
->setUrl(url('api/activities/'. $client->public_id)) ->setUrl(url('api/activities/'. $client->public_id))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
@ -112,7 +116,11 @@
@if ($hasRecurringInvoices) @if ($hasRecurringInvoices)
{{ Datatable::table() {{ Datatable::table()
->addColumn('How Often', 'Start Date', 'End Date', 'Invoice Total') ->addColumn(
trans('texts.frequency_id'),
trans('texts.start_date'),
trans('texts.end_date'),
trans('texts.invoice_total'))
->setUrl(url('api/recurring_invoices/' . $client->public_id)) ->setUrl(url('api/recurring_invoices/' . $client->public_id))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
@ -121,7 +129,13 @@
@endif @endif
{{ Datatable::table() {{ Datatable::table()
->addColumn('Invoice Number', 'Invoice Date', 'Invoice Total', 'Balance Due', 'Due Date', 'Status') ->addColumn(
trans('texts.invoice_number'),
trans('texts.invoice_date'),
trans('texts.invoice_total'),
trans('texts.balance_due'),
trans('texts.due_date'),
trans('texts.status'))
->setUrl(url('api/invoices/' . $client->public_id)) ->setUrl(url('api/invoices/' . $client->public_id))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
@ -132,7 +146,12 @@
<div class="tab-pane" id="payments"> <div class="tab-pane" id="payments">
{{ Datatable::table() {{ Datatable::table()
->addColumn('Invoice', 'Transaction Reference', 'Method', 'Payment Amount', 'Payment Date') ->addColumn(
trans('texts.invoice'),
trans('texts.transaction_reference'),
trans('texts.method'),
trans('texts.payment_amount'),
trans('texts.payment_date'))
->setUrl(url('api/payments/' . $client->public_id)) ->setUrl(url('api/payments/' . $client->public_id))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
@ -143,7 +162,11 @@
<div class="tab-pane" id="credits"> <div class="tab-pane" id="credits">
{{ Datatable::table() {{ Datatable::table()
->addColumn('Credit Amount', 'Credit Balance', 'Credit Date', 'Private Notes') ->addColumn(
trans('texts.credit_amount'),
trans('texts.credit_balance'),
trans('texts.credit_date'),
trans('texts.private_notes'))
->setUrl(url('api/credits/' . $client->public_id)) ->setUrl(url('api/credits/' . $client->public_id))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
@ -170,7 +193,7 @@
} }
function onDeleteClick() { function onDeleteClick() {
if (confirm('Are you sure you want to delete this client?')) { if (confirm("{{ trans('texts.are_you_sure') }}")) {
$('#action').val('delete'); $('#action').val('delete');
$('.mainForm').submit(); $('.mainForm').submit();
} }

View File

@ -19,7 +19,7 @@
{{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }} {{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }}
{{ Former::text('amount') }} {{ Former::text('amount') }}
{{ Former::text('credit_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }} {{ Former::text('credit_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }}
{{-- Former::select('currency_id')->addOption('','')->label('Currency') {{-- Former::select('currency_id')->addOption('','')
->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}} ->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}}
{{ Former::textarea('private_notes') }} {{ Former::textarea('private_notes') }}
@ -29,8 +29,8 @@
</div> </div>
</div> </div>
<center class="buttons"> <center class="buttons">
{{ Button::lg_primary_submit_success('Save')->append_with_icon('floppy-disk') }} {{ Button::lg_primary_submit_success(trans('texts.save'))->append_with_icon('floppy-disk') }}
{{ Button::lg_default_link('credits/' . ($credit ? $credit->public_id : ''), 'Cancel')->append_with_icon('remove-circle'); }} {{ Button::lg_default_link('credits/' . ($credit ? $credit->public_id : ''), trans('texts.cancel'))->append_with_icon('remove-circle'); }}
</center> </center>
{{ Former::close() }} {{ Former::close() }}
@ -54,10 +54,7 @@
$clientSelect.combobox(); $clientSelect.combobox();
$('#currency_id').combobox(); $('#currency_id').combobox();
$('#credit_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }})); $('#credit_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }}));
}); });

View File

@ -20,10 +20,10 @@
{{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }} {{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }}
{{ Former::select('invoice')->addOption('', '')->addGroupClass('invoice-select') }} {{ Former::select('invoice')->addOption('', '')->addGroupClass('invoice-select') }}
{{ Former::text('amount') }} {{ Former::text('amount') }}
{{ Former::select('payment_type_id')->addOption('','')->label('Payment type') {{ Former::select('payment_type_id')->addOption('','')
->fromQuery($paymentTypes, 'name', 'id') }} ->fromQuery($paymentTypes, 'name', 'id') }}
{{ Former::text('payment_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }} {{ Former::text('payment_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }}
{{-- Former::select('currency_id')->addOption('','')->label('Currency') {{-- Former::select('currency_id')->addOption('','')
->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}} ->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}}
</div> </div>
@ -33,8 +33,8 @@
</div> </div>
<center class="buttons"> <center class="buttons">
{{ Button::lg_primary_submit_success('Save')->append_with_icon('floppy-disk') }} {{ Button::lg_primary_submit_success(trans('texts.save'))->append_with_icon('floppy-disk') }}
{{ Button::lg_default_link('payments/' . ($payment ? $payment->public_id : ''), 'Cancel')->append_with_icon('remove-circle'); }} {{ Button::lg_default_link('payments/' . ($payment ? $payment->public_id : ''), trans('texts.cancel'))->append_with_icon('remove-circle'); }}
</center> </center>
{{ Former::close() }} {{ Former::close() }}
@ -49,7 +49,6 @@
populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }}); populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }});
$('#payment_type_id').combobox(); $('#payment_type_id').combobox();
$('#payment_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }})); $('#payment_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }}));
}); });