Merge pull request #8855 from turbo124/v5-develop

v5.7.26
This commit is contained in:
David Bomba 2023-10-05 12:01:28 +11:00 committed by GitHub
commit 49d848e9c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 151 additions and 101 deletions

View File

@ -1 +1 @@
5.7.24 5.7.26

View File

@ -132,6 +132,7 @@ class BaseExport
]; ];
protected array $invoice_report_keys = [ protected array $invoice_report_keys = [
'name' => 'client.name',
"invoice_number" => "invoice.number", "invoice_number" => "invoice.number",
"amount" => "invoice.amount", "amount" => "invoice.amount",
"balance" => "invoice.balance", "balance" => "invoice.balance",

View File

@ -114,7 +114,7 @@ class PaymentFilters extends QueryFilters
} }
if(in_array('partially_unapplied', $status_parameters)) { if(in_array('partially_unapplied', $status_parameters)) {
$query->where('amount', '>', 'applied')->where('refunded', 0); $query->whereColumn('amount', '>', 'applied')->where('refunded', 0);
} }
}); });

View File

@ -80,6 +80,7 @@ class ContactForgotPasswordController extends Controller
'passwordEmailRoute' => 'client.password.email', 'passwordEmailRoute' => 'client.password.email',
'account' => $account, 'account' => $account,
'company' => $company, 'company' => $company,
'is_react' => false,
]); ]);
} }

View File

@ -33,11 +33,18 @@ class StorePaymentRequest extends Request
*/ */
public function authorize() : bool public function authorize() : bool
{ {
return auth()->user()->can('create', Payment::class); /** @var \App\Models\User $user */
$user = auth()->user();
return $user->can('create', Payment::class);
} }
public function prepareForValidation() public function prepareForValidation()
{ {
/** @var \App\Models\User $user */
$user = auth()->user();
$input = $this->all(); $input = $this->all();
$invoices_total = 0; $invoices_total = 0;
@ -86,7 +93,7 @@ class StorePaymentRequest extends Request
} }
if (! isset($input['date'])) { if (! isset($input['date'])) {
$input['date'] = now()->addSeconds(auth()->user()->company()->timezone()->utc_offset)->format('Y-m-d'); $input['date'] = now()->addSeconds($user->company()->timezone()->utc_offset)->format('Y-m-d');
} }
$this->replace($input); $this->replace($input);
@ -94,10 +101,13 @@ class StorePaymentRequest extends Request
public function rules() public function rules()
{ {
/** @var \App\Models\User $user */
$user = auth()->user();
$rules = [ $rules = [
'amount' => ['numeric', 'bail', new PaymentAmountsBalanceRule(), new ValidCreditsPresentRule($this->all())], 'amount' => ['numeric', 'bail', new PaymentAmountsBalanceRule(), new ValidCreditsPresentRule($this->all())],
// 'client_id' => 'bail|required|exists:clients,id', // 'client_id' => 'bail|required|exists:clients,id',
'client_id' => 'bail|required|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0', 'client_id' => 'bail|required|exists:clients,id,company_id,'.$user->company()->id.',is_deleted,0',
'invoices.*.invoice_id' => 'bail|required|distinct|exists:invoices,id', 'invoices.*.invoice_id' => 'bail|required|distinct|exists:invoices,id',
'invoices.*.amount' => 'bail|required', 'invoices.*.amount' => 'bail|required',
'invoices.*.invoice_id' => new ValidInvoicesRules($this->all()), 'invoices.*.invoice_id' => new ValidInvoicesRules($this->all()),
@ -105,8 +115,8 @@ class StorePaymentRequest extends Request
'credits.*.credit_id' => new ValidCreditsRules($this->all()), 'credits.*.credit_id' => new ValidCreditsRules($this->all()),
'credits.*.amount' => ['bail','required', new CreditsSumRule($this->all())], 'credits.*.amount' => ['bail','required', new CreditsSumRule($this->all())],
'invoices' => new ValidPayableInvoicesRule(), 'invoices' => new ValidPayableInvoicesRule(),
'number' => ['nullable', 'bail', Rule::unique('payments')->where('company_id', auth()->user()->company()->id)], 'number' => ['nullable', 'bail', Rule::unique('payments')->where('company_id', $user->company()->id)],
'idempotency_key' => ['nullable', 'bail', 'string','max:64', Rule::unique('payments')->where('company_id', auth()->user()->company()->id)], 'idempotency_key' => ['nullable', 'bail', 'string','max:64', Rule::unique('payments')->where('company_id', $user->company()->id)],
]; ];

View File

@ -660,7 +660,7 @@ class User extends Authenticatable implements MustVerifyEmail
public function getLocale() public function getLocale()
{ {
$locale = $this->language->locale ?? false; $locale = $this->language->locale ?? null;
if($locale) if($locale)
App::setLocale($locale); App::setLocale($locale);

View File

@ -98,10 +98,17 @@ class GoCardlessPaymentDriver extends BaseDriver
public function init(): self public function init(): self
{ {
$this->gateway = new \GoCardlessPro\Client([ try {
'access_token' => $this->company_gateway->getConfigField('accessToken'), $this->gateway = new \GoCardlessPro\Client([
'environment' => $this->company_gateway->getConfigField('testMode') ? \GoCardlessPro\Environment::SANDBOX : \GoCardlessPro\Environment::LIVE, 'access_token' => $this->company_gateway->getConfigField('accessToken'),
]); 'environment' => $this->company_gateway->getConfigField('testMode') ? \GoCardlessPro\Environment::SANDBOX : \GoCardlessPro\Environment::LIVE,
]);
}
catch(\GoCardlessPro\Core\Exception\AuthenticationException $e){
throw new \Exception('GoCardless: Invalid Access Token', 403);
}
return $this; return $this;
} }

View File

@ -101,6 +101,9 @@ class PaymentRepository extends BaseRepository
$client->saveQuietly(); $client->saveQuietly();
} }
}, 1); }, 1);
$client = Client::query()->where('id', $data['client_id'])->withTrashed()->first();
} }
/*Fill the payment*/ /*Fill the payment*/
@ -108,7 +111,7 @@ class PaymentRepository extends BaseRepository
$payment->is_manual = true; $payment->is_manual = true;
$payment->status_id = Payment::STATUS_COMPLETED; $payment->status_id = Payment::STATUS_COMPLETED;
if (! $payment->currency_id && $client) { if ((!$payment->currency_id || $payment->currency_id == 0) && $client) {
if (property_exists($client->settings, 'currency_id')) { if (property_exists($client->settings, 'currency_id')) {
$payment->currency_id = $client->settings->currency_id; $payment->currency_id = $client->settings->currency_id;
} else { } else {

View File

@ -90,7 +90,6 @@ class RecurringExpenseTransformer extends EntityTransformer
'currency_id' => (string) $recurring_expense->currency_id ?: '', 'currency_id' => (string) $recurring_expense->currency_id ?: '',
'category_id' => $this->encodePrimaryKey($recurring_expense->category_id), 'category_id' => $this->encodePrimaryKey($recurring_expense->category_id),
'payment_type_id' => (string) $recurring_expense->payment_type_id ?: '', 'payment_type_id' => (string) $recurring_expense->payment_type_id ?: '',
'recurring_recurring_expense_id' => (string) $recurring_expense->recurring_recurring_expense_id ?: '',
'is_deleted' => (bool) $recurring_expense->is_deleted, 'is_deleted' => (bool) $recurring_expense->is_deleted,
'should_be_invoiced' => (bool) $recurring_expense->should_be_invoiced, 'should_be_invoiced' => (bool) $recurring_expense->should_be_invoiced,
'invoice_documents' => (bool) $recurring_expense->invoice_documents, 'invoice_documents' => (bool) $recurring_expense->invoice_documents,

107
composer.lock generated
View File

@ -485,16 +485,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.282.0", "version": "3.283.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "79a3ed5bb573f592823f8b1cffe0dbac3132e6b4" "reference": "5084c03431ecda0003e35d7fc7a12eeca4242685"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/79a3ed5bb573f592823f8b1cffe0dbac3132e6b4", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5084c03431ecda0003e35d7fc7a12eeca4242685",
"reference": "79a3ed5bb573f592823f8b1cffe0dbac3132e6b4", "reference": "5084c03431ecda0003e35d7fc7a12eeca4242685",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -574,9 +574,9 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.282.0" "source": "https://github.com/aws/aws-sdk-php/tree/3.283.0"
}, },
"time": "2023-09-28T18:09:20+00:00" "time": "2023-10-04T18:08:32+00:00"
}, },
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -2169,16 +2169,16 @@
}, },
{ {
"name": "firebase/php-jwt", "name": "firebase/php-jwt",
"version": "v6.8.1", "version": "v6.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/firebase/php-jwt.git", "url": "https://github.com/firebase/php-jwt.git",
"reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" "reference": "f03270e63eaccf3019ef0f32849c497385774e11"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11",
"reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", "reference": "f03270e63eaccf3019ef0f32849c497385774e11",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2226,9 +2226,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/firebase/php-jwt/issues", "issues": "https://github.com/firebase/php-jwt/issues",
"source": "https://github.com/firebase/php-jwt/tree/v6.8.1" "source": "https://github.com/firebase/php-jwt/tree/v6.9.0"
}, },
"time": "2023-07-14T18:33:00+00:00" "time": "2023-10-05T00:24:42+00:00"
}, },
{ {
"name": "fruitcake/php-cors", "name": "fruitcake/php-cors",
@ -4287,16 +4287,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v10.25.2", "version": "v10.26.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "6014dd456b414b305fb0b408404efdcec18e64bc" "reference": "6e5440f7c518f26b4495e5d7e4796ec239e26df9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/6014dd456b414b305fb0b408404efdcec18e64bc", "url": "https://api.github.com/repos/laravel/framework/zipball/6e5440f7c518f26b4495e5d7e4796ec239e26df9",
"reference": "6014dd456b414b305fb0b408404efdcec18e64bc", "reference": "6e5440f7c518f26b4495e5d7e4796ec239e26df9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4483,20 +4483,20 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2023-09-28T14:08:59+00:00" "time": "2023-10-03T14:24:20+00:00"
}, },
{ {
"name": "laravel/prompts", "name": "laravel/prompts",
"version": "v0.1.10", "version": "v0.1.11",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/prompts.git", "url": "https://github.com/laravel/prompts.git",
"reference": "37ed55f6950d921a87d5beeab16d03f8de26b060" "reference": "cce65a90e64712909ea1adc033e1d88de8455ffd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/37ed55f6950d921a87d5beeab16d03f8de26b060", "url": "https://api.github.com/repos/laravel/prompts/zipball/cce65a90e64712909ea1adc033e1d88de8455ffd",
"reference": "37ed55f6950d921a87d5beeab16d03f8de26b060", "reference": "cce65a90e64712909ea1adc033e1d88de8455ffd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4538,9 +4538,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/laravel/prompts/issues", "issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.10" "source": "https://github.com/laravel/prompts/tree/v0.1.11"
}, },
"time": "2023-09-29T07:26:07+00:00" "time": "2023-10-03T01:07:35+00:00"
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
@ -9560,16 +9560,16 @@
}, },
{ {
"name": "sentry/sentry-laravel", "name": "sentry/sentry-laravel",
"version": "3.8.0", "version": "3.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-laravel.git", "url": "https://github.com/getsentry/sentry-laravel.git",
"reference": "c7e7611553f9f90af10ed98dde1a680220f02e4d" "reference": "b6142a80fa9360a10b786d2da032339602d0e362"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/c7e7611553f9f90af10ed98dde1a680220f02e4d", "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/b6142a80fa9360a10b786d2da032339602d0e362",
"reference": "c7e7611553f9f90af10ed98dde1a680220f02e4d", "reference": "b6142a80fa9360a10b786d2da032339602d0e362",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9636,7 +9636,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-laravel/issues", "issues": "https://github.com/getsentry/sentry-laravel/issues",
"source": "https://github.com/getsentry/sentry-laravel/tree/3.8.0" "source": "https://github.com/getsentry/sentry-laravel/tree/3.8.1"
}, },
"funding": [ "funding": [
{ {
@ -9648,7 +9648,7 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2023-09-05T11:02:34+00:00" "time": "2023-10-04T10:21:16+00:00"
}, },
{ {
"name": "setasign/fpdf", "name": "setasign/fpdf",
@ -14528,16 +14528,16 @@
}, },
{ {
"name": "brianium/paratest", "name": "brianium/paratest",
"version": "v7.2.7", "version": "v7.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/paratestphp/paratest.git", "url": "https://github.com/paratestphp/paratest.git",
"reference": "1526eb4fd195f65075456dee394d14742ae0a66c" "reference": "882b02d197328138686bb06ce7d8cbb98fc0a16c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/1526eb4fd195f65075456dee394d14742ae0a66c", "url": "https://api.github.com/repos/paratestphp/paratest/zipball/882b02d197328138686bb06ce7d8cbb98fc0a16c",
"reference": "1526eb4fd195f65075456dee394d14742ae0a66c", "reference": "882b02d197328138686bb06ce7d8cbb98fc0a16c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -14607,7 +14607,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/paratestphp/paratest/issues", "issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v7.2.7" "source": "https://github.com/paratestphp/paratest/tree/v7.2.8"
}, },
"funding": [ "funding": [
{ {
@ -14619,7 +14619,7 @@
"type": "paypal" "type": "paypal"
} }
], ],
"time": "2023-09-14T14:10:09+00:00" "time": "2023-10-04T13:38:04+00:00"
}, },
{ {
"name": "composer/class-map-generator", "name": "composer/class-map-generator",
@ -15046,16 +15046,16 @@
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.34.0", "version": "v3.34.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "7c7a4ad2ed8fe50df3e25528218b13d383608f23" "reference": "98bf1b1068b4ceddbbc2a2b70b67a5e380add9e3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7c7a4ad2ed8fe50df3e25528218b13d383608f23", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/98bf1b1068b4ceddbbc2a2b70b67a5e380add9e3",
"reference": "7c7a4ad2ed8fe50df3e25528218b13d383608f23", "reference": "98bf1b1068b4ceddbbc2a2b70b67a5e380add9e3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -15076,9 +15076,6 @@
"symfony/process": "^5.4 || ^6.0", "symfony/process": "^5.4 || ^6.0",
"symfony/stopwatch": "^5.4 || ^6.0" "symfony/stopwatch": "^5.4 || ^6.0"
}, },
"conflict": {
"stevebauman/unfinalize": "*"
},
"require-dev": { "require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0", "facile-it/paraunit": "^1.3 || ^2.0",
"justinrainbow/json-schema": "^5.2", "justinrainbow/json-schema": "^5.2",
@ -15132,7 +15129,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.34.0" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.34.1"
}, },
"funding": [ "funding": [
{ {
@ -15140,7 +15137,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-09-29T15:34:26+00:00" "time": "2023-10-03T23:51:05+00:00"
}, },
{ {
"name": "hamcrest/hamcrest-php", "name": "hamcrest/hamcrest-php",
@ -15851,16 +15848,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.36", "version": "1.10.37",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "ffa3089511121a672e62969404e4fddc753f9b15" "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ffa3089511121a672e62969404e4fddc753f9b15", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/058ba07e92f744d4dcf6061ae75283d0c6456f2e",
"reference": "ffa3089511121a672e62969404e4fddc753f9b15", "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -15909,20 +15906,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-09-29T14:07:45+00:00" "time": "2023-10-02T16:18:37+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "10.1.6", "version": "10.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "56f33548fe522c8d82da7ff3824b42829d324364" "reference": "355324ca4980b8916c18b9db29f3ef484078f26e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/56f33548fe522c8d82da7ff3824b42829d324364", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e",
"reference": "56f33548fe522c8d82da7ff3824b42829d324364", "reference": "355324ca4980b8916c18b9db29f3ef484078f26e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -15979,7 +15976,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.6" "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7"
}, },
"funding": [ "funding": [
{ {
@ -15987,7 +15984,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-09-19T04:59:03+00:00" "time": "2023-10-04T15:34:17+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",

View File

@ -36,10 +36,6 @@ return [
* the built in metrics. * the built in metrics.
*/ */
'system_logging' => [ 'system_logging' => [
'Turbo124\Beacon\Jobs\System\CpuMetric',
'Turbo124\Beacon\Jobs\System\HdMetric',
'Turbo124\Beacon\Jobs\System\MemMetric',
App\Jobs\Ninja\CheckDbStatus::class,
], ],
]; ];

View File

@ -15,8 +15,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' => env('APP_VERSION','5.7.24'), 'app_version' => env('APP_VERSION','5.7.26'),
'app_tag' => env('APP_TAG','5.7.24'), 'app_tag' => env('APP_TAG','5.7.26'),
'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', ''),

File diff suppressed because one or more lines are too long

View File

@ -76,7 +76,7 @@
"src": "resources/js/clients/payments/checkout-credit-card.js" "src": "resources/js/clients/payments/checkout-credit-card.js"
}, },
"resources/js/clients/payments/eway-credit-card.js": { "resources/js/clients/payments/eway-credit-card.js": {
"file": "assets/eway-credit-card-19df3242.js", "file": "assets/eway-credit-card-62ce5f3b.js",
"isEntry": true, "isEntry": true,
"src": "resources/js/clients/payments/eway-credit-card.js" "src": "resources/js/clients/payments/eway-credit-card.js"
}, },

View File

@ -469,7 +469,7 @@ class EwayRapid {
?.addEventListener('click', (e) => this.completeAuthorization(e)); ?.addEventListener('click', (e) => this.completeAuthorization(e));
Array.from( Array.from(
document.getElementsByClassName('toggle-payment-with-token') document.getElementsByClassName('toggle-payment-with-token') ?? []
).forEach((element) => ).forEach((element) =>
element.addEventListener('click', (element) => { element.addEventListener('click', (element) => {
document document
@ -483,17 +483,20 @@ class EwayRapid {
}) })
); );
document if (document.getElementById('toggle-payment-with-credit-card'))
.getElementById('toggle-payment-with-credit-card') {
.addEventListener('click', (element) => { document
document .getElementById('toggle-payment-with-credit-card')
.getElementById('eway-secure-panel') .addEventListener('click', (element) => {
.classList.remove('hidden'); document
document.getElementById('save-card--container').style.display = .getElementById('eway-secure-panel')
'grid'; .classList.remove('hidden');
document.querySelector('input[name=token]').value = ''; document.getElementById('save-card--container').style.display =
document.getElementById('pay-now').disabled = true; 'grid';
}); document.querySelector('input[name=token]').value = '';
document.getElementById('pay-now').disabled = true;
});
}
document.getElementById('pay-now')?.addEventListener('click', (e) => { document.getElementById('pay-now')?.addEventListener('click', (e) => {
let tokenInput = document.querySelector('input[name=token]'); let tokenInput = document.querySelector('input[name=token]');

View File

@ -25,7 +25,7 @@
@foreach($multiple_contacts as $contact) @foreach($multiple_contacts as $contact)
<a data-turbolinks="false" <a data-turbolinks="false"
href="{{ route('client.switch_company', $contact->hashed_id) }}" href="{{ route('client.switch_company', $contact->hashed_id) }}"
class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ $contact->client->present()->name()}} - {{ $contact->company->present()->name() }} class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ $contact->client->present()->name()}}
</a> </a>
@endforeach @endforeach
</div> </div>

View File

@ -92,5 +92,7 @@
@section('gateway_footer') @section('gateway_footer')
<script src="https://js.braintreegateway.com/web/3.81.0/js/client.min.js"></script> <script src="https://js.braintreegateway.com/web/3.81.0/js/client.min.js"></script>
<script src="https://js.braintreegateway.com/web/3.81.0/js/us-bank-account.min.js"></script> <script src="https://js.braintreegateway.com/web/3.81.0/js/us-bank-account.min.js"></script>
@vite('resources/js/clients/payment_methods/braintree-ach.js')
<script defer src="{{ asset('js/clients/payment_methods/braintree-ach.js') }}"></script>
@endsection @endsection

View File

@ -43,7 +43,7 @@
@endsection @endsection
@push('footer') @push('footer')
<script> <script defer>
Array Array
.from(document.getElementsByClassName('toggle-payment-with-token')) .from(document.getElementsByClassName('toggle-payment-with-token'))
.forEach((element) => element.addEventListener('click', (element) => { .forEach((element) => element.addEventListener('click', (element) => {

View File

@ -75,7 +75,9 @@
@endsection @endsection
@section('gateway_footer') @section('gateway_footer')
@vite('resources/js/clients/payments/braintree-credit-card.js')
<script defer src="{{ asset('js/clients/payments/braintree-credit-card.js') }}"></script>
@endsection @endsection
<div id="threeds"></div> <div id="threeds"></div>

View File

@ -158,6 +158,44 @@ class ReminderTest extends TestCase
} }
public function testReminderInThePast()
{
$translations = new \stdClass;
$translations->late_fee_added = "Fee added :date";
$settings = $this->company->settings;
$settings->enable_reminder1 = false;
$settings->schedule_reminder1 = '';
$settings->num_days_reminder1 = 1;
$settings->enable_reminder2 = false;
$settings->schedule_reminder2 = '';
$settings->num_days_reminder2 = 2;
$settings->enable_reminder3 = false;
$settings->schedule_reminder3 = '';
$settings->num_days_reminder3 = 3;
$settings->timezone_id = '29';
$settings->entity_send_time = 0;
$settings->endless_reminder_frequency_id = '5';
$settings->enable_reminder_endless = true;
$settings->translations = $translations;
$settings->late_fee_amount1 = '0';
$settings->late_fee_amount2 = '0';
$settings->late_fee_amount3 = '0';
$this->buildData(($settings));
$this->invoice->date = now()->subMonths(2)->format('Y-m-d');
$this->invoice->due_date = now()->subMonth()->format('Y-m-d');
$this->invoice->last_sent_date = now();
$this->invoice->service()->setReminder($settings)->save();
$this->invoice = $this->invoice->fresh();
$this->assertEquals(now()->startOfDay()->addMonth()->format('Y-m-d'), \Carbon\Carbon::parse($this->invoice->next_send_date)->startOfDay()->format('Y-m-d'));
}
public function testsForTranslationsInReminders() public function testsForTranslationsInReminders()
{ {