Merge branch 'hotspotbilling:master' into master

This commit is contained in:
Focuslinkstech 2024-07-31 10:00:05 +01:00 committed by GitHub
commit d494df3321
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 79 additions and 29 deletions

View File

@ -70,13 +70,13 @@ CREATE TABLE `tbl_payment_gateway` (
`id` int NOT NULL, `id` int NOT NULL,
`username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`gateway` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'xendit | midtrans', `gateway` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'xendit | midtrans',
`gateway_trx_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `gateway_trx_id` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`plan_id` int NOT NULL, `plan_id` int NOT NULL,
`plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers_id` int NOT NULL, `routers_id` int NOT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`pg_url_payment` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `pg_url_payment` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_method` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `payment_method` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_channel` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `payment_channel` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`pg_request` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, `pg_request` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,

View File

@ -345,7 +345,11 @@ switch ($action) {
$tax_rate = $tax_rate_setting; $tax_rate = $tax_rate_setting;
} }
$plan = ORM::for_table('tbl_plans')->find_one($routes['3']); $plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
$tax = Package::tax($plan['price'], $tax_rate); $add_cost = 0;
if ($router['name'] != 'balance') {
list($bills, $add_cost) = User::getBills($id_customer);
}
$tax = Package::tax($plan['price'] + $add_cost, $tax_rate);
$pgs = array_values(explode(',', $config['payment_gateway'])); $pgs = array_values(explode(',', $config['payment_gateway']));
if (count($pgs) == 0) { if (count($pgs) == 0) {
sendTelegram("Payment Gateway not set, please set it in Settings"); sendTelegram("Payment Gateway not set, please set it in Settings");
@ -359,6 +363,8 @@ switch ($action) {
} }
$ui->assign('route2', $routes[2]); $ui->assign('route2', $routes[2]);
$ui->assign('route3', $routes[3]); $ui->assign('route3', $routes[3]);
$ui->assign('add_cost', $add_cost);
$ui->assign('bills', $bills);
$ui->assign('plan', $plan); $ui->assign('plan', $plan);
$ui->display('user-selectGateway.tpl'); $ui->display('user-selectGateway.tpl');
break; break;

View File

@ -678,5 +678,7 @@
"Logout_Admin_if_not_Available_Online_a_period_of_time": "Logout Admin if not Available\/Online a period of time", "Logout_Admin_if_not_Available_Online_a_period_of_time": "Logout Admin if not Available\/Online a period of time",
"Timeout_Duration": "Timeout Duration", "Timeout_Duration": "Timeout Duration",
"Enter_the_session_timeout_duration__minutes_": "Enter the session timeout duration (minutes)", "Enter_the_session_timeout_duration__minutes_": "Enter the session timeout duration (minutes)",
"Idle_Timeout__Logout_Admin_if_Idle_for_xx_minutes": "Idle Timeout, Logout Admin if Idle for xx minutes" "Idle_Timeout__Logout_Admin_if_Idle_for_xx_minutes": "Idle Timeout, Logout Admin if Idle for xx minutes",
"Failed_to_create_transaction__please_tell_seller_": "Failed to create transaction, please tell seller.",
"_": "-"
} }

View File

@ -129,5 +129,9 @@
"2024.7.24" : [ "2024.7.24" : [
"ALTER TABLE `tbl_voucher` ADD `used_date` DATETIME NULL DEFAULT NULL AFTER `status`;", "ALTER TABLE `tbl_voucher` ADD `used_date` DATETIME NULL DEFAULT NULL AFTER `status`;",
"UPDATE `tbl_voucher` SET `used_date`=now() WHERE `status`=1;" "UPDATE `tbl_voucher` SET `used_date`=now() WHERE `status`=1;"
],
"2024.7.31" : [
"ALTER TABLE `tbl_payment_gateway` CHANGE `gateway_trx_id` `gateway_trx_id` VARCHAR(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;",
"ALTER TABLE `tbl_payment_gateway` CHANGE `pg_url_payment` `pg_url_payment` VARCHAR(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;"
] ]
} }

View File

@ -11,8 +11,8 @@
<div class="col-md-8"> <div class="col-md-8">
<select name="gateway" id="gateway" class="form-control"> <select name="gateway" id="gateway" class="form-control">
{foreach $pgs as $pg} {foreach $pgs as $pg}
<option value="{$pg}"> <option value="{$pg}">
{ucwords($pg)}</option> {ucwords($pg)}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
@ -25,44 +25,82 @@
<b>{Lang::T('Plan Name')}</b> <span class="pull-right">{$plan['name_plan']}</span> <b>{Lang::T('Plan Name')}</b> <span class="pull-right">{$plan['name_plan']}</span>
</li> </li>
{if $plan['is_radius'] or $plan['routers']} {if $plan['is_radius'] or $plan['routers']}
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Location')}</b> <span class="pull-right">{if <b>{Lang::T('Location')}</b> <span class="pull-right">{if
$plan['is_radius']}Radius{else}{$plan['routers']}{/if}</span> $plan['is_radius']}Radius{else}{$plan['routers']}
{/if}</span>
</li> </li>
{/if} {/if}
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Type')}</b> <span class="pull-right">{if $plan['prepaid'] eq <b>{Lang::T('Type')}</b> <span class="pull-right">{if $plan['prepaid'] eq
'yes'}Prepaid{else}Postpaid{/if} 'yes'}Prepaid{else}Postpaid
{/if}
{$plan['type']}</span> {$plan['type']}</span>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Plan Price')}</b> <span class="pull-right">{if $using eq <b>{Lang::T('Plan Price')}</b> <span class="pull-right">{if $using eq
'zero'}{Lang::moneyFormat(0)}{else}{Lang::moneyFormat($plan['price'])}{/if}</span> 'zero'}{Lang::moneyFormat(0)}
{else}
{Lang::moneyFormat($plan['price'])}
{/if}</span>
</li> </li>
{if $plan['validity']} {if $plan['validity']}
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Plan Validity')}</b> <span class="pull-right">{$plan['validity']} <b>{Lang::T('Plan Validity')}</b> <span class="pull-right">{$plan['validity']}
{$plan['validity_unit']}</span> {$plan['validity_unit']}</span>
</li> </li>
{/if} {/if}
</ul> </ul>
<center><b>{Lang::T('Summary')}</b></center> <center><b>{Lang::T('Summary')}</b></center>
<ul class="list-group list-group-unbordered"> <ul class="list-group list-group-unbordered">
{if $tax} {if $tax}
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Tax')}</b> <span <b>{Lang::T('Tax')}</b> <span class="pull-right">{Lang::moneyFormat($tax)}</span>
class="pull-right">{Lang::moneyFormat($tax)}</span> </li>
</li> {if $add_cost>0}
<li class="list-group-item"> {foreach $bills as $k => $v}
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} + {Lang::T('Tax')})</small><span class="pull-right" <li class="list-group-item">
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$tax)}</span> <b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li> </li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')}
+{Lang::T('Additional Cost')})</small><span class="pull-right"
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$add_cost+$tax)}</span>
</li>
{else}
<li class="list-group-item">
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} + {Lang::T('Tax')})</small><span
class="pull-right"
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$tax)}</span>
</li>
{/if}
{else} {else}
<li class="list-group-item"> {if $add_cost>0}
<b>{Lang::T('Total')}</b> <span class="pull-right" {foreach $bills as $k => $v}
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; "> <li class="list-group-item">
{Lang::moneyFormat($plan['price'])}</span> <b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li> </li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')}
+{Lang::T('Additional Cost')})</small><span class="pull-right"
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$add_cost)}</span>
</li>
{else}
<li class="list-group-item">
<b>{Lang::T('Total')}</b> <span class="pull-right"
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price'])}</span>
</li>
{/if}
{/if} {/if}
</ul> </ul>
<center> <center>

View File

@ -1,3 +1,3 @@
{ {
"version": "2024.7.27" "version": "2024.7.31"
} }