mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Clean up for createsingleaccount
This commit is contained in:
parent
0caa8ea8ce
commit
4364f0d168
@ -80,10 +80,7 @@ class CreateSingleAccount extends Command
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(config('ninja.is_docker'))
|
if (Ninja::isHosted() || config('ninja.is_docker') || !$this->confirm('Are you sure you want to inject dummy data?'))
|
||||||
return;
|
|
||||||
|
|
||||||
if (!$this->confirm('Are you sure you want to inject dummy data?'))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$this->invoice_repo = new InvoiceRepository();
|
$this->invoice_repo = new InvoiceRepository();
|
||||||
@ -105,6 +102,11 @@ class CreateSingleAccount extends Command
|
|||||||
{
|
{
|
||||||
$this->info('Creating Small Account and Company');
|
$this->info('Creating Small Account and Company');
|
||||||
|
|
||||||
|
if($user = User::where('email','small@example.com')->first())
|
||||||
|
{
|
||||||
|
$user->account->delete();
|
||||||
|
}
|
||||||
|
|
||||||
$account = Account::factory()->create();
|
$account = Account::factory()->create();
|
||||||
$company = Company::factory()->create([
|
$company = Company::factory()->create([
|
||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
|
@ -670,6 +670,8 @@ class SubscriptionService
|
|||||||
nlog("pro rata refund = {$pro_rata_refund_amount}");
|
nlog("pro rata refund = {$pro_rata_refund_amount}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nlog("{$pro_rata_refund_amount} + {$pro_rata_charge_amount} + {$this->subscription->price}");
|
||||||
|
|
||||||
$total_payable = $pro_rata_refund_amount + $pro_rata_charge_amount + $this->subscription->price;
|
$total_payable = $pro_rata_refund_amount + $pro_rata_charge_amount + $this->subscription->price;
|
||||||
|
|
||||||
if($total_payable > 0)
|
if($total_payable > 0)
|
||||||
|
@ -68,7 +68,8 @@ class PaymentTest extends TestCase
|
|||||||
$response = $this->withHeaders([
|
$response = $this->withHeaders([
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-TOKEN' => $this->token,
|
'X-API-TOKEN' => $this->token,
|
||||||
])->get('/api/v1/payments?match_transactions=true');
|
])->get('/api/v1/payments?match_transactions=true')
|
||||||
|
->assertStatus(200);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user