From 213579ff347560e1fa1732b38167f58e5f68be52 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 14 Sep 2014 00:13:09 +0300 Subject: [PATCH] Bug fixes --- app/controllers/PaymentController.php | 6 ++---- app/models/Activity.php | 6 +++--- app/ninja/repositories/ClientRepository.php | 2 +- app/ninja/repositories/CreditRepository.php | 2 +- app/ninja/repositories/InvoiceRepository.php | 2 +- app/ninja/repositories/PaymentRepository.php | 2 +- app/views/header.blade.php | 3 ++- app/views/master.blade.php | 1 - app/views/public/header.blade.php | 1 + 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index 6bbb69f679d9..da6327963b07 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -122,12 +122,10 @@ class PaymentController extends \BaseController $gateway->$function($val); } - /* - if (!Utils::isProd()) + if (Utils::isNinjaDev()) { $gateway->setTestMode(true); - } - */ + } return $gateway; } diff --git a/app/models/Activity.php b/app/models/Activity.php index f9e17fa05e4b..c3a02ee67f5d 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -268,13 +268,13 @@ class Activity extends Eloquent { $activity = Activity::getBlank($client); $activity->contact_id = $payment->contact_id; - $activity->message = Utils::encodeActivity($payment->invitation->contact, 'entered ' . $payment->getName()); + $activity->message = Utils::encodeActivity($payment->invitation->contact, 'entered ' . $payment->getName() . ' for ', $payment->invoice); } else { $activity = Activity::getBlank(); - $message = $payment->payment_type_id == PAYMENT_TYPE_CREDIT ? 'applied credit' : 'entered ' . $payment->getName(); - $activity->message = Utils::encodeActivity(Auth::user(), $message); + $message = $payment->payment_type_id == PAYMENT_TYPE_CREDIT ? 'applied credit for ' : 'entered ' . $payment->getName() . ' for '; + $activity->message = Utils::encodeActivity(Auth::user(), $message, $payment->invoice); } $activity->payment_id = $payment->id; diff --git a/app/ninja/repositories/ClientRepository.php b/app/ninja/repositories/ClientRepository.php index b665b0e33553..4b56bc135f37 100755 --- a/app/ninja/repositories/ClientRepository.php +++ b/app/ninja/repositories/ClientRepository.php @@ -188,7 +188,7 @@ class ClientRepository public function bulk($ids, $action) { - $clients = Client::scope($ids)->get(); + $clients = Client::withTrashed()->scope($ids)->get(); foreach ($clients as $client) { diff --git a/app/ninja/repositories/CreditRepository.php b/app/ninja/repositories/CreditRepository.php index 704ebc54c1e2..1300bd5dc95b 100755 --- a/app/ninja/repositories/CreditRepository.php +++ b/app/ninja/repositories/CreditRepository.php @@ -66,7 +66,7 @@ class CreditRepository return 0; } - $credits = Credit::scope($ids)->get(); + $credits = Credit::withTrashed()->scope($ids)->get(); foreach ($credits as $credit) { diff --git a/app/ninja/repositories/InvoiceRepository.php b/app/ninja/repositories/InvoiceRepository.php index 66923e4157ed..dad05fbd6fa4 100755 --- a/app/ninja/repositories/InvoiceRepository.php +++ b/app/ninja/repositories/InvoiceRepository.php @@ -435,7 +435,7 @@ class InvoiceRepository return 0; } - $invoices = Invoice::scope($ids)->get(); + $invoices = Invoice::withTrashed()->scope($ids)->get(); foreach ($invoices as $invoice) { diff --git a/app/ninja/repositories/PaymentRepository.php b/app/ninja/repositories/PaymentRepository.php index 2cf96ceeae2e..f19b2ffb5830 100755 --- a/app/ninja/repositories/PaymentRepository.php +++ b/app/ninja/repositories/PaymentRepository.php @@ -112,7 +112,7 @@ class PaymentRepository return 0; } - $payments = Payment::scope($ids)->get(); + $payments = Payment::withTrashed()->scope($ids)->get(); foreach ($payments as $payment) { diff --git a/app/views/header.blade.php b/app/views/header.blade.php index d84b14aa2060..991f6e5a7367 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -385,7 +385,8 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice @endif -@if (!Utils::isNinjaProd() && !Utils::isNinjaDev()) +{{-- Per our license, please do not remove or modify this link. --}} +@if (!Utils::isNinja())
{{ trans('texts.powered_by') }} InvoiceNinja.com
@endif diff --git a/app/views/master.blade.php b/app/views/master.blade.php index 371b1f7e84d0..6ee2b16b7925 100755 --- a/app/views/master.blade.php +++ b/app/views/master.blade.php @@ -93,7 +93,6 @@ @yield('body') -