From 80a5d8a37d00545cca9e11e22c8a9fddd97a75b2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 12 Jan 2023 14:21:54 +1100 Subject: [PATCH] Fixes for pro rata invoicing --- .../Ninja/RenewalFailureNotification.php | 79 +++++++++++++++++++ .../Subscription/SubscriptionService.php | 5 +- 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 app/Notifications/Ninja/RenewalFailureNotification.php diff --git a/app/Notifications/Ninja/RenewalFailureNotification.php b/app/Notifications/Ninja/RenewalFailureNotification.php new file mode 100644 index 000000000000..f9cf87f18afd --- /dev/null +++ b/app/Notifications/Ninja/RenewalFailureNotification.php @@ -0,0 +1,79 @@ +notification_message}"; + + return (new SlackMessage) + ->success() + ->from(ctrans('texts.notification_bot')) + ->image('https://app.invoiceninja.com/favicon.png') + ->content($content); + } +} diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index ba5fe331a5ad..fd517f04d169 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -679,8 +679,9 @@ class SubscriptionService } else if($last_invoice->balance > 0) { - $pro_rata_charge_amount = $this->calculateProRataCharge($last_invoice, $old_subscription); - nlog("pro rata charge = {$pro_rata_charge_amount}"); + $last_invoice = null; + // $pro_rata_charge_amount = $this->calculateProRataCharge($last_invoice, $old_subscription); + // nlog("pro rata charge = {$pro_rata_charge_amount}"); } else {