mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #7340 from turbo124/v5-develop
Fixes for custom messages
This commit is contained in:
commit
e5798b442b
@ -529,17 +529,17 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->currency()->code == 'EUR' && in_array(GatewayType::SEPA, array_column($pms, 'gateway_type_id'))) {
|
// if ($this->currency()->code == 'EUR' && in_array(GatewayType::SEPA, array_column($pms, 'gateway_type_id'))) {
|
||||||
foreach ($pms as $pm) {
|
// foreach ($pms as $pm) {
|
||||||
if ($pm['gateway_type_id'] == GatewayType::SEPA) {
|
// if ($pm['gateway_type_id'] == GatewayType::SEPA) {
|
||||||
$cg = CompanyGateway::find($pm['company_gateway_id']);
|
// $cg = CompanyGateway::find($pm['company_gateway_id']);
|
||||||
|
|
||||||
if ($cg && $cg->fees_and_limits->{GatewayType::SEPA}->is_enabled) {
|
// if ($cg && $cg->fees_and_limits->{GatewayType::SEPA}->is_enabled) {
|
||||||
return $cg;
|
// return $cg;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ($this->country && $this->country->iso_3166_3 == 'GBR' && in_array(GatewayType::DIRECT_DEBIT, array_column($pms, 'gateway_type_id'))) {
|
if ($this->country && $this->country->iso_3166_3 == 'GBR' && in_array(GatewayType::DIRECT_DEBIT, array_column($pms, 'gateway_type_id'))) {
|
||||||
foreach ($pms as $pm) {
|
foreach ($pms as $pm) {
|
||||||
|
@ -34,6 +34,12 @@ class SEPA
|
|||||||
|
|
||||||
public function authorizeView($data)
|
public function authorizeView($data)
|
||||||
{
|
{
|
||||||
|
$data['gateway'] = $this->stripe;
|
||||||
|
$data['payment_method_id'] = GatewayType::SEPA;
|
||||||
|
$data['client'] = $this->stripe->client;
|
||||||
|
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||||
|
$data['currency'] = $this->stripe->client->currency();
|
||||||
|
|
||||||
return render('gateways.stripe.sepa.authorize', $data);
|
return render('gateways.stripe.sepa.authorize', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,6 +362,8 @@ class InvoiceService
|
|||||||
if(!collect($this->invoice->line_items)->contains('type_id', 3))
|
if(!collect($this->invoice->line_items)->contains('type_id', 3))
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
|
$pre_count = count($this->invoice->line_items);
|
||||||
|
|
||||||
$this->invoice->line_items = collect($this->invoice->line_items)
|
$this->invoice->line_items = collect($this->invoice->line_items)
|
||||||
->reject(function ($item) {
|
->reject(function ($item) {
|
||||||
return $item->type_id == '3';
|
return $item->type_id == '3';
|
||||||
@ -372,7 +374,7 @@ class InvoiceService
|
|||||||
/* 24-03-2022 */
|
/* 24-03-2022 */
|
||||||
$new_balance = $this->invoice->balance;
|
$new_balance = $this->invoice->balance;
|
||||||
|
|
||||||
if(floatval($balance) - floatval($new_balance) != 0)
|
if($pre_count != count($this->invoice->line_items))
|
||||||
{
|
{
|
||||||
$adjustment = $balance - $new_balance;
|
$adjustment = $balance - $new_balance;
|
||||||
|
|
||||||
|
@ -96,17 +96,10 @@ class MarkPaid extends AbstractService
|
|||||||
$payment->ledger()
|
$payment->ledger()
|
||||||
->updatePaymentBalance($payment->amount * -1);
|
->updatePaymentBalance($payment->amount * -1);
|
||||||
|
|
||||||
// $client = $this->invoice->client->fresh();
|
$client = $this->invoice->client->fresh();
|
||||||
// $client->paid_to_date += $payment->amount;
|
$client->paid_to_date += $payment->amount;
|
||||||
// $client->balance += $payment->amount * -1;
|
$client->balance += $payment->amount * -1;
|
||||||
// $client->save();
|
$client->save();
|
||||||
|
|
||||||
$this->invoice
|
|
||||||
->client
|
|
||||||
->service()
|
|
||||||
->updateBalance($payment->amount * -1)
|
|
||||||
->updatePaidToDate($payment->amount)
|
|
||||||
->save();
|
|
||||||
|
|
||||||
$this->invoice = $this->invoice
|
$this->invoice = $this->invoice
|
||||||
->service()
|
->service()
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Gateway;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class ReverseAppleDomainForHosted extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(Ninja::isHosted())
|
||||||
|
{
|
||||||
|
|
||||||
|
$stripe_connect = Gateway::find(56);
|
||||||
|
|
||||||
|
if($stripe_connect){
|
||||||
|
$stripe_connect->fields = '{"account_id":""}';
|
||||||
|
$stripe_connect->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
@ -31,7 +31,7 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
@if(isset($account) && !$account->isPaid())
|
@if(isset($company->account) && !$company->account->isPaid())
|
||||||
<title>@yield('meta_title', '') — Invoice Ninja</title>
|
<title>@yield('meta_title', '') — Invoice Ninja</title>
|
||||||
@elseif(isset($company) && !is_null($company))
|
@elseif(isset($company) && !is_null($company))
|
||||||
<title>@yield('meta_title', '') — {{ $company->present()->name() }}</title>
|
<title>@yield('meta_title', '') — {{ $company->present()->name() }}</title>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
{{-- Feel free to push anything to header using @push('header') --}}
|
{{-- Feel free to push anything to header using @push('header') --}}
|
||||||
@stack('head')
|
@stack('head')
|
||||||
|
|
||||||
@if((isset($account) && $account->isPaid()) || ((bool) \App\Utils\Ninja::isSelfHost() && !empty($client->getSetting('portal_custom_head'))))
|
@if((isset($company) && $company->account->isPaid() && !empty($client->getSetting('portal_custom_head'))) || ((bool) \App\Utils\Ninja::isSelfHost() && !empty($client->getSetting('portal_custom_head'))))
|
||||||
<div class="py-1 text-sm text-center text-white bg-primary">
|
<div class="py-1 text-sm text-center text-white bg-primary">
|
||||||
{!! $client->getSetting('portal_custom_head') !!}
|
{!! $client->getSetting('portal_custom_head') !!}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user