mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge inclusive tax fix
This commit is contained in:
parent
ec5bfb4129
commit
58af36b2d2
@ -286,12 +286,13 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for any taxes which have been deleted
|
// Check for any taxes which have been deleted
|
||||||
|
$taxRateOptions = $account->present()->taxRateOptions;
|
||||||
if ($invoice->exists) {
|
if ($invoice->exists) {
|
||||||
foreach ($invoice->getTaxes() as $key => $rate) {
|
foreach ($invoice->getTaxes() as $key => $rate) {
|
||||||
if (isset($options[$key])) {
|
if (isset($taxRateOptions[$key])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$options['0 ' . $key] = $rate['name'] . ' ' . $rate['rate'] . '%';
|
$taxRateOptions['0 ' . $key] = $rate['name'] . ' ' . $rate['rate'] . '%';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +300,7 @@ class InvoiceController extends BaseController
|
|||||||
'data' => Input::old('data'),
|
'data' => Input::old('data'),
|
||||||
'account' => Auth::user()->account->load('country'),
|
'account' => Auth::user()->account->load('country'),
|
||||||
'products' => Product::scope()->with('default_tax_rate')->orderBy('product_key')->get(),
|
'products' => Product::scope()->with('default_tax_rate')->orderBy('product_key')->get(),
|
||||||
'taxRateOptions' => $account->present()->taxRateOptions,
|
'taxRateOptions' => $taxRateOptions,
|
||||||
'defaultTax' => $account->default_tax_rate,
|
'defaultTax' => $account->default_tax_rate,
|
||||||
'currencies' => Cache::get('currencies'),
|
'currencies' => Cache::get('currencies'),
|
||||||
'sizes' => Cache::get('sizes'),
|
'sizes' => Cache::get('sizes'),
|
||||||
@ -401,7 +402,7 @@ class InvoiceController extends BaseController
|
|||||||
if ($invoice->is_recurring) {
|
if ($invoice->is_recurring) {
|
||||||
$response = $this->emailRecurringInvoice($invoice);
|
$response = $this->emailRecurringInvoice($invoice);
|
||||||
} else {
|
} else {
|
||||||
$this->dispatch(new SendInvoiceEmail($invoice, $reminder, $pdfUpload, $template));
|
$this->dispatch(new SendInvoiceEmail($invoice, $reminder, $template));
|
||||||
$response = true;
|
$response = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,16 +433,11 @@ class InvoiceController extends BaseController
|
|||||||
// in case auto-bill is enabled then a receipt has been sent
|
// in case auto-bill is enabled then a receipt has been sent
|
||||||
if ($invoice->isPaid()) {
|
if ($invoice->isPaid()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
// TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
|
|
||||||
if (config('queue.default') === 'sync') {
|
|
||||||
return app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
|
|
||||||
} else {
|
} else {
|
||||||
$this->dispatch(new SendInvoiceEmail($invoice));
|
$this->dispatch(new SendInvoiceEmail($invoice));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
@ -469,7 +465,6 @@ class InvoiceController extends BaseController
|
|||||||
public function bulk($entityType = ENTITY_INVOICE)
|
public function bulk($entityType = ENTITY_INVOICE)
|
||||||
{
|
{
|
||||||
$action = Input::get('bulk_action') ?: Input::get('action');
|
$action = Input::get('bulk_action') ?: Input::get('action');
|
||||||
;
|
|
||||||
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids'));
|
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids'));
|
||||||
$count = $this->invoiceService->bulk($ids, $action);
|
$count = $this->invoiceService->bulk($ids, $action);
|
||||||
|
|
||||||
@ -487,6 +482,10 @@ class InvoiceController extends BaseController
|
|||||||
Session::flash('message', $message);
|
Session::flash('message', $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strpos(\Request::server('HTTP_REFERER'), 'recurring_invoices')) {
|
||||||
|
$entityType = ENTITY_RECURRING_INVOICE;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->returnBulk($entityType, $action, $ids);
|
return $this->returnBulk($entityType, $action, $ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user