mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
9b0ed57be4
@ -1 +1 @@
|
||||
5.8.16
|
||||
5.8.17
|
@ -493,7 +493,10 @@ class CompanySettings extends BaseSettings
|
||||
|
||||
public $payment_email_all_contacts = false;
|
||||
|
||||
public $show_pdfhtml_on_mobile = true;
|
||||
|
||||
public static $casts = [
|
||||
'show_pdfhtml_on_mobile' => 'bool',
|
||||
'payment_email_all_contacts' => 'bool',
|
||||
'statement_design_id' => 'string',
|
||||
'delivery_note_design_id' => 'string',
|
||||
|
@ -54,6 +54,6 @@ class SubscriptionPlanSwitchController extends Controller
|
||||
|
||||
public function not_availabe()
|
||||
{
|
||||
abort(404, 'ewwo');
|
||||
abort(404, 'Not Available');
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,8 @@ class PdfSlot extends Component
|
||||
|
||||
private $entity_calc;
|
||||
|
||||
public $html_entity_option = true;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
MultiDB::setDb($this->db);
|
||||
@ -128,7 +130,8 @@ class PdfSlot extends Component
|
||||
$this->entity_calc = $this->entity->calc();
|
||||
|
||||
$this->settings = $this->entity->client ? $this->entity->client->getMergedSettings() : $this->entity->company->settings;
|
||||
|
||||
$this->html_entity_option = $this->entity->client ? $this->entity->client->getSetting('show_pdfhtml_on_mobile') : $this->entity->company->getSetting('show_pdfhtml_on_mobile');
|
||||
|
||||
$this->show_cost = in_array('$product.unit_cost', $this->settings->pdf_variables->product_columns);
|
||||
$this->show_line_total = in_array('$product.line_total', $this->settings->pdf_variables->product_columns);
|
||||
$this->show_quantity = in_array('$product.quantity', $this->settings->pdf_variables->product_columns);
|
||||
|
@ -155,7 +155,6 @@ class SubscriptionPlanSwitch extends Component
|
||||
|
||||
$this->dispatch('redirectRoute', ['route' => $response]);
|
||||
|
||||
// return redirect($response);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
@ -100,8 +100,8 @@ class PaymentMigrationRepository extends BaseRepository
|
||||
$payment->deleted_at = $data['deleted_at'] ?: null;
|
||||
|
||||
|
||||
if ($payment->currency_id == 0) {
|
||||
$payment->currency_id = $payment->company->settings->currency_id;
|
||||
if (!$payment->currency_id || $payment->currency_id == 0 || $payment->currency_id == '') {
|
||||
$payment->currency_id = $payment->client->settings->currency_id ?? $payment->company->settings->currency_id;
|
||||
}
|
||||
|
||||
/*Ensure payment number generated*/
|
||||
|
@ -11,25 +11,29 @@
|
||||
|
||||
namespace App\Services\Client;
|
||||
|
||||
use App\Utils\Number;
|
||||
use App\Models\Client;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Services\Email\Email;
|
||||
use App\Services\Email\EmailObject;
|
||||
use App\Utils\Number;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use Illuminate\Mail\Mailables\Address;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Services\Email\EmailObject;
|
||||
use App\Utils\Traits\GeneratesCounter;
|
||||
use Illuminate\Mail\Mailables\Address;
|
||||
use Illuminate\Database\QueryException;
|
||||
|
||||
class ClientService
|
||||
{
|
||||
use MakesDates;
|
||||
use MakesDates, GeneratesCounter;
|
||||
|
||||
private string $client_start_date;
|
||||
|
||||
private string $client_end_date;
|
||||
|
||||
private bool $completed = true;
|
||||
|
||||
public function __construct(private Client $client)
|
||||
{
|
||||
}
|
||||
@ -145,6 +149,31 @@ class ClientService
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function applyNumber(): self
|
||||
{
|
||||
$x = 1;
|
||||
|
||||
if(isset($this->client->number))
|
||||
return $this;
|
||||
|
||||
do {
|
||||
try {
|
||||
$this->client->number = $this->getNextClientNumber($this->client);
|
||||
$this->client->saveQuietly();
|
||||
|
||||
$this->completed = false;
|
||||
} catch (QueryException $e) {
|
||||
$x++;
|
||||
|
||||
if ($x > 10) {
|
||||
$this->completed = false;
|
||||
}
|
||||
}
|
||||
} while ($this->completed);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function updatePaymentBalance()
|
||||
{
|
||||
$amount = Payment::query()->where('client_id', $this->client->id)
|
||||
|
@ -17,8 +17,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => env('APP_VERSION', '5.8.16'),
|
||||
'app_tag' => env('APP_TAG', '5.8.16'),
|
||||
'app_version' => env('APP_VERSION', '5.8.17'),
|
||||
'app_tag' => env('APP_TAG', '5.8.17'),
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', false),
|
||||
|
@ -21,7 +21,11 @@
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
@if($html_entity_option)
|
||||
<div class="hidden lg:block">
|
||||
@else
|
||||
<div>
|
||||
@endif
|
||||
<div wire:init="getPdf()">
|
||||
<div class="flex mt-4 place-items-center" id="loader" wire:ignore>
|
||||
<span class="loader m-auto" wire:ignore></span>
|
||||
@ -61,17 +65,18 @@
|
||||
</style>
|
||||
</div>
|
||||
@if($pdf)
|
||||
<!-- <iframe id="pdf-iframe" src="{!! $pdf !!}" class="h-screen w-full border-0 mt-4"></iframe> -->
|
||||
<iframe id="pdf-iframe" src="/{{ $route_entity }}/showBlob/{{ $pdf }}" class="h-screen w-full border-0 mt-4"></iframe>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($html_entity_option)
|
||||
<div class="block lg:hidden">
|
||||
@include('portal.ninja2020.components.html-viewer')
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
@if(!$state['payment_initialised'])
|
||||
@foreach($this->methods as $method)
|
||||
<button
|
||||
wire:click="handleMethodSelectingEvent('{{ $method['company_gateway_id'] }}', '{{ $method['gateway_type_id'] }}')"
|
||||
wire:click="handleMethodSelectingEvent('{{ $method['company_gateway_id'] }}', '{{ $method['gateway_type_id'] }}'); $wire.$refresh();"
|
||||
class="px-3 py-2 border bg-white rounded mr-4 hover:border-blue-600">
|
||||
{{ $method['label'] }}
|
||||
</button>
|
||||
@ -80,11 +80,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script defer>
|
||||
window.addEventListener('redirectRoute', event => {
|
||||
<script>
|
||||
|
||||
window.location.href = event.detail.route;
|
||||
document.addEventListener('livewire:init', () => {
|
||||
|
||||
Livewire.on('redirectRoute', (event) => {
|
||||
window.location.href = event[0].route;
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user