minor fixes

This commit is contained in:
Deon George 2011-12-22 21:20:19 +11:00
parent 5b1e7aeb22
commit 7fdba208eb
5 changed files with 20 additions and 19 deletions

View File

@ -90,7 +90,7 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault_Admin {
'account->accnum()'=>array('label'=>'Num'), 'account->accnum()'=>array('label'=>'Num'),
'account->name()'=>array('label'=>'Account'), 'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'), 'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>'user/payment/view/'), 'id'=>array('label'=>'ID','url'=>'admin/payment/view/'),
'total_amt'=>array('label'=>'Total','class'=>'right'), 'total_amt'=>array('label'=>'Total','class'=>'right'),
'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'), 'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'),
), ),

View File

@ -169,7 +169,7 @@ class Controller_Task_Invoice extends Controller_Task {
$sid = is_null($this->request->param('id')) ? NULL : explode(':',$this->request->param('id')); $sid = is_null($this->request->param('id')) ? NULL : explode(':',$this->request->param('id'));
// Sort our service by account_id, then we can generate 1 invoice. // Sort our service by account_id, then we can generate 1 invoice.
$svs = ORM::factory('service')->list_invoicesoon(); $svs = ORM::factory('service')->list_invoicesoon()->as_array();
Sort::MAsort($svs,'account_id,date_next_invoice'); Sort::MAsort($svs,'account_id,date_next_invoice');
$aid = $due = $io = NULL; $aid = $due = $io = NULL;
@ -265,7 +265,7 @@ class Controller_Task_Invoice extends Controller_Task {
public function action_send() { public function action_send() {
// Used to only process X invoices in a row. // Used to only process X invoices in a row.
// @todo This should be a configuration item. // @todo This should be a configuration item.
$max = 2; $max = 10;
$action = array(); $action = array();
$iid = $this->request->param('id'); $iid = $this->request->param('id');
$x = NULL; $x = NULL;

View File

@ -515,7 +515,7 @@ class Model_Invoice extends ORMOSB {
$css .= 'tr.even { background-color: #F6F6F8; }'; $css .= 'tr.even { background-color: #F6F6F8; }';
$css .= '</style>'; $css .= '</style>';
$output = View::factory($this->viwepath()) $output = View::factory('invoice/user/email')
->set('mediapath',Route::get('default/media')) ->set('mediapath',Route::get('default/media'))
->set('io',$this); ->set('io',$this);

View File

@ -55,6 +55,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io) foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io)
$output .= View::factory($this->viewpath().'/body') $output .= View::factory($this->viewpath().'/body')
->set('trc',$i++%2 ? 'odd' : 'even') ->set('trc',$i++%2 ? 'odd' : 'even')
->set('pio',ORM::factory('payment_item'))
->set('io',$io); ->set('io',$io);
// @todo Need the JS to add up the payment allocation before submission // @todo Need the JS to add up the payment allocation before submission
@ -97,13 +98,14 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
if ($_POST) { if ($_POST) {
if (isset($_POST['payment_item']) AND count($_POST['payment_item'])) { if (isset($_POST['payment_item']) AND count($_POST['payment_item'])) {
foreach ($_POST['payment_item'] as $k=>$v) { foreach ($_POST['payment_item'] as $k=>$v) {
if ($v) {
$pio = $po->add_item(); $pio = $po->add_item();
$pio->invoice_id = $k; $pio->invoice_id = $k;
$pio->alloc_amt = $v; $pio->alloc_amt = $v;
} }
} }
}
if ($po->changed()) {
// Entry updated // Entry updated
if (! $po->values($_POST)->check() OR ! $po->save()) if (! $po->values($_POST)->check() OR ! $po->save())
throw new Kohana_Exception('Unable to save payment'); throw new Kohana_Exception('Unable to save payment');
@ -114,7 +116,6 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
'body'=>'Payment successfully recorded.', 'body'=>'Payment successfully recorded.',
)); ));
} }
}
$output .= Form::open(); $output .= Form::open();
$output .= View::factory('payment/admin/add_view') $output .= View::factory('payment/admin/add_view')

View File

@ -1,5 +1,5 @@
<tr class="<?php echo $trc; ?>"> <tr class="<?php echo $trc; ?>">
<td><?php echo $io->id(); ?></td> <td><?php echo HTML::anchor('user/invoice/view/'.$io->id,$io->id()); ?></td>
<td><?php echo $io->display('date_orig'); ?></td> <td><?php echo $io->display('date_orig'); ?></td>
<td><?php echo $io->display('due_date'); ?></td> <td><?php echo $io->display('due_date'); ?></td>
<td><?php echo $io->total(TRUE); ?></td> <td><?php echo $io->total(TRUE); ?></td>