diff --git a/.gitignore b/.gitignore index 0ff666ab56..7cc6a79c6d 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /app/config/staging /app/config/development +/app/storage/ /public/logo /bootstrap/compiled.php /vendor diff --git a/app/controllers/ActivityController.php b/app/controllers/ActivityController.php index 04713f2106..38c6192393 100755 --- a/app/controllers/ActivityController.php +++ b/app/controllers/ActivityController.php @@ -7,7 +7,7 @@ class ActivityController extends \BaseController { $clientId = Client::getPrivateId($clientPublicId); return Datatable::collection(Activity::scope()->where('client_id','=',$clientId)->get()) - ->addColumn('date', function($model) { return Utils::timestampToDateString($model->created_at); }) + ->addColumn('date', function($model) { return Utils::timestampToDateTimeString($model->created_at); }) ->addColumn('message', function($model) { return $model->message; }) ->addColumn('balance', function($model) { return '$' . $model->balance; }) ->orderColumns('date') diff --git a/app/controllers/ClientController.php b/app/controllers/ClientController.php index 4853145135..f3bd68a401 100755 --- a/app/controllers/ClientController.php +++ b/app/controllers/ClientController.php @@ -15,12 +15,12 @@ class ClientController extends \BaseController { return View::make('list', array( 'entityType'=>ENTITY_CLIENT, 'title' => '- Clients', - 'columns'=>['checkbox', 'Client', 'Contact', 'Balance', 'Last Login', 'Date Created', 'Email', 'Phone', 'Action'] + 'columns'=>['checkbox', 'Client', 'Contact', 'Date Created', 'Email', 'Phone', 'Last Login', 'Balance', 'Action'] )); } public function getDatatable() - { + { $query = DB::table('clients') ->join('contacts', 'contacts.client_id', '=', 'clients.id') ->where('clients.account_id', '=', Auth::user()->account_id) @@ -28,15 +28,30 @@ class ClientController extends \BaseController { ->where('contacts.is_primary', '=', true) ->select('clients.public_id','clients.name','contacts.first_name','contacts.last_name','clients.balance','clients.last_login','clients.created_at','clients.work_phone','contacts.email'); + $filter = Input::get('sSearch'); + if ($filter) + { + $query->where(function($query) use ($filter) + { + $query->where('clients.name', 'like', '%'.$filter.'%') + ->orWhere('contacts.first_name', 'like', '%'.$filter.'%') + ->orWhere('contacts.last_name', 'like', '%'.$filter.'%') + ->orWhere('contacts.email', 'like', '%'.$filter.'%'); + }); + } + + //$query->get(); + //dd(DB::getQueryLog()); + return Datatable::query($query) ->addColumn('checkbox', function($model) { return ''; }) ->addColumn('name', function($model) { return link_to('clients/' . $model->public_id, $model->name); }) ->addColumn('first_name', function($model) { return $model->first_name . ' ' . $model->last_name; }) - ->addColumn('balance', function($model) { return '$' . $model->balance; }) - ->addColumn('last_login', function($model) { return Utils::timestampToDateString($model->last_login); }) ->addColumn('created_at', function($model) { return Utils::timestampToDateString($model->created_at); }) ->addColumn('email', function($model) { return $model->email ? HTML::mailto($model->email, $model->email) : ''; }) ->addColumn('work_phone', function($model) { return Utils::formatPhoneNumber($model->work_phone); }) + ->addColumn('last_login', function($model) { return Utils::timestampToDateString($model->last_login); }) + ->addColumn('balance', function($model) { return '$' . $model->balance; }) ->addColumn('dropdown', function($model) { return ' - + {{ Former::legend('Additional Info') }} + {{ Former::select('client_size_id')->addOption('','')->label('Size') + ->fromQuery($clientSizes, 'name', 'id')->select($client ? $client->client_size_id : '') }} + {{ Former::select('client_industry_id')->addOption('','')->label('Industry') + ->fromQuery($clientIndustries, 'name', 'id')->select($client ? $client->client_industry_id : '') }} + {{ Former::textarea('notes') }} + diff --git a/app/views/clients/show.blade.php b/app/views/clients/show.blade.php index df0e70eef5..1c35e43729 100755 --- a/app/views/clients/show.blade.php +++ b/app/views/clients/show.blade.php @@ -49,6 +49,7 @@

{{ $client->getAddress() }}

{{ $client->getPhone() }}

{{ $client->getNotes() }}

+

{{ $client->getIndustry() }}

@@ -91,7 +92,7 @@ @if ($hasRecurringInvoices) {{ Datatable::table() - ->addColumn('Total', 'How Often', 'Start Date', 'End Date') + ->addColumn('How Often', 'Start Date', 'End Date', 'Invoice Total') ->setUrl(url('api/recurring_invoices/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -99,7 +100,7 @@ @endif {{ Datatable::table() - ->addColumn('Invoice Number', 'Total', 'Amount Due', 'Invoice Date', 'Due Date', 'Status') + ->addColumn('Invoice Number', 'Invoice Date', 'Invoice Total', 'Balance Due', 'Due Date', 'Status') ->setUrl(url('api/invoices/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -109,7 +110,7 @@
{{ Datatable::table() - ->addColumn('Transaction Reference', 'Invoice', 'Amount', 'Payment Date') + ->addColumn('Transaction Reference', 'Invoice', 'Payment Amount', 'Payment Date') ->setUrl(url('api/payments/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) @@ -119,7 +120,7 @@
{{ Datatable::table() - ->addColumn('Amount', 'Credit Date') + ->addColumn('Credit Amount', 'Credit Date') ->setUrl(url('api/credits/' . $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) diff --git a/app/views/datatable.blade.php b/app/views/datatable.blade.php index 7f2f08eb14..ece747931c 100755 --- a/app/views/datatable.blade.php +++ b/app/views/datatable.blade.php @@ -7,7 +7,11 @@ @foreach($columns as $i => $c) - + @if ($c == 'checkbox' && $hasCheckboxes = true) @else @@ -45,7 +49,6 @@ {{ json_encode($k) }}: {{ $o }}, @endforeach "fnDrawCallback": function(oSettings) { - //jQuery.uniform.update(); if (window.onDatatableReady) { window.onDatatableReady(); } diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 308c19f68f..b45db23116 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -33,22 +33,25 @@ @endif
-
+
{{ Former::select('client')->addOption('', '')->fromQuery($clients, 'name', 'public_id')->select($client ? $client->public_id : '')->addGroupClass('client_select') ->help('Create new client') }} + {{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }} {{ Former::textarea('notes') }} +
-
+
- {{ Former::checkbox('recurring')->text('Enable automatic invoicing | Learn more')->onchange('toggleRecurring()') + {{ Former::checkbox('recurring')->text('Enable | Learn more')->onchange('toggleRecurring()') ->inlineHelp($invoice && $invoice->last_sent_date ? 'Last invoice sent ' . Utils::timestampToDateString($invoice->last_sent_date) : '') }}
{{ Former::text('invoice_number')->label('Invoice #') }} + {{ Former::text('po_number')->label('PO number') }} {{ Former::text('invoice_date') }} {{ Former::text('due_date') }} - {{-- Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") --}} + {{-- Former::text('invoice_date')->label('Invoice Date')->data_date_format('yyyy-mm-dd') --}}
+
@@ -71,8 +77,8 @@ Item Description - Unit Cost - Quantity + Rate + Units Line Total @@ -130,7 +136,7 @@ - Invoice Total + Balance Due @@ -146,11 +152,15 @@ @endif
+ + {{ Button::normal('Download PDF', array('onclick' => 'onDownloadClick()')) }} + @if ($invoice) - {{ DropdownButton::normal('Download PDF', + {{ DropdownButton::primary('Save Invoice', Navigation::links( array( - array('Download PDF', "javascript:onDownloadClick()"), + array('Save Invoice', "javascript:onSaveClick()"), + array('Clone Invoice', "javascript:onCloneClick()"), array(Navigation::DIVIDER), array('Archive Invoice', "javascript:onArchiveClick()"), array('Delete Invoice', "javascript:onDeleteClick()"), @@ -158,18 +168,17 @@ ) , array('id'=>'actionDropDown','style'=>'text-align:left'))->split(); }} @else - {{ Button::normal('Download PDF', array('onclick' => 'onDownloadClick()')) }} + {{ Button::primary_submit('Save Invoice') }} @endif - {{ Button::primary_submit('Save Invoice') }} {{ Button::primary('Send Email', array('id' => 'email_button', 'onclick' => 'onEmailClick()')) }}

 

- - + +