mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:54:41 -04:00
Merged minor fixes
This commit is contained in:
parent
536b21595d
commit
dade97fbfa
@ -124,25 +124,23 @@ class AccountRepository
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$client = $this->getNinjaClient(Auth::user()->account);
|
$account = Auth::user()->account;
|
||||||
$invitation = $this->createNinjaInvoice($client);
|
$client = $this->getNinjaClient($account);
|
||||||
|
$invitation = $this->createNinjaInvoice($client, $account);
|
||||||
return $invitation;
|
return $invitation;
|
||||||
}
|
}
|
||||||
|
public function createNinjaInvoice($client, $clientAccount)
|
||||||
public function createNinjaInvoice($client)
|
|
||||||
{
|
{
|
||||||
$account = $this->getNinjaAccount();
|
$account = $this->getNinjaAccount();
|
||||||
$lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first();
|
$lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first();
|
||||||
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
|
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
|
||||||
|
|
||||||
$invoice = new Invoice();
|
$invoice = new Invoice();
|
||||||
$invoice->account_id = $account->id;
|
$invoice->account_id = $account->id;
|
||||||
$invoice->user_id = $account->users()->first()->id;
|
$invoice->user_id = $account->users()->first()->id;
|
||||||
$invoice->public_id = $publicId;
|
$invoice->public_id = $publicId;
|
||||||
$invoice->client_id = $client->id;
|
$invoice->client_id = $client->id;
|
||||||
$invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
|
$invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
|
||||||
$invoice->invoice_date = Auth::user()->account->getRenewalDate();
|
$invoice->invoice_date = $clientAccount->getRenewalDate();
|
||||||
$invoice->amount = PRO_PLAN_PRICE;
|
$invoice->amount = PRO_PLAN_PRICE;
|
||||||
$invoice->balance = PRO_PLAN_PRICE;
|
$invoice->balance = PRO_PLAN_PRICE;
|
||||||
$invoice->save();
|
$invoice->save();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?php namespace app\Services;
|
<?php namespace App\Services;
|
||||||
|
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use Excel;
|
use Excel;
|
||||||
|
@ -269,6 +269,7 @@
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
|
NINJA.formIsChanged = false;
|
||||||
model.importResults(result);
|
model.importResults(result);
|
||||||
model.setPage('done');
|
model.setPage('done');
|
||||||
}
|
}
|
||||||
|
@ -354,7 +354,7 @@
|
|||||||
|
|
||||||
// Focus the search input if the user clicks forward slash
|
// Focus the search input if the user clicks forward slash
|
||||||
$('body').keypress(function(event) {
|
$('body').keypress(function(event) {
|
||||||
if (event.which == 47) {
|
if (event.which == 47 && !$('*:focus').length) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
showSearch();
|
showSearch();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user