mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 17:34:29 -04:00
commit
ea47d9db30
@ -1 +1 @@
|
||||
5.3.62
|
||||
5.3.63
|
@ -46,7 +46,8 @@ class BaseSettings
|
||||
return is_null($value) ? '' : (string) $value;
|
||||
case 'bool':
|
||||
case 'boolean':
|
||||
return (bool) ($value);
|
||||
nlog($value);
|
||||
return boolval($value);
|
||||
case 'object':
|
||||
return json_decode($value);
|
||||
case 'array':
|
||||
|
@ -51,7 +51,7 @@ class ContactHashLoginController extends Controller
|
||||
return render('generic.error', ['title' => session()->get('title'), 'notification' => session()->get('notification')]);
|
||||
}
|
||||
|
||||
private function setRedirectPath()
|
||||
private function setRedirectPath()
|
||||
{
|
||||
|
||||
if(auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES)
|
||||
|
@ -125,7 +125,7 @@ class InvitationController extends Controller
|
||||
}
|
||||
|
||||
|
||||
if (auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) {
|
||||
if (auth()->guard('contact')->user() && ! request()->has('silent') && ! $invitation->viewed_date) {
|
||||
$invitation->markViewed();
|
||||
|
||||
event(new InvitationWasViewed($invitation->{$entity}, $invitation, $invitation->{$entity}->company, Ninja::eventVars()));
|
||||
@ -264,15 +264,18 @@ class InvitationController extends Controller
|
||||
abort(404, "Invoice not found");
|
||||
}
|
||||
|
||||
public function unsubscribe(Request $request, string $invitation_key)
|
||||
public function unsubscribe(Request $request, string $entity_type, string $invitation_key)
|
||||
{
|
||||
if($invite = InvoiceInvitation::withTrashed()->where('key', $invitation_key)->first()){
|
||||
if($entity_type == 'invoice'){
|
||||
$invite = InvoiceInvitation::withTrashed()->where('key', $invitation_key)->first();
|
||||
$invite->contact->send_email = false;
|
||||
$invite->contact->save();
|
||||
}elseif($invite = QuoteInvitation::withTrashed()->where('key', $invitation_key)->first()){
|
||||
}elseif($entity_type == 'quote'){
|
||||
$invite = QuoteInvitation::withTrashed()->where('key', $invitation_key)->first();
|
||||
$invite->contact->send_email = false;
|
||||
$invite->contact->save();
|
||||
}elseif($invite = CreditInvitation::withTrashed()->where('key', $invitation_key)->first()){
|
||||
}elseif($entity_type == 'credit'){
|
||||
$invite = CreditInvitation::withTrashed()->where('key', $invitation_key)->first();
|
||||
$invite->contact->send_email = false;
|
||||
$invite->contact->save();
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ class NinjaPlanController extends Controller
|
||||
public function trial()
|
||||
{
|
||||
|
||||
$gateway = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->first();
|
||||
$gateway = CompanyGateway::on('db-ninja-01')->find(config('ninja.ninja_default_company_gateway_id'));
|
||||
|
||||
$data['gateway'] = $gateway;
|
||||
|
||||
@ -106,8 +106,7 @@ class NinjaPlanController extends Controller
|
||||
$client->save();
|
||||
|
||||
//store payment method
|
||||
|
||||
$gateway = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->first();
|
||||
$gateway = CompanyGateway::on('db-ninja-01')->find(config('ninja.ninja_default_company_gateway_id'));
|
||||
$gateway_driver = $gateway->driver(auth()->guard('contact')->user()->client)->init();
|
||||
|
||||
$stripe_response = json_decode($request->input('gateway_response'));
|
||||
@ -132,10 +131,16 @@ class NinjaPlanController extends Controller
|
||||
$gateway_driver->storeGatewayToken($data, ['gateway_customer_reference' => $customer->id]);
|
||||
|
||||
//set free trial
|
||||
$account = auth()->guard('contact')->user()->company->account;
|
||||
$account->trial_started = now();
|
||||
$account->trial_plan = 'pro';
|
||||
$account->save();
|
||||
// $account = auth()->guard('contact')->user()->company->account;
|
||||
if(auth()->guard('contact')->user()->client->custom_value2){
|
||||
MultiDB::findAndSetDbByAccountKey(auth()->guard('contact')->user()->client->custom_value2);
|
||||
$account = Account::where('key', auth()->guard('contact')->user()->client->custom_value2);
|
||||
$account->trial_started = now();
|
||||
$account->trial_plan = 'pro';
|
||||
$account->save();
|
||||
}
|
||||
|
||||
MultiDB::setDB('db-ninja-01');
|
||||
|
||||
//create recurring invoice
|
||||
$subscription_repo = new SubscriptionRepository();
|
||||
@ -154,6 +159,8 @@ class NinjaPlanController extends Controller
|
||||
$recurring_invoice->next_send_date = now()->addDays(14)->format('Y-m-d');
|
||||
|
||||
$recurring_invoice->save();
|
||||
$recurring_invoice = $recurring_invoice->calc()->getRecurringInvoice();
|
||||
|
||||
$recurring_invoice->service()->start();
|
||||
|
||||
return redirect('/');
|
||||
|
@ -37,14 +37,13 @@ class CheckClientExistence
|
||||
->where('email', auth()->guard('contact')->user()->email)
|
||||
->whereNotNull('email')
|
||||
->where('email', '<>', '')
|
||||
->distinct('company_id')
|
||||
->distinct('email')
|
||||
->distinct('client_id')
|
||||
->whereNotNull('company_id')
|
||||
->whereHas('client', function ($query) {
|
||||
return $query->where('is_deleted', false);
|
||||
})
|
||||
->whereHas('company', function ($query){
|
||||
return $query->where('id', auth()->guard('contact')->user()->client->company_id);
|
||||
return $query->where('companies.account_id', auth()->guard('contact')->user()->company->account_id);
|
||||
})
|
||||
->get();
|
||||
|
||||
|
@ -123,6 +123,8 @@ class ContactKeyLogin
|
||||
return redirect($this->setRedirectPath());
|
||||
}
|
||||
}
|
||||
//28-02-2022 middleware should not allow this to progress as we should have redirected by this stage.
|
||||
abort(404, "Unable to authenticate.");
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
@ -46,6 +46,9 @@ class SetInviteDb
|
||||
if($entity == "pay")
|
||||
$entity = "invoice";
|
||||
|
||||
if(!in_array($entity, ['invoice','quote','credit','recurring_invoice']))
|
||||
abort(404,'I could not find this resource.');
|
||||
|
||||
/* Try and determine the DB from the invitation key STRING*/
|
||||
if (config('ninja.db.multi_db_enabled')) {
|
||||
|
||||
|
@ -58,7 +58,9 @@ class StoreCreditRequest extends Request
|
||||
// $rules['number'] = new UniqueCreditNumberRule($this->all());
|
||||
$rules['number'] = ['nullable', Rule::unique('credits')->where('company_id', auth()->user()->company()->id)];
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
|
||||
if($this->invoice_id)
|
||||
$rules['invoice_id'] = new ValidInvoiceCreditRule();
|
||||
|
||||
|
@ -58,7 +58,8 @@ class UpdateCreditRequest extends Request
|
||||
|
||||
$rules['line_items'] = 'array';
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ class ActionInvoiceRequest extends Request
|
||||
*/
|
||||
private $error_msg;
|
||||
|
||||
private $invoice;
|
||||
// private $invoice;
|
||||
|
||||
public function authorize() : bool
|
||||
{
|
||||
@ -45,7 +45,9 @@ class ActionInvoiceRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if (!array_key_exists('action', $input)) {
|
||||
if($this->action){
|
||||
$input['action'] = $this->action;
|
||||
} elseif (!array_key_exists('action', $input) ) {
|
||||
$this->error_msg = 'Action is a required field';
|
||||
} elseif (!$this->invoiceDeletable($this->invoice)) {
|
||||
unset($input['action']);
|
||||
|
@ -55,7 +55,8 @@ class StoreInvoiceRequest extends Request
|
||||
$rules['number'] = ['nullable', Rule::unique('invoices')->where('company_id', auth()->user()->company()->id)];
|
||||
|
||||
$rules['project_id'] = ['bail', 'sometimes', new ValidProjectForClient($this->all())];
|
||||
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
$rules['line_items'] = 'array';
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
|
@ -55,6 +55,8 @@ class UpdateInvoiceRequest extends Request
|
||||
if($this->number)
|
||||
$rules['number'] = Rule::unique('invoices')->where('company_id', auth()->user()->company()->id)->ignore($this->invoice->id);
|
||||
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
$rules['line_items'] = 'array';
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
|
@ -52,6 +52,8 @@ class StoreQuoteRequest extends Request
|
||||
$rules['number'] = ['nullable',Rule::unique('quotes')->where('company_id', auth()->user()->company()->id)];
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
// $rules['number'] = new UniqueQuoteNumberRule($this->all());
|
||||
$rules['line_items'] = 'array';
|
||||
|
||||
|
@ -52,6 +52,8 @@ class UpdateQuoteRequest extends Request
|
||||
|
||||
$rules['line_items'] = 'array';
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ class InvoiceTransformer extends BaseTransformer
|
||||
$this->getString($invoice_data, 'invoice.status')
|
||||
))
|
||||
] ?? Invoice::STATUS_SENT,
|
||||
'archived' => $status === 'archived',
|
||||
// 'archived' => $status === 'archived',
|
||||
];
|
||||
|
||||
/* If we can't find the client, then lets try and create a client */
|
||||
|
@ -110,13 +110,10 @@ class PaymentFailedMailer implements ShouldQueue
|
||||
});
|
||||
|
||||
//add client payment failures here.
|
||||
nlog("pre client failure email");
|
||||
|
||||
//
|
||||
if($contact = $this->client->primary_contact()->first())
|
||||
{
|
||||
|
||||
nlog("inside failure");
|
||||
|
||||
$mail_obj = (new ClientPaymentFailureObject($this->client, $this->error, $this->company, $this->payment_hash))->build();
|
||||
|
||||
$nmo = new NinjaMailerObject;
|
||||
|
@ -82,6 +82,9 @@ class PaymentFailureMailer implements ShouldQueue
|
||||
//determine if this user has the right permissions
|
||||
$methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure_all','payment_failure', 'payment_failure_user', 'all_notifications']);
|
||||
|
||||
if(!is_string($this->error))
|
||||
$this->error = "Undefined error. Please contact the administrator for further information.";
|
||||
|
||||
//if mail is a method type -fire mail!!
|
||||
if (($key = array_search('mail', $methods)) !== false) {
|
||||
unset($methods[$key]);
|
||||
|
@ -57,7 +57,6 @@ class ClientPaymentFailureObject
|
||||
public function build()
|
||||
{
|
||||
if(!$this->payment_hash){
|
||||
nlog("no payment has for failure notification - ClientPaymentFailureObject");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -124,7 +123,6 @@ class ClientPaymentFailureObject
|
||||
'settings' => $this->client->getMergedSettings(),
|
||||
'whitelabel' => $this->company->account->isPaid() ? true : false,
|
||||
'url' => $this->invoices->first()->invitations->first()->getPaymentLink(),
|
||||
// 'button' => 'texts.pay_now',
|
||||
'button' => ctrans('texts.pay_now'),
|
||||
'additional_info' => false,
|
||||
'company' => $this->company,
|
||||
|
@ -111,7 +111,7 @@ class TemplateEmail extends Mailable
|
||||
'company' => $company,
|
||||
'whitelabel' => $this->client->user->account->isPaid() ? true : false,
|
||||
'logo' => $this->company->present()->logo($settings),
|
||||
'unsubscribe_link' => $this->invitation->getUnsubscribeLink(),
|
||||
'unsubscribe_link' => $this->invitation ? $this->invitation->getUnsubscribeLink() : '',
|
||||
])
|
||||
->withSwiftMessage(function ($message) use($company){
|
||||
$message->getHeaders()->addTextHeader('Tag', $company->company_key);
|
||||
|
@ -90,6 +90,8 @@ class Credit extends BaseModel
|
||||
'updated_at' => 'timestamp',
|
||||
'created_at' => 'timestamp',
|
||||
'deleted_at' => 'timestamp',
|
||||
'is_amount_discount' => 'bool',
|
||||
|
||||
];
|
||||
|
||||
protected $touches = [];
|
||||
|
@ -103,6 +103,7 @@ class Invoice extends BaseModel
|
||||
'created_at' => 'timestamp',
|
||||
'deleted_at' => 'timestamp',
|
||||
'is_deleted' => 'bool',
|
||||
'is_amount_discount' => 'bool',
|
||||
];
|
||||
|
||||
protected $with = [];
|
||||
@ -497,6 +498,20 @@ class Invoice extends BaseModel
|
||||
return $this->calc()->getTotal();
|
||||
}
|
||||
|
||||
public function getPayableAmount()
|
||||
{
|
||||
if($this->partial > 0)
|
||||
return $this->partial;
|
||||
|
||||
if($this->balance > 0)
|
||||
return $this->balance;
|
||||
|
||||
if($this->status_id = 1)
|
||||
return $this->amount;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function entityEmailEvent($invitation, $reminder_template, $template)
|
||||
{
|
||||
switch ($reminder_template) {
|
||||
|
@ -89,6 +89,7 @@ class Quote extends BaseModel
|
||||
'created_at' => 'timestamp',
|
||||
'deleted_at' => 'timestamp',
|
||||
'is_deleted' => 'boolean',
|
||||
'is_amount_discount' => 'bool',
|
||||
];
|
||||
|
||||
protected $dates = [];
|
||||
|
@ -141,6 +141,6 @@ class FPX
|
||||
$this->stripe->client->company,
|
||||
);
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
throw new PaymentFailed('Failed to process the payment.', 400);
|
||||
}
|
||||
}
|
||||
|
@ -228,10 +228,14 @@ class SubscriptionService
|
||||
->where('is_deleted', 0)
|
||||
->orderBy('id', 'desc')
|
||||
->first();
|
||||
|
||||
}
|
||||
|
||||
if ($outstanding->count() == 0){
|
||||
//need to ensure at this point that a refund is appropriate!!
|
||||
//28-02-2022
|
||||
if($recurring_invoice->invoices()->count() == 0){
|
||||
return $target->price;
|
||||
}
|
||||
elseif ($outstanding->count() == 0){
|
||||
//nothing outstanding
|
||||
return $target->price - $this->calculateProRataRefundForSubscription($outstanding_invoice);
|
||||
}
|
||||
|
@ -62,7 +62,9 @@ trait Inviteable
|
||||
else
|
||||
$domain = config('ninja.app_url');
|
||||
|
||||
return $domain.'/client/unsubscribe/'.$this->key;
|
||||
$entity_type = Str::snake(class_basename($this->entityType()));
|
||||
|
||||
return $domain.'/client/unsubscribe/'.$entity_type.'/'.$this->key;
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => '5.3.62',
|
||||
'app_tag' => '5.3.62',
|
||||
'app_version' => '5.3.63',
|
||||
'app_tag' => '5.3.63',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
2
public/css/app.css
vendored
2
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
4
public/flutter_service_worker.js
vendored
4
public/flutter_service_worker.js
vendored
@ -28,11 +28,11 @@ const RESOURCES = {
|
||||
"assets/NOTICES": "9a4bf0423a5e265f38c4df37f7a0a913",
|
||||
"assets/fonts/MaterialIcons-Regular.otf": "7e7a6cccddf6d7b20012a548461d5d81",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628",
|
||||
"/": "a10a76fa9beabc958dfdeda4f1be38c8",
|
||||
"/": "5b6588d4983a2540f5d0da10ef512a78",
|
||||
"version.json": "a00481850d5c63ba5df4e22636643438",
|
||||
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
|
||||
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
||||
"main.dart.js": "2c4d2723a1998a9cfe695f465288e5e8",
|
||||
"main.dart.js": "8be39c52c4228fcf411da26c2517a432",
|
||||
"favicon.png": "dca91c54388f52eded692718d5a98b8b",
|
||||
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
|
||||
"canvaskit/profiling/canvaskit.js": "ae2949af4efc61d28a4a80fffa1db900",
|
||||
|
2
public/js/clients/payments/stripe-fpx.js
vendored
2
public/js/clients/payments/stripe-fpx.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! For license information please see stripe-fpx.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key);var e=r.stripe.elements();return r.fpx=e.create("fpxBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}},accountHolderType:"individual"}),r.fpx.mount("#fpx-bank-element"),r})),o(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmFpxPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{fpx:r.fpx},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
|
||||
(()=>{var e,t,n,r;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"setupStripe",(function(){r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key);var e=r.stripe.elements();return r.fpx=e.create("fpxBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}},accountHolderType:"individual"}),r.fpx.mount("#fpx-bank-element"),r})),i(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmFpxPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{fpx:r.fpx},return_url:document.querySelector('meta[name="return-url"]').content}).then((function(e){e.error&&r.handleFailure(e.error.message)}))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,r;return t=e,(n=[{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&o(t.prototype,n),r&&o(t,r),e}();new a(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
|
88420
public/main.dart.js
vendored
88420
public/main.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -37,8 +37,8 @@
|
||||
"/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=188426574f27660936e2",
|
||||
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=e240b907ad163cac04c0",
|
||||
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=71e49866d66a6d85b88a",
|
||||
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=3a1cac8fb671c2e4337f",
|
||||
"/css/app.css": "/css/app.css?id=daf6d6885d24b59775d5",
|
||||
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=765874308d4374726b25",
|
||||
"/css/app.css": "/css/app.css?id=41b6a44f816ac830ea05",
|
||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad",
|
||||
"/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=ad98572d415d2f245284"
|
||||
}
|
||||
|
2
public/vendor/livewire/livewire.js
vendored
2
public/vendor/livewire/livewire.js
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/livewire.js.map
vendored
2
public/vendor/livewire/livewire.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/manifest.json
vendored
2
public/vendor/livewire/manifest.json
vendored
@ -1 +1 @@
|
||||
{"/livewire.js":"/livewire.js?id=ece4c4ab4b746f6f1739"}
|
||||
{"/livewire.js":"/livewire.js?id=9a36ebbddb8dd0aa91b1"}
|
20
resources/js/clients/payments/stripe-fpx.js
vendored
20
resources/js/clients/payments/stripe-fpx.js
vendored
@ -60,11 +60,29 @@ class ProcessFPXPay {
|
||||
'meta[name="return-url"]'
|
||||
).content,
|
||||
}
|
||||
);
|
||||
).then((result) => {
|
||||
if (result.error) {
|
||||
this.handleFailure(result.error.message);
|
||||
}
|
||||
});;
|
||||
});
|
||||
};
|
||||
|
||||
handleFailure(message) {
|
||||
let errors = document.getElementById('errors');
|
||||
|
||||
errors.textContent = '';
|
||||
errors.textContent = message;
|
||||
errors.hidden = false;
|
||||
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
@ -4547,7 +4547,25 @@ $LANG = array(
|
||||
'to_view_entity_set_password' => 'To view the :entity you need to set password.',
|
||||
'unsubscribe' => 'Unsubscribe',
|
||||
'unsubscribed' => 'Unsubscribed',
|
||||
'unsubscribed_text' => 'You have been removed from notifications for this document'
|
||||
'unsubscribed_text' => 'You have been removed from notifications for this document',
|
||||
'client_shipping_state' => 'Client Shipping State',
|
||||
'client_shipping_city' => 'Client Shipping City',
|
||||
'client_shipping_postal_code' => 'Client Shipping Postal Code',
|
||||
'client_shipping_country' => 'Client Shipping Country',
|
||||
'load_pdf' => 'Load PDF',
|
||||
'start_free_trial' => 'Start Free Trial',
|
||||
'start_free_trial_message' => 'Start your FREE 14 day trial of the pro plan',
|
||||
'due_on_receipt' => 'Due on Receipt',
|
||||
'is_paid' => 'Is Paid',
|
||||
'age_group_paid' => 'Paid',
|
||||
'id' => 'Id',
|
||||
'convert_to' => 'Convert To',
|
||||
'client_currency' => 'Client Currency',
|
||||
'company_currency' => 'Company Currency',
|
||||
'custom_emails_disabled_help' => 'To prevent spam we require upgrading to a paid account to customize the email',
|
||||
'upgrade_to_add_company' => 'Upgrade your plan to add companies',
|
||||
'file_saved_in_downloads_folder' => 'The file has been saved in the downloads folder',
|
||||
'small' => 'Small',
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
@ -54,8 +54,6 @@
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.save_card')
|
||||
|
||||
@include('portal.ninja2020.gateways.wepay.includes.credit_card')
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
|
||||
</form>
|
||||
|
@ -59,7 +59,7 @@
|
||||
@if($settings->client_portal_allow_under_payment || $settings->client_portal_allow_over_payment)
|
||||
<button class="button button-primary bg-primary">{{ ctrans('texts.pay_now') }}</button>
|
||||
@else
|
||||
@livewire('pay-now-dropdown', ['total' => $invoice->partial > 0 ? $invoice->partial : $invoice->balance, 'company' => $company])
|
||||
@livewire('pay-now-dropdown', ['total' => $invoice->getPayableAmount(), 'company' => $company])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,7 +14,7 @@
|
||||
@livewire('required-client-info', ['fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact' => auth()->guard('contact')->user(), 'countries' => $countries, 'company' => $company])
|
||||
|
||||
<div class="container mx-auto grid grid-cols-12 opacity-25 pointer-events-none" data-ref="gateway-container">
|
||||
<div class="col-span-12 lg:col-span-6 lg:col-start-4 overflow-hidden bg-white shadow rounded-lg">
|
||||
<div class="col-span-12 lg:col-span-6 lg:col-start-4 bg-white shadow rounded-lg">
|
||||
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
||||
@isset($card_title)
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
||||
|
@ -8,16 +8,28 @@
|
||||
<span class="page-link">@lang('pagination.previous')</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<button type="button" class="page-link" wire:click="previousPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
|
||||
</li>
|
||||
@if(method_exists($paginator,'getCursorName'))
|
||||
<li class="page-item">
|
||||
<button dusk="previousPage" type="button" class="page-link" wire:click="setPage('{{$paginator->previousCursor()->encode()}}','{{ $paginator->getCursorName() }}')" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<button type="button" dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}" class="page-link" wire:click="previousPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<button type="button" class="page-link" wire:click="nextPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
|
||||
</li>
|
||||
@if(method_exists($paginator,'getCursorName'))
|
||||
<li class="page-item">
|
||||
<button dusk="nextPage" type="button" class="page-link" wire:click="setPage('{{$paginator->nextCursor()->encode()}}','{{ $paginator->getCursorName() }}')" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<button type="button" dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}" class="page-link" wire:click="nextPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.next')</span>
|
||||
|
@ -114,7 +114,7 @@ Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'clie
|
||||
Route::get('{entity}/{invitation_key}/download', 'ClientPortal\InvitationController@routerForDownload');
|
||||
Route::get('pay/{invitation_key}', 'ClientPortal\InvitationController@payInvoice')->name('pay.invoice');
|
||||
|
||||
Route::get('unsubscribe/{invitation_key}', 'ClientPortal\InvitationController@unsubscribe')->name('unsubscribe');
|
||||
Route::get('unsubscribe/{entity_type}/{invitation_key}', 'ClientPortal\InvitationController@unsubscribe')->name('unsubscribe');
|
||||
|
||||
// Route::get('{entity}/{client_hash}/{invitation_key}', 'ClientPortal\InvitationController@routerForIframe')->name('invoice.client_hash_and_invitation_key'); //should never need this
|
||||
|
||||
|
@ -377,7 +377,7 @@ class PaymentTest extends TestCase
|
||||
$this->invoice->company->setRelation('company', $this->company);
|
||||
$this->invoice->company->setRelation('client', $client);
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
$this->invoice->is_deleted = false;
|
||||
$this->invoice->save();
|
||||
|
||||
@ -457,7 +457,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$data = [
|
||||
'amount' => 2.0,
|
||||
@ -531,7 +531,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$this->invoice->setRelation('client', $client);
|
||||
|
||||
@ -579,7 +579,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$data = [
|
||||
'amount' => 2.0,
|
||||
@ -639,7 +639,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$payment = PaymentFactory::create($this->company->id, $this->user->id);
|
||||
$payment->amount = 10;
|
||||
@ -692,7 +692,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$payment = PaymentFactory::create($this->company->id, $this->user->id);
|
||||
$payment->amount = 10;
|
||||
@ -752,7 +752,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$data = [
|
||||
'amount' => 15.0,
|
||||
@ -803,7 +803,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$data = [
|
||||
'amount' => 15.0,
|
||||
@ -851,7 +851,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$data = [
|
||||
'amount' => 20.0,
|
||||
@ -895,7 +895,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
// $this->invoice = $this->invoice_calc->getInvoice();
|
||||
// $this->invoice->save();
|
||||
// $this->invoice->service()->markSent()->save();
|
||||
// $this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
// $data = [
|
||||
// 'amount' => 20.0,
|
||||
@ -1327,7 +1327,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
$data = [
|
||||
'amount' => 20.0,
|
||||
@ -1422,7 +1422,7 @@ class PaymentTest extends TestCase
|
||||
|
||||
$this->invoice = $this->invoice_calc->getInvoice();
|
||||
$this->invoice->save();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
$this->invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
|
||||
$this->assertEquals(10, $this->invoice->balance);
|
||||
|
@ -79,7 +79,7 @@ class CreditPaymentTest extends TestCase
|
||||
$invoice = $invoice_calc->getInvoice();
|
||||
$invoice->setRelation('client', $this->client);
|
||||
$invoice->setRelation('company', $this->company);
|
||||
$invoice->service()->markSent()->save();
|
||||
$invoice->service()->markSent()->createInvitations()->save();
|
||||
|
||||
|
||||
$data = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user