mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Bug Fixes (#3177)
* Implement first_load query parameter which checks client size and returns an truncated response if client count is greater than 1000 * Fixes for listeners
This commit is contained in:
parent
54fc78a88b
commit
e406020ee5
@ -335,7 +335,7 @@ class CreateTestData extends Command
|
|||||||
|
|
||||||
$payment->invoices()->save($invoice);
|
$payment->invoices()->save($invoice);
|
||||||
|
|
||||||
event(new PaymentWasCreated($payment));
|
event(new PaymentWasCreated($payment, $payment->company));
|
||||||
|
|
||||||
UpdateInvoicePayment::dispatchNow($payment, $payment->company);
|
UpdateInvoicePayment::dispatchNow($payment, $payment->company);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class CompanySettings extends BaseSettings
|
|||||||
public $custom_message_paid_invoice = '';
|
public $custom_message_paid_invoice = '';
|
||||||
public $custom_message_unapproved_quote = '';
|
public $custom_message_unapproved_quote = '';
|
||||||
public $auto_archive_quote = false;
|
public $auto_archive_quote = false;
|
||||||
public $auto_convert_quote = false;
|
public $auto_convert_quote = true;
|
||||||
public $auto_email_invoice = true;
|
public $auto_email_invoice = true;
|
||||||
|
|
||||||
public $inclusive_taxes = false;
|
public $inclusive_taxes = false;
|
||||||
|
@ -69,7 +69,52 @@ class BaseController extends Controller
|
|||||||
{
|
{
|
||||||
$include = '';
|
$include = '';
|
||||||
|
|
||||||
if(request()->input('include') !== null)
|
if(request()->has('first_load') && request()->input('first_load') == 'true')
|
||||||
|
{
|
||||||
|
|
||||||
|
if(auth()->user()->getCompany()->clients->count() > 1000)
|
||||||
|
{
|
||||||
|
$include = [
|
||||||
|
'account',
|
||||||
|
'user.company_user',
|
||||||
|
'token',
|
||||||
|
'company.activities',
|
||||||
|
'company.users.company_user',
|
||||||
|
'company.tax_rates',
|
||||||
|
'company.groups',
|
||||||
|
'company.company_gateways.gateway',
|
||||||
|
// 'company.clients',
|
||||||
|
// 'company.products',
|
||||||
|
// 'company.invoices',
|
||||||
|
// 'company.payments',
|
||||||
|
// 'company.quotes',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$include = [
|
||||||
|
'account',
|
||||||
|
'user.company_user',
|
||||||
|
'token',
|
||||||
|
'company.activities',
|
||||||
|
'company.users.company_user',
|
||||||
|
'company.tax_rates',
|
||||||
|
'company.groups',
|
||||||
|
'company.company_gateways.gateway',
|
||||||
|
'company.clients',
|
||||||
|
'company.products',
|
||||||
|
'company.invoices',
|
||||||
|
'company.payments',
|
||||||
|
'company.quotes',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$include = array_merge($this->forced_includes, $include);
|
||||||
|
|
||||||
|
$include = implode(",", $include);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(request()->input('include') !== null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$request_include = explode(",", request()->input('include'));
|
$request_include = explode(",", request()->input('include'));
|
||||||
|
@ -53,7 +53,7 @@ class StoreInvoice implements ShouldQueue
|
|||||||
* We expect the Invoice object along with
|
* We expect the Invoice object along with
|
||||||
* the request in array form
|
* the request in array form
|
||||||
*
|
*
|
||||||
* Embedded in the request may be additionals
|
* Embedded in the request may be additional
|
||||||
* attributes which require additional work to be
|
* attributes which require additional work to be
|
||||||
* done in this job, these include - but are not limited to:
|
* done in this job, these include - but are not limited to:
|
||||||
*
|
*
|
||||||
|
@ -39,6 +39,7 @@ class UpdateOrCreateProduct implements ShouldQueue
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->products = $products;
|
$this->products = $products;
|
||||||
|
|
||||||
$this->invoice = $invoice;
|
$this->invoice = $invoice;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -60,6 +61,8 @@ class UpdateOrCreateProduct implements ShouldQueue
|
|||||||
$product->product_key = $item->product_key;
|
$product->product_key = $item->product_key;
|
||||||
$product->notes = $item->notes;
|
$product->notes = $item->notes;
|
||||||
$product->cost = $item->cost;
|
$product->cost = $item->cost;
|
||||||
|
$product->price = $item->price;
|
||||||
|
$product->quantity = $item->quantity;
|
||||||
$product->tax_name1 = $item->tax_name1;
|
$product->tax_name1 = $item->tax_name1;
|
||||||
$product->tax_rate1 = $item->tax_rate1;
|
$product->tax_rate1 = $item->tax_rate1;
|
||||||
$product->tax_name2 = $item->tax_name2;
|
$product->tax_name2 = $item->tax_name2;
|
||||||
|
@ -35,6 +35,6 @@ class CreateInvoicePdf implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle($event)
|
public function handle($event)
|
||||||
{
|
{
|
||||||
PdfCreator::dispatch($event->invoice);
|
PdfCreator::dispatch($event->invoice, $event->company);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ class Client extends BaseModel
|
|||||||
// 'primary_contact',
|
// 'primary_contact',
|
||||||
'country',
|
'country',
|
||||||
// 'shipping_country',
|
// 'shipping_country',
|
||||||
'company'
|
// 'company'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
Loading…
Reference in New Issue
Block a user