diff --git a/.env.example b/.env.example index ab3a104fb6f4..6c7b680226cd 100644 --- a/.env.example +++ b/.env.example @@ -51,7 +51,7 @@ TRUSTED_PROXIES= NINJA_ENVIRONMENT=selfhost -PHANTOMJS_PDF_GENERATION=true +PHANTOMJS_PDF_GENERATION=false PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address' PHANTOMJS_SECRET=secret diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 05b3db324400..c36c00d2c5c9 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -339,7 +339,7 @@ class CheckData extends Command $total_invoice_payments += $credit_total_applied; } //todo this is contentious - info("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}"); + nlog("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}"); if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) { $wrong_paid_to_dates++; diff --git a/app/Console/Commands/PostUpdate.php b/app/Console/Commands/PostUpdate.php index 70b1a69105f3..0326d31be3a1 100644 --- a/app/Console/Commands/PostUpdate.php +++ b/app/Console/Commands/PostUpdate.php @@ -42,42 +42,42 @@ class PostUpdate extends Command { set_time_limit(0); - info('running post update'); + nlog('running post update'); try { Artisan::call('migrate', ['--force' => true]); } catch (\Exception $e) { - info("I wasn't able to migrate the data."); + nlog("I wasn't able to migrate the data."); } - info("finished migrating"); + nlog("finished migrating"); exec('vendor/bin/composer install --no-dev:'); - info("finished running composer install "); + nlog("finished running composer install "); try { Artisan::call('optimize'); } catch (\Exception $e) { - info("I wasn't able to optimize."); + nlog("I wasn't able to optimize."); } - info("optimized"); + nlog("optimized"); try { Artisan::call('view:clear'); } catch (\Exception $e) { - info("I wasn't able to clear the views."); + nlog("I wasn't able to clear the views."); } - info("view cleared"); + nlog("view cleared"); /* For the following to work, the web user (www-data) must own all the directories */ VersionCheck::dispatch(); - info("sent for version check"); + nlog("sent for version check"); // echo "Done."; } diff --git a/app/Helpers/Mail/GmailTransport.php b/app/Helpers/Mail/GmailTransport.php index 4575ff1e343d..f705fbfc51b8 100644 --- a/app/Helpers/Mail/GmailTransport.php +++ b/app/Helpers/Mail/GmailTransport.php @@ -60,7 +60,7 @@ class GmailTransport extends Transport $this->gmail->cc($message->getCc()); $this->gmail->bcc($message->getBcc()); - info(print_r($message->getChildren(), 1)); + nlog(print_r($message->getChildren(), 1)); foreach ($message->getChildren() as $child) { $this->gmail->attach($child); diff --git a/app/Http/Controllers/MigrationController.php b/app/Http/Controllers/MigrationController.php index d67097ea89e8..0d27dc476827 100644 --- a/app/Http/Controllers/MigrationController.php +++ b/app/Http/Controllers/MigrationController.php @@ -221,7 +221,7 @@ class MigrationController extends BaseController $companies = json_decode($request->companies); if (app()->environment() === 'local') { - info($request->all()); + nlog($request->all()); } foreach ($companies as $company) { @@ -244,7 +244,7 @@ class MigrationController extends BaseController // If there's existing company and ** no ** force is provided - skip migration. if ($checks['existing_company'] == true && $checks['force'] == false) { - info('Migrating: Existing company without force. (CASE_01)'); + nlog('Migrating: Existing company without force. (CASE_01)'); MailRouter::dispatch(new ExistingMigration(), $existing_company, $user); @@ -257,7 +257,7 @@ class MigrationController extends BaseController // If there's existing company and force ** is provided ** - purge the company and migrate again. if ($checks['existing_company'] == true && $checks['force'] == true) { - info("purging the existing company here"); + nlog("purging the existing company here"); $this->purgeCompanyWithForceFlag($existing_company); $account = auth()->user()->account; @@ -330,10 +330,10 @@ class MigrationController extends BaseController try { // StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5)); - info($migration_file); + nlog($migration_file); StartMigration::dispatch($migration_file, $user, $fresh_company); } catch (\Exception $e) { - info($e->getMessage()); + nlog($e->getMessage()); } } diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 5e3adf272517..6845ecdedd58 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -181,7 +181,7 @@ class PreviewController extends BaseController $invoice->setRelation('company', auth()->user()->company()); $invoice->load('client'); - // info(print_r($invoice->toArray(),1)); + // nlog(print_r($invoice->toArray(),1)); $design_object = json_decode(json_encode(request()->input('design'))); diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index c905d4d39345..acf23d40c0be 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -65,12 +65,12 @@ class SelfUpdateController extends BaseController /* .git MUST be owned/writable by the webserver user */ $repo = new GitRepository(base_path()); - info('Are there changes to pull? '.$repo->hasChanges()); + nlog('Are there changes to pull? '.$repo->hasChanges()); try { $res = $repo->pull(); } catch (GitException $e) { - info($e->getMessage()); + nlog($e->getMessage()); return response()->json(['message'=>$e->getMessage()], 500); } diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index ed3054c0800f..0d8309186e23 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -56,13 +56,13 @@ class SetupController extends Controller try { $check = SystemHealth::check(false); } catch (\Exception $e) { - info(['message' => $e->getMessage(), 'action' => 'SetupController::doSetup()']); + nlog(['message' => $e->getMessage(), 'action' => 'SetupController::doSetup()']); return response()->json(['message' => $e->getMessage()], 400); } if ($check['system_health'] === false) { - info($check); + nlog($check); return response('Oops, something went wrong. Check your logs.'); /* We should never reach this block, but just in case. */ } @@ -149,7 +149,7 @@ class SetupController extends Controller return redirect('/'); } catch (Exception $e) { - info($e->getMessage()); + nlog($e->getMessage()); return redirect() ->back() @@ -174,7 +174,7 @@ class SetupController extends Controller return response($status, 400); } catch (\Exception $e) { - info(['message' => $e->getMessage(), 'action' => 'SetupController::checkDB()']); + nlog(['message' => $e->getMessage(), 'action' => 'SetupController::checkDB()']); return response()->json(['message' => $e->getMessage()], 400); } @@ -197,7 +197,7 @@ class SetupController extends Controller return response()->json(['message' => $response['message']], 400); } } catch (Exception $e) { - info(['message' => $e->getMessage(), 'action' => 'SetupController::checkMail()']); + nlog(['message' => $e->getMessage(), 'action' => 'SetupController::checkMail()']); return response()->json(['message' => $e->getMessage()], 400); } @@ -235,7 +235,7 @@ class SetupController extends Controller return response(['url' => asset('test.pdf')], 200); } catch (Exception $e) { - info($e->getMessage()); + nlog($e->getMessage()); return response([], 500); } diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index 509a9414a0bc..517034beba9e 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -51,10 +51,10 @@ class QueryLogging $timeEnd = microtime(true); $time = $timeEnd - $timeStart; - Log::info($request->method().' - '.$request->url().": $count queries - ".$time); + nlog($request->method().' - '.$request->url().": $count queries - ".$time); // if($count > 50) - // Log::info($queries); + // Log::nlog($queries); } } diff --git a/app/Http/Middleware/SetEmailDb.php b/app/Http/Middleware/SetEmailDb.php index de45635b4d54..833dd8c40feb 100644 --- a/app/Http/Middleware/SetEmailDb.php +++ b/app/Http/Middleware/SetEmailDb.php @@ -33,7 +33,7 @@ class SetEmailDb ]; if ($request->input('email') && config('ninja.db.multi_db_enabled')) { - info("trying to find db"); + nlog("trying to find db"); if (! MultiDB::userFindAndSetDb($request->input('email'))) { return response()->json($error, 400); } diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index b14cd40da4a0..6f1c30c23d47 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -39,7 +39,7 @@ class StorePaymentRequest extends Request { $input = $this->all(); - // info(print_r($input,1)); + // nlog(print_r($input,1)); $invoices_total = 0; $credits_total = 0; diff --git a/app/Http/Requests/Setup/CheckMailRequest.php b/app/Http/Requests/Setup/CheckMailRequest.php index ecd5df3cc9ab..bc0b7e787cc0 100644 --- a/app/Http/Requests/Setup/CheckMailRequest.php +++ b/app/Http/Requests/Setup/CheckMailRequest.php @@ -33,7 +33,7 @@ class CheckMailRequest extends Request */ public function rules() { - info($this->driver); + nlog($this->driver); return [ 'mail_driver' => 'required', diff --git a/app/Http/ValidationRules/Credit/ValidCreditsRules.php b/app/Http/ValidationRules/Credit/ValidCreditsRules.php index 54fafa3f8020..3b05055c3150 100644 --- a/app/Http/ValidationRules/Credit/ValidCreditsRules.php +++ b/app/Http/ValidationRules/Credit/ValidCreditsRules.php @@ -85,10 +85,10 @@ class ValidCreditsRules implements Rule // $total_payments = $this->input['amount'] + array_sum(array_column($this->input['credits'], 'amount')); -// info(print_r($this->input,1)); -// info("total payments = {$total_payments}"); -// info("total credits available = " . array_sum(array_column($this->input['credits'], 'amount'))); -// info("total invoices payable = " . array_sum(array_column($this->input['invoices'], 'amount'))); +// nlog(print_r($this->input,1)); +// nlog("total payments = {$total_payments}"); +// nlog("total credits available = " . array_sum(array_column($this->input['credits'], 'amount'))); +// nlog("total invoices payable = " . array_sum(array_column($this->input['invoices'], 'amount'))); // if($total_payments > array_sum(array_column($this->input['invoices'], 'amount'))){ diff --git a/app/Http/ValidationRules/PaymentAmountsBalanceRule.php b/app/Http/ValidationRules/PaymentAmountsBalanceRule.php index 9d235be37892..60b7ca6f9bf8 100644 --- a/app/Http/ValidationRules/PaymentAmountsBalanceRule.php +++ b/app/Http/ValidationRules/PaymentAmountsBalanceRule.php @@ -71,8 +71,8 @@ class PaymentAmountsBalanceRule implements Rule return true; } // if no invoices are present, then this is an unapplied payment, let this pass validation! - // info("payment amounts = {$payment_amounts}"); - // info("invoice amounts = {$invoice_amounts}"); + // nlog("payment amounts = {$payment_amounts}"); + // nlog("invoice amounts = {$invoice_amounts}"); return $payment_amounts >= $invoice_amounts; } diff --git a/app/Jobs/Cron/RecurringInvoicesCron.php b/app/Jobs/Cron/RecurringInvoicesCron.php index 73c08909dbba..ed79e493fe12 100644 --- a/app/Jobs/Cron/RecurringInvoicesCron.php +++ b/app/Jobs/Cron/RecurringInvoicesCron.php @@ -39,7 +39,7 @@ class RecurringInvoicesCron public function handle() : void { /* Get all invoices where the send date is less than NOW + 30 minutes() */ - info("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s')); + nlog("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s')); if (! config('ninja.db.multi_db_enabled')) { $recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now()) @@ -47,10 +47,10 @@ class RecurringInvoicesCron ->with('company') ->cursor(); - Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count()); + nlog(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count()); $recurring_invoices->each(function ($recurring_invoice, $key) { - info("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date); + nlog("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date); if (!$recurring_invoice->company->is_disabled) { SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db); @@ -66,10 +66,10 @@ class RecurringInvoicesCron ->with('company') ->cursor(); - Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db); + nlog(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db); $recurring_invoices->each(function ($recurring_invoice, $key) { - info("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date); + nlog("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date); if (!$recurring_invoice->company->is_disabled) { SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db); diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index cedacb670521..4652e447f2bc 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -146,7 +146,7 @@ class CreateEntityPdf implements ShouldQueue ->build(); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily - //info("make dir => {$path}"); + //nlog("make dir => {$path}"); //Storage::makeDirectory($path, 0775); $pdf = null; @@ -154,11 +154,11 @@ class CreateEntityPdf implements ShouldQueue try { $pdf = $this->makePdf(null, null, $maker->getCompiledHTML(true)); } catch (\Exception $e) { - info(print_r($e->getMessage(), 1)); + nlog(print_r($e->getMessage(), 1)); } if (config('ninja.log_pdf_html')) { - info($maker->getCompiledHTML()); + nlog($maker->getCompiledHTML()); } if ($pdf) { @@ -170,6 +170,6 @@ class CreateEntityPdf implements ShouldQueue public function failed(\Exception $exception) { - info("help!"); + nlog("help!"); } } diff --git a/app/Jobs/Import/CSVImport.php b/app/Jobs/Import/CSVImport.php index f8747b062ebe..c997de6071b1 100644 --- a/app/Jobs/Import/CSVImport.php +++ b/app/Jobs/Import/CSVImport.php @@ -110,7 +110,7 @@ class CSVImport implements ShouldQueue 'settings' => $this->company->settings ]; - //info(print_r($data, 1)); + //nlog(print_r($data, 1)); MailRouter::dispatch(new ImportCompleted($data), $this->company, auth()->user()); } @@ -136,7 +136,7 @@ class CSVImport implements ShouldQueue } if (!$invoice_number_key) { - info("no invoice number to use as key - returning"); + nlog("no invoice number to use as key - returning"); return; } diff --git a/app/Jobs/Mail/BaseMailerJob.php b/app/Jobs/Mail/BaseMailerJob.php index ae3fb9711c73..301a3f1357d8 100644 --- a/app/Jobs/Mail/BaseMailerJob.php +++ b/app/Jobs/Mail/BaseMailerJob.php @@ -96,8 +96,8 @@ class BaseMailerJob implements ShouldQueue public function failed($exception = null) { - info('the job failed'); - info($exception->getMessage()); + nlog('the job failed'); + nlog($exception->getMessage()); $job_failure = new EmailFailure(); $job_failure->string_metric5 = get_parent_class($this); diff --git a/app/Jobs/Ninja/SendReminders.php b/app/Jobs/Ninja/SendReminders.php index cc6b3f1ae22e..d354522a681b 100644 --- a/app/Jobs/Ninja/SendReminders.php +++ b/app/Jobs/Ninja/SendReminders.php @@ -49,7 +49,7 @@ class SendReminders implements ShouldQueue */ public function handle() { - info("Sending reminders ".Carbon::now()->format('Y-m-d h:i:s')); + nlog("Sending reminders ".Carbon::now()->format('Y-m-d h:i:s')); if (! config('ninja.db.multi_db_enabled')) { $this->sendReminderEmails(); @@ -79,7 +79,7 @@ class SendReminders implements ShouldQueue })->each(function ($invoice) { $reminder_template = $invoice->calculateTemplate('invoice'); - info("hitting a reminder for {$invoice->number} with template {$reminder_template}"); + nlog("hitting a reminder for {$invoice->number} with template {$reminder_template}"); if (in_array($reminder_template, ['reminder1', 'reminder2', 'reminder3', 'endless_reminder'])) { $this->sendReminder($invoice, $reminder_template); @@ -208,7 +208,7 @@ class SendReminders implements ShouldQueue //only send if enable_reminder setting is toggled to yes if ($this->checkSendSetting($invoice, $template)) { - info("firing email"); + nlog("firing email"); EmailEntity::dispatchNow($invitation, $invitation->company, $template); } diff --git a/app/Jobs/Payment/EmailPayment.php b/app/Jobs/Payment/EmailPayment.php index f4301535bde2..b26d92bafb2e 100644 --- a/app/Jobs/Payment/EmailPayment.php +++ b/app/Jobs/Payment/EmailPayment.php @@ -82,7 +82,7 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue $mail = Mail::to($this->contact->email, $this->contact->present()->name()); $mail->send(new TemplateEmail($email_builder, $this->contact->user, $this->contact->client)); } catch (\Exception $e) { - info("mailing failed with message " . $e->getMessage()); + nlog("mailing failed with message " . $e->getMessage()); event(new PaymentWasEmailedAndFailed($this->payment, $this->company, Mail::failures(), Ninja::eventVars())); $this->failed($e); return $this->logMailError($e->getMessage(), $this->payment->client); diff --git a/app/Jobs/RecurringInvoice/SendRecurring.php b/app/Jobs/RecurringInvoice/SendRecurring.php index 8ec0e3c1a4aa..5ddebc75b1d1 100644 --- a/app/Jobs/RecurringInvoice/SendRecurring.php +++ b/app/Jobs/RecurringInvoice/SendRecurring.php @@ -65,12 +65,12 @@ class SendRecurring implements ShouldQueue ->createInvitations() ->save(); - info("Invoice {$invoice->number} created"); + nlog("Invoice {$invoice->number} created"); $invoice->invitations->each(function ($invitation) use ($invoice) { if ($invitation->contact && strlen($invitation->contact->email) >=1) { EmailEntity::dispatch($invitation, $invoice->company); - info("Firing email for invoice {$invoice->number}"); + nlog("Firing email for invoice {$invoice->number}"); } }); @@ -78,7 +78,7 @@ class SendRecurring implements ShouldQueue $invoice->service()->autoBill()->save(); } - info("updating recurring invoice dates"); + nlog("updating recurring invoice dates"); /* Set next date here to prevent a recurring loop forming */ $this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate()->format('Y-m-d'); $this->recurring_invoice->remaining_cycles = $this->recurring_invoice->remainingCycles(); @@ -89,9 +89,9 @@ class SendRecurring implements ShouldQueue $this->recurring_invoice->setCompleted(); } - info("next send date = " . $this->recurring_invoice->next_send_date); - info("remaining cycles = " . $this->recurring_invoice->remaining_cycles); - info("last send date = " . $this->recurring_invoice->last_sent_date); + nlog("next send date = " . $this->recurring_invoice->next_send_date); + nlog("remaining cycles = " . $this->recurring_invoice->remaining_cycles); + nlog("last send date = " . $this->recurring_invoice->last_sent_date); $this->recurring_invoice->save(); @@ -102,7 +102,7 @@ class SendRecurring implements ShouldQueue public function failed($exception = null) { - info('the job failed'); + nlog('the job failed'); $job_failure = new SendRecurringFailure(); $job_failure->string_metric5 = get_class($this); @@ -111,6 +111,6 @@ class SendRecurring implements ShouldQueue LightLogs::create($job_failure) ->batch(); - info(print_r($exception->getMessage(), 1)); + nlog(print_r($exception->getMessage(), 1)); } } diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 3080df70fdae..566b57a97f1c 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -62,7 +62,7 @@ class ReminderJob implements ShouldQueue $invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) { EmailEntity::dispatch($invitation, $invitation->company, $reminder_template); - info("Firing email for invoice {$invoice->number}"); + nlog("Firing email for invoice {$invoice->number}"); }); if ($invoice->invitations->count() > 0) { diff --git a/app/Jobs/Util/WebhookHandler.php b/app/Jobs/Util/WebhookHandler.php index aaf1a2399db8..8d26bbe5097a 100644 --- a/app/Jobs/Util/WebhookHandler.php +++ b/app/Jobs/Util/WebhookHandler.php @@ -117,6 +117,6 @@ class WebhookHandler implements ShouldQueue public function failed($exception) { - info(print_r($exception->getMessage(), 1)); + nlog(print_r($exception->getMessage(), 1)); } } diff --git a/app/Listeners/Invoice/InvoicePaidActivity.php b/app/Listeners/Invoice/InvoicePaidActivity.php index 41d3ea92fa0f..c57f34575c19 100644 --- a/app/Listeners/Invoice/InvoicePaidActivity.php +++ b/app/Listeners/Invoice/InvoicePaidActivity.php @@ -53,7 +53,7 @@ class InvoicePaidActivity implements ShouldQueue try { $event->invoice->service()->touchPdf(); } catch (\Exception $e) { - info(print_r($e->getMessage(), 1)); + nlog(print_r($e->getMessage(), 1)); } } } diff --git a/app/Listeners/Payment/PaymentEmailFailureActivity.php b/app/Listeners/Payment/PaymentEmailFailureActivity.php index 3ed2eed98072..60c1638ac835 100644 --- a/app/Listeners/Payment/PaymentEmailFailureActivity.php +++ b/app/Listeners/Payment/PaymentEmailFailureActivity.php @@ -40,7 +40,7 @@ class PaymentEmailFailureActivity implements ShouldQueue $payment = $event->payment; - info("i failed emailing {$payment->number}"); - // info(print_r($event->errors,1)); + nlog("i failed emailing {$payment->number}"); + // nlog(print_r($event->errors,1)); } } diff --git a/app/Listeners/Payment/PaymentEmailedActivity.php b/app/Listeners/Payment/PaymentEmailedActivity.php index a552e5489dd7..e507f27fd067 100644 --- a/app/Listeners/Payment/PaymentEmailedActivity.php +++ b/app/Listeners/Payment/PaymentEmailedActivity.php @@ -40,6 +40,6 @@ class PaymentEmailedActivity implements ShouldQueue $payment = $event->payment; - info("i succeeded in emailing payment {$payment->number}"); + nlog("i succeeded in emailing payment {$payment->number}"); } } diff --git a/app/Listeners/SendVerificationNotification.php b/app/Listeners/SendVerificationNotification.php index 05eede2e949b..5025e023bc9d 100644 --- a/app/Listeners/SendVerificationNotification.php +++ b/app/Listeners/SendVerificationNotification.php @@ -49,7 +49,7 @@ class SendVerificationNotification implements ShouldQueue Ninja::registerNinjaUser($event->user); } catch (Exception $e) { - info("I couldn't send the email " . $e->getMessage()); + nlog("I couldn't send the email " . $e->getMessage()); } } } diff --git a/app/Mail/Engine/InvoiceEmailEngine.php b/app/Mail/Engine/InvoiceEmailEngine.php index 711b4bdc6dc7..3bb61ce32620 100644 --- a/app/Mail/Engine/InvoiceEmailEngine.php +++ b/app/Mail/Engine/InvoiceEmailEngine.php @@ -65,12 +65,12 @@ class InvoiceEmailEngine extends BaseEmailEngine if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) { $subject_template = $this->template_data['subject']; - info("subject = template data"); + nlog("subject = template data"); } elseif (strlen($this->client->getSetting('email_subject_'.$this->reminder_template)) > 0) { $subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template); - info("subject = settings var"); + nlog("subject = settings var"); } else { - info("subject = default template " . 'email_subject_'.$this->reminder_template); + nlog("subject = default template " . 'email_subject_'.$this->reminder_template); $subject_template = EmailTemplateDefaults::getDefaultTemplate('email_subject_'.$this->reminder_template, $this->client->locale()); // $subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template); } diff --git a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php index 918dfeb63f90..ba6d7b442279 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php +++ b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php @@ -213,7 +213,7 @@ class AuthorizeCreditCard private function processFailedResponse($data, $request) { //dd($data); -// info(print_r($data, 1)); +// nlog(print_r($data, 1)); } private function formatGatewayResponse($data, $vars) diff --git a/app/PaymentDrivers/Authorize/AuthorizeTransactions.php b/app/PaymentDrivers/Authorize/AuthorizeTransactions.php index 20906860bde2..8f756d70cb9f 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeTransactions.php +++ b/app/PaymentDrivers/Authorize/AuthorizeTransactions.php @@ -46,13 +46,13 @@ class AuthorizeTransactions $response = $controller->executeWithApiResponse($this->authorize->mode()); if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { - info('SUCCESS: Transaction Status:'.$response->getTransaction()->getTransactionStatus()); - info(' Auth Amount:'.$response->getTransaction()->getAuthAmount()); - info(' Trans ID:'.$response->getTransaction()->getTransId()); + nlog('SUCCESS: Transaction Status:'.$response->getTransaction()->getTransactionStatus()); + nlog(' Auth Amount:'.$response->getTransaction()->getAuthAmount()); + nlog(' Trans ID:'.$response->getTransaction()->getTransId()); } else { - info("ERROR : Invalid response\n"); + nlog("ERROR : Invalid response\n"); $errorMessages = $response->getMessages()->getMessage(); - info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()); + nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()); } return $response; diff --git a/app/PaymentDrivers/Authorize/ChargePaymentProfile.php b/app/PaymentDrivers/Authorize/ChargePaymentProfile.php index 4d7281609d57..94fc46bb114f 100644 --- a/app/PaymentDrivers/Authorize/ChargePaymentProfile.php +++ b/app/PaymentDrivers/Authorize/ChargePaymentProfile.php @@ -59,36 +59,36 @@ class ChargePaymentProfile $tresponse = $response->getTransactionResponse(); if ($tresponse != null && $tresponse->getMessages() != null) { - info(' Transaction Response code : '.$tresponse->getResponseCode()); - info('Charge Customer Profile APPROVED :'); - info(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()); - info(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()); - info(' Code : '.$tresponse->getMessages()[0]->getCode()); - info(' Description : '.$tresponse->getMessages()[0]->getDescription()); - //info(" Charge Customer Profile TRANS STATUS : " . $tresponse->getTransactionStatus() ); - //info(" Charge Customer Profile Amount : " . $tresponse->getAuthAmount()); + nlog(' Transaction Response code : '.$tresponse->getResponseCode()); + nlog('Charge Customer Profile APPROVED :'); + nlog(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()); + nlog(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()); + nlog(' Code : '.$tresponse->getMessages()[0]->getCode()); + nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()); + //nlog(" Charge Customer Profile TRANS STATUS : " . $tresponse->getTransactionStatus() ); + //nlog(" Charge Customer Profile Amount : " . $tresponse->getAuthAmount()); - info(' Code : '.$tresponse->getMessages()[0]->getCode()); - info(' Description : '.$tresponse->getMessages()[0]->getDescription()); - info(print_r($tresponse->getMessages()[0], 1)); + nlog(' Code : '.$tresponse->getMessages()[0]->getCode()); + nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()); + nlog(print_r($tresponse->getMessages()[0], 1)); } else { - info('Transaction Failed '); + nlog('Transaction Failed '); if ($tresponse->getErrors() != null) { - info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()); - info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()); - info(print_r($tresponse->getErrors()[0], 1)); + nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()); + nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText()); + nlog(print_r($tresponse->getErrors()[0], 1)); } } } else { - info('Transaction Failed '); + nlog('Transaction Failed '); $tresponse = $response->getTransactionResponse(); if ($tresponse != null && $tresponse->getErrors() != null) { - info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()); - info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()); - info(print_r($tresponse->getErrors()[0], 1)); + nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()); + nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText()); + nlog(print_r($tresponse->getErrors()[0], 1)); } else { - info(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()); - info(' Error message : '.$response->getMessages()->getMessage()[0]->getText()); + nlog(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()); + nlog(' Error message : '.$response->getMessages()->getMessage()[0]->getText()); } } diff --git a/app/PaymentDrivers/Stripe/Charge.php b/app/PaymentDrivers/Stripe/Charge.php index 2c9b7f725315..b11c7ff35a0f 100644 --- a/app/PaymentDrivers/Stripe/Charge.php +++ b/app/PaymentDrivers/Stripe/Charge.php @@ -168,7 +168,7 @@ class Charge } $payment_method_type = $response->charges->data[0]->payment_method_details->card->brand; - //info($payment_method_type); + //nlog($payment_method_type); $data = [ 'gateway_type_id' => $cgt->gateway_type_id, diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 10cc679c9109..37c733c9ac27 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -319,7 +319,7 @@ class StripePaymentDriver extends BaseDriver } catch (Exception $e) { SystemLogger::dispatch(['server_response' => $response, 'data' => request()->all(),], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_STRIPE, $this->client); - info($e->getMessage()); + nlog($e->getMessage()); return [ 'transaction_reference' => null, diff --git a/app/Repositories/Migration/InvoiceMigrationRepository.php b/app/Repositories/Migration/InvoiceMigrationRepository.php index 8d06ab14b04a..be27adef6909 100644 --- a/app/Repositories/Migration/InvoiceMigrationRepository.php +++ b/app/Repositories/Migration/InvoiceMigrationRepository.php @@ -91,6 +91,9 @@ class InvoiceMigrationRepository extends BaseRepository InvoiceInvitation::unguard(); RecurringInvoiceInvitation::unguard(); + if($model instanceof RecurringInvoice) + $lcfirst_resource_id = 'recurring_invoice_id'; + foreach($data['invitations'] as $invitation) { nlog($invitation); diff --git a/tests/Feature/CompanyGatewayResolutionTest.php b/tests/Feature/CompanyGatewayResolutionTest.php index 6395c8a7120e..126eaff0e7ef 100644 --- a/tests/Feature/CompanyGatewayResolutionTest.php +++ b/tests/Feature/CompanyGatewayResolutionTest.php @@ -150,6 +150,6 @@ class CompanyGatewayResolutionTest extends TestCase $this->assertEquals(4, count($this->cg->driver($this->client)->gatewayTypes())); - // info(print_r($this->client->getPaymentMethods(10),1)); + // nlog(print_r($this->client->getPaymentMethods(10),1)); } } diff --git a/tests/Feature/CompanyGatewayTest.php b/tests/Feature/CompanyGatewayTest.php index a7dd8e42f216..2f8578db2027 100644 --- a/tests/Feature/CompanyGatewayTest.php +++ b/tests/Feature/CompanyGatewayTest.php @@ -101,10 +101,10 @@ class CompanyGatewayTest extends TestCase } if ((property_exists($fees_and_limits, 'min_limit')) && $fees_and_limits->min_limit !== null && $amount < $fees_and_limits->min_limit) { - info("amount {$amount} less than ".$fees_and_limits->min_limit); + nlog("amount {$amount} less than ".$fees_and_limits->min_limit); $passes = false; } elseif ((property_exists($fees_and_limits, 'max_limit')) && $fees_and_limits->max_limit !== null && $amount > $fees_and_limits->max_limit) { - info("amount {$amount} greater than ".$fees_and_limits->max_limit); + nlog("amount {$amount} greater than ".$fees_and_limits->max_limit); $passes = false; } else { $passes = true; diff --git a/tests/Feature/Export/ExportCsvTest.php b/tests/Feature/Export/ExportCsvTest.php index 1b20fce5ef01..2421d84e38dd 100644 --- a/tests/Feature/Export/ExportCsvTest.php +++ b/tests/Feature/Export/ExportCsvTest.php @@ -58,8 +58,8 @@ class ExportCsvTest extends TestCase $merged_values = array_merge($header_invoice_values, (array)$header_item_values); $merged_keys = array_merge($header_invoice_keys, (array)$header_item_keys); - info(print_r($merged_keys, 1)); - info(print_r($merged_values, 1)); + nlog(print_r($merged_keys, 1)); + nlog(print_r($merged_values, 1)); foreach ($merged_keys as &$key) { diff --git a/tests/Feature/InvoiceTest.php b/tests/Feature/InvoiceTest.php index c5f4c407eb65..ef4bc594f60c 100644 --- a/tests/Feature/InvoiceTest.php +++ b/tests/Feature/InvoiceTest.php @@ -184,8 +184,8 @@ class InvoiceTest extends TestCase ->assertStatus(302); } catch (ValidationException $e) { $message = json_decode($e->validator->getMessageBag(), 1); - info('inside update invoice validator'); - info($message); + nlog('inside update invoice validator'); + nlog($message); $this->assertNotNull($message); } diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php index 6d122d2d4e6c..474a6c1719ea 100644 --- a/tests/Feature/LoginTest.php +++ b/tests/Feature/LoginTest.php @@ -190,12 +190,12 @@ class LoginTest extends TestCase ])->post('/api/v1/login', $data); } catch (ValidationException $e) { $message = json_decode($e->validator->getMessageBag(), 1); - info(print_r($message, 1)); + nlog(print_r($message, 1)); } $arr = $response->json(); - info(print_r($arr, 1)); + nlog(print_r($arr, 1)); $response->assertStatus(200); } diff --git a/tests/Feature/PaymentTest.php b/tests/Feature/PaymentTest.php index 90eb26830576..000fd78592c8 100644 --- a/tests/Feature/PaymentTest.php +++ b/tests/Feature/PaymentTest.php @@ -1289,7 +1289,7 @@ class PaymentTest extends TestCase $payment = Payment::find($this->decodePrimaryKey($payment_id))->first(); - // info($payment); + // nlog($payment); $this->assertNotNull($payment); $this->assertNotNull($payment->invoices()); diff --git a/tests/Feature/PdfMaker/ExampleIntegrationTest.php b/tests/Feature/PdfMaker/ExampleIntegrationTest.php index 100e89ef279a..5674ccc412cb 100644 --- a/tests/Feature/PdfMaker/ExampleIntegrationTest.php +++ b/tests/Feature/PdfMaker/ExampleIntegrationTest.php @@ -58,7 +58,7 @@ class ExampleIntegrationTest extends TestCase // exec('echo "" > storage/logs/laravel.log'); -// info($maker->getCompiledHTML(true)); +// nlog($maker->getCompiledHTML(true)); $this->assertTrue(true); } diff --git a/tests/Feature/PdfMaker/PdfMakerTest.php b/tests/Feature/PdfMaker/PdfMakerTest.php index 5935ca4f894f..3cd9e83b32d2 100644 --- a/tests/Feature/PdfMaker/PdfMakerTest.php +++ b/tests/Feature/PdfMaker/PdfMakerTest.php @@ -370,7 +370,7 @@ class PdfMakerTest extends TestCase // exec('echo "" > storage/logs/laravel.log'); - // info($maker->getCompiledHTML(true)); + // nlog($maker->getCompiledHTML(true)); $this->assertTrue(true); } diff --git a/tests/Integration/CompanyLedgerTest.php b/tests/Integration/CompanyLedgerTest.php index bb856de2c895..45fb879d7e90 100644 --- a/tests/Integration/CompanyLedgerTest.php +++ b/tests/Integration/CompanyLedgerTest.php @@ -222,7 +222,7 @@ class CompanyLedgerTest extends TestCase 'X-API-TOKEN' => $this->token, ])->post('/api/v1/payments/', $data); } catch (ValidationException $e) { - info(print_r($e->validator->getMessageBag(), 1)); + nlog(print_r($e->validator->getMessageBag(), 1)); } $acc = $response->json(); @@ -231,7 +231,7 @@ class CompanyLedgerTest extends TestCase $payment_ledger = $payment->company_ledger->sortByDesc('id')->first(); - //info($payment->client->balance); + //nlog($payment->client->balance); $this->assertEquals($payment->client->balance, $payment_ledger->balance); $this->assertEquals($payment->client->paid_to_date, 10); diff --git a/tests/Integration/PaymentDrivers/AuthorizeTest.php b/tests/Integration/PaymentDrivers/AuthorizeTest.php index 68bf0d6ec8fc..3ceb956a2ca6 100644 --- a/tests/Integration/PaymentDrivers/AuthorizeTest.php +++ b/tests/Integration/PaymentDrivers/AuthorizeTest.php @@ -100,12 +100,12 @@ class AuthorizeTest extends TestCase $controller = new GetCustomerProfileIdsController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { - // info("GetCustomerProfileId's SUCCESS: "."\n"); - // info(print_r($response->getIds(), 1)); + // nlog("GetCustomerProfileId's SUCCESS: "."\n"); + // nlog(print_r($response->getIds(), 1)); } else { - // info("GetCustomerProfileId's ERROR : Invalid response\n"); + // nlog("GetCustomerProfileId's ERROR : Invalid response\n"); $errorMessages = $response->getMessages()->getMessage(); - // info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); + // nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); } $this->assertNotNull($response); @@ -171,16 +171,16 @@ class AuthorizeTest extends TestCase $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { - info('Succesfully created customer profile : '.$response->getCustomerProfileId()."\n"); + nlog('Succesfully created customer profile : '.$response->getCustomerProfileId()."\n"); $paymentProfiles = $response->getCustomerPaymentProfileIdList(); - // info(print_r($paymentProfiles, 1)); + // nlog(print_r($paymentProfiles, 1)); } else { - info("ERROR : Invalid response\n"); + nlog("ERROR : Invalid response\n"); $errorMessages = $response->getMessages()->getMessage(); - // info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); + // nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); } - // info('the new customer profile id = '.$response->getCustomerProfileId()); + // nlog('the new customer profile id = '.$response->getCustomerProfileId()); $this->assertNotNull($response); } @@ -202,10 +202,10 @@ class AuthorizeTest extends TestCase $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { - // info('got profile'); - // info(print_r($response->getProfile(), 1)); + // nlog('got profile'); + // nlog(print_r($response->getProfile(), 1)); } else { - info("ERROR : Invalid response\n"); + nlog("ERROR : Invalid response\n"); } $this->assertNotNull($response); @@ -213,7 +213,7 @@ class AuthorizeTest extends TestCase public function testCreateCustomerPaymentProfile() { - info('test create customer payment profile'); + nlog('test create customer payment profile'); error_reporting(E_ALL & ~E_DEPRECATED); @@ -270,11 +270,11 @@ class AuthorizeTest extends TestCase $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { - // info('Create Customer Payment Profile SUCCESS: '.$response->getCustomerPaymentProfileId()."\n"); + // nlog('Create Customer Payment Profile SUCCESS: '.$response->getCustomerPaymentProfileId()."\n"); } else { - // info("Create Customer Payment Profile: ERROR Invalid response\n"); + // nlog("Create Customer Payment Profile: ERROR Invalid response\n"); $errorMessages = $response->getMessages()->getMessage(); - // info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); + // nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); } $this->assertNotNull($response); @@ -316,32 +316,32 @@ class AuthorizeTest extends TestCase $tresponse = $response->getTransactionResponse(); if ($tresponse != null && $tresponse->getMessages() != null) { - info(' Transaction Response code : '.$tresponse->getResponseCode()."\n"); - info('Charge Customer Profile APPROVED :'."\n"); - info(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()."\n"); - info(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()."\n"); - info(' Code : '.$tresponse->getMessages()[0]->getCode()."\n"); - info(' Description : '.$tresponse->getMessages()[0]->getDescription()."\n"); + nlog(' Transaction Response code : '.$tresponse->getResponseCode()."\n"); + nlog('Charge Customer Profile APPROVED :'."\n"); + nlog(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()."\n"); + nlog(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()."\n"); + nlog(' Code : '.$tresponse->getMessages()[0]->getCode()."\n"); + nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()."\n"); } else { - info("Transaction Failed \n"); + nlog("Transaction Failed \n"); if ($tresponse->getErrors() != null) { - info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n"); - info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n"); + nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n"); + nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n"); } } } else { - info("Transaction Failed \n"); + nlog("Transaction Failed \n"); $tresponse = $response->getTransactionResponse(); if ($tresponse != null && $tresponse->getErrors() != null) { - info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n"); - info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n"); + nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n"); + nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n"); } else { - info(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()."\n"); - info(' Error message : '.$response->getMessages()->getMessage()[0]->getText()."\n"); + nlog(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()."\n"); + nlog(' Error message : '.$response->getMessages()->getMessage()[0]->getText()."\n"); } } } else { - info("No response returned \n"); + nlog("No response returned \n"); } $this->assertNotNull($response);