1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Merge pull request #7873 from turbo124/v5-develop

Fixes for check data + payment activities
This commit is contained in:
David Bomba 2022-10-14 21:20:05 +11:00 committed by GitHub
commit b1805010e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 26 additions and 13 deletions

View File

@ -1 +1 @@
5.5.31 5.5.32

View File

@ -712,14 +712,23 @@ class CheckData extends Command
->pluck('p') ->pluck('p')
->first(); ->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) )){ 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"); $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(); $client->save();
} }

View File

@ -28,7 +28,7 @@ class ClientFilters extends QueryFilters
* @param string $name * @param string $name
* @return Builder * @return Builder
*/ */
public function name(string $name): Builder public function name(string $name = ''): Builder
{ {
if(strlen($name) >=1) if(strlen($name) >=1)
return $this->builder->where('name', 'like', '%'.$name.'%'); return $this->builder->where('name', 'like', '%'.$name.'%');

View File

@ -36,6 +36,7 @@ class SubdomainController extends BaseController
'lb', 'lb',
'shopify', 'shopify',
'beta', 'beta',
'prometh'
]; ];
public function __construct() public function __construct()

View File

@ -51,7 +51,7 @@ class ClientLedgerBalanceUpdate implements ShouldQueue
MultiDB::setDb($this->company->db); 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) { if ($company_ledger->balance > 0) {
return; return;
} }

View File

@ -78,6 +78,7 @@ class Charge
'payment_method' => $cgt->token, 'payment_method' => $cgt->token,
'customer' => $cgt->gateway_customer_reference, 'customer' => $cgt->gateway_customer_reference,
'confirm' => true, 'confirm' => true,
// 'off_session' => true,
'description' => $description, 'description' => $description,
'metadata' => [ 'metadata' => [
'payment_hash' => $payment_hash->hash, 'payment_hash' => $payment_hash->hash,

View File

@ -398,7 +398,7 @@ class StripePaymentDriver extends BaseDriver
{ {
$this->init(); $this->init();
$params = []; $params = ['usage' => 'off_session'];
$meta = $this->stripe_connect_auth; $meta = $this->stripe_connect_auth;
return SetupIntent::create($params, $meta); return SetupIntent::create($params, $meta);

View File

@ -79,7 +79,10 @@ class RefundPayment
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db); 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; return $this->payment;
} }
@ -98,8 +101,6 @@ class RefundPayment
$this->payment->refunded += $this->total_refund; $this->payment->refunded += $this->total_refund;
$this->createActivity($this->payment);
if ($response['success'] == false) { if ($response['success'] == false) {
$this->payment->save(); $this->payment->save();
@ -133,7 +134,7 @@ class RefundPayment
$fields->company_id = $this->payment->company_id; $fields->company_id = $this->payment->company_id;
$fields->activity_type_id = Activity::REFUNDED_PAYMENT; $fields->activity_type_id = Activity::REFUNDED_PAYMENT;
// $fields->credit_id = $this->credit_note->id; // TODO // $fields->credit_id = $this->credit_note->id; // TODO
$fields->notes = json_encode($notes); $fields->notes = $notes;
if (isset($this->refund_data['invoices'])) { if (isset($this->refund_data['invoices'])) {
foreach ($this->refund_data['invoices'] as $invoice) { foreach ($this->refund_data['invoices'] as $invoice) {

View File

@ -40,7 +40,7 @@ return [
/* /*
* Route for accessing parsed swagger annotations. * Route for accessing parsed swagger annotations.
*/ */
'docs' => 'docs', 'docs' => 'swagger-docs-that-should-be-inaccessible',
/* /*
* Route for Oauth2 authentication callback. * Route for Oauth2 authentication callback.

View File

@ -43,6 +43,7 @@ return [
'password' => env('MAIL_PASSWORD'), 'password' => env('MAIL_PASSWORD'),
'timeout' => null, 'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'), 'local_domain' => env('MAIL_EHLO_DOMAIN'),
'verify_peer' => env('MAIL_VERIFY_PEER', true),
], ],
'ses' => [ 'ses' => [

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.5.31', 'app_version' => '5.5.32',
'app_tag' => '5.5.31', 'app_tag' => '5.5.32',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),