Discount price requested by Fiberwan

This commit is contained in:
Ibnu Maksum 2024-09-23 16:43:24 +07:00
parent 8e3a16a123
commit aa0432df38
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
14 changed files with 749 additions and 622 deletions

View File

@ -2,6 +2,11 @@
# CHANGELOG # CHANGELOG
## 2024.9.23
- Discount Price
- Burst Preset
## 2024.9.20 ## 2024.9.20
- Forgot Password - Forgot Password

View File

@ -83,9 +83,9 @@ switch ($action) {
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'Hotspot')->findArray(); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'Hotspot')->findArray();
$ids = array_column($bws, 'id_bw'); $ids = array_column($bws, 'id_bw');
if(count($ids)){ if (count($ids)) {
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray()); $ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
}else{ } else {
$ui->assign('bws', []); $ui->assign('bws', []);
} }
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
@ -321,6 +321,7 @@ switch ($action) {
$id_bw = _post('id_bw'); $id_bw = _post('id_bw');
$typebp = _post('typebp'); $typebp = _post('typebp');
$price = _post('price'); $price = _post('price');
$price_old = _post('price_old');
$limit_type = _post('limit_type'); $limit_type = _post('limit_type');
$time_limit = _post('time_limit'); $time_limit = _post('time_limit');
$time_unit = _post('time_unit'); $time_unit = _post('time_unit');
@ -353,6 +354,11 @@ switch ($action) {
} else { } else {
$msg .= Lang::T('Data Not Found') . '<br>'; $msg .= Lang::T('Data Not Found') . '<br>';
} }
if ($price_old <= $price) {
$price_old = '';
}
run_hook('edit_plan'); #HOOK run_hook('edit_plan'); #HOOK
if ($msg == '') { if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one(); $b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
@ -378,6 +384,7 @@ switch ($action) {
$d->name_plan = $name; $d->name_plan = $name;
$d->id_bw = $id_bw; $d->id_bw = $id_bw;
$d->price = $price; // Set price with or without tax based on configuration $d->price = $price; // Set price with or without tax based on configuration
$d->price_old = $price_old;
$d->typebp = $typebp; $d->typebp = $typebp;
$d->limit_type = $limit_type; $d->limit_type = $limit_type;
$d->time_limit = $time_limit; $d->time_limit = $time_limit;
@ -453,9 +460,9 @@ switch ($action) {
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'PPPOE')->findArray(); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'PPPOE')->findArray();
$ids = array_column($bws, 'id_bw'); $ids = array_column($bws, 'id_bw');
if(count($ids)){ if (count($ids)) {
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray()); $ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
}else{ } else {
$ui->assign('bws', []); $ui->assign('bws', []);
} }
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
@ -705,6 +712,7 @@ switch ($action) {
$name = _post('name_plan'); $name = _post('name_plan');
$id_bw = _post('id_bw'); $id_bw = _post('id_bw');
$price = _post('price'); $price = _post('price');
$price_old = _post('price_old');
$validity = _post('validity'); $validity = _post('validity');
$validity_unit = _post('validity_unit'); $validity_unit = _post('validity_unit');
$routers = _post('routers'); $routers = _post('routers');
@ -728,6 +736,10 @@ switch ($action) {
$msg .= Lang::T('All field is required') . '<br>'; $msg .= Lang::T('All field is required') . '<br>';
} }
if ($price_old <= $price) {
$price_old = '';
}
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); $d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
$old = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); $old = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) { if ($d) {
@ -758,6 +770,7 @@ switch ($action) {
$d->name_plan = $name; $d->name_plan = $name;
$d->id_bw = $id_bw; $d->id_bw = $id_bw;
$d->price = $price; $d->price = $price;
$d->price_old = $price_old;
$d->plan_type = $plan_type; $d->plan_type = $plan_type;
$d->validity = $validity; $d->validity = $validity;
$d->validity_unit = $validity_unit; $d->validity_unit = $validity_unit;
@ -835,6 +848,7 @@ switch ($action) {
$id = _post('id'); $id = _post('id');
$name = _post('name'); $name = _post('name');
$price = _post('price'); $price = _post('price');
$price_old = _post('price_old');
$enabled = _post('enabled'); $enabled = _post('enabled');
$prepaid = _post('prepaid'); $prepaid = _post('prepaid');
@ -851,11 +865,15 @@ switch ($action) {
} else { } else {
$msg .= Lang::T('Data Not Found') . '<br>'; $msg .= Lang::T('Data Not Found') . '<br>';
} }
if ($price_old <= $price) {
$price_old = '';
}
run_hook('edit_ppoe'); #HOOK run_hook('edit_ppoe'); #HOOK
if ($msg == '') { if ($msg == '') {
$d->name_plan = $name; $d->name_plan = $name;
$d->price = $price; $d->price = $price;
$d->enabled = $enabled; $d->enabled = $enabled;
$d->price_old = $price_old;
$d->prepaid = 'yes'; $d->prepaid = 'yes';
$d->save(); $d->save();
@ -935,9 +953,9 @@ switch ($action) {
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'VPN')->findArray(); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'VPN')->findArray();
$ids = array_column($bws, 'id_bw'); $ids = array_column($bws, 'id_bw');
if(count($ids)){ if (count($ids)) {
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray()); $ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
}else{ } else {
$ui->assign('bws', []); $ui->assign('bws', []);
} }
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
@ -1187,6 +1205,7 @@ switch ($action) {
$name = _post('name_plan'); $name = _post('name_plan');
$id_bw = _post('id_bw'); $id_bw = _post('id_bw');
$price = _post('price'); $price = _post('price');
$price_old = _post('price_old');
$validity = _post('validity'); $validity = _post('validity');
$validity_unit = _post('validity_unit'); $validity_unit = _post('validity_unit');
$routers = _post('routers'); $routers = _post('routers');
@ -1210,6 +1229,10 @@ switch ($action) {
$msg .= Lang::T('All field is required') . '<br>'; $msg .= Lang::T('All field is required') . '<br>';
} }
if($price_old<=$price){
$price_old = '';
}
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); $d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
$old = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); $old = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) { if ($d) {
@ -1240,6 +1263,7 @@ switch ($action) {
$d->name_plan = $name; $d->name_plan = $name;
$d->id_bw = $id_bw; $d->id_bw = $id_bw;
$d->price = $price; $d->price = $price;
$d->price_old = $price_old;
$d->plan_type = $plan_type; $d->plan_type = $plan_type;
$d->validity = $validity; $d->validity = $validity;
$d->validity_unit = $validity_unit; $d->validity_unit = $validity_unit;

View File

@ -1,6 +1,6 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30"> <div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Edit Service Package')}</div> <div class="panel-heading">{Lang::T('Edit Service Package')}</div>
@ -21,10 +21,11 @@
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Package Name')}</label> <label class="col-md-2 control-label">{Lang::T('Package Name')}</label>
<div class="col-md-6"> <div class="col-md-6">
<input type="text" required class="form-control" id="name" value="{$d['name_plan']}" name="name" maxlength="40" placeholder="{Lang::T('Topup')} 100"> <input type="text" required class="form-control" id="name" value="{$d['name_plan']}"
name="name" maxlength="40" placeholder="{Lang::T('Topup')} 100">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group has-success">
<label class="col-md-2 control-label">{Lang::T('Package Price')}</label> <label class="col-md-2 control-label">{Lang::T('Package Price')}</label>
<div class="col-md-6"> <div class="col-md-6">
<div class="input-group"> <div class="input-group">
@ -41,9 +42,17 @@
will be added')}</p> will be added')}</p>
{/if} {/if}
{/if} {/if}
</div> </div>
<div class="form-group has-warning">
<label class="col-md-2 control-label">{Lang::T('Price Before Discount')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price_old" required value="{$d['price_old']}">
</div>
<p class="help-block">{Lang::T('For Discount Rate, this is price before get discount, must be more expensive with real price')}</p>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-2 col-lg-10"> <div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button> <button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
@ -54,6 +63,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{include file="sections/footer.tpl"} {include file="sections/footer.tpl"}

View File

@ -36,7 +36,9 @@
{foreach $d as $ds} {foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"{/if}> <tr {if $ds['enabled'] != 1}class="danger" title="disabled"{/if}>
<td>{$ds['name_plan']}</td> <td>{$ds['name_plan']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($ds['price_old'])}</sup>
{/if}</td>
<td> <td>
<a href="{$_url}services/balance-edit/{$ds['id']}" class="btn btn-info btn-xs">{Lang::T('Edit')}</a> <a href="{$_url}services/balance-edit/{$ds['id']}" class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
<a href="{$_url}services/balance-delete/{$ds['id']}" onclick="return confirm('{Lang::T('Delete')}?')" id="{$ds['id']}" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a> <a href="{$_url}services/balance-delete/{$ds['id']}" onclick="return confirm('{Lang::T('Delete')}?')" id="{$ds['id']}" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>

View File

@ -151,7 +151,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group has-success">
<label class="col-md-3 control-label">{Lang::T('Package Price')}</label> <label class="col-md-3 control-label">{Lang::T('Package Price')}</label>
<div class="col-md-9"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
@ -168,7 +168,16 @@
will be added')}</p> will be added')}</p>
{/if} {/if}
{/if} {/if}
</div>
<div class="form-group has-warning">
<label class="col-md-3 control-label">{Lang::T('Price Before Discount')}</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price_old" required value="{$d['price_old']}">
</div>
<p class="help-block">{Lang::T('For Discount Rate, this is price before get discount, must be more expensive with real price')}</p>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Shared Users')} <label class="col-md-3 control-label">{Lang::T('Shared Users')}

View File

@ -142,7 +142,11 @@
<td>{if $ds['prepaid'] == no}<b>Postpaid</b>{else}Prepaid{/if} {$ds['plan_type']}</td> <td>{if $ds['prepaid'] == no}<b>Postpaid</b>{else}Prepaid{/if} {$ds['plan_type']}</td>
<td>{$ds['name_bw']}</td> <td>{$ds['name_bw']}</td>
<td>{$ds['typebp']}</td> <td>{$ds['typebp']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}
{if !empty($ds['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($ds['price_old'])}</sup>
{/if}
</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td> <td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['time_limit']} {$ds['time_unit']}</td> <td>{$ds['time_limit']} {$ds['time_unit']}</td>
<td>{$ds['data_limit']} {$ds['data_unit']}</td> <td>{$ds['data_limit']} {$ds['data_unit']}</td>

View File

@ -91,7 +91,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group has-success">
<label class="col-md-3 control-label">{Lang::T('Plan Price')}</label> <label class="col-md-3 control-label">{Lang::T('Plan Price')}</label>
<div class="col-md-9"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
@ -108,7 +108,16 @@
will be added')}</p> will be added')}</p>
{/if} {/if}
{/if} {/if}
</div>
<div class="form-group has-warning">
<label class="col-md-3 control-label">{Lang::T('Price Before Discount')}</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price_old" required value="{$d['price_old']}">
</div>
<p class="help-block">{Lang::T('For Discount Rate, this is price before get discount, must be more expensive with real price')}</p>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Plan Validity')}</label> <label class="col-md-3 control-label">{Lang::T('Plan Validity')}</label>

View File

@ -135,9 +135,15 @@
<tr {if $ds['enabled'] !=1}class="danger" title="disabled" {/if}> <tr {if $ds['enabled'] !=1}class="danger" title="disabled" {/if}>
<td>{$ds['name_plan']}</td> <td>{$ds['name_plan']}</td>
<td>{$ds['plan_type']} {if $ds['prepaid'] != <td>{$ds['plan_type']} {if $ds['prepaid'] !=
'yes'}<b>{Lang::T('Postpaid')}</b>{else}{Lang::T('Prepaid')}{/if}</td> 'yes'}<b>{Lang::T('Postpaid')}</b>
{else}
{Lang::T('Prepaid')}
{/if}</td>
<td>{$ds['name_bw']}</td> <td>{$ds['name_bw']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($ds['price_old'])}</sup>
{/if}
</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td> <td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['pool']}</td> <td>{$ds['pool']}</td>
<td>{if $ds['plan_expired']}<a <td>{if $ds['plan_expired']}<a

View File

@ -16,7 +16,11 @@
<tbody> <tbody>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -27,7 +27,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -81,7 +85,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -136,7 +144,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -189,7 +201,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -254,7 +270,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -306,7 +326,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -358,7 +382,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -414,7 +442,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -464,7 +496,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>
@ -514,7 +550,11 @@
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Price')}</td> <td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td> <td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr> </tr>
<tr> <tr>
<td>{Lang::T('Validity')}</td> <td>{Lang::T('Validity')}</td>

View File

@ -46,11 +46,12 @@
{$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">
'zero'}{Lang::moneyFormat(0)} {if !empty($plan['price_old'])}
{else} <sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
{Lang::moneyFormat($plan['price'])} {Lang::moneyFormat($plan['price'])}
{/if}</span> </span>
</li> </li>
{if $plan['validity']} {if $plan['validity']}
<li class="list-group-item"> <li class="list-group-item">

View File

@ -91,7 +91,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group has-success">
<label class="col-md-3 control-label">{Lang::T('Plan Price')}</label> <label class="col-md-3 control-label">{Lang::T('Plan Price')}</label>
<div class="col-md-9"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
@ -108,7 +108,16 @@
will be added')}</p> will be added')}</p>
{/if} {/if}
{/if} {/if}
</div>
<div class="form-group has-warning">
<label class="col-md-3 control-label">{Lang::T('Price Before Discount')}</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price_old" required value="{$d['price_old']}">
</div>
<p class="help-block">{Lang::T('For Discount Rate, this is price before get discount, must be more expensive with real price')}</p>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Plan Validity')}</label> <label class="col-md-3 control-label">{Lang::T('Plan Validity')}</label>

View File

@ -133,9 +133,14 @@
{foreach $d as $ds} {foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled" {/if}> <tr {if $ds['enabled'] != 1}class="danger" title="disabled" {/if}>
<td>{$ds['name_plan']}</td> <td>{$ds['name_plan']}</td>
<td>{$ds['plan_type']} {if $ds['prepaid'] != 'yes'}<b>{Lang::T('Postpaid')}</b>{else}{Lang::T('Prepaid')}{/if}</td> <td>{$ds['plan_type']}
{if $ds['prepaid'] != 'yes'}<b>{Lang::T('Postpaid')}</b>{else}{Lang::T('Prepaid')}{/if}
</td>
<td>{$ds['name_bw']}</td> <td>{$ds['name_bw']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($ds['price_old'])}</sup>
{/if}
</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td> <td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['pool']}</td> <td>{$ds['pool']}</td>
<td>{if $ds['plan_expired']}<a <td>{if $ds['plan_expired']}<a

View File

@ -1,3 +1,3 @@
{ {
"version": "2024.9.20" "version": "2024.9.23"
} }