diff --git a/VERSION.txt b/VERSION.txt index 9c6da40607ea..91e000a3e7f1 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.31 \ No newline at end of file +5.5.32 \ No newline at end of file diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 36f0f9d8dd63..846496a487b0 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -712,14 +712,23 @@ class CheckData extends Command ->pluck('p') ->first(); + $over_payment = $over_payment*-1; + + if(floatval($over_payment) == floatval($client->balance)){ + + } + else { + + $this->logMessage("# {$client->id} # {$client->name} {$client->balance} is invalid should be {$over_payment}"); + + } - $this->logMessage("# {$client->id} # {$client->name} {$client->balance} is invalid should be {$over_payment}"); if($this->option('client_balance') && (floatval($over_payment) != floatval($client->balance) )){ $this->logMessage("# {$client->id} " . $client->present()->name().' - '.$client->number." Fixing {$client->balance} to 0"); - $client->balance = $over_payment * -1; + $client->balance = $over_payment; $client->save(); } diff --git a/app/Filters/ClientFilters.php b/app/Filters/ClientFilters.php index 18eb909d0c58..422842a46c4b 100644 --- a/app/Filters/ClientFilters.php +++ b/app/Filters/ClientFilters.php @@ -28,7 +28,7 @@ class ClientFilters extends QueryFilters * @param string $name * @return Builder */ - public function name(string $name): Builder + public function name(string $name = ''): Builder { if(strlen($name) >=1) return $this->builder->where('name', 'like', '%'.$name.'%'); diff --git a/app/Http/Controllers/SubdomainController.php b/app/Http/Controllers/SubdomainController.php index 46dc95744cc8..b9513a8c5dad 100644 --- a/app/Http/Controllers/SubdomainController.php +++ b/app/Http/Controllers/SubdomainController.php @@ -36,6 +36,7 @@ class SubdomainController extends BaseController 'lb', 'shopify', 'beta', + 'prometh' ]; public function __construct() diff --git a/app/Jobs/Ledger/ClientLedgerBalanceUpdate.php b/app/Jobs/Ledger/ClientLedgerBalanceUpdate.php index 36055d693da4..19db1c829087 100644 --- a/app/Jobs/Ledger/ClientLedgerBalanceUpdate.php +++ b/app/Jobs/Ledger/ClientLedgerBalanceUpdate.php @@ -51,7 +51,7 @@ class ClientLedgerBalanceUpdate implements ShouldQueue MultiDB::setDb($this->company->db); - CompanyLedger::where('balance', 0)->where('client_id', $this->client->id)->cursor()->each(function ($company_ledger) { + CompanyLedger::where('balance', 0)->where('client_id', $this->client->id)->orderBy('updated_at', 'ASC')->cursor()->each(function ($company_ledger) { if ($company_ledger->balance > 0) { return; } diff --git a/app/PaymentDrivers/Stripe/Charge.php b/app/PaymentDrivers/Stripe/Charge.php index f1dee3019796..3c927e544baa 100644 --- a/app/PaymentDrivers/Stripe/Charge.php +++ b/app/PaymentDrivers/Stripe/Charge.php @@ -78,6 +78,7 @@ class Charge 'payment_method' => $cgt->token, 'customer' => $cgt->gateway_customer_reference, 'confirm' => true, + // 'off_session' => true, 'description' => $description, 'metadata' => [ 'payment_hash' => $payment_hash->hash, diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index a46d17ace9c8..5917c9212de7 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -398,7 +398,7 @@ class StripePaymentDriver extends BaseDriver { $this->init(); - $params = []; + $params = ['usage' => 'off_session']; $meta = $this->stripe_connect_auth; return SetupIntent::create($params, $meta); diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index 57e8de922f05..2b4b36df758f 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -79,7 +79,10 @@ class RefundPayment TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db); - SystemLogger::dispatch(['user' => auth()->user() ? auth()->user()->email : '', 'paymentables' => $this->payment->paymentables->makeHidden(['id','payment_id', 'paymentable_id','paymentable_type', 'deleted_at'])->toArray(), 'request' => request() ? request()->all() : []], SystemLog::CATEGORY_LOG, SystemLog::EVENT_USER, SystemLog::TYPE_GENERIC, $this->payment->client, $this->payment->company); + $notes = ctrans('texts.refunded') . " : {$this->total_refund} - " . ctrans('texts.gateway_refund') . " : "; + $notes .= $this->refund_data['gateway_refund'] !== false ? ctrans('texts.yes') : ctrans('texts.no'); + + $this->createActivity($notes); return $this->payment; } @@ -98,8 +101,6 @@ class RefundPayment $this->payment->refunded += $this->total_refund; - $this->createActivity($this->payment); - if ($response['success'] == false) { $this->payment->save(); @@ -133,7 +134,7 @@ class RefundPayment $fields->company_id = $this->payment->company_id; $fields->activity_type_id = Activity::REFUNDED_PAYMENT; // $fields->credit_id = $this->credit_note->id; // TODO - $fields->notes = json_encode($notes); + $fields->notes = $notes; if (isset($this->refund_data['invoices'])) { foreach ($this->refund_data['invoices'] as $invoice) { diff --git a/config/l5-swagger.php b/config/l5-swagger.php index b97581cdb9dd..d7eeac03f990 100644 --- a/config/l5-swagger.php +++ b/config/l5-swagger.php @@ -40,7 +40,7 @@ return [ /* * Route for accessing parsed swagger annotations. */ - 'docs' => 'docs', + 'docs' => 'swagger-docs-that-should-be-inaccessible', /* * Route for Oauth2 authentication callback. diff --git a/config/mail.php b/config/mail.php index 2b778f378dfe..0cd235b4048f 100644 --- a/config/mail.php +++ b/config/mail.php @@ -43,6 +43,7 @@ return [ 'password' => env('MAIL_PASSWORD'), 'timeout' => null, 'local_domain' => env('MAIL_EHLO_DOMAIN'), + 'verify_peer' => env('MAIL_VERIFY_PEER', true), ], 'ses' => [ diff --git a/config/ninja.php b/config/ninja.php index cac1d3333d1f..7fe3ff05f171 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.5.31', - 'app_tag' => '5.5.31', + 'app_version' => '5.5.32', + 'app_tag' => '5.5.32', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),