mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
e131659d81
@ -1 +1 @@
|
|||||||
5.8.2
|
5.8.3
|
@ -50,9 +50,9 @@ class S3Cleanup extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
if (!Ninja::isHosted()) {
|
// if (!Ninja::isHosted()) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$c1 = Company::on('db-ninja-01')->pluck('company_key');
|
$c1 = Company::on('db-ninja-01')->pluck('company_key');
|
||||||
$c2 = Company::on('db-ninja-02')->pluck('company_key');
|
$c2 = Company::on('db-ninja-02')->pluck('company_key');
|
||||||
|
@ -64,7 +64,7 @@ class CompanyExport implements ShouldQueue
|
|||||||
{
|
{
|
||||||
MultiDB::setDb($this->company->db);
|
MultiDB::setDb($this->company->db);
|
||||||
|
|
||||||
$this->company = Company::query()->where('company_key', $this->company->company_key)->first();
|
// $this->company = Company::query()->where('company_key', $this->company->company_key)->first();
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
|
@ -96,7 +96,8 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
*
|
*
|
||||||
* @var Invoice
|
* @var Invoice
|
||||||
*/
|
*/
|
||||||
public $invoice;
|
|
||||||
|
public \App\Models\Invoice $invoice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Coupon model for user input
|
* Coupon model for user input
|
||||||
@ -112,6 +113,9 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
*/
|
*/
|
||||||
public $quantity;
|
public $quantity;
|
||||||
|
|
||||||
|
public $invoice_hashed_id = '';
|
||||||
|
|
||||||
|
public $payable_amount = 0;
|
||||||
/**
|
/**
|
||||||
* First-hit request data (queries, locales...).
|
* First-hit request data (queries, locales...).
|
||||||
*
|
*
|
||||||
@ -182,6 +186,9 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
$this->sub_total = 0;
|
$this->sub_total = 0;
|
||||||
$this->float_amount_total = 0;
|
$this->float_amount_total = 0;
|
||||||
|
|
||||||
|
$this->invoice_hashed_id = '';
|
||||||
|
$this->payable_amount = 0;
|
||||||
|
|
||||||
$this->data = [];
|
$this->data = [];
|
||||||
|
|
||||||
$this->price = $this->subscription->price; // ?
|
$this->price = $this->subscription->price; // ?
|
||||||
@ -493,6 +500,9 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
$this->payment_method_id = $gateway_type_id;
|
$this->payment_method_id = $gateway_type_id;
|
||||||
|
|
||||||
$this->handleBeforePaymentEvents();
|
$this->handleBeforePaymentEvents();
|
||||||
|
|
||||||
|
$this->dispatch('beforePaymentEventsCompleted');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -500,7 +510,7 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function handleBeforePaymentEvents() :self
|
public function handleBeforePaymentEvents(): self
|
||||||
{
|
{
|
||||||
$eligibility_check = $this->subscription->service()->isEligible($this->contact);
|
$eligibility_check = $this->subscription->service()->isEligible($this->contact);
|
||||||
|
|
||||||
@ -520,7 +530,6 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
]],
|
]],
|
||||||
'user_input_promo_code' => $this->coupon,
|
'user_input_promo_code' => $this->coupon,
|
||||||
'coupon' => empty($this->subscription->promo_code) ? '' : $this->coupon,
|
'coupon' => empty($this->subscription->promo_code) ? '' : $this->coupon,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->invoice = $this->subscription
|
$this->invoice = $this->subscription
|
||||||
@ -532,6 +541,9 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
->adjustInventory()
|
->adjustInventory()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
|
$this->payable_amount = $this->invoice->partial > 0 ? \App\Utils\Number::formatValue($this->invoice->partial, $this->invoice->client->currency()) : \App\Utils\Number::formatValue($this->invoice->balance, $this->invoice->client->currency());
|
||||||
|
$this->invoice_hashed_id = $this->invoice->hashed_id;
|
||||||
|
|
||||||
Cache::put($this->hash, [
|
Cache::put($this->hash, [
|
||||||
'subscription_id' => $this->subscription->hashed_id,
|
'subscription_id' => $this->subscription->hashed_id,
|
||||||
'email' => $this->email ?? $this->contact->email,
|
'email' => $this->email ?? $this->contact->email,
|
||||||
@ -542,8 +554,6 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
'bundle' => $this->bundle,
|
'bundle' => $this->bundle,
|
||||||
], now()->addMinutes(60));
|
], now()->addMinutes(60));
|
||||||
|
|
||||||
$this->dispatch('beforePaymentEventsCompleted');
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ class InvoiceTransformer extends EntityTransformer
|
|||||||
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
||||||
'footer' => $invoice->footer ?: '',
|
'footer' => $invoice->footer ?: '',
|
||||||
'partial' => (float) ($invoice->partial ?: 0.0),
|
'partial' => (float) ($invoice->partial ?: 0.0),
|
||||||
'partial_due_date' => ($invoice->partial_due_date && $invoice->partial_due_date != "-0001-11-30") ?: '',
|
'partial_due_date' => ($invoice->partial_due_date && $invoice->partial_due_date != "-0001-11-30") ? $invoice->partial_due_date : '',
|
||||||
'custom_value1' => (string) $invoice->custom_value1 ?: '',
|
'custom_value1' => (string) $invoice->custom_value1 ?: '',
|
||||||
'custom_value2' => (string) $invoice->custom_value2 ?: '',
|
'custom_value2' => (string) $invoice->custom_value2 ?: '',
|
||||||
'custom_value3' => (string) $invoice->custom_value3 ?: '',
|
'custom_value3' => (string) $invoice->custom_value3 ?: '',
|
||||||
|
@ -17,8 +17,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.8.2'),
|
'app_version' => env('APP_VERSION', '5.8.3'),
|
||||||
'app_tag' => env('APP_TAG', '5.8.2'),
|
'app_tag' => env('APP_TAG', '5.8.3'),
|
||||||
'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', false),
|
'api_secret' => env('API_SECRET', false),
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
@push('footer')
|
@push('footer')
|
||||||
<script>
|
<script>
|
||||||
function updateGatewayFields(companyGatewayId, paymentMethodId) {
|
function updateGatewayFields(companyGatewayId, paymentMethodId) {
|
||||||
|
console.log(companyGatewayId, paymentMethodId);
|
||||||
|
|
||||||
document.getElementById('company_gateway_id').value = companyGatewayId;
|
document.getElementById('company_gateway_id').value = companyGatewayId;
|
||||||
document.getElementById('payment_method_id').value = paymentMethodId;
|
document.getElementById('payment_method_id').value = paymentMethodId;
|
||||||
}
|
}
|
||||||
|
@ -8,27 +8,21 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if(isset($invoice))
|
|
||||||
<div class="flex items-center mt-4 text-sm">
|
<div class="flex items-center mt-4 text-sm">
|
||||||
<form action="{{ route('client.payments.process', ['hash' => $hash, 'sidebar' => 'hidden']) }}"
|
<form action="{{ route('client.payments.process', ['hash' => $hash, 'sidebar' => 'hidden']) }}"
|
||||||
method="post"
|
method="post"
|
||||||
id="payment-method-form">
|
id="payment-method-form">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
@if($invoice instanceof \App\Models\Invoice)
|
<input type="hidden" name="invoices[]" value="{{ $invoice_hashed_id }}">
|
||||||
<input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}">
|
<input type="hidden" name="payable_invoices[0][amount]" value="{{ $payable_amount }}">
|
||||||
<input type="hidden" name="payable_invoices[0][amount]"
|
<input type="hidden" name="payable_invoices[0][invoice_id]" value="{{ $invoice_hashed_id }}">
|
||||||
value="{{ $invoice->partial > 0 ? \App\Utils\Number::formatValue($invoice->partial, $invoice->client->currency()) : \App\Utils\Number::formatValue($invoice->balance, $invoice->client->currency()) }}">
|
|
||||||
<input type="hidden" name="payable_invoices[0][invoice_id]"
|
|
||||||
value="{{ $invoice->hashed_id }}">
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<input type="hidden" name="action" value="payment">
|
<input type="hidden" name="action" value="payment">
|
||||||
<input type="hidden" name="company_gateway_id" value="{{ $company_gateway_id }}"/>
|
<input type="hidden" name="company_gateway_id" value="{{ $company_gateway_id }}"/>
|
||||||
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}"/>
|
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
|
||||||
|
|
||||||
<form wire:submit="submit">
|
<form wire:submit="submit">
|
||||||
<!-- Recurring Plan Products-->
|
<!-- Recurring Plan Products-->
|
||||||
@ -391,17 +385,68 @@
|
|||||||
<form wire:submit="handleLogin" class="" x-data="otpForm()">
|
<form wire:submit="handleLogin" class="" x-data="otpForm()">
|
||||||
<p class="mb-4"></p>
|
<p class="mb-4"></p>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<template x-for="(input, index) in length" :key="index">
|
<!-- <template x-for="(input, index) in length" :key="index"> -->
|
||||||
<input
|
<input
|
||||||
|
id="0"
|
||||||
type="text"
|
type="text"
|
||||||
maxlength="1"
|
maxlength="1"
|
||||||
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
:x-ref="index"
|
:x-ref="0"
|
||||||
x-on:input="handleInput($event)"
|
x-on:input="handleInput($event)"
|
||||||
x-on:paste="handlePaste($event)"
|
x-on:paste="handlePaste($event)"
|
||||||
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
/>
|
/>
|
||||||
</template>
|
<input
|
||||||
|
id="1"
|
||||||
|
type="text"
|
||||||
|
maxlength="1"
|
||||||
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
|
:x-ref="1"
|
||||||
|
x-on:input="handleInput($event)"
|
||||||
|
x-on:paste="handlePaste($event)"
|
||||||
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="2"
|
||||||
|
type="text"
|
||||||
|
maxlength="1"
|
||||||
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
|
:x-ref="2"
|
||||||
|
x-on:input="handleInput($event)"
|
||||||
|
x-on:paste="handlePaste($event)"
|
||||||
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="3"
|
||||||
|
type="text"
|
||||||
|
maxlength="1"
|
||||||
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
|
:x-ref="3"
|
||||||
|
x-on:input="handleInput($event)"
|
||||||
|
x-on:paste="handlePaste($event)"
|
||||||
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="4"
|
||||||
|
type="text"
|
||||||
|
maxlength="1"
|
||||||
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
|
:x-ref="4"
|
||||||
|
x-on:input="handleInput($event)"
|
||||||
|
x-on:paste="handlePaste($event)"
|
||||||
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="5"
|
||||||
|
type="text"
|
||||||
|
maxlength="1"
|
||||||
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
|
:x-ref="5"
|
||||||
|
x-on:input="handleInput($event)"
|
||||||
|
x-on:paste="handlePaste($event)"
|
||||||
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
|
/>
|
||||||
|
<!-- </template> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
@ -430,7 +475,7 @@
|
|||||||
const input = e.target;
|
const input = e.target;
|
||||||
|
|
||||||
this.login = Array.from(Array(this.length), (element, i) => {
|
this.login = Array.from(Array(this.length), (element, i) => {
|
||||||
return this.$refs[i].value || "";
|
return document.getElementById(i.toString()).value || '';
|
||||||
}).join("");
|
}).join("");
|
||||||
|
|
||||||
if (input.nextElementSibling && input.value) {
|
if (input.nextElementSibling && input.value) {
|
||||||
@ -451,8 +496,17 @@
|
|||||||
const inputs = Array.from(Array(this.length));
|
const inputs = Array.from(Array(this.length));
|
||||||
|
|
||||||
inputs.forEach((element, i) => {
|
inputs.forEach((element, i) => {
|
||||||
this.$refs[i].value = paste[i] || '';
|
document.getElementById(i.toString()).value = paste[i] || '';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.login = Array.from(Array(this.length), (element, i) => {
|
||||||
|
return document.getElementById(i.toString()).value || '';
|
||||||
|
}).join("");
|
||||||
|
|
||||||
|
if(this.login.length == 6){
|
||||||
|
this.$wire.handleLogin(this.login);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleBackspace(e) {
|
handleBackspace(e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user