diff --git a/VERSION.txt b/VERSION.txt index 4d42c3866b..72e2dd4be4 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.3.60 \ No newline at end of file +5.3.61 \ No newline at end of file diff --git a/app/Console/Commands/BackupUpdate.php b/app/Console/Commands/BackupUpdate.php index d1418a7a79..d8275328c8 100644 --- a/app/Console/Commands/BackupUpdate.php +++ b/app/Console/Commands/BackupUpdate.php @@ -77,7 +77,7 @@ class BackupUpdate extends Command { set_time_limit(0); - Backup::chunk(100, function ($backups) { + Backup::whereRaw('html_backup != "" OR html_backup IS NOT NULL')->chunk(5000, function ($backups) { foreach ($backups as $backup) { if($backup->activity->client()->exists()){ diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index 0b4d430821..5d9a8447c2 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -80,7 +80,6 @@ class BaseImport public function getCsvData($entity_type) { - nlog("get csv data = entity name = " . $entity_type); $base64_encoded_csv = Cache::pull($this->hash . '-' . $entity_type); if (empty($base64_encoded_csv)) { diff --git a/app/PaymentDrivers/Mollie/CreditCard.php b/app/PaymentDrivers/Mollie/CreditCard.php index 8a6af3dd2d..1c96455d86 100644 --- a/app/PaymentDrivers/Mollie/CreditCard.php +++ b/app/PaymentDrivers/Mollie/CreditCard.php @@ -70,6 +70,12 @@ class CreditCard 'sequenceType' => 'recurring', 'description' => \sprintf('Hash: %s', $this->mollie->payment_hash->hash), 'webhookUrl' => $this->mollie->company_gateway->webhookUrl(), + 'metadata' => [ + 'client_id' => $this->mollie->client->hashed_id, + 'hash' => $this->mollie->payment_hash->hash, + 'gateway_type_id' => GatewayType::CREDIT_CARD, + 'payment_type_id' => PaymentType::CREDIT_CARD_OTHER, + ], ]); if ($payment->status === 'paid') { @@ -106,6 +112,12 @@ class CreditCard 'hash' => $this->mollie->payment_hash->hash, ]), 'webhookUrl' => $this->mollie->company_gateway->webhookUrl(), + 'metadata' => [ + 'client_id' => $this->mollie->client->hashed_id, + 'hash' => $this->mollie->payment_hash->hash, + 'gateway_type_id' => GatewayType::CREDIT_CARD, + 'payment_type_id' => PaymentType::CREDIT_CARD_OTHER, + ], 'cardToken' => $request->gateway_response, ]; diff --git a/app/Providers/MailServiceProvider.php b/app/Providers/MailServiceProvider.php index cc16f654f7..55f0b37290 100644 --- a/app/Providers/MailServiceProvider.php +++ b/app/Providers/MailServiceProvider.php @@ -17,6 +17,7 @@ use Coconuts\Mail\PostmarkTransport; use GuzzleHttp\Client as HttpClient; use Illuminate\Mail\MailServiceProvider as MailProvider; use Illuminate\Mail\TransportManager; +use Illuminate\Container\Container; class MailServiceProvider extends MailProvider { @@ -33,11 +34,17 @@ class MailServiceProvider extends MailProvider protected function registerIlluminateMailer() { - + // //this is not octane safe $this->app->singleton('mail.manager', function($app) { return new GmailTransportManager($app); }); + + //this is octane ready - but is untested + // $this->app->bind('mail.manager', function ($app){ + // return new GmailTransportManager($app); + // }); + $this->app->bind('mailer', function ($app) { return $app->make('mail.manager')->mailer(); }); diff --git a/app/Providers/NinjaTranslationServiceProvider.php b/app/Providers/NinjaTranslationServiceProvider.php index 985987bc02..7054f32514 100644 --- a/app/Providers/NinjaTranslationServiceProvider.php +++ b/app/Providers/NinjaTranslationServiceProvider.php @@ -33,6 +33,7 @@ class NinjaTranslationServiceProvider extends TranslationServiceProvider * */ + //this is not octane safe $this->app->singleton('translator', function ($app) { $loader = $app['translation.loader']; diff --git a/app/Services/Client/PaymentMethod.php b/app/Services/Client/PaymentMethod.php index 4a18387d22..f36fb2b2d3 100644 --- a/app/Services/Client/PaymentMethod.php +++ b/app/Services/Client/PaymentMethod.php @@ -70,16 +70,16 @@ class PaymentMethod $transformed_ids = $this->transformKeys(explode(',', $company_gateways)); - $this->gateways = - CompanyGateway::with('gateway') - ->where('company_id', $this->client->company_id) + $this->gateways = $this->client + ->company + ->company_gateways ->whereIn('id', $transformed_ids) ->where('is_deleted', false) ->whereNull('deleted_at') ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa') ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority return array_search($model->id, $transformed_ids);// this closure sorts for us - })->get(); + }); } else { @@ -105,15 +105,16 @@ class PaymentMethod $transformed_ids = $this->transformKeys(explode(',', $company_gateways)); - $this->gateways = CompanyGateway::with('gateway') - ->where('company_id', $this->client->company_id) + $this->gateways = $this->client + ->company + ->company_gateways ->whereIn('id', $transformed_ids) ->where('is_deleted', false) ->whereNull('deleted_at') ->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa') ->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority return array_search($model->id, $transformed_ids);// this closure sorts for us - })->get(); + }); } else { diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php index 6f633612e4..ca4a7e5d5b 100644 --- a/app/Utils/Helpers.php +++ b/app/Utils/Helpers.php @@ -262,9 +262,11 @@ class Helpers } } - $x = str_replace(["\n", "
"], ["\r", "
"], $value); + return $value; - return $x; + // $x = str_replace(["\n", "
"], ["\r", "
"], $value); + + // return $x; } /** diff --git a/app/Utils/Number.php b/app/Utils/Number.php index 87b99a8022..f3105ce779 100644 --- a/app/Utils/Number.php +++ b/app/Utils/Number.php @@ -205,6 +205,9 @@ class Number if($v<1) $precision = strlen($v) - strrpos($v, '.') - 1; + // if($precision == 1) + // $precision = 2; + $value = number_format($v, $precision, $decimal, $thousand); $symbol = $currency->symbol; diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index b6ae0d3c88..2b510d8c5c 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -164,6 +164,8 @@ class SystemHealth private static function extensions(): array { + $loaded_extensions = null; + $loaded_extensions = []; foreach (self::$extensions as $extension) { diff --git a/config/ninja.php b/config/ninja.php index 491c140389..5bbe097f9a 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.3.60', - 'app_tag' => '5.3.60', + 'app_version' => '5.3.61', + 'app_tag' => '5.3.61', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/resources/views/portal/ninja2020/auth/login.blade.php b/resources/views/portal/ninja2020/auth/login.blade.php index 5fbc2a0527..44fdaf5d39 100644 --- a/resources/views/portal/ninja2020/auth/login.blade.php +++ b/resources/views/portal/ninja2020/auth/login.blade.php @@ -26,7 +26,7 @@ @elseif(isset($company) && !is_null($company))
{{ $company->present()->name() }} logo + class="mx-auto border-b border-gray-100 h-18 pb-4" alt="{{ $company->present()->name() }} logo">
@endif diff --git a/resources/views/portal/ninja2020/invoices/payment.blade.php b/resources/views/portal/ninja2020/invoices/payment.blade.php index a3969763b6..b45fd44355 100644 --- a/resources/views/portal/ninja2020/invoices/payment.blade.php +++ b/resources/views/portal/ninja2020/invoices/payment.blade.php @@ -78,7 +78,7 @@ {{ ctrans('texts.due_date') }}
- {{ $invoice->due_date }} + {{ $invoice->translateDate($invoice->due_date, $invoice->client->date_format(), $invoice->client->locale()) }}
@endif diff --git a/routes/web.php b/routes/web.php index f29bf383ab..67513dc9cc 100644 --- a/routes/web.php +++ b/routes/web.php @@ -41,7 +41,7 @@ Route::group(['middleware' => ['url_db']], function () { Route::get('stripe/signup/{token}', 'StripeConnectController@initialize')->name('stripe_connect.initialization'); Route::get('stripe/completed', 'StripeConnectController@completed')->name('stripe_connect.return'); -Route::get('checkout/3ds_redirect/{company_key}/{company_gateway_id}/{hash}', 'Gateways\Checkout3dsController@index')->name('checkout.3ds_redirect'); -Route::get('mollie/3ds_redirect/{company_key}/{company_gateway_id}/{hash}', 'Gateways\Mollie3dsController@index')->name('mollie.3ds_redirect'); -Route::get('gocardless/ibp_redirect/{company_key}/{company_gateway_id}/{hash}', 'Gateways\GoCardlessController@ibpRedirect')->name('gocardless.ibp_redirect'); +Route::get('checkout/3ds_redirect/{company_key}/{company_gateway_id}/{hash}', 'Gateways\Checkout3dsController@index')->middleware('domain_db')->name('checkout.3ds_redirect'); +Route::get('mollie/3ds_redirect/{company_key}/{company_gateway_id}/{hash}', 'Gateways\Mollie3dsController@index')->middleware('domain_db')->name('mollie.3ds_redirect'); +Route::get('gocardless/ibp_redirect/{company_key}/{company_gateway_id}/{hash}', 'Gateways\GoCardlessController@ibpRedirect')->middleware('domain_db')->name('gocardless.ibp_redirect'); Route::get('.well-known/apple-developer-merchantid-domain-association', 'ClientPortal\ApplePayDomainController@showAppleMerchantId');