From b70b3c76d83380d1b671a04a9c80d2249e89966e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 4 Jul 2025 11:40:49 +1000 Subject: [PATCH 1/3] Disable recurring invoice payment notifications --- app/Listeners/Payment/PaymentNotification.php | 7 +++++++ lang/en/texts.php | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app/Listeners/Payment/PaymentNotification.php b/app/Listeners/Payment/PaymentNotification.php index 3a1172a765..b4d3de7753 100644 --- a/app/Listeners/Payment/PaymentNotification.php +++ b/app/Listeners/Payment/PaymentNotification.php @@ -110,6 +110,13 @@ class PaymentNotification implements ShouldQueue if (($key = array_search('mail', $methods)) !== false) { unset($methods[$key]); + //new check, IF the payment is on a recurring invoice AND the user had notifications disabled for recurring invoices. then we disable the notification for this payment. + $disabled_recurring_invoice_notifications = $this->findUserEntityNotificationType($payment, $company_user,['disable_recurring_payment_notification']); + + if ($payment->invoices->first()->recurring_id && (array_search('mail', $disabled_recurring_invoice_notifications) !== false)) { + continue; + } + $nmo = new NinjaMailerObject(); $nmo->mailable = new NinjaMailer((new EntityPaidObject($payment, $company_user->portalType()))->build()); $nmo->company = $event->company; diff --git a/lang/en/texts.php b/lang/en/texts.php index 9624a18aa4..d4c2059496 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5591,6 +5591,8 @@ $lang = array( 'docuninja_disable_warning' => 'This will remove all access to your DocuNinja account.', 'docuninja_downgrade_info' => 'Your user limit will automatically be reduced at the end of the current billing cycle.', 'recurring_invoice_item' => 'Recurring Invoice Item', + 'disable_recurring_payment_notification' => 'Disable Recurring Payment Notification', + 'disable_recurring_payment_notification_help' => 'Successful recurring invoice payment notifications will not be sent.', ); return $lang; From 288a25dbcef046033bae1c58f932af09018e4dee Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 6 Jul 2025 14:36:39 +1000 Subject: [PATCH 2/3] fixes for logging note activities --- app/Http/Controllers/ActivityController.php | 5 +++-- app/Services/Pdf/PdfService.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 63335ab127..8446f283e0 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -247,19 +247,20 @@ class ActivityController extends BaseController $activity->project_id = $entity->project_id; $activity->vendor_id = $entity->vendor_id; // no break + break; case Task::class: $activity->task_id = $entity->id; - $activity->expense_id = $entity->id; $activity->client_id = $entity->client_id; $activity->project_id = $entity->project_id; $activity->vendor_id = $entity->vendor_id; // no break + break; case Payment::class: $activity->payment_id = $entity->id; - $activity->expense_id = $entity->id; $activity->client_id = $entity->client_id; $activity->project_id = $entity->project_id; // no break + break; default: # code... break; diff --git a/app/Services/Pdf/PdfService.php b/app/Services/Pdf/PdfService.php index d506aa7811..40fde5bc20 100644 --- a/app/Services/Pdf/PdfService.php +++ b/app/Services/Pdf/PdfService.php @@ -92,7 +92,7 @@ class PdfService try { $html = $this->getHtml(); - // nlog($html); + // nlog($html); $pdf = $this->resolvePdfEngine($html); $numbered_pdf = $this->pageNumbering($pdf, $this->company); From ee6fb16266de25bf1770ac37013b30f4e75235cc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 6 Jul 2025 16:00:50 +1000 Subject: [PATCH 3/3] v5.12.8 --- VERSION.txt | 2 +- app/Console/Commands/CheckData.php | 7 +++++++ config/ninja.php | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 082eb5fd8c..31a3d5d53e 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.12.7 \ No newline at end of file +5.12.8 \ No newline at end of file diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index c89d888c23..f2eec912ae 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -191,11 +191,18 @@ class CheckData extends Command $this->logMessage("Task #{$task->id} has a time log with more than 4 elements"); + if($this->option('tasks') == 'true'){ + $log = [(int)$log[0], (int)$log[1], (string)$log[2], (bool)$log[3]]; + } + } + elseif(count($log) == 4){ + if($this->option('tasks') == 'true'){ $log = [(int)$log[0], (int)$log[1], (string)$log[2], (bool)$log[3]]; } } } + unset($log); // Unset the reference variable if($this->option('tasks') == 'true'){ $task->time_log = json_encode($time_log); diff --git a/config/ninja.php b/config/ninja.php index 0749b70e06..ada62f685d 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.12.7'), - 'app_tag' => env('APP_TAG', '5.12.7'), + 'app_version' => env('APP_VERSION', '5.12.8'), + 'app_tag' => env('APP_TAG', '5.12.8'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),