Skip to content

Commit

Permalink
Merge pull request invoiceninja#10527 from turbo124/v5-develop
Browse files Browse the repository at this point in the history
v5.11.24
  • Loading branch information
turbo124 authored Jan 14, 2025
2 parents 3d2ba32 + 5c9506a commit 4ff745d
Show file tree
Hide file tree
Showing 34 changed files with 483 additions and 468 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.11.23
5.11.24
1 change: 1 addition & 0 deletions app/Helpers/SwissQr/SwissQrGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public function run()
->setPrintable(false)
->getPaymentPart();

// return $html;
return htmlspecialchars($html);
} catch (\Exception $e) {

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/ClientPortal/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ public function showBlob($hash)
break;
}

usleep(200000);
usleep(300000);

}

$invitation = false;

match($data['entity_type'] ?? 'invoice') {
'invoice' => $invitation = InvoiceInvitation::withTrashed()->find($data['invitation_id']),
'invoice' => $invitation = InvoiceInvitation::withTrashed()->find($data['invitation_id']), //@todo - sometimes this is false!!
'quote' => $invitation = QuoteInvitation::withTrashed()->find($data['invitation_id']),
'credit' => $invitation = CreditInvitation::withTrashed()->find($data['invitation_id']),
'recurring_invoice' => $invitation = RecurringInvoiceInvitation::withTrashed()->find($data['invitation_id']),
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Requests/Company/UpdateCompanyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ private function filterSaveableSettings($settings)

if (Ninja::isHosted()) {
foreach ($this->protected_input as $protected_var) {
$settings[$protected_var] = str_replace("script", "", $settings[$protected_var]);

if(isset($settings[$protected_var])) {
$settings[$protected_var] = str_replace("script", "", $settings[$protected_var]);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use App\Http\Requests\Request;
use App\Http\ValidationRules\Project\ValidProjectForClient;
use App\Http\ValidationRules\Recurring\UniqueRecurringInvoiceNumberRule;
use App\Models\Client;
use App\Models\RecurringInvoice;
use App\Utils\Traits\CleanLineItems;
Expand Down Expand Up @@ -68,7 +67,7 @@ public function rules()

$rules['project_id'] = ['bail', 'sometimes', new ValidProjectForClient($this->all())];

$rules['number'] = new UniqueRecurringInvoiceNumberRule($this->all());
$rules['number'] = ['bail', 'nullable', \Illuminate\Validation\Rule::unique('recurring_invoices')->where('company_id', $user->company()->id)];

$rules['tax_rate1'] = 'bail|sometimes|numeric';
$rules['tax_rate2'] = 'bail|sometimes|numeric';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace App\Http\Requests\RecurringQuote;

use App\Http\Requests\Request;
use App\Http\ValidationRules\Recurring\UniqueRecurringQuoteNumberRule;
use App\Models\Client;
use App\Models\RecurringQuote;
use App\Utils\Traits\CleanLineItems;
Expand Down Expand Up @@ -63,7 +62,7 @@ public function rules()

$rules['frequency_id'] = 'required|integer|digits_between:1,12';

$rules['number'] = new UniqueRecurringQuoteNumberRule($this->all());
$rules['number'] = ['bail', 'nullable', \Illuminate\Validation\Rule::unique('recurring_quotes')->where('company_id', $user->company()->id)];

return $rules;
}
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion app/Jobs/Mail/NinjaMailerJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ private function cleanUpMailers(): void
private function checkValidSendingUser($user)
{
/* Always ensure the user is set on the correct account */
if ($user->account_id != $this->company->account_id) {
if (!$user ||($user->account_id != $this->company->account_id)) {
$this->nmo->settings->email_sending_method = 'default';
return $this->setMailDriver();
}
Expand Down
3 changes: 3 additions & 0 deletions app/Livewire/Flow2/InvoicePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public function paymentMethodSelected($company_gateway_id, $gateway_type_id, $am

$company_gateway = CompanyGateway::query()->find($company_gateway_id);

if(!$company_gateway)
return $this->required_fields = false;

$this->checkRequiredFields($company_gateway);
}

Expand Down
4 changes: 4 additions & 0 deletions app/PaymentDrivers/Authorize/AuthorizeTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function chargeCustomer(string $profile_id, array $data)
$transactionRequestType->setOrder($order);
$transactionRequestType->addToTransactionSettings($duplicateWindowSetting);

$solution = new \net\authorize\api\contract\v1\SolutionType();
$solution->setId($this->authorize->company_gateway->getConfigField('testMode') ? 'AAA100303' : 'AAA172036');
$transactionRequestType->setSolution($solution);

$transactionRequestType->setPayment($paymentOne);
$transactionRequestType->setCurrencyCode($this->authorize->client->currency()->code);

Expand Down
4 changes: 4 additions & 0 deletions app/PaymentDrivers/Authorize/ChargePaymentProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public function chargeCustomerProfile($profile_id, $payment_profile_id, $amount)
$transactionRequestType->setProfile($profileToCharge);
$transactionRequestType->setCurrencyCode($this->authorize->client->currency()->code);

$solution = new \net\authorize\api\contract\v1\SolutionType();
$solution->setId($this->authorize->company_gateway->getConfigField('testMode') ? 'AAA100303' : 'AAA172036');
$transactionRequestType->setSolution($solution);

$request = new CreateTransactionRequest();
$request->setMerchantAuthentication($this->authorize->merchant_authentication);
$request->setRefId($refId);
Expand Down
4 changes: 4 additions & 0 deletions app/PaymentDrivers/Authorize/RefundTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public function refundTransaction(Payment $payment, $amount)
$transactionRequest->setPayment($paymentOne);
$transactionRequest->setRefTransId($payment->transaction_reference);

$solution = new \net\authorize\api\contract\v1\SolutionType();
$solution->setId($this->authorize->company_gateway->getConfigField('testMode') ? 'AAA100303' : 'AAA172036');
$transactionRequest->setSolution($solution);

$request = new CreateTransactionRequest();
$request->setMerchantAuthentication($this->authorize->merchant_authentication);
$request->setRefId($refId);
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Email/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ private function cleanUpMailers(): void
private function checkValidSendingUser($user)
{
/* Always ensure the user is set on the correct account */
if ($user->account_id != $this->company->account_id) {
if (!$user || ($user->account_id != $this->company->account_id)) {
$this->email_object->settings->email_sending_method = 'default';

return $this->setMailDriver();
Expand Down
Loading

0 comments on commit 4ff745d

Please sign in to comment.