Skip to content

Commit

Permalink
Prepaid airtime and electricity templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques committed Dec 1, 2015
1 parent 966f550 commit d6d265b
Show file tree
Hide file tree
Showing 4 changed files with 391 additions and 0 deletions.
103 changes: 103 additions & 0 deletions prepaid__airtime.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{include file="header.tpl" title="Purchase Prepaid Airtime"}

<div>
<h2 class="page-header">Prepaid Airtime</h2>
</div>

<div>
{include file="_partials/success.tpl"}
{include file="_partials/errors.tpl"}

<div class="row">
<div class="col-md-6">

<form method="post" class="form-horizontal" role="form">
<input name="utf8" type="hidden" value="&#x2713;" />
{include file="_partials/csrf.tpl"}
<div class="form-group">
<label for="inputNetwork" class="col-sm-4 control-label">Select the voucher</label>
<div class="col-sm-8">
<select class="form-control" name="network" id="inputNetwork">
<option value="none">Please select a network</option>
<option value="vodacom">Vodacom</option>
<option value="mtn">MTN</option>
<option value="cellc">Cell C</option>
<option value="virginmobile">Virgin Mobile</option>
<option value="telkommobile">Telkom Mobile</option>
<option value="telkom">Telkom</option>
<option value="neotel">Neotel</option>
</select>
</div>
</div>
<div id="vouchers">
<div class="form-group">
<label for="inputVoucher" class="col-sm-4 control-label">Select the voucher</label>
<div class="col-sm-8">
<select class="form-control" name="voucher" id="voucher">
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="inputMSISDN" class="col-sm-4 control-label">Recipients <acronym="Phone Number">MSISDN</acronym></label>
<div class="col-sm-8">
<input class="form-control" id="inputMSISDN" type="text" name="msisdn" placeholder="Phone Number">
</div>
</div>
<div class="form-group">
<label for="inputSource" class="col-sm-4 control-label">Pay from account</label>
<div class="col-sm-8">
<select name="source" class="form-control" id="inputSource">
{foreach $accounts item=row}
{if $row.account_type eq 'wallet'}
<option value="{$row.uuid}"{if isset($smarty.post.source) && $smarty.post.source eq $row.uuid} selected{/if}>Diamond Wallet Account &mdash; {$row.account_number} (R {($row.balance/100)|string_format:"%.2f"})</option>
{else}
{* Other account types cannot purchase electricity at the moment. *}
{/if}
{/foreach}
</select>
</div>
</div>

<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button data-disable-with="Processing ..." type="submit" class="btn btn-primary"{if $smarty.session.fica_status eq 0} disabled{/if}>Buy Now</button>
</div>
</div>
</div>
<div class="col-md-6">
<img width="500" src="/images/products/airtime/woman-on-phone.jpg">
</div>
</div>

{include file="_partials/fica_notice_transact.tpl"}
</form>
<h3>Recent Airtime Purchases</h3>

<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Date</th>
<th>Reference</th>
<th>Mobile Phone</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
{foreach $transactions item=row}
<tr>
<td>{$row.date}</td>
<td>{$row.txn_id}</td>
<td>{$row.msisdn}</td>
<td>R {($row.amount/100)|string_format:"%.2f"}</td>
</tr>
{/foreach}
</tbody>
</table>

<p>
You can lookup the token for a transaction on your transaction view of your Diamond Cash Account.
</p>
</div>

{include file="footer.tpl"}
117 changes: 117 additions & 0 deletions prepaid__electricity.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{include file="header.tpl" title="Prepaid Electricity"}

<div>
<h2 class=page-header">Prepaid Electricity</h2>
<hr />
</div>
<div>
{include file="_partials/success.tpl"}
{include file="_partials/errors.tpl"}
<div class="row">
<div class="col-md-6">
<form method="post" class="form-horizontal" role="form">
<input name="utf8" type="hidden" value="&#x2713;" />
<input name="step" type="hidden" value="verify" />
{include file="_partials/csrf.tpl"}
<div class="form-group">
<label for="inputMeterNumber" class="col-sm-4 control-label">Prepaid Meter Number</label>
<div class="col-sm-8">
<input class="form-control" id="inputMeterNumber" type="text" name="meter_number" placeholder="Meter Number">
</div>
</div>
<div class="form-group">
<label for="inputAmount" class="col-sm-4 control-label">Amount</label>
<div class="col-sm-8">
<input class="form-control" id="inputAmount" type="text" name="amount" placeholder="Amount in Rands">
</div>
</div>
<div class="form-group">
<label for="inputSource" class="col-sm-4 control-label">Pay from account</label>
<div class="col-sm-8">
<select id="inputSource" class="form-control" name="source">
{foreach $accounts item=row}
{if $row.account_type eq 'wallet'}
<option value="{$row.uuid}"{if isset($smarty.post.source) && $smarty.post.source eq $row.uuid} selected{/if}>Diamond Wallet Account &mdash; {$row.account_number} (R {($row.balance/100)|string_format:"%.2f"})</option>
{else}
{* Other account types cannot purchase electricity at the moment. *}
{/if}
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-primary"{if $smarty.session.fica_status eq 0} disabled{/if}>Buy Now</button>
</div>
</div>
</div>
<div class="col-md-6">Supported municipalities and electricity utilties:
<ul>
<li>Breede Valley</li>
<li>Centlec (Bloemfontein)</li>
<li>City of Cape Town</li>
<li>George</li>
<li>Kimberly</li>
<li>Johannesburg (City Power)</li>
<li>Stellenbosch</li>
</ul>
<p>
Support for the following municipalities are coming online in the next few weeks:
</p>
<ul>
<li>Durban</li>
<li>Port Elizabeth</li>
<li>Pretoria (Tshwane)</li>
</ul>
</div>
</div>
<div class="alert alert-info" role="alert">
Please ensure you have entered the correct meter number as the municipalities do not allow reversals on vends of electricity.
</div>
{include file="_partials/fica_notice_transact.tpl"}
<h3>Recent Electricty Purchases</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Date</th>
<th>Reference</th>
<th>Meter Number</th>
<th>Amount</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{foreach $transactions item=row}
<tr>
<td>{$row.date}</td>
<td>{$row.txn_id}</td>
<td>{$row.meter_number}</td>
<td>R {($row.amount/100)|string_format:"%.2f"}</td>
<td><a href="/prepaid/electricity/{$row.uuid}">View Receipt</a></td>
</tr>
{/foreach}
</tbody>
</table>
<p>
You can lookup the token for a transaction on your transaction view of your Diamond Wallet Account.
</p>
</div>
{include file="footer.tpl"}
53 changes: 53 additions & 0 deletions prepaid__electricity__confirm.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{include file="header.tpl" title="Prepaid Electricity"}
<div>
<h2 class="page-header">Prepaid Electricity</h2>
</div>

<div>
{include file="_partials/success.tpl"}
{include file="_partials/errors.tpl"}

<form method="post" class="form-inline" role="form">
<input name="utf8" type="hidden" value="&#x2713;" />
<input name="step" type="hidden" value="confirm" />
{include file="_partials/csrf.tpl"}
<input name="source" type="hidden" value="{$source}" />
<input name="meter_number" type="hidden" value="{$meter_number}" />
<input name="amount" type="hidden" value="{$amount}" />

<table class="table table-border table-striped">
<tbody>
<tr>
<th>Meter Number</th>
<td>{$meter_number}</td>
</tr>
<tr>
<th>Customer Name</th>
<td>{$customer_name}</td>
</tr>
<tr>
<th>Address</th>
<td>{$address}</td>
</tr>
<tr>
<th>Amount</th>
<td>R {($amount)|number_format:2:'.':','}</td>
</tr>
<tr>
<th>Utility</th>
<td>{$utility}</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><button type="submit" class="btn btn-primary"{if $smarty.session.fica_status eq 0} disabled{/if}>Buy Now</button></td>
</tr>
</tbody>
</table>
</form>

<div class="alert alert-info" role="alert">
Please ensure you have entered the correct meter number as the municipalities do not allow reversals on vends of electricity.
</div>
</div>

{include file="footer.tpl"}
118 changes: 118 additions & 0 deletions prepaid__electricity__paid.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{include file="header.tpl" title="Prepaid Electricity"}
<div>
<h2 class="page-header hidden-print">Prepaid Electricity</h2>
</div>

<div>
<h3 class="page-title">RECEIPT</h3>

<table class="table">
<tbody>
<tr>
<th>Utility</th>
<td>{$utility->name}</td>
</tr>
<tr>
<th>{$utility->name} VAT No.</th>
<td>{$receipt->vatno}</td>
</tr>
<tr>
<th>{$utility->name} Address</th>
<td>{$receipt->address}</td>
</tr>
<tr>
<th>{$utility->name} Receipt No.</th>
<td>{$tokens.0->rctnum}</td>
</tr>
<tr>
<th>Date</th>
<td>{$date}</td>
</tr>
<tr>
<th>Our Ref</th>
<td>{$reference}</td>
</tr>
</tbody>
</table>

<h4 class="page-title">Customer</h4>

<table class="table">
<tbody>
<tr>
<th>Customer</th>
<td>{$customer_info->name}</td>
</tr>
<tr>
<th>Address</th>
<td>{$customer_info->address}</td>
</tr>
</tbody>
</table>

<h4 class="page-title">Meter Info</h4>

<table class="table">
<thead>
<th>Meter Number</th>
<th>Tarrif</th>
<th>SGC</th>
<th>TI</th>
<th>ALG</th>
<th>KRN</th>
<th>TTC</th>
<th>MT</th>
</thead>
<tbody>
<td>{$meter_number}</td>
<td>{$tariff}</td>
<td>{$customer_info->supgrpref}</td>
<td>{$customer_info->tariff_index}</td>
<td>{$customer_info->alg_code}</td>
<td>{$customer_info->key_rev_num}</td>
<td>{$customer_info->token_tech_code}</td>
<td>{$customer_info->meter_type}</td>
</tbody>
</table>

<h4 class="page-title">Tokens</h4>

{foreach $tokens item=row}

<table class="table">
<tbody>
<tr>
<th>Token Type</th>
<td>{$row->type}</td>
</tr>
<tr>
<th>Units</th>
<td>{$row->units} kWh</td>
</tr>
<tr>
<th>Tariff</th>
<td>{$row->tariff}</td>
</tr>
<tr>
<th>Token</th>
<td><h4>{$row->token|ststoken}</h4></td>
</tr>
<tr>
<th>Electricity (excl. VAT)</th>
<td>R {($row->amount/100)|number_format:2:'.':','}</td>
</tr>
<tr>
<th>VAT</th>
<td>R {($row->tax/100)|number_format:2:'.':','}</td>
</tr>
<tr>
<th>Total</th>
<td>R {(($row->amount+$row->tax)/100)|number_format:2:'.':','}</td>
</tr>
</tbody>
</table>
{/foreach}

</div>

{include file="footer.tpl"}

0 comments on commit d6d265b

Please sign in to comment.