Minor fixes

This commit is contained in:
David Bomba 2021-12-01 21:29:48 +11:00
parent 0c267131c4
commit 2eeaea61a5
4 changed files with 6 additions and 4 deletions

View File

@ -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',

View File

@ -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);

View File

@ -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;
}

View File

@ -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);
}
}