|
@@ -54,6 +54,62 @@ $routeName = request()->route()->getName();
|
|
copyTextToClipboard($(this).attr('data-target'));
|
|
copyTextToClipboard($(this).attr('data-target'));
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ parentSegment.find('.generate-and-visit-ic-portal')
|
|
|
|
+ .off('click.generate-and-visit-ic-portal')
|
|
|
|
+ .on('click.generate-and-visit-ic-portal', function() {
|
|
|
|
+ $.post('/api/session/proLogInAsCustomer', {
|
|
|
|
+ customerUid: $(this).attr('data-uid')
|
|
|
|
+ }, _data => {
|
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
|
+ window.location.href = '/ic/home/' + _data.data;
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ parentSegment.find('.generate-and-copy-ic-portal-url')
|
|
|
|
+ .off('click.generate-and-copy-ic-portal-url')
|
|
|
|
+ .on('click.generate-and-visit-ic-portal', function() {
|
|
|
|
+ $.post('/api/session/proLogInAsCustomer', {
|
|
|
|
+ customerUid: $(this).attr('data-uid')
|
|
|
|
+ }, _data => {
|
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
|
+ copyTextToClipboard('{{config('app.url')}}/ic/home/' + _data.data);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ parentSegment.find('.generate-and-visit-ic-pay')
|
|
|
|
+ .off('click.generate-and-visit-ic-pay')
|
|
|
|
+ .on('click.generate-and-visit-ic-pay', function() {
|
|
|
|
+ $.post('/api/session/proLogInAsCustomer', {
|
|
|
|
+ customerUid: $(this).attr('data-uid')
|
|
|
|
+ }, _data => {
|
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
|
+ window.location.href = '/ic/pay/' + $(this).attr('data-invoice-uid') + '/' + _data.data;
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ parentSegment.find('.generate-and-copy-ic-pay-url')
|
|
|
|
+ .off('click.generate-and-copy-ic-pay-url')
|
|
|
|
+ .on('click.generate-and-visit-ic-pay', function() {
|
|
|
|
+ $.post('/api/session/proLogInAsCustomer', {
|
|
|
|
+ customerUid: $(this).attr('data-uid')
|
|
|
|
+ }, _data => {
|
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
|
+ copyTextToClipboard('{{config('app.url')}}/ic/pay/' + $(this).attr('data-invoice-uid') + '/' + _data.data);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
addMCInitializer('invoice-center', init)
|
|
addMCInitializer('invoice-center', init)
|
|
}).call(window);
|
|
}).call(window);
|