diff --git a/app/Console/Commands/SendRemindersCron.php b/app/Console/Commands/SendRemindersCron.php index ad0b99387..0e0550d9e 100644 --- a/app/Console/Commands/SendRemindersCron.php +++ b/app/Console/Commands/SendRemindersCron.php @@ -26,6 +26,7 @@ use App\Utils\Traits\MakesReminders; use Illuminate\Console\Command; use Illuminate\Support\Facades\App; +//@deprecated 27-11-2022 - only ever should be used for testing class SendRemindersCron extends Command { use MakesReminders, MakesDates; diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index b81b4a476..c9df6ee84 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -428,13 +428,13 @@ class InvoiceController extends BaseController event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); - $transaction = [ - 'invoice' => $invoice->transaction_event(), - 'payment' => [], - 'client' => $invoice->client->transaction_event(), - 'credit' => [], - 'metadata' => [], - ]; + // $transaction = [ + // 'invoice' => $invoice->transaction_event(), + // 'payment' => [], + // 'client' => $invoice->client->transaction_event(), + // 'credit' => [], + // 'metadata' => [], + // ]; // TransactionLog::dispatch(TransactionEvent::INVOICE_UPDATED, $transaction, $invoice->company->db); diff --git a/app/Jobs/Company/CompanyExport.php b/app/Jobs/Company/CompanyExport.php index f523c91b3..5da3430b6 100644 --- a/app/Jobs/Company/CompanyExport.php +++ b/app/Jobs/Company/CompanyExport.php @@ -36,6 +36,8 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Storage; +use function Amp\call; + class CompanyExport implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, MakesHash; @@ -531,6 +533,15 @@ class CompanyExport implements ShouldQueue $path = 'backups'; + Storage::makeDirectory(public_path('storage/backups/')); + + try { + mkdir(public_path('storage/backups/')); + } + catch(\Exception $e) { + nlog("could not create directory"); + } + $zip_path = public_path('storage/backups/'.$file_name); $zip = new \ZipArchive(); diff --git a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php index 8ab0e0949..ac100e0e4 100644 --- a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php +++ b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php @@ -48,7 +48,7 @@ class InvoiceFailedEmailNotification $first_notification_sent = true; $invoice = $event->invitation->invoice; - $invoice->update(['last_sent_date' => now()]); + // $invoice->update(['last_sent_date' => now()]); $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer((new EntityFailedSendObject($event->invitation, 'invoice', $event->template, $event->message))->build()); diff --git a/app/PaymentDrivers/Stripe/SEPA.php b/app/PaymentDrivers/Stripe/SEPA.php index c002d08f1..0b817b814 100644 --- a/app/PaymentDrivers/Stripe/SEPA.php +++ b/app/PaymentDrivers/Stripe/SEPA.php @@ -84,7 +84,7 @@ class SEPA $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if (property_exists($gateway_response, 'status') && ($gateway_response->status == 'processing' || $gateway_response->status === 'succeeded')) { + if (property_exists($gateway_response, 'status') && ($gateway_response->status == 'processing' || $gateway_response->status == 'succeeded')) { if ($request->store_card) { $this->storePaymentMethod($gateway_response); } diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index 9b9da5dfa..54bfcb799 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -33,8 +33,6 @@ class ClientService try { \DB::connection(config('database.default'))->transaction(function () use($amount) { - nlog("inside transaction - updating balance by {$amount}"); - $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first(); $this->client->balance += $amount; $this->client->save(); diff --git a/config/queue.php b/config/queue.php index 412282299..18666fc43 100644 --- a/config/queue.php +++ b/config/queue.php @@ -67,7 +67,7 @@ return [ 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90000000, - 'block_for' => null, + 'block_for' => 1, 'after_commit' => false, ],