Fixes to OSB to work with KH 3.3
This commit is contained in:
@@ -24,8 +24,8 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
||||
$return = array();
|
||||
|
||||
if (isset($_REQUEST['term']) AND trim($_REQUEST['term'])) {
|
||||
$return += ORM::factory('account')->list_autocomplete($_REQUEST['term']);
|
||||
$return += ORM::factory('invoice')->list_autocomplete($_REQUEST['term'],'account_id');
|
||||
$return += ORM::factory('Account')->list_autocomplete($_REQUEST['term']);
|
||||
$return += ORM::factory('Invoice')->list_autocomplete($_REQUEST['term'],'account_id');
|
||||
}
|
||||
|
||||
$this->auto_render = FALSE;
|
||||
@@ -44,7 +44,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
||||
$i = 0;
|
||||
$list = array();
|
||||
if (isset($_REQUEST['pid']))
|
||||
foreach (ORM::factory('payment',$_REQUEST['pid'])->items() as $pio) {
|
||||
foreach (ORM::factory('Payment',$_REQUEST['pid'])->items() as $pio) {
|
||||
$output .= View::factory($this->viewpath().'/body')
|
||||
->set('trc',$i++%2 ? 'odd' : 'even')
|
||||
->set('pio',$pio)
|
||||
@@ -54,12 +54,12 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
||||
array_push($list,$pio->invoice_id);
|
||||
}
|
||||
|
||||
foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io)
|
||||
foreach (ORM::factory('Account',$_REQUEST['key'])->invoices_due() as $io)
|
||||
// Only list invoices not yet listed
|
||||
if (! in_array($io->id,$list))
|
||||
$output .= View::factory($this->viewpath().'/body')
|
||||
->set('trc',$i++%2 ? 'odd' : 'even')
|
||||
->set('pio',ORM::factory('payment_item'))
|
||||
->set('pio',ORM::factory('Payment_Item'))
|
||||
->set('io',$io);
|
||||
|
||||
// @todo Need the JS to add up the payment allocation before submission
|
||||
@@ -76,7 +76,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
||||
Block::add(array(
|
||||
'title'=>_('Customer Payments'),
|
||||
'body'=>Table::display(
|
||||
ORM::factory('payment')->find_all(),
|
||||
ORM::factory('Payment')->find_all(),
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>'admin/payment/view/'),
|
||||
@@ -97,7 +97,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
||||
}
|
||||
|
||||
private function add_view($id=NULL,$output='') {
|
||||
$po = ORM::factory('payment',$id);
|
||||
$po = ORM::factory('Payment',$id);
|
||||
|
||||
if ($_POST) {
|
||||
// Update our invoice payment items
|
||||
@@ -210,7 +210,7 @@ class Controller_Admin_Payment extends Controller_TemplateDefault_Admin {
|
||||
$output = '';
|
||||
|
||||
if ($_POST AND isset($_POST['payer'])) {
|
||||
$c = sprintf('payment_bulk_%s',$_POST['payer']);
|
||||
$c = sprintf('Payment_Bulk_%s',ucfirst($_POST['payer']));
|
||||
$o = new $c();
|
||||
|
||||
if (! $_FILES) {
|
@@ -64,7 +64,7 @@ class Model_Payment extends ORM_OSB {
|
||||
|
||||
// New Item
|
||||
$c = count($this->payment_items);
|
||||
$this->payment_items[$c] = ORM::factory('payment_item');
|
||||
$this->payment_items[$c] = ORM::factory('Payment_Item');
|
||||
$this->payment_items[$c]->invoice_id = $iid;
|
||||
|
||||
return $this->payment_items[$c];
|
||||
@@ -76,7 +76,7 @@ class Model_Payment extends ORM_OSB {
|
||||
* @param int $start List payments that were modified this many days ago
|
||||
*/
|
||||
public function export($start) {
|
||||
return ORM::factory('payment')
|
||||
return ORM::factory('Payment')
|
||||
->where('date_payment','>=',time()-$start*86400)
|
||||
->find_all();
|
||||
}
|
||||
@@ -165,9 +165,9 @@ class Model_Payment extends ORM_OSB {
|
||||
foreach ($items as $pio) {
|
||||
// Only need to check items that ave actually changed.
|
||||
if ($pio->changed()) {
|
||||
$old_pio = ORM::factory('payment_item',$pio->id);
|
||||
$old_pio = ORM::factory('Payment_Item',$pio->id);
|
||||
|
||||
if (($it = $pio->invoice->due()+ORM::factory('payment_item',$pio->id)->alloc_amt-$pio->alloc_amt) < 0)
|
||||
if (($it = $pio->invoice->due()+ORM::factory('Payment_Item',$pio->id)->alloc_amt-$pio->alloc_amt) < 0)
|
||||
$msg .= ($msg ? ' ' : '').sprintf('Invoice %s over allocated by %3.2f.',$pio->invoice_id,$it);
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ class Payment_Bulk_Ezypay {
|
||||
if (preg_match('/^'.Config::siteid(TRUE).'-/',$array[4]) AND $array[10] == 'Cleared') {
|
||||
$aid = preg_replace('/^'.Config::siteid(TRUE).'-/','',$array[4]);
|
||||
|
||||
$po = ORM::factory('payment');
|
||||
$po = ORM::factory('Payment');
|
||||
$po->account_id = $aid;
|
||||
$po->total_amt = $array[7];
|
||||
$po->notes = $array[2].':'.$array[3];
|
||||
@@ -85,7 +85,7 @@ class Payment_Bulk_Ezypay {
|
||||
}
|
||||
|
||||
$return = '';
|
||||
$return .= View::Factory('payment/admin/addbulk/ezypay/head');
|
||||
$return .= View::Factory('Payment/Admin/Addbulk/Ezypay/head');
|
||||
|
||||
$total = $fees = 0;
|
||||
foreach ($payments as $po) {
|
||||
@@ -94,11 +94,11 @@ class Payment_Bulk_Ezypay {
|
||||
$total += $po->total_amt;
|
||||
$fees += $po->fees_amt;
|
||||
|
||||
$return .= View::Factory('payment/admin/addbulk/ezypay/body')
|
||||
$return .= View::Factory('Payment/Admin/Addbulk/Ezypay/body')
|
||||
->set('o',$po);
|
||||
}
|
||||
|
||||
$return .= View::Factory('payment/admin/addbulk/ezypay/foot')
|
||||
$return .= View::Factory('Payment/Admin/Addbulk/Ezypay/foot')
|
||||
->set('total',$total)
|
||||
->set('fees',$fees);;
|
||||
|
Reference in New Issue
Block a user