mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fix bug where restoring a credit wouldn't work
This commit is contained in:
parent
e00500efd8
commit
fec8e8b520
@ -536,6 +536,13 @@ class CreditController extends BaseController
|
|||||||
case 'archive':
|
case 'archive':
|
||||||
$this->credit_repository->archive($credit);
|
$this->credit_repository->archive($credit);
|
||||||
|
|
||||||
|
if (!$bulk) {
|
||||||
|
return $this->listResponse($credit);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'restore':
|
||||||
|
$this->credit_repository->restore($credit);
|
||||||
|
|
||||||
if (!$bulk) {
|
if (!$bulk) {
|
||||||
return $this->listResponse($credit);
|
return $this->listResponse($credit);
|
||||||
}
|
}
|
||||||
|
@ -39,11 +39,6 @@ class StartupCheck
|
|||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
// $start = microtime(true);
|
// $start = microtime(true);
|
||||||
// Log::error('start up check');
|
|
||||||
|
|
||||||
if ($request->has('clear_cache')) {
|
|
||||||
Session::flash('message', 'Cache cleared');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure our cache is built */
|
/* Make sure our cache is built */
|
||||||
$cached_tables = config('ninja.cached_tables');
|
$cached_tables = config('ninja.cached_tables');
|
||||||
|
@ -185,7 +185,7 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
// CreateInvoicePdf::class,
|
// CreateInvoicePdf::class,
|
||||||
],
|
],
|
||||||
InvoiceWasPaid::class => [
|
InvoiceWasPaid::class => [
|
||||||
CreateInvoiceHtmlBackup::class,
|
// CreateInvoiceHtmlBackup::class,
|
||||||
],
|
],
|
||||||
InvoiceWasViewed::class => [
|
InvoiceWasViewed::class => [
|
||||||
InvoiceViewedActivity::class,
|
InvoiceViewedActivity::class,
|
||||||
|
@ -252,7 +252,7 @@ class BaseRepository
|
|||||||
$invitations = collect($data['invitations']);
|
$invitations = collect($data['invitations']);
|
||||||
|
|
||||||
/* Get array of Keys which have been removed from the invitations array and soft delete each invitation */
|
/* Get array of Keys which have been removed from the invitations array and soft delete each invitation */
|
||||||
$model->invitations->pluck('key')->diff($invitations->pluck('key'))->each(function ($invitation) {
|
$model->invitations->pluck('key')->diff($invitations->pluck('key'))->each(function ($invitation) use($resource){
|
||||||
$this->getInvitation($invitation, $resource)->delete();
|
$this->getInvitation($invitation, $resource)->delete();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -44,15 +44,15 @@ class TriggeredActions extends AbstractService
|
|||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->request->has('auto_bill')) {
|
if($this->request->has('auto_bill') && $this->request->input('auto_bill') == 'true') {
|
||||||
$this->invoice = $this->invoice->service()->autoBill()->save();
|
$this->invoice = $this->invoice->service()->autoBill()->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->request->has('paid') && (bool)$this->request->input('paid') !== false) {
|
if($this->request->has('paid') && $this->request->input('paid') == 'true') {
|
||||||
$this->invoice = $this->invoice->service()->markPaid()->save();
|
$this->invoice = $this->invoice->service()->markPaid()->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->request->has('send_email') && (bool)$this->request->input('send_email') !== false) {
|
if($this->request->has('send_email') && $this->request->input('send_email') == 'true') {
|
||||||
$this->sendEmail();
|
$this->sendEmail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user