Skip to content

Commit

Permalink
View Invoice from Customer side
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnux committed Mar 14, 2024
1 parent e206a58 commit 68d3c91
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# CHANGELOG

## 2024.3.14

- Add Note to Invoices
- Add Additional Bill
- View Invoice from Customer side

## 2024.3.13

- Postpaid System
Expand Down
2 changes: 1 addition & 1 deletion system/controllers/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
$ui->assign('gateway', $gateway);
$ui->assign('channel', $channel);
$ui->assign('server', $b['routers']);
$ui->assign('using', 'default');
$ui->assign('using', 'cash');
$ui->assign('plan', $plan);
$ui->display('recharge-confirm.tpl');
}
Expand Down
6 changes: 5 additions & 1 deletion system/controllers/voucher.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
$ui->display('user-activation-list.tpl');

break;

case 'invoice':
$id = $routes[2];
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->where('id', $id)->find_one();
Package::createInvoice($in);
$ui->display('invoice-customer.tpl');
default:
$ui->display('a404.tpl');
}
3 changes: 2 additions & 1 deletion system/lan/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -486,5 +486,6 @@
"Total": "Total",
"Current_Cycle": "Current Cycle",
"Additional_Cost": "Additional Cost",
"Remaining": "Remaining"
"Remaining": "Remaining",
"": ""
}
21 changes: 21 additions & 0 deletions ui/ui/invoice-customer.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{include file="sections/user-header.tpl"}

<div class="row">
<div class="col-md-4 col-md-offset-2">
<div class="panel panel-hovered panel-primary panel-stacked mb30">
<div class="panel-heading">{$in['invoice']}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
<pre id="content">{$invoice}</pre>
<input type="hidden" name="id" value="{$in['id']}">
<a href="{$_url}voucher/list-activated" class="btn btn-default btn-sm"><i
class="ion-reply-all"></i>{Lang::T('Finish')}</a>
<a href="https://api.whatsapp.com/send/?text={$whatsapp}" target="_blank"
class="btn btn-primary btn-sm">
<i class="glyphicon glyphicon-share"></i> WhatsApp</a>
</form>
</div>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}
2 changes: 1 addition & 1 deletion ui/ui/recharge-confirm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{$plan['validity_unit']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Using')}</b> <span class="pull-right">{$using}</span>
<b>{Lang::T('Using')}</b> <span class="pull-right">{ucwords($using)}</span>
</li>
</ul>
<center><b>{Lang::T('Total')}</b></center>
Expand Down
2 changes: 1 addition & 1 deletion ui/ui/recharge.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<label class="col-md-2 control-label">{Lang::T('Using')}</label>
<div class="col-md-6">
<select name="using" class="form-control">
<option value="default">{Lang::T('Default')}</option>
<option value="cash">{Lang::T('Cash')}</option>
{if $_c['enable_balance'] eq 'yes'}
<option value="balance">{Lang::T('Customer Balance')}</option>
{/if}
Expand Down
6 changes: 3 additions & 3 deletions ui/ui/user-activation-list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<table id="datatable" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Invoice')}</th>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Type')}</th>
Expand All @@ -21,8 +21,8 @@
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<tr onclick="window.location.href = '{$_url}voucher/invoice/{$ds['id']}'" style="cursor: pointer;">
<td>{$ds['invoice']}</td>
<td>{$ds['plan_name']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['type']}</td>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2024.3.13"
"version": "2024.3.14"
}

0 comments on commit 68d3c91

Please sign in to comment.