diff --git a/app/Http/Controllers/Auth/ContactForgotPasswordController.php b/app/Http/Controllers/Auth/ContactForgotPasswordController.php index 184d09475c2b..84a33915ec2a 100644 --- a/app/Http/Controllers/Auth/ContactForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ContactForgotPasswordController.php @@ -62,6 +62,9 @@ class ContactForgotPasswordController extends Controller $account = Account::find($account_id); $company = $account->companies->first(); + if(!$account) + $account = Account::first(); + return $this->render('auth.passwords.request', [ 'title' => 'Client Password Reset', 'passwordEmailRoute' => 'client.password.email', diff --git a/app/PaymentDrivers/Stripe/Charge.php b/app/PaymentDrivers/Stripe/Charge.php index 5984a5c80d6d..351399841c4e 100644 --- a/app/PaymentDrivers/Stripe/Charge.php +++ b/app/PaymentDrivers/Stripe/Charge.php @@ -56,7 +56,6 @@ class Charge if($cgt->gateway_type_id == GatewayType::BANK_TRANSFER) return (new ACH($this->stripe))->tokenBilling($cgt, $payment_hash); - nlog(" DB = ".$this->stripe->client->company->db); $amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total; $invoice = Invoice::whereIn('id', $this->transformKeys(array_column($payment_hash->invoices(), 'invoice_id')))->withTrashed()->first(); @@ -119,7 +118,6 @@ class Charge $data['message'] = $e->getMessage(); break; } - $this->stripe->processInternallyFailedPayment($this->stripe, $e); diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index a310c635d31e..981de82ef9bb 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -139,6 +139,7 @@ class InvoiceService // $this->invoice = (new UpdateBalance($this->invoice, $balance_adjustment, $is_draft))->run(); if ((bool)$this->invoice->is_deleted !== false) { + nlog($this->invoice->number . " is deleted returning"); return $this; } diff --git a/tests/Unit/SubscriptionsCalcTest.php b/tests/Unit/SubscriptionsCalcTest.php index 5b07efeb9478..98e07240bef3 100644 --- a/tests/Unit/SubscriptionsCalcTest.php +++ b/tests/Unit/SubscriptionsCalcTest.php @@ -94,13 +94,13 @@ class SubscriptionsCalcTest extends TestCase $refund = $pro_rata->refund($invoice->amount, Carbon::parse('2021-01-01'), Carbon::parse('2021-01-06'), $subscription->frequency_id); - $this->assertEquals(1.67, $refund); + $this->assertEquals(1.61, $refund); $pro_rata = new ProRata; $upgrade = $pro_rata->charge($target->price, Carbon::parse('2021-01-01'), Carbon::parse('2021-01-06'), $subscription->frequency_id); - $this->assertEquals(3.33, $upgrade); + $this->assertEquals(3.23, $upgrade); } }