From 94a9c42369439ddad6fe5514e93bd76b2d067b33 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 6 Jan 2014 08:48:11 +0200 Subject: [PATCH] bug fixes --- app/config/gae-development/database.php | 0 app/config/gae-production/cache.php | 0 app/config/gae-production/database.php | 0 app/config/gae-production/session.php | 0 app/controllers/InvoiceController.php | 10 +++------- app/models/Client.php | 4 ++-- app/models/Invoice.php | 20 ++++++++++++++++++++ app/ninja/mailers/ContactMailer.php | 5 +++-- app/views/clients/edit.blade.php | 2 +- app/views/header.blade.php | 2 +- app/views/invoices/edit.blade.php | 10 ++++++---- public/css/style.css | 4 ++++ 12 files changed, 40 insertions(+), 17 deletions(-) mode change 100755 => 100644 app/config/gae-development/database.php mode change 100755 => 100644 app/config/gae-production/cache.php mode change 100755 => 100644 app/config/gae-production/database.php mode change 100755 => 100644 app/config/gae-production/session.php diff --git a/app/config/gae-development/database.php b/app/config/gae-development/database.php old mode 100755 new mode 100644 diff --git a/app/config/gae-production/cache.php b/app/config/gae-production/cache.php old mode 100755 new mode 100644 diff --git a/app/config/gae-production/database.php b/app/config/gae-production/database.php old mode 100755 new mode 100644 diff --git a/app/config/gae-production/session.php b/app/config/gae-production/session.php old mode 100755 new mode 100644 diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 2841a7b45a..10e190fcc1 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -150,7 +150,7 @@ class InvoiceController extends \BaseController { $client->save(); Activity::viewInvoice($invitation); - + $data = array( 'invoice' => $invoice->hidePrivateFields(), 'invitation' => $invitation @@ -300,12 +300,7 @@ class InvoiceController extends \BaseController { { $invoice = Invoice::scope($publicId)->with('account.country', 'client.contacts', 'invoice_items')->firstOrFail(); Utils::trackViewed($invoice->invoice_number . ' - ' . $invoice->client->getDisplayName(), ENTITY_INVOICE); - - $invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date); - $invoice->due_date = Utils::fromSqlDate($invoice->due_date); - $invoice->start_date = Utils::fromSqlDate($invoice->start_date); - $invoice->end_date = Utils::fromSqlDate($invoice->end_date); - + $contactIds = DB::table('invitations') ->join('contacts', 'contacts.id', '=','invitations.contact_id') ->where('invitations.invoice_id', '=', $invoice->id) @@ -453,6 +448,7 @@ class InvoiceController extends \BaseController { { $message = ' and created client'; $url = URL::to('clients/' . $client->public_id); + Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT, $url); } diff --git a/app/models/Client.php b/app/models/Client.php index e232f4226e..2c91d6f02e 100755 --- a/app/models/Client.php +++ b/app/models/Client.php @@ -60,8 +60,8 @@ class Client extends EntityModel } $contact = $this->contacts()->first(); - - return $contact->getFullName(); + + return $contact->getDisplayName(); } public function getEntityType() diff --git a/app/models/Invoice.php b/app/models/Invoice.php index 24abf3127e..cf89b184fb 100755 --- a/app/models/Invoice.php +++ b/app/models/Invoice.php @@ -37,6 +37,26 @@ class Invoice extends EntityModel return ENTITY_INVOICE; } + public function getInvoiceDateAttribute($value) + { + return Utils::fromSqlDate($value); + } + + public function getDueDateAttribute($value) + { + return Utils::fromSqlDate($value); + } + + public function getStartDateAttribute($value) + { + return Utils::fromSqlDate($value); + } + + public function getEndDateAttribute($value) + { + return Utils::fromSqlDate($value); + } + public function isSent() { return $this->invoice_status_id >= INVOICE_STATUS_SENT; diff --git a/app/ninja/mailers/ContactMailer.php b/app/ninja/mailers/ContactMailer.php index 4e41c0ca0e..7148fd3b8b 100755 --- a/app/ninja/mailers/ContactMailer.php +++ b/app/ninja/mailers/ContactMailer.php @@ -12,13 +12,14 @@ class ContactMailer extends Mailer { public function sendInvoice(Invoice $invoice) { $view = 'invoice'; - $data = array('link' => URL::to('view') . '/' . $invoice->invoice_key); $subject = ''; foreach ($invoice->invitations as $invitation) { - //$invitation->date_sent = + $invitation->sent_date = Carbon::now()->toDateTimeString(); $invitation->save(); + + $data = array('link' => URL::to('view') . '/' . $invitation->invitation_key); $this->sendTo($invitation->contact->email, $subject, $view, $data); diff --git a/app/views/clients/edit.blade.php b/app/views/clients/edit.blade.php index 1e82b34d16..35bf06cf88 100755 --- a/app/views/clients/edit.blade.php +++ b/app/views/clients/edit.blade.php @@ -2,7 +2,7 @@ @section('onReady') - $('input#first_name').focus(); + $('input#name').focus(); @stop @section('content') diff --git a/app/views/header.blade.php b/app/views/header.blade.php index e418ae2630..f9d03a0b3e 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -383,7 +383,7 @@ @if (Session::has('message')) setTimeout(function() { $('.alert-info').fadeOut(); - }, 5000); + }, 3000); @endif @yield('onReady') diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 7e4652e5c1..9e93e44735 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -86,7 +86,7 @@
@@ -347,9 +347,11 @@ {{ Former::checkbox('invoice_taxes')->text('Enable specifying an invoice tax') ->label('Settings')->data_bind('checked: $root.invoice_taxes, enable: $root.tax_rates().length > 1') }} - {{ Former::checkbox('invoice_item_taxes')->text('Enable specifying line item taxes') + {{ Former::checkbox('invoice_item_taxes')->text('Enable specifying line item taxes')->addOnGroupClass('no-space-bottom') ->label(' ')->data_bind('checked: $root.invoice_item_taxes, enable: $root.tax_rates().length > 1') }} +
+