mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Minor fixes
This commit is contained in:
parent
0c267131c4
commit
2eeaea61a5
@ -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',
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user