1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Fix bug where restoring a credit wouldn't work

This commit is contained in:
David Bomba 2020-07-20 07:54:10 +10:00
parent e00500efd8
commit fec8e8b520
5 changed files with 12 additions and 10 deletions

View File

@ -536,6 +536,13 @@ class CreditController extends BaseController
case 'archive':
$this->credit_repository->archive($credit);
if (!$bulk) {
return $this->listResponse($credit);
}
break;
case 'restore':
$this->credit_repository->restore($credit);
if (!$bulk) {
return $this->listResponse($credit);
}

View File

@ -39,11 +39,6 @@ class StartupCheck
public function handle(Request $request, Closure $next)
{
// $start = microtime(true);
// Log::error('start up check');
if ($request->has('clear_cache')) {
Session::flash('message', 'Cache cleared');
}
/* Make sure our cache is built */
$cached_tables = config('ninja.cached_tables');

View File

@ -185,7 +185,7 @@ class EventServiceProvider extends ServiceProvider
// CreateInvoicePdf::class,
],
InvoiceWasPaid::class => [
CreateInvoiceHtmlBackup::class,
// CreateInvoiceHtmlBackup::class,
],
InvoiceWasViewed::class => [
InvoiceViewedActivity::class,

View File

@ -252,7 +252,7 @@ class BaseRepository
$invitations = collect($data['invitations']);
/* 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();
});

View File

@ -44,15 +44,15 @@ class TriggeredActions extends AbstractService
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();
}
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();
}
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();
}