diff --git a/application/classes/controller/admin/welcome.php b/application/classes/controller/admin/welcome.php index 50ea5440..1cbe89be 100644 --- a/application/classes/controller/admin/welcome.php +++ b/application/classes/controller/admin/welcome.php @@ -90,7 +90,7 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault_Admin { 'account->accnum()'=>array('label'=>'Num'), 'account->name()'=>array('label'=>'Account'), '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'), 'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'), ), diff --git a/modules/invoice/classes/controller/task/invoice.php b/modules/invoice/classes/controller/task/invoice.php index ccda20e9..34f2d8ca 100644 --- a/modules/invoice/classes/controller/task/invoice.php +++ b/modules/invoice/classes/controller/task/invoice.php @@ -169,7 +169,7 @@ class Controller_Task_Invoice extends Controller_Task { $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. - $svs = ORM::factory('service')->list_invoicesoon(); + $svs = ORM::factory('service')->list_invoicesoon()->as_array(); Sort::MAsort($svs,'account_id,date_next_invoice'); $aid = $due = $io = NULL; @@ -265,7 +265,7 @@ class Controller_Task_Invoice extends Controller_Task { public function action_send() { // Used to only process X invoices in a row. // @todo This should be a configuration item. - $max = 2; + $max = 10; $action = array(); $iid = $this->request->param('id'); $x = NULL; diff --git a/modules/invoice/classes/model/invoice.php b/modules/invoice/classes/model/invoice.php index 655cfb9f..eba515e0 100644 --- a/modules/invoice/classes/model/invoice.php +++ b/modules/invoice/classes/model/invoice.php @@ -515,7 +515,7 @@ class Model_Invoice extends ORMOSB { $css .= 'tr.even { background-color: #F6F6F8; }'; $css .= ''; - $output = View::factory($this->viwepath()) + $output = View::factory('invoice/user/email') ->set('mediapath',Route::get('default/media')) ->set('io',$this); diff --git a/modules/payment/classes/controller/admin/payment.php b/modules/payment/classes/controller/admin/payment.php index 4ee85374..fe1944aa 100644 --- a/modules/payment/classes/controller/admin/payment.php +++ b/modules/payment/classes/controller/admin/payment.php @@ -55,6 +55,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin { foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io) $output .= View::factory($this->viewpath().'/body') ->set('trc',$i++%2 ? 'odd' : 'even') + ->set('pio',ORM::factory('payment_item')) ->set('io',$io); // @todo Need the JS to add up the payment allocation before submission @@ -97,23 +98,23 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin { if ($_POST) { if (isset($_POST['payment_item']) AND count($_POST['payment_item'])) { foreach ($_POST['payment_item'] as $k=>$v) { - $pio = $po->add_item(); - $pio->invoice_id = $k; - $pio->alloc_amt = $v; + if ($v) { + $pio = $po->add_item(); + $pio->invoice_id = $k; + $pio->alloc_amt = $v; + } } } - if ($po->changed()) { - // Entry updated - if (! $po->values($_POST)->check() OR ! $po->save()) - throw new Kohana_Exception('Unable to save payment'); - else - SystemMessage::add(array( - 'title'=>'Payment Recorded', - 'type'=>'info', - 'body'=>'Payment successfully recorded.', - )); - } + // Entry updated + if (! $po->values($_POST)->check() OR ! $po->save()) + throw new Kohana_Exception('Unable to save payment'); + else + SystemMessage::add(array( + 'title'=>'Payment Recorded', + 'type'=>'info', + 'body'=>'Payment successfully recorded.', + )); } $output .= Form::open(); diff --git a/modules/payment/views/payment/admin/autoitemlist/body.php b/modules/payment/views/payment/admin/autoitemlist/body.php index 1232b29e..d25fb989 100644 --- a/modules/payment/views/payment/admin/autoitemlist/body.php +++ b/modules/payment/views/payment/admin/autoitemlist/body.php @@ -1,5 +1,5 @@ - id(); ?> + id,$io->id()); ?> display('date_orig'); ?> display('due_date'); ?> total(TRUE); ?>