1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Merge branch 'v2' into v2

This commit is contained in:
David Bomba 2020-06-27 12:22:08 +10:00 committed by GitHub
commit 91e0fba997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 217 additions and 91 deletions

View File

@ -21,6 +21,6 @@ class DashboardController extends Controller
*/
public function index()
{
return $this->render('dashboard.index');
return redirect()->route('client.invoices.index');
}
}

View File

@ -44,8 +44,12 @@ class PaymentMethodController extends Controller
{
$gateway = auth()->user()->client->getCreditCardGateway();
return $gateway->driver(auth()->user()->client)->authorizeView(GatewayType::CREDIT_CARD);
$data['gateway'] = $gateway;
return $gateway
->driver(auth()->user()->client)
->setPaymentMethod(GatewayType::BANK_TRANSFER)
->authorizeView($data);
}
/**
@ -57,9 +61,11 @@ class PaymentMethodController extends Controller
public function store(Request $request)
{
$gateway = auth()->user()->client->getCreditCardGateway();
return $gateway->driver(auth()->user()->client)->authorizeResponseView($request->all());
return $gateway
->driver(auth()->user()->client)
->setPaymentMethod(GatewayType::BANK_TRANSFER)
->authorizeResponse($request);
}
/**
@ -104,7 +110,7 @@ class PaymentMethodController extends Controller
return $gateway
->driver(auth()->user()->client)
->setPaymentMethod('App\\PaymentDrivers\\Stripe\\ACH')
->setPaymentMethod(GatewayType::BANK_TRANSFER)
->verificationView($payment_method);
}
@ -114,7 +120,7 @@ class PaymentMethodController extends Controller
return $gateway
->driver(auth()->user()->client)
->setPaymentMethod('App\\PaymentDrivers\\Stripe\\ACH')
->setPaymentMethod(GatewayType::BANK_TRANSFER)
->processVerification($payment_method);
}

View File

@ -15,6 +15,7 @@ namespace App\Http\Controllers\Traits;
use App\Models\User;
use App\Utils\Traits\UserSessionAttributes;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
/**
* Class VerifiesUserEmail
@ -30,20 +31,49 @@ trait VerifiesUserEmail
*/
public function confirm()
{
if ($user = User::whereRaw("BINARY `confirmation_code`= ?", request()->route('confirmation_code'))->first()) {
$user->email_verified_at = now();
$user->confirmation_code = null;
$user->save();
$user = User::where('confirmation_code', request()->confirmation_code)->first();
// if ($user = User::whereRaw("BINARY `confirmation_code`= ?", request()->input('confirmation_code'))->first()) {
return $this->render('auth.confirmed', [
'root' => 'themes',
'message' => ctrans('texts.security_confirmation'),
]);
if (!$user) {
return $this->render('auth.confirmed', ['root' => 'themes', 'message' => ctrans('texts.wrong_confirmation')]);
}
if (is_null($user->password) || empty($user->password)) {
return $this->render('auth.confirmation_with_password', ['root' => 'themes']);
}
$user->email_verified_at = now();
$user->confirmation_code = null;
$user->save();
return $this->render('auth.confirmed', [
'root' => 'themes',
'message' => ctrans('texts.wrong_confirmation'),
'message' => ctrans('texts.security_confirmation'),
]);
}
public function confirmWithPassword()
{
$user = User::where('confirmation_code', request()->confirmation_code)->first();
if (!$user) {
return $this->render('auth.confirmed', ['root' => 'themes', 'message' => ctrans('texts.wrong_confirmation')]);
}
request()->validate([
'password' => ['required', 'min:6', 'confirmed'],
]);
$user->password = Hash::make(request()->password);
$user->email_verified_at = now();
$user->confirmation_code = null;
$user->save();
return $this->render('auth.confirmed', [
'root' => 'themes',
'message' => ctrans('texts.security_confirmation'),
]);
}
}

View File

@ -60,7 +60,7 @@ class PortalComposer
{
$data = [];
$data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity'];
// $data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity'];
$data[] = [ 'title' => ctrans('texts.invoices'), 'url' => 'client.invoices.index', 'icon' => 'file-text'];
$data[] = [ 'title' => ctrans('texts.recurring_invoices'), 'url' => 'client.recurring_invoices.index', 'icon' => 'file'];
$data[] = [ 'title' => ctrans('texts.payments'), 'url' => 'client.payments.index', 'icon' => 'credit-card'];

View File

@ -172,7 +172,7 @@ class StripePaymentDriver extends BasePaymentDriver
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function authorizeCreditCardResponse($request)
public function authorizeResponse($request)
{
return $this->payment_method->authorizeResponse($request);
}

View File

@ -1,2 +1,2 @@
/*! For license information please see action-selectors.js.LICENSE.txt */
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=5)}({5:function(e,t,n){e.exports=n("Boob")},Boob:function(e,t){function n(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)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,o;return t=e,(r=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()}));var r=document.createElement("INPUT");r.setAttribute("name","invoices[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,t.append(r)}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t=!0,n=!1,r=void 0;try{for(var o,c=function(){var t=o.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))},u=document.querySelectorAll(".form-check-child")[Symbol.iterator]();!(t=(o=u.next()).done);t=!0)c()}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=5)}({5:function(e,t,n){e.exports=n("Boob")},Boob:function(e,t){function n(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)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,o;return t=e,(r=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==e.checked){var r=document.createElement("INPUT");r.setAttribute("name","invoices[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,t.append(r)}else{var o=document.querySelectorAll("input.child-hidden-input"),c=!0,u=!1,l=void 0;try{for(var i,a=o[Symbol.iterator]();!(c=(i=a.next()).done);c=!0){var d=i.value;d.value==e.dataset.value&&d.remove()}}catch(e){u=!0,l=e}finally{try{c||null==a.return||a.return()}finally{if(u)throw l}}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t=!0,n=!1,r=void 0;try{for(var o,c=function(){var t=o.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))},u=document.querySelectorAll(".form-check-child")[Symbol.iterator]();!(t=(o=u.next()).done);t=!0)c()}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});

View File

@ -1,2 +1,2 @@
/*! For license information please see action-selectors.js.LICENSE.txt */
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=10)}({10:function(e,t,n){e.exports=n("ydWM")},ydWM:function(e,t){function n(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)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,o;return t=e,(r=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()}));var r=document.createElement("INPUT");r.setAttribute("name","quotes[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,t.append(r)}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t=!0,n=!1,r=void 0;try{for(var o,c=function(){var t=o.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))},u=document.querySelectorAll(".form-check-child")[Symbol.iterator]();!(t=(o=u.next()).done);t=!0)c()}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=10)}({10:function(e,t,n){e.exports=n("ydWM")},ydWM:function(e,t){function n(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)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,o;return t=e,(r=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==e.checked){var r=document.createElement("INPUT");r.setAttribute("name","invoices[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,t.append(r)}else{var o=document.querySelectorAll("input.child-hidden-input"),c=!0,u=!1,l=void 0;try{for(var i,a=o[Symbol.iterator]();!(c=(i=a.next()).done);c=!0){var d=i.value;d.value==e.dataset.value&&d.remove()}}catch(e){u=!0,l=e}finally{try{c||null==a.return||a.return()}finally{if(u)throw l}}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t=!0,n=!1,r=void 0;try{for(var o,c=function(){var t=o.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))},u=document.querySelectorAll(".form-check-child")[Symbol.iterator]();!(t=(o=u.next()).done);t=!0)c()}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});

View File

@ -1,7 +1,7 @@
{
"/js/app.js": "/js/app.js?id=baf7fef12d5e65c3d9ff",
"/css/app.css": "/css/app.css?id=369c7335c317e8ac0212",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=0632d6281202800e0921",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=d244486b16dc6f94a726",
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=d7e708d66a9c769b4c6e",
"/js/clients/payment_methods/authorize-ach.js": "/js/clients/payment_methods/authorize-ach.js?id=9e6495d9ae236b3cb5ad",
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=83c223814db63f9db590",
@ -12,7 +12,7 @@
"/js/clients/payments/checkout.com.js": "/js/clients/payments/checkout.com.js?id=42d239882b80af83ad22",
"/js/clients/payments/process.js": "/js/clients/payments/process.js?id=49b220081e0d7fa8140b",
"/js/clients/payments/sofort.js": "/js/clients/payments/sofort.js?id=ff4ad07a93bd9fb327c1",
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=2fe0ad3e46ead2edb8c3",
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=b6b33ab51b58b51e1212",
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=1c5d76fb5f98bd49f6c8",
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=ba1182244cda0e0ffbeb",
"/js/setup/setup.js": "/js/setup/setup.js?id=87653cfb4084aadea7a2",

View File

@ -10,48 +10,65 @@
class ActionSelectors {
constructor() {
this.parentElement = document.querySelector(".form-check-parent");
this.parentForm = document.getElementById("bulkActions");
this.parentElement = document.querySelector('.form-check-parent');
this.parentForm = document.getElementById('bulkActions');
}
watchCheckboxes(parentElement) {
document.querySelectorAll(".form-check-child").forEach(child => {
document
.querySelectorAll('.child-hidden-input')
.forEach((element) => element.remove());
document.querySelectorAll('.form-check-child').forEach((child) => {
if (parentElement.checked) {
child.checked = parentElement.checked;
this.processChildItem(child, document.getElementById("bulkActions"));
this.processChildItem(
child,
document.getElementById('bulkActions')
);
} else {
child.checked = false;
document
.querySelectorAll(".child-hidden-input")
.forEach(element => element.remove());
.querySelectorAll('.child-hidden-input')
.forEach((element) => element.remove());
}
});
}
processChildItem(element, parent, options = {}) {
if (options.hasOwnProperty("single")) {
if (options.hasOwnProperty('single')) {
document
.querySelectorAll(".child-hidden-input")
.forEach(element => element.remove());
.querySelectorAll('.child-hidden-input')
.forEach((element) => element.remove());
}
let _temp = document.createElement("INPUT");
if (element.checked === false) {
let inputs = document.querySelectorAll('input.child-hidden-input');
_temp.setAttribute("name", "invoices[]");
_temp.setAttribute("value", element.dataset.value);
_temp.setAttribute("class", "child-hidden-input");
for (let i of inputs) {
if (i.value == element.dataset.value) i.remove();
}
return;
}
let _temp = document.createElement('INPUT');
_temp.setAttribute('name', 'invoices[]');
_temp.setAttribute('value', element.dataset.value);
_temp.setAttribute('class', 'child-hidden-input');
_temp.hidden = true;
parent.append(_temp);
}
handle() {
this.parentElement.addEventListener("click", () => {
this.parentElement.addEventListener('click', () => {
this.watchCheckboxes(this.parentElement);
});
for (let child of document.querySelectorAll(".form-check-child")) {
child.addEventListener("click", () => {
for (let child of document.querySelectorAll('.form-check-child')) {
child.addEventListener('click', () => {
this.processChildItem(child, this.parentForm);
});
}

View File

@ -10,48 +10,65 @@
class ActionSelectors {
constructor() {
this.parentElement = document.querySelector(".form-check-parent");
this.parentForm = document.getElementById("bulkActions");
this.parentElement = document.querySelector('.form-check-parent');
this.parentForm = document.getElementById('bulkActions');
}
watchCheckboxes(parentElement) {
document.querySelectorAll(".form-check-child").forEach(child => {
document
.querySelectorAll('.child-hidden-input')
.forEach((element) => element.remove());
document.querySelectorAll('.form-check-child').forEach((child) => {
if (parentElement.checked) {
child.checked = parentElement.checked;
this.processChildItem(child, document.getElementById("bulkActions"));
this.processChildItem(
child,
document.getElementById('bulkActions')
);
} else {
child.checked = false;
document
.querySelectorAll(".child-hidden-input")
.forEach(element => element.remove());
.querySelectorAll('.child-hidden-input')
.forEach((element) => element.remove());
}
});
}
processChildItem(element, parent, options = {}) {
if (options.hasOwnProperty("single")) {
if (options.hasOwnProperty('single')) {
document
.querySelectorAll(".child-hidden-input")
.forEach(element => element.remove());
.querySelectorAll('.child-hidden-input')
.forEach((element) => element.remove());
}
let _temp = document.createElement("INPUT");
if (element.checked === false) {
let inputs = document.querySelectorAll('input.child-hidden-input');
_temp.setAttribute("name", "quotes[]");
_temp.setAttribute("value", element.dataset.value);
_temp.setAttribute("class", "child-hidden-input");
for (let i of inputs) {
if (i.value == element.dataset.value) i.remove();
}
return;
}
let _temp = document.createElement('INPUT');
_temp.setAttribute('name', 'invoices[]');
_temp.setAttribute('value', element.dataset.value);
_temp.setAttribute('class', 'child-hidden-input');
_temp.hidden = true;
parent.append(_temp);
}
handle() {
this.parentElement.addEventListener("click", () => {
this.parentElement.addEventListener('click', () => {
this.watchCheckboxes(this.parentElement);
});
for (let child of document.querySelectorAll(".form-check-child")) {
child.addEventListener("click", () => {
for (let child of document.querySelectorAll('.form-check-child')) {
child.addEventListener('click', () => {
this.processChildItem(child, this.parentForm);
});
}

View File

@ -3223,7 +3223,9 @@ return [
'month_invalid' => 'Provided month is not valid.',
'year_invalid' => 'Provided year is not valid.',
'if_you_need_help' => 'If you need help you can either post to our',
'https_required' => 'HTTPS is required, form will fail',
'if_you_need_help' => 'If you need help you can either post to our',
'reversed' => 'Reversed',
'update_password_on_confirm' => 'After updating password, your account will be confirmed.',
'bank_account_not_linked' => 'To pay with bank account, first you have to add it as payment method.',
];

View File

@ -90,7 +90,7 @@
{!! App\Models\Quote::badgeForStatus($quote->status_id) !!}
</td>
<td class="px-6 py-4 whitespace-no-wrap flex items-center justify-end text-sm leading-5 font-medium">
<a href="{{ route('client.quotes.show', $quote->hashed_id) }}" class="button-link">
<a href="{{ route('client.quote.show', $quote->hashed_id) }}" class="button-link">
@lang('texts.view')
</a>
</td>

View File

@ -2,18 +2,20 @@
@section('meta_title', ctrans('texts.ach'))
@section('body')
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
@csrf
@foreach($invoices as $invoice)
<input type="hidden" name="hashed_ids[]" value="{{ $invoice->hashed_id }}">
@endforeach
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}">
<input type="hidden" name="source" value="{{ $token->meta->id }}">
<input type="hidden" name="amount" value="{{ $amount }}">
<input type="hidden" name="currency" value="{{ $currency }}">
<input type="hidden" name="customer" value="{{ $customer->id }}">
</form>
@if($token)
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
@csrf
@foreach($invoices as $invoice)
<input type="hidden" name="hashed_ids[]" value="{{ $invoice->hashed_id }}">
@endforeach
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}">
<input type="hidden" name="source" value="{{ $token->meta->id }}">
<input type="hidden" name="amount" value="{{ $amount }}">
<input type="hidden" name="currency" value="{{ $currency }}">
<input type="hidden" name="customer" value="{{ $customer->id }}">
</form>
@endif
<div class="container mx-auto">
<div class="grid grid-cols-6 gap-4">
@ -29,27 +31,36 @@
</p>
</div>
<div>
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.payment_type') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ ctrans('texts.ach') }} ({{ ctrans('texts.bank_transfer') }}) (****{{ $token->meta->last4 }})
</dd>
</div>
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.amount') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<span class="font-bold">{{ App\Utils\Number::formatMoney($amount, $client) }}</span>
</dd>
</div>
<div class="bg-gray-50 px-4 py-5 flex justify-end">
<button type="button" id="pay-now" class="button button-primary" onclick="document.getElementById('server-response').submit()">
{{ ctrans('texts.pay_now') }}
</button>
</div>
@if($token)
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.payment_type') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ ctrans('texts.ach') }} ({{ ctrans('texts.bank_transfer') }}) (****{{ $token->meta->last4 }})
</dd>
</div>
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.amount') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<span class="font-bold">{{ App\Utils\Number::formatMoney($amount, $client) }}</span>
</dd>
</div>
<div class="bg-gray-50 px-4 py-5 flex justify-end">
<button type="button" id="pay-now" class="button button-primary" onclick="document.getElementById('server-response').submit()">
{{ ctrans('texts.pay_now') }}
</button>
</div>
@else
<div class="bg-gray-50 px-4 py-5 sm:px-6 flex items-center">
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<span>{{ ctrans('texts.bank_account_not_linked') }}</span>
<a class="button button-link" href="{{ route('client.payment_methods.index') }}">{{ ctrans('texts.add_payment_method') }}</a>
</dd>
</div>
@endif
</div>
</div>
</div>

View File

@ -13,7 +13,6 @@
@section('body')
<div class="flex justify-between items-center">
<span>{{ ctrans('texts.with_selected') }}</span>
<form action="{{ route('client.quotes.bulk') }}" method="post" id="bulkActions">
@csrf
<button type="submit" class="button button-primary" name="action"

View File

@ -0,0 +1,43 @@
@extends('portal.ninja2020.layout.clean')
@section('meta_title', ctrans('texts.set_password'))
@section('body')
<div class="flex h-screen">
<div class="m-auto md:w-1/3 lg:w-1/5">
<div class="flex flex-col">
<img src="{{ asset('images/invoiceninja-black-logo-2.png') }}" class="border-b border-gray-100 h-18 pb-4" alt="Invoice Ninja logo">
<h1 class="text-center text-3xl mt-10">{{ ctrans('texts.set_password') }}</h1>
<span class="text-gray-900 text-sm text-center">{{ ctrans('texts.update_password_on_confirm') }}</span>
<form action="{{ url()->current() }}" method="post" class="mt-6">
@csrf
<div class="flex flex-col mt-4">
<label for="password" class="input-label">{{ ctrans('texts.password') }}</label>
<input type="password" name="password" id="password"
class="input"
autofocus>
@error('password')
<div class="validation validation-fail">
{{ $message }}
</div>
@enderror
</div>
<div class="flex flex-col mt-4">
<label for="password" class="input-label">{{ ctrans('texts.password_confirmation') }}</label>
<input type="password" name="password_confirmation" id="password_confirmation"
class="input"
autofocus>
@error('password_confirmation')
<div class="validation validation-fail">
{{ $message }}
</div>
@enderror
</div>
<div class="mt-5">
<button class="button button-primary button-block">{{ ctrans('texts.update') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@ -38,7 +38,7 @@
@enderror
</div>
<div class="flex flex-col mt-4">
<label for="password" class="input-label">{{ ctrans('texts.password') }}</label>
<label for="password" class="input-label">{{ ctrans('texts.password_confirmation') }}</label>
<input type="password" name="password_confirmation" id="password_confirmation"
class="input"
autofocus>

View File

@ -30,4 +30,5 @@ Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('passw
*/
Route::group(['middleware' => ['url_db']], function () {
Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm');
Route::post('/user/confirm/{confirmation_code}', 'UserController@confirmWithPassword');
});