Internal overhaul

This commit is contained in:
Deon George
2013-11-28 17:41:34 +11:00
parent 0ed5e5163d
commit f8a5b153cf
91 changed files with 1570 additions and 1619 deletions

View File

@@ -121,12 +121,9 @@ class Controller_Admin_Payment extends Controller_Payment {
->type('stdin')
->data('
$(document).ready(function() {
var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
$("#date_payment_label").datepicker({
autoclose : true,
endDate : now,
endDate : new Date(),
format : "dd-mm-yyyy",
todayBtn : true,
}).on("hide",function(ev) {

View File

@@ -214,6 +214,22 @@ class Model_Payment extends ORM_OSB {
/** LIST FUNCTIONS **/
/**
* Show recent payments for this account
*/
public function list_recent_table() {
return Table::factory()
->data($this->limit(10)->find_all())
->columns(array(
'id'=>'ID',
'date_payment'=>'Date',
'checkout->display("name")'=>'Method',
'total_amt'=>'Total',
'balance(TRUE)'=>'Balance',
'invoicelist()'=>'Invoices'
));
}
public function list_unapplied() {
$pid = array();
@@ -232,32 +248,5 @@ class Model_Payment extends ORM_OSB {
return $this->where('id','IN',$pid)->order_by('account_id')->find_all();
}
public function list_recent_table() {
// @todo This should be in a config file.
$css = '<style type="text/css">';
$css .= 'table.box-left { border: 1px solid #AAAACC; margin-right: auto; }';
$css .= 'tr.head { font-weight: bold; }';
$css .= 'td.head { font-weight: bold; }';
$css .= 'td.right { text-align: right; }';
$css .= 'tr.odd { background-color: #FCFCFE; }';
$css .= 'tr.even { background-color: #F6F6F8; }';
$css .= '</style>';
return $css.Table::display(
$this->limit(10)->find_all(),
25,
array(
'id'=>array('label'=>'ID'),
'date_payment'=>array('label'=>'Date'),
'checkout->display("name")'=>array('label'=>'Method'),
'total_amt'=>array('label'=>'Total','class'=>'right'),
'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'),
'invoicelist()'=>array('label'=>'Invoices'),
),
array(
'type'=>'list',
));
}
}
?>

View File

@@ -1,23 +1,21 @@
<div class="row">
<div class="span9 offset1">
<div class="span11">
<fieldset>
<legend>Payment Details</legend>
<fieldset>
<legend>Payment Details</legend>
<div class="input-append date" id="date_payment_label">
<?php echo Form::input('date_payment_label',$o->display('date_payment'),array('class'=>'span2','label'=>'Date Paid','add-on'=>'<i class="icon-calendar"></i>','disabled')); ?>
</div>
<div class="input-append date" id="date_payment_label">
<?php echo Form::input('date_payment_label',$o->display('date_payment'),array('class'=>'span2','label'=>'Date Paid','add-on'=>'<i class="icon-calendar"></i>','disabled')); ?>
</div>
<?php echo Form::hidden('date_payment',$o->date_payment); ?>
<?php echo Form::select('checkout_id',ORM::factory('Checkout')->list_select(),$o->checkout_id,array('label'=>'Payment Method','required')); ?>
<?php echo Form::input('total_amt',$o->total_amt,array('class'=>'span2','label'=>'Amount','placeholder'=>'Total','help-block'=>sprintf('Credits: %s, Balance: %s',$o->credit(),$o->total()))); ?>
<?php echo Form::input('fees_amt',$o->fees_amt,array('class'=>'span2','label'=>'Fees','placeholder'=>'Fees')); ?>
<?php echo Form::input('account_id_label',$o->account->name(),array('class'=>'span5','label'=>'Account','placeholder'=>'Account','data-provide'=>'typeahead')); ?>
<?php echo Form::hidden('account_id',$o->account_id); ?>
<?php echo Form::input('notes',$o->notes,array('class'=>'span5','label'=>'Notes','placeholder'=>'Any notes about this payment?')); ?>
</fieldset>
<?php echo Form::hidden('date_payment',$o->date_payment); ?>
<?php echo Form::select('checkout_id',ORM::factory('Checkout')->list_select(),$o->checkout_id,array('label'=>'Payment Method','required')); ?>
<?php echo Form::input('total_amt',$o->total_amt,array('class'=>'span2','label'=>'Amount','placeholder'=>'Total','help-block'=>sprintf('Credits: %s, Balance: %s',$o->credit(),$o->total()))); ?>
<?php echo Form::input('fees_amt',$o->fees_amt,array('class'=>'span2','label'=>'Fees','placeholder'=>'Fees')); ?>
<?php echo Form::input('account_id_label',$o->account->name(),array('class'=>'span5','label'=>'Account','placeholder'=>'Account','data-provide'=>'typeahead')); ?>
<?php echo Form::hidden('account_id',$o->account_id); ?>
<?php echo Form::input('notes',$o->notes,array('class'=>'span5','label'=>'Notes','placeholder'=>'Any notes about this payment?')); ?>
</fieldset>
<div class="span8" id="items"</div>
<td><div id='items'></div></td>
<?php echo Form::button('submit','Submit',array('class'=>'btn btn-primary')); ?>
</div> <!-- /span -->
</div> <!-- /row -->
<?php echo Form::button('submit','Submit',array('class'=>'btn btn-primary')); ?>
</div> <!-- /span -->

View File

@@ -1,13 +1,11 @@
<div class="row">
<div class="span9 offset1">
<fieldset>
<legend>Ezypay Payment</legend>
<div class="span11">
<fieldset>
<legend>Ezypay Payment</legend>
<?php echo Form::hidden('payer',$_POST['payer']); ?>
<?php echo Form::file('transaction',array('label'=>'Transaction File','required','help-block'=>'AddItems')); ?>
<?php echo Form::file('payment',array('label'=>'Payment File','required','help-block'=>'BillDetails')); ?>
</fieldset>
<?php echo Form::hidden('payer',$_POST['payer']); ?>
<?php echo Form::file('transaction',array('label'=>'Transaction File','required','help-block'=>'AddItems')); ?>
<?php echo Form::file('payment',array('label'=>'Payment File','required','help-block'=>'BillDetails')); ?>
</fieldset>
<?php echo Form::button('submit','Submit',array('class'=>'btn btn-primary')); ?>
</div> <!-- /span -->
</div> <!-- /row -->
<?php echo Form::button('submit','Submit',array('class'=>'btn btn-primary')); ?>
</div> <!-- /span -->

View File

@@ -1,18 +1,16 @@
<div class="row">
<div class="span9 offset1">
<fieldset>
<legend>Bulk Payment Details</legend>
</fieldset>
<div class="span11">
<fieldset>
<legend>Bulk Payment Details</legend>
</fieldset>
<div class="dl-horizontal">
<dt>Total</dt>
<dd><?php echo $total; ?></dd>
<div class="dl-horizontal">
<dt>Total</dt>
<dd><?php echo $total; ?></dd>
<dt>Fees</dt>
<dd><?php echo $fee; ?></dd>
<dt>Fees</dt>
<dd><?php echo $fee; ?></dd>
<dt>Payments</dt>
<dd><?php echo $table; ?></dd>
</div> <!-- /dl-horizontal -->
</div> <!-- /span -->
</div> <!-- /row -->
<dt>Payments</dt>
<dd><?php echo $table; ?></dd>
</div> <!-- /dl-horizontal -->
</div> <!-- /span -->

View File

@@ -1,16 +1,17 @@
<table class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th>Invoice</th>
<th>Date Issue</th>
<th>Date Due</th>
<th class="text-right">Total</th>
<th class="text-right">Payments</th>
<th class="text-right">Due</th>
<th class="text-right">Alloc</th>
</tr>
</thead>
<table class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th>Invoice</th>
<th>Date Issue</th>
<th>Date Due</th>
<th class="text-right">Total</th>
<th class="text-right">Payments</th>
<th class="text-right">Due</th>
<th class="text-right">Alloc</th>
</tr>
</thead>
<tbody>
<?php $c=0;foreach ($o->items('ALLOC') as $pio) : ?>
<tr>
<td><?php echo HTML::anchor(URL::link('user','invoice/view/'.$pio->invoice_id),$pio->invoice->id()); ?></td>
@@ -22,10 +23,10 @@
<td class="text-right"><?php echo Form::input('payment_item['.$pio->invoice_id.']',$pio->display('alloc_amt'),array('class'=>'span1','nocg'=>TRUE,'tabindex'=>++$c)); ?></td>
</tr>
<?php endforeach ?>
<tr>
<td class="text-right" colspan="6">Unapplied</td>
<td class="text-right"><?php echo Form::input('invoice_item[excess]',$o->balance(TRUE),array('class'=>'span1','nocg'=>TRUE,'disabled'=>'disabled')); ?></td>
</tr>
</table>
</tbody>
</table>