diff --git a/application/classes/lnapp/config.php b/application/classes/lnapp/config.php index bb026d13..fe83e45a 100644 --- a/application/classes/lnapp/config.php +++ b/application/classes/lnapp/config.php @@ -98,7 +98,7 @@ abstract class lnApp_Config extends Kohana_Config { * Show a date using a site configured format */ public static function date($date) { - return $date ? date(Kohana::config('config.date_format'),$date) : '>Not Set<'; + return $date ? date(Kohana::config('config.date_format'),$date) : '>Not Set<'; } /** diff --git a/application/classes/model/account.php b/application/classes/model/account.php index 93e6bf79..576e93e4 100644 --- a/application/classes/model/account.php +++ b/application/classes/model/account.php @@ -39,7 +39,7 @@ class Model_Account extends Model_Auth_UserDefault { */ public function name($withcompany=FALSE) { if ($withcompany) - return sprintf('%s %s (%s)',$this->first_name,$this->last_name,$this->company); + return sprintf('%s %s%s',$this->first_name,$this->last_name,$this->company ? sprintf(' (%s)',$this->company) : ''); else return sprintf('%s %s',$this->first_name,$this->last_name); } @@ -121,11 +121,55 @@ class Model_Account extends Model_Auth_UserDefault { // Log the logout $alo = ORM::factory('account_log'); $alo->account_id = $this->id; - $alo->ip = $_SERVER['REMOTE_ADDR']; + $alo->ip = Request::$client_ip; $alo->details = $message; $alo->save(); return $alo->saved(); } + + /** + * Search for accounts matching a term + */ + public function list_autocomplete($term,$index='id') { + $return = array(); + + $this->clear(); + $value = 'name(TRUE)'; + + // Build our where clause + // First Name, Last name + if (preg_match('/\ /',$term)) { + list($fn,$ln) = explode(' ',$term,2); + + $this->where_open() + ->where('first_name','like','%'.$fn.'%') + ->and_where('last_name','like','%'.$ln.'%') + ->where_close() + ->or_where('company','like','%'.$term.'%'); + + } elseif (is_numeric($term)) { + $this->where('id','like','%'.$term.'%'); + + } elseif (preg_match('/\@/',$term)) { + $this->where('email','like','%'.$term.'%'); + $value = 'email'; + + } else { + $this->where('company','like','%'.$term.'%') + ->or_where('first_name','like','%'.$term.'%') + ->or_where('last_name','like','%'.$term.'%') + ->or_where('email','like','%'.$term.'%'); + } + + // @todo This should limit the results so that users dont see other users services. + foreach ($this->find_all() as $o) + $return[$o->$index] = array( + 'value'=>$o->$index, + 'label'=>sprintf('ACC %s: %s',$o->id,Table::resolve($o,$value)), + ); + + return $return; + } } ?> diff --git a/application/classes/ormosb.php b/application/classes/ormosb.php index b219d7be..c4407d37 100644 --- a/application/classes/ormosb.php +++ b/application/classes/ormosb.php @@ -118,5 +118,9 @@ abstract class ORMOSB extends ORM { return $plugin ? sprintf('%s/%s/%s/%s',$request->controller(),$request->directory(),$plugin,$request->action()) : sprintf('%s/%s/%s',$request->controller(),$request->directory(),$request->action()); } + + public function changed() { + return $this->_changed; + } } ?> diff --git a/application/classes/staticlistmodule.php b/application/classes/staticlistmodule.php index d2765ae6..f0b7fe94 100644 --- a/application/classes/staticlistmodule.php +++ b/application/classes/staticlistmodule.php @@ -47,7 +47,7 @@ abstract class StaticListModule extends StaticList { */ public static function form($name,$default='',$addblank=FALSE) { // Override our argument list as defined in parent - list($name,$table,$default,$key,$value,$where) = func_get_args(); + list($name,$table,$default,$key,$value,$where,$addblank,$attributes) = func_get_args(); // @todo - our query type should come from our configuration? $db = DB::select()->from($table); @@ -69,6 +69,9 @@ abstract class StaticListModule extends StaticList { // Else we return a select list $x = array(); + if ($addblank) + $x[] = ''; + foreach ($db as $record) { $x[$record[$key]] = $record[$value]; @@ -77,7 +80,7 @@ abstract class StaticListModule extends StaticList { static::$record[$table] = $record; } - return Form::select($name,$x,$default); + return Form::select($name,$x,$default,$attributes); } } ?> diff --git a/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css b/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css index 0f1a7e77..bff0f269 100644 --- a/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css +++ b/application/media/js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css @@ -56,7 +56,7 @@ /* Component containers ----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget { font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 60%; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } @@ -565,4 +565,4 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://docs.jquery.com/UI/Progressbar#theming */ .ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } diff --git a/modules/adsl/classes/model/adsl/plan.php b/modules/adsl/classes/model/adsl/plan.php index 73b9a2a9..0b8b9036 100644 --- a/modules/adsl/classes/model/adsl/plan.php +++ b/modules/adsl/classes/model/adsl/plan.php @@ -16,9 +16,6 @@ class Model_ADSL_Plan extends ORMOSB { protected $_belongs_to = array( 'adsl_supplier_plan'=>array(), ); - protected $_has_many = array( - 'product'=>array('far_key'=>'id','foreign_key'=>'prod_plugin_data'), - ); protected $_display_filters = array( 'extra_down_peak'=>array( diff --git a/modules/adsl/classes/model/adsl/supplier.php b/modules/adsl/classes/model/adsl/supplier.php index 295831e4..aa00cdca 100644 --- a/modules/adsl/classes/model/adsl/supplier.php +++ b/modules/adsl/classes/model/adsl/supplier.php @@ -18,6 +18,31 @@ class Model_ADSL_Supplier extends ORMOSB { protected $_updated_column = FALSE; + /** + * Return a list of plans that this supplier makes available + */ + public function plans($active=TRUE) { + $a = $this->adsl_supplier_plan; + + if ($active) + $a->where('status','=',TRUE); + + return $a; + } + + /** + * Return a list of plans that we provide by this supplier + */ + public function adsl_plans($active=TRUE) { + $return = array(); + + foreach ($this->plans($active)->find_all() as $po) + foreach ($po->adsl_plan->find_all() as $apo) + $return[$apo->id] = $apo; + + return $return; + } + /** * Return a list of services for this supplier * @@ -27,16 +52,13 @@ class Model_ADSL_Supplier extends ORMOSB { $services = array(); // Get a list of plans made for this supplier - // @todo This doesnt work if a product adsl plan is overriden. - foreach ($this->adsl_supplier_plan->find_all() as $aspo) - // Find all the plan who use this supplier plan - foreach ($aspo->adsl_plan->find_all() as $apo) - // Find all the products who use this plan - foreach ($apo->product->find_all() as $po) - // Find all the services who that use this product - foreach ($po->service->find_all() as $so) - if (! $active OR $so->active) - array_push($services,$so); + $plans = array_keys($this->adsl_plans(FALSE)); + + // Start with all our ADSL Plans + foreach (ORM::factory('service')->list_bylistgroup('ADSL') as $so) + if (! $active OR $so->active) + if (in_array($so->product->prod_plugin_data,$plans) OR in_array($so->plugin()->provided_adsl_plan_id,$plans)) + array_push($services,$so); return $services; } diff --git a/modules/domain/classes/domain.php b/modules/domain/classes/domain.php index ae7e9905..564ca452 100644 --- a/modules/domain/classes/domain.php +++ b/modules/domain/classes/domain.php @@ -46,9 +46,9 @@ $(document).ready(function() { public static function NS(Model_Service_Plugin_Domain $o) { if ($o->registrar_ns) - return is_array($o->registrar_ns) ? implode(',',$o->registrar_ns) : '>Invalid<'; + return is_array($o->registrar_ns) ? implode(',',$o->registrar_ns) : '>Invalid<'; else - return is_array($o->domain_registrar->whitelabel_ns) ? implode(',',$o->domain_registrar->whitelabel_ns) : '>Unknown<'; + return is_array($o->domain_registrar->whitelabel_ns) ? implode(',',$o->domain_registrar->whitelabel_ns) : '>Unknown<'; } } ?> diff --git a/modules/invoice/classes/controller/user/invoice.php b/modules/invoice/classes/controller/user/invoice.php index e2c4ed49..bf6d84bc 100644 --- a/modules/invoice/classes/controller/user/invoice.php +++ b/modules/invoice/classes/controller/user/invoice.php @@ -71,7 +71,7 @@ class Controller_User_Invoice extends Controller_TemplateDefault_User { ->set('io',$io); Block::add(array( - 'title'=>sprintf('%s: %s',_('Invoice'),$io->refnum()), + 'title'=>sprintf('%s: %s - %s',_('Invoice'),$io->refnum(),$io->account->name()), 'body'=>$output, )); } diff --git a/modules/invoice/classes/model/invoice.php b/modules/invoice/classes/model/invoice.php index 3d2d9d44..eba515e0 100644 --- a/modules/invoice/classes/model/invoice.php +++ b/modules/invoice/classes/model/invoice.php @@ -135,7 +135,7 @@ class Model_Invoice extends ORMOSB { } public function payments() { - return ($this->loaded() AND ! $this->_changed) ? $this->payment_item->find_all() : NULL; + return ($this->loaded() AND ! $this->_changed) ? $this->payment_item->find_all() : array(); } public function payments_total($format=FALSE) { @@ -406,6 +406,30 @@ class Model_Invoice extends ORMOSB { /** LIST FUNCTIONS **/ + /** + * Search for invoices matching a term + */ + public function list_autocomplete($term,$index='id') { + $return = array(); + + if (is_numeric($term)) { + $this->clear(); + $value = 'account->name(TRUE)'; + + // Build our where clause + $this->where('id','like','%'.$term.'%'); + + // @todo This should limit the results so that users dont see other users services. + foreach ($this->find_all() as $o) + $return[$o->$index] = array( + 'value'=>$o->$index, + 'label'=>sprintf('INV %s: %s',$o->id,Table::resolve($o,$value)), + ); + } + + return $return; + } + private function _list_active() { return ORM::factory('invoice')->where('status','=',1); } diff --git a/modules/payment/auth.inc.php b/modules/payment/auth.inc.php deleted file mode 100644 index 474549d7..00000000 --- a/modules/payment/auth.inc.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @copyright 2009 Deon George - * @link http://osb.leenooks.net - * - * @link http://www.agileco.com/ - * @copyright 2004-2008 Agileco, LLC. - * @license http://www.agileco.com/agilebill/license1-4.txt - * @author Tony Landis - * @package AgileBill - * @subpackage Modules:Invoice - */ - -/** - * The main AgileBill Payment Class - * - * @package AgileBill - */ - -$auth_methods = array ( -); -?> diff --git a/modules/payment/classes/controller/admin/payment.php b/modules/payment/classes/controller/admin/payment.php new file mode 100644 index 00000000..af4164d1 --- /dev/null +++ b/modules/payment/classes/controller/admin/payment.php @@ -0,0 +1,204 @@ +TRUE, + 'list'=>TRUE, + 'autocomplete'=>FALSE, + 'autoitemlist'=>FALSE, + ); + + public function action_autocomplete() { + // We are only available via an ajax call. + if (! Request::current()->is_ajax()) + die(); + + $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'); + } + + $this->auto_render = FALSE; + $this->response->headers('Content-Type','application/json'); + $this->response->body(json_encode(array_values($return))); + } + + public function action_autoitemlist() { + // We are only available via an ajax call. + if (! Request::current()->is_ajax() OR ! isset($_REQUEST['key']) OR ! trim($_REQUEST['key'])) + die(); + + $output = View::factory('payment/admin/item/list_head'); + $this->auto_render = FALSE; + + $i = 0; + if (isset($_REQUEST['pid'])) + foreach (ORM::factory('payment_item')->where('payment_id','=',$_REQUEST['pid'])->find_all() as $pio) + $output .= View::factory('payment/admin/item/list_body') + ->set('trc',$i++%2 ? 'odd' : 'even') + ->set('pio',$pio) + ->set('io',$pio->invoice); + + foreach (ORM::factory('account',$_REQUEST['key'])->invoices_due() as $io) + $output .= View::factory('payment/admin/item/list_body') + ->set('trc',$i++%2 ? 'odd' : 'even') + ->set('io',$io); + + // @todo Need the JS to add up the payment allocation before submission + $output .= View::factory('payment/admin/item/list_foot') + ->set('trc',$i++%2 ? 'odd' : 'even'); + + $this->response->body($output); + } + + /** + * Show a list of invoices + */ + public function action_list() { + Block::add(array( + 'title'=>_('Customer Payments'), + 'body'=>Table::display( + ORM::factory('payment')->find_all(), + 25, + array( + 'id'=>array('label'=>'ID','url'=>'admin/payment/add/'), + 'date_payment'=>array('label'=>'Date'), + 'account->accnum()'=>array('class'=>'right'), + 'account->name()'=>array('label'=>'Account'), + '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( + 'page'=>TRUE, + 'type'=>'select', + 'form'=>'admin/payment/add', + )), + )); + } + + public function action_add() { + $output = ''; + + if (! $id = $this->request->param('id')) { + if (isset($_POST['id']) AND is_array($_POST['id'])) + Table::post('payment_view','id'); + + list($id,$output) = Table::page('payment_view'); + + } else { + $id = $this->request->param('id'); + } + + $po = ORM::factory('payment',$id); + + 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 ($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.', + )); + } + } + + $output .= Form::open(); + $output .= View::factory('payment/admin/add') + ->set('po',$po);; + $output .= Form::submit('submit','submit',array('class'=>'form_button')); + $output .= Form::close(); + + Style::add(array( + 'type'=>'stdin', + 'data'=>'.ui-autocomplete-loading { background: white url("'.URL::site('media/img/ui-anim_basic_16x16.gif').'") right center no-repeat; }' + )); + + Style::add(array( + 'type'=>'file', + 'data'=>'js/jquery.ui/css/smoothness/jquery-ui-1.8.16.custom.css', + )); + + Script::add(array( + 'type'=>'file', + 'data'=>'js/jquery-ui-1.8.16.custom.min.js', + )); + + Script::add(array('type'=>'stdin','data'=>' + $(document).ready(function() { + $("input[name=date_payment]").datepicker({ + dateFormat: "@", + showOtherMonths: true, + selectOtherMonths: true, + showButtonPanel: true, + beforeShow: function(data) { + if (data.value) + data.value = data.value*1000; + }, + onClose: function(data) { + $("input[name=date_payment]").val(data/1000); + } + }); + $("input[name=account_id]").autocomplete({ + source: "'.URL::site('admin/payment/autocomplete').'", + minLength: 2, + change: function(event,ui) { + // Send the request and update sub category dropdown + $.ajax({ + type: "GET", + data: "key="+$(this).val(), + dataType: "html", + cache: false, + url: "'.URL::site('admin/payment/autoitemlist').'", + timeout: 2000, + error: function(x) { + alert("Failed to submit"); + }, + success: function(data) { + $("div[id=items]").replaceWith(data); + } + }); + } + }); + });' + )); + + if ($po->loaded()) { + Script::add(array('type'=>'stdin','data'=>' + $(document).ready(function() { + $("div[id=items]").load("'.URL::site('admin/payment/autoitemlist').'", {key: "'.$po->account_id.'", pid: "'.$po->id.'" }); + });' + )); + } + + Block::add(array( + 'title'=>_('Add Payments Received'), + 'body'=>$output, + )); + } +} +?> diff --git a/modules/payment/classes/model/payment.php b/modules/payment/classes/model/payment.php index 0aab7050..cc31503e 100644 --- a/modules/payment/classes/model/payment.php +++ b/modules/payment/classes/model/payment.php @@ -1,10 +1,10 @@ loaded() AND ! $this->_changed) + return $this->payment_item->order_by('invoice_id')->find_all()->as_array(); + else + return $this->payment_items; + } + + /** + * Add an item to an invoice + */ + public function add_item() { + if ($this->loaded() and ! $this->payment_items) + throw new Kohana_Exception('Need to load payment_items?'); + + $c = count($this->payment_items); + + $this->payment_items[$c] = ORM::factory('payment_item'); + + return $this->payment_items[$c]; + } + /** * Find all items that are exportable. * @@ -103,7 +131,7 @@ class Model_Payment extends ORMOSB { return $css.Table::display( $this->limit(10)->find_all(), 25, - array( + array( 'id'=>array('label'=>'ID'), 'date_payment'=>array('label'=>'Date'), 'checkout->display("name")'=>array('label'=>'Method'), @@ -111,9 +139,45 @@ class Model_Payment extends ORMOSB { 'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'), 'invoicelist()'=>array('label'=>'Invoices'), ), - array( + array( 'type'=>'list', )); } + + public function save(Validation $validation = NULL) { + // Our items will be clobbered once we save the object, so we need to save it here. + $items = $this->items(); + + $this->source_id = Auth::instance()->get_user()->id; + $this->ip = Request::$client_ip; + + // @todo Need validation, if there is an overbalance in payment_items or if an invoice is overpaid. + + // Save the payment + parent::save($validation); + + // Need to save the associated items and their taxes + if ($this->saved()) { + foreach ($items as $pio) { + $pio->payment_id = $this->id; + + if (! $pio->check()) { + // @todo Mark payment as cancelled and write a memo, then... + throw new Kohana_Exception('Problem saving payment_item for invoice :invoice - Failed check()',array(':invoice'=>$invoice->id)); + } + + $pio->save(); + + if (! $pio->saved()) { + // @todo Mark payment as cancelled and write a memo, then... + throw new Kohana_Exception('Problem saving payment_item for invoice :invoice - Failed save()',array(':invoice'=>$invoice->id)); + } + } + + } else + throw new Kohana_Exception('Couldnt save payment for some reason?'); + + return TRUE; + } } ?> diff --git a/modules/payment/payment.inc.php b/modules/payment/payment.inc.php deleted file mode 100644 index 8d51309d..00000000 --- a/modules/payment/payment.inc.php +++ /dev/null @@ -1,241 +0,0 @@ -. - * - * Originally authored by Deon George - * - * @author Deon George - * @copyright 2009 Deon George - * @link http://osb.leenooks.net - * @license http://www.gnu.org/licenses/ - * @package AgileBill - * @subpackage Modules:Payment - */ - -/** - * The main AgileBill Payment Class - * - * @package AgileBill - * @subpackage Modules:Payment - */ -class payment extends OSB_module { - public function allocate($VAR) { return $this->tmAllocate($VAR); } - /** - * Template Method to support the allocation of payments to invoices - * - * @uses payment_item - * @uses invoice - */ - public function tmAllocate($VAR) { - $db = DB(); - $invoices = array(); - - include_once(PATH_MODULES.'payment_item/payment_item.inc.php'); - $pi = new payment_item; - - include_once(PATH_MODULES.'invoice/invoice.inc.php'); - $io = new Invoice; - - # Get our payment information - $payment = $this->sPaymentsBal($VAR['payment_id']); - - # If this payment has been allocated to some invoices, collect those details - $payment_items = $pi->sPaymentAllocation($VAR['payment_id']); - - foreach ($io->sInvoicesBal($payment['account_id']) as $index => $details) { - $invoices[$index] = $details; - - # Get additional information on the invoices to be displayed. - $invoices[$index]['id'] = $index; - $invoices[$index]['_C'] = sprintf('row%s',$i++%2 ? 1 : 2); - if (isset($payment_items[$index])) { - $invoices[$index]['alloc_amt'] = $payment_items[$index]; - unset($payment_items[$index]); - } - } - - # Left over payment_items are fully paid invoices - if (count($payment_items)) { - foreach ($io->sInvoicesAcc($payment['account_id'],array_keys($payment_items)) as $index => $details) { - $invoices[$index] = $details; - - # Get additional information on the invoices to be displayed. - $invoices[$index]['id'] = $index; - $invoices[$index]['_C'] = sprintf('row%s',$i++%2 ? 1 : 2); - $invoices[$index]['alloc_amt'] = $payment_items[$index]; - } - } - - # Sort the entries - ksort($invoices); - - global $smarty; - $smarty->assign('invoices',$invoices); - $smarty->assign('results',count($invoices)); - } - - /** - * Compare the billed_amt with the payments, and auto fix when the allocation is not correct - */ - public function taskAuditPaymentItems() { - $db = DB(); - - $rs = $db->Execute(sprintf('SELECT A.id,A.account_id,A.billed_amt,A.total_amt,IFNULL(A.credit_amt,0) as credit_amt,ROUND(SUM(IFNULL(B.alloc_amt,0)),4) AS alloc_amt FROM %sinvoice A LEFT OUTER JOIN %spayment_item B ON (A.id=B.invoice_id) WHERE A.site_id=%s GROUP BY A.id HAVING A.billed_amt != alloc_amt',AGILE_DB_PREFIX,AGILE_DB_PREFIX,DEFAULT_SITE)); - if ($rs && $rs->RecordCount()) { - while (! $rs->EOF) { - $db->Execute(sqlUpdate('invoice',array('billed_amt'=>$rs->fields['alloc_amt']),array('where'=>array('id'=>$rs->fields['id'])))); - - # Add a memo - $db->Execute(sqlInsert($db,'invoice_memo',array('date_orig'=>time(),'invoice_id'=>$rs->fields['id'],'account_id'=>$rs->fields['account_id'],'type'=>'audit','memo'=>sprintf('Payments applied to this invoice have been changed, due to over allocation, was: %3.2f, payments applied: %3.2f, credits applied: %3.2f',$rs->fields['billed_amt'],$rs->fields['alloc_amt'],$rs->fields['credit_amt'])))); - - $rs->MoveNext(); - } - } - } - - public function ListUnbalanced($VAR) { return $this->tmListUnbalanced($VAR); } - /** - * List all invoices that are out of balance with the payment tables. - * - * @return void - */ - public function tmListUnbalanced() { - global $smarty; - - $db = DB(); - $smart = array(); - - $counter = 0; - $rs = $db->Execute(sprintf('SELECT B.payment_id AS id,A.account_id,B.invoice_id,A.billed_amt,A.total_amt,IFNULL(A.credit_amt,0) as credit_amt,B.payment_id,ROUND(SUM(IFNULL(B.alloc_amt,0)),4) AS alloc_amt,A.date_orig FROM %sinvoice A LEFT OUTER JOIN %spayment_item B ON (A.id=B.invoice_id) WHERE A.site_id=%s GROUP BY A.id HAVING A.billed_amt != alloc_amt OR A.total_amt < A.billed_amt ORDER BY A.account_id,A.id',AGILE_DB_PREFIX,AGILE_DB_PREFIX,DEFAULT_SITE)); - if ($rs && $rs->RecordCount()) { - while (! $rs->EOF) { - $rs->fields['_C'] = ++$counter%s ? 'row1' : 'row2'; - array_push($smart,$rs->fields); - $rs->MoveNext(); - } - } - - $smarty->assign('results',count($smart)); - $smarty->assign('limit',count($smart)); - $smarty->assign('search_show',$smart); - } - - public function ListUnallocated($VAR) { return $this->tmListUnallocated($VAR); } - /** - * Return payments that still have unallocated balances - * - * @return void - * @uses invoice - */ - public function tmListUnallocated($VAR) { - global $smarty; - - require_once(PATH_MODULES.'invoice/invoice.inc.php'); - $io = new invoice; - $accounts = $io->sAccountsBal(); - - $smart = array(); - $counter = 0; - foreach ($this->sPaymentsBal() as $payment) { - $payment['_C'] = ++$counter%s ? 'row1' : 'row2'; - $payment['balance'] = $payment['total_amt']-$payment['alloc_amt']; - $payment['acct_bal'] = isset($accounts[$payment['account_id']]) ? $accounts[$payment['account_id']] : 0; - array_push($smart,$payment); - } - - $smarty->assign('results',count($smart)); - $smarty->assign('limit',count($smart)); - $smarty->assign('search_show',$smart); - } - - public function ListInvoicesBalance($VAR) { return $this->tmListInvoicesBalance($VAR); } - public function tmListInvoicesBalance($VAR) { - global $smarty; - - $smart = array(); - $counter = 0; - foreach ($this->sAccountsBal() as $account_id => $invoices) { - foreach ($invoices as $index => $values) { - $smart[$index] = $values; - $smart[$index]['_C'] = ++$counter%s ? 'row1' : 'row2'; - } - } - - $smarty->assign('results',count($smart)); - $smarty->assign('limit',count($smart)); - $smarty->assign('search_show',$smart); - } - - /** - * Return a list of payments with an unallocated balance - * - * @param $payment_id Return only this payment ID, otherwise return all payment IDs. - * @return array Payments with a unallocated balance - */ - public function sPaymentsBal($payment_id=null) { - static $sPaymentsBal = array(); - - if (! count($sPaymentsBal) || (! is_null($payment_id) && ! isset($sPaymentsBal[$payment_id]))) { - $db = &DB(); - - $rs = $db->Execute(sprintf('SELECT A.id,A.account_id,A.total_amt,ROUND(SUM(IFNULL(B.alloc_amt,0)),4) AS alloc_amt,A.date_orig FROM %spayment A LEFT OUTER JOIN %spayment_item B ON (B.payment_id=A.id) WHERE A.site_id=%s GROUP BY (A.id) HAVING %s alloc_amt != A.total_amt ORDER BY A.account_id', - AGILE_DB_PREFIX,AGILE_DB_PREFIX,DEFAULT_SITE,is_null($payment_id) ? '' : sprintf('A.id=%s OR',$payment_id))); - if ($rs && $rs->RecordCount()) { - while (! $rs->EOF) { - $sPaymentsBal[$rs->fields['id']]['id'] = $rs->fields['id']; - $sPaymentsBal[$rs->fields['id']]['account_id'] = $rs->fields['account_id']; - $sPaymentsBal[$rs->fields['id']]['total_amt'] = $rs->fields['total_amt']; - $sPaymentsBal[$rs->fields['id']]['alloc_amt'] = $rs->fields['alloc_amt']; - $sPaymentsBal[$rs->fields['id']]['date_orig'] = $rs->fields['date_orig']; - $rs->MoveNext(); - } - } - } - - return (is_null($payment_id) ? $sPaymentsBal : (isset($sPaymentsBal[$payment_id]) ? $sPaymentsBal[$payment_id] : array())); - } - - /** - * Return a list of invoices with unbalanced payments - * - * @param $account_id Return invoices with unbalanced payments for an account, otherwise return all accounts - * @return array Invoices with unbalanced payments - */ - public function sAccountsBal($account_id) { - static $sAccountsBal = array(); - - if (! count($sAccountsBal) || (! is_null($account_id) && ! isset($sAccountsBal[$account_id]))) { - $db = &DB(); - - $rs = $db->Execute(sprintf('SELECT A.id,A.account_id,A.total_amt,A.billed_amt,IFNULL(A.credit_amt,0) as credit_amt,ROUND(SUM(IFNULL(B.alloc_amt,0)),4) AS alloc_amt,A.date_orig,B.payment_id FROM %sinvoice A INNER JOIN %spayment_item B ON (B.invoice_id=A.id) WHERE A.site_id=%s GROUP BY (A.id) HAVING %s A.total_amt!=alloc_amt+credit_amt ORDER BY A.account_id,A.id', - AGILE_DB_PREFIX,AGILE_DB_PREFIX,DEFAULT_SITE,is_null($account_id) ? '' : sprintf('A.account_id=%s AND',$account_id))); - if ($rs && $rs->RecordCount()) { - while (! $rs->EOF) { - $sAccountsBal[$rs->fields['account_id']][$rs->fields['id']]['id'] = $rs->fields['payment_id']; - $sAccountsBal[$rs->fields['account_id']][$rs->fields['id']]['invoice_id'] = $rs->fields['id']; - $sAccountsBal[$rs->fields['account_id']][$rs->fields['id']]['account_id'] = $rs->fields['account_id']; - $sAccountsBal[$rs->fields['account_id']][$rs->fields['id']]['total_amt'] = $rs->fields['total_amt']; - $sAccountsBal[$rs->fields['account_id']][$rs->fields['id']]['alloc_amt'] = $rs->fields['alloc_amt']; - $sAccountsBal[$rs->fields['account_id']][$rs->fields['id']]['date_orig'] = $rs->fields['date_orig']; - $rs->MoveNext(); - } - } - } - - return (is_null($account_id) ? $sAccountsBal : (isset($sAccountsBal[$account_id]) ? $sAccountsBal[$account_id] : array())); - } -} -?> diff --git a/modules/payment/payment_construct.xml b/modules/payment/payment_construct.xml deleted file mode 100644 index 655af6dc..00000000 --- a/modules/payment/payment_construct.xml +++ /dev/null @@ -1,248 +0,0 @@ - - - - payment - - payment
- - invoice - - 0 - - date_orig - - 25 - - 1 - - - - - - - - - - Payment - 1 - I4 - 1 - - - - 1 - I4 - - - - date-now - Date Created - I8 - - - - date-now - Date Updated - I8 - - - - account - first_name,last_name - I8 - any - - - - date-time - Payment Date - I8 - - - - checkout - name - Checkout Plugin - I4 - any - - - - C(255) - array - - - - F - float - - - - F - - - - I4 - - - - F - - - - I4 - - - - Refund Status - L - - - - account - username - Source - I8 - any - - - - Pending - L - - - - X - - - - C(32) - - - - - - account_id,date_payment,checkout_plugin_id,total_amt,fees_amt,notes,source_id - account_id,date_payment,checkout_plugin_id,total_amt,fees_amt,notes,pending_status - id,account_id,date_payment,checkout_plugin_id,total_amt,source_id - id,date_orig,account_id,date_payment,checkout_plugin_id,total_amt,fees_amt,notes,source_id - - - - - - - - <view>Payment</view> - - - - - - - id - checkbox - 25px - - - account_id - - - source_id - - - checkout_plugin_id - - - date_payment - date - - - total_amt - currency - - - - - id - checkbox - 25px - - - id - - - date_orig - date - - - total_amt - currency - - - - - id - checkbox - 25px - - - id - - - account_id - - - date_orig - date - - - total_amt - currency - - - alloc_amt - currency - - - balance - currency - - - acct_bal - - - - - id - checkbox - 25px - - - id - - - account_id - - - invoice_id - - - date_orig - date - - - total_amt - currency - - - billed_amt - currency - - - alloc_amt - currency - - - -
diff --git a/modules/payment/payment_install.xml b/modules/payment/payment_install.xml deleted file mode 100644 index 76546150..00000000 --- a/modules/payment/payment_install.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - Payment - - 1 - - payment - - - - invoice - - - - - - - - - - Add - 1 - add - - - - delete - - - - List - 1 - search - - - - - Search - 1 - search_form - - - - search_show - - - - update - - - - view - - - - diff --git a/modules/payment/views/payment/admin/add.php b/modules/payment/views/payment/admin/add.php new file mode 100644 index 00000000..a050a048 --- /dev/null +++ b/modules/payment/views/payment/admin/add.php @@ -0,0 +1,35 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Payment Datedate_payment); ?>
Accountaccount_id); ?>
Methodcheckout_plugin_id,'id','name',array('active'=>'=:1'),TRUE,array('class'=>'form_button'));?>
Amounttotal_amt); ?>
Feesfees_amt); ?>
Notesnotes); ?>
+
diff --git a/modules/payment/views/payment/admin/item/list_body.php b/modules/payment/views/payment/admin/item/list_body.php new file mode 100644 index 00000000..1232b29e --- /dev/null +++ b/modules/payment/views/payment/admin/item/list_body.php @@ -0,0 +1,9 @@ + + id(); ?> + display('date_orig'); ?> + display('due_date'); ?> + total(TRUE); ?> + payments_total(TRUE); ?> + due(TRUE); ?> + id.']',$pio->alloc_amt); ?> + diff --git a/modules/payment/views/payment/admin/item/list_foot.php b/modules/payment/views/payment/admin/item/list_foot.php new file mode 100644 index 00000000..79ee84d9 --- /dev/null +++ b/modules/payment/views/payment/admin/item/list_foot.php @@ -0,0 +1,7 @@ + +   + Unapplied + 'disabled')); ?> + + + diff --git a/modules/payment/views/payment/admin/item/list_head.php b/modules/payment/views/payment/admin/item/list_head.php new file mode 100644 index 00000000..aa4e9465 --- /dev/null +++ b/modules/payment/views/payment/admin/item/list_head.php @@ -0,0 +1,11 @@ +
+ + + + + + + + + + diff --git a/modules/payment_item/payment_item.inc.php b/modules/payment_item/payment_item.inc.php deleted file mode 100644 index 7869adf2..00000000 --- a/modules/payment_item/payment_item.inc.php +++ /dev/null @@ -1,159 +0,0 @@ -. - * - * Originally authored by Deon George - * - * @author Deon George - * @copyright 2009 Deon George - * @link http://osb.leenooks.net - * @license http://www.gnu.org/licenses/ - * @package AgileBill - * @subpackage Modules:Payment - */ - -/** - * The main AgileBill Payment Class - * - * @package AgileBill - * @subpackage Modules:Payment - */ -class payment_item extends OSB_module { - public function allocate($VAR) { return $this->doAllocate($VAR); } - /** - * Allocate a payment to invoices - * - * @uses invoice - * @uses payment - */ - public function doAllocate($VAR) { - $db = DB(); - - # Get the payment invoices for this account. - include_once(PATH_MODULES.'payment/payment.inc.php'); - $po = new payment; - - # Get our payment information - if (! $payment = $po->sPaymentsBal($VAR['payment_id'])) - return false; - - # Check that our allocation is correct. - $total = round(array_sum($VAR['payment_item_allocate']),2); - - if ($total > $payment['total_amt']) { - global $C_debug; - $C_debug->alert(sprintf('%s: (%3.2f/%3.2f) ?',_('Payment over allocated'),$total,$payment['total_amt'])); - return false; - } - - # If this payment has been allocated to some invoices, collect those details - $payment_items = $this->sPaymentAllocation($VAR['payment_id']); - - # Get the unpaid invoices for this account. - include_once(PATH_MODULES.'invoice/invoice.inc.php'); - $io = new invoice; - $invoices = $io->sInvoicesAcc($payment['account_id'],array_keys($VAR['payment_item_allocate'])); - - # Apply the new allocation - foreach ($VAR['payment_item_allocate'] as $invoice => $alloc) { - if (! trim($alloc)) - continue; - - # Sanity check - if (! isset($invoices[$invoice])) { - global $C_debug; - $C_debug->alert(sprintf('Payment for invoice doesnt exist? (%s)?',$invoices['invoice'])); - - # This payment has been processed - if (isset($payment_items[$invoice])) - unset($payment_items[$invoice]); - - continue; - - } elseif ((isset($payment_items[$invoice]) && $invoices[$invoice]['balance']+$payment_items[$invoice] < $alloc) - || (! isset($payment_items[$invoice]) && $invoices[$invoice]['balance'] < $alloc)) { - - global $C_debug; - $C_debug->alert(sprintf('Over allocation for invoice %s - remaining balance is %s?',$invoice,$invoices[$invoice]['balance'])); - - # This payment has been processed - if (isset($payment_items[$invoice])) - unset($payment_items[$invoice]); - - continue; - } - - # Have we already applied payments to this invoice in the past - if (isset($payment_items[$invoice])) { - if ($alloc != $payment_items[$invoice]) { - # Record the adjusted payment details - $db->Execute(sqlUpdate('payment_item',array('date_last'=>time(),'alloc_amt'=>$alloc),array('where'=>array('payment_id'=>$VAR['payment_id'],'invoice_id'=>$invoice,'alloc_amt'=>$payment_items[$invoice])))); - - # Adjust the invoice balance - $db->Execute(sqlUpdate('invoice',array('billed_amt'=>$invoices[$invoice]['billed_amt']+$alloc-$payment_items[$invoice]),array('where'=>array('id'=>$invoice,'billed_amt'=>$invoices[$invoice]['billed_amt'])))); - } - - # This payment has been processed - unset($payment_items[$invoice]); - - # New payment allocation - } else { - # Reduce the invoice balance - $db->Execute(sqlUpdate('invoice',array('billed_amt'=>$invoices[$invoice]['billed_amt']+$alloc),array('where'=>array('id'=>$invoice)))); - - # Record the payment - $db->Execute(sqlInsert($db,'payment_item',array('date_orig'=>time(),'date_last'=>time(),'payment_id'=>$VAR['payment_id'],'invoice_id'=>$invoice,'alloc_amt'=>$alloc))); - } - } - - # Any left over payments need to be reversed - foreach ($payment_items as $invoice => $alloc) { - if (! $alloc) - continue; - - $db->Execute(sqlUpdate('payment_item',array('date_last'=>time(),'alloc_amt'=>0),array('where'=>array('payment_id'=>$VAR['payment_id'],'invoice_id'=>$invoice,'alloc_amt'=>$payment_items[$invoice])))); - $db->Execute(sqlUpdate('invoice',array('billed_amt'=>$invoices[$invoice]['billed_amt']-$alloc),array('where'=>array('id'=>$invoice,'billed_amt'=>$invoices[$invoice]['billed_amt'])))); - } - - # Force the refresh of the account balances - $io->sInvoicesBal(null,true); - } - - /** - * Get the payment allocation for a payment ID - * - * @param $payment_id Payment ID to retrieve - * @return array Invoices and the payment location - */ - public function sPaymentAllocation($payment_id) { - static $sPaymentAllocation = array(); - - if (! isset($sPaymentsBalance[$payment_id])) { - $db = DB(); - $rs = $db->Execute(sqlSelect('payment_item','invoice_id,alloc_amt',array('where'=>array('payment_id'=>$payment_id)))); - - if ($rs && $rs->RecordCount()) { - while (! $rs->EOF) { - $sPaymentsBalance[$payment_id][$rs->fields['invoice_id']] = $rs->fields['alloc_amt']; - $rs->MoveNext(); - } - } - } - - return $sPaymentsBalance[$payment_id]; - } -} -?> diff --git a/modules/payment_item/payment_item_construct.xml b/modules/payment_item/payment_item_construct.xml deleted file mode 100644 index e7dc725d..00000000 --- a/modules/payment_item/payment_item_construct.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - payment_item - -
InvoiceDate IssueDate DueTotalPaymentsDueAlloc
payment_item
- - payment - - 0 - - date_orig - - 25 - - 1 - - - - - - - - - - - 1 - I4 - 1 - - - - 1 - I4 - - - - date-now - Date Created - I8 - - - - date-now - Date Updated - I8 - - - - account - I8 - - - - invoice - I8 - - - - F - float - - - - - - payment_id,invoice_id,alloc_amt - - - - - - - - - - - - - diff --git a/modules/payment_item/payment_item_install.xml b/modules/payment_item/payment_item_install.xml deleted file mode 100644 index c62c3651..00000000 --- a/modules/payment_item/payment_item_install.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - payment - - - - 0 - - payment_item - - - - payment - - - - - - - - - - add - - - - delete - - - - search - - - - - search_form - - - - search_show - - - - update - - - - view - - - - - - - diff --git a/themes/default/blocks/payment/ListInvoicesBalance.tpl b/themes/default/blocks/payment/ListInvoicesBalance.tpl deleted file mode 100644 index ec339243..00000000 --- a/themes/default/blocks/payment/ListInvoicesBalance.tpl +++ /dev/null @@ -1,34 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - -{$method->exe($meth.0,$meth.1)} -{if ($method->result == FALSE)} - {$block->display('core:method_error')} -{else} - - {include file='file:../core/search_show_pre.tpl'} - - - - - -
- - {$method->exe_noauth($meth.0,'tpl_search_show')} - {foreach from=$search_show item=record} - {include file='file:../core/search_show_tr_record.tpl'} - - - - - - - - - {/foreach} -
{$record.id}{$record.account_id}{$list->date($record.date_orig)}{$list->format_currency_num($record.total_amt,$record.billed_currency_id)}{$list->format_currency_num($record.alloc_amt,$record.billed_currency_id)}{$list->format_currency_num($record.balance,$record.billed_currency_id)}{$list->format_currency_num($record.acct_bal,$record.billed_currency_id)}
-
- - {include file='file:../core/search_show_post-1.tpl'} - {include file='file:../core/search_show_post-2.tpl'} -{/if} \ No newline at end of file diff --git a/themes/default/blocks/payment/ListUnallocated.tpl b/themes/default/blocks/payment/ListUnallocated.tpl deleted file mode 100644 index ec339243..00000000 --- a/themes/default/blocks/payment/ListUnallocated.tpl +++ /dev/null @@ -1,34 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - -{$method->exe($meth.0,$meth.1)} -{if ($method->result == FALSE)} - {$block->display('core:method_error')} -{else} - - {include file='file:../core/search_show_pre.tpl'} - - - - - -
- - {$method->exe_noauth($meth.0,'tpl_search_show')} - {foreach from=$search_show item=record} - {include file='file:../core/search_show_tr_record.tpl'} - - - - - - - - - {/foreach} -
{$record.id}{$record.account_id}{$list->date($record.date_orig)}{$list->format_currency_num($record.total_amt,$record.billed_currency_id)}{$list->format_currency_num($record.alloc_amt,$record.billed_currency_id)}{$list->format_currency_num($record.balance,$record.billed_currency_id)}{$list->format_currency_num($record.acct_bal,$record.billed_currency_id)}
-
- - {include file='file:../core/search_show_post-1.tpl'} - {include file='file:../core/search_show_post-2.tpl'} -{/if} \ No newline at end of file diff --git a/themes/default/blocks/payment/ListUnbalanced.tpl b/themes/default/blocks/payment/ListUnbalanced.tpl deleted file mode 100644 index 5e5cad5c..00000000 --- a/themes/default/blocks/payment/ListUnbalanced.tpl +++ /dev/null @@ -1,34 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - -{$method->exe($meth.0,$meth.1)} -{if ($method->result == FALSE)} - {$block->display('core:method_error')} -{else} - - {include file='file:../core/search_show_pre.tpl'} - - - - - -
- - {$method->exe_noauth($meth.0,'tpl_search_show')} - {foreach from=$search_show item=record} - {include file='file:../core/search_show_tr_record.tpl'} - - - - - - - - - {/foreach} -
{$record.id}{$record.account_id}{$record.invoice_id}{$list->date($record.date_orig)}{$list->format_currency_num($record.total_amt,$record.billed_currency_id)}{$list->format_currency_num($record.billed_amt,$record.billed_currency_id)}{$list->format_currency_num($record.alloc_amt,$record.billed_currency_id)}
-
- - {include file='file:../core/search_show_post-1.tpl'} - {include file='file:../core/search_show_post-2.tpl'} -{/if} \ No newline at end of file diff --git a/themes/default/blocks/payment/add.tpl b/themes/default/blocks/payment/add.tpl deleted file mode 100644 index d7bd3305..00000000 --- a/themes/default/blocks/payment/add.tpl +++ /dev/null @@ -1,66 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - - -{if $form_validation} - {$block->display('core:alert_fields')} -{/if} - - -
- - - - - -
- - - - - - - - -
{osb f=tt}
- - - - - - {if $VAR.payment_account_id} - - - - - - - - - - - - - - - - - - - - - {include file='file:../core/add_tr_submit.tpl'} - {else} - - - {include file='file:../core/view_td_submit.tpl'} - - {/if} -
{osb f=tf field=account_id}{osb f=autoselect module=account return=id field=payment_account_id default=$VAR.payment_account_id}
{osb f=tf field=date_payment}{$list->calender_add('payment_date_payment','now','form_field','')}
{osb f=tf field=checkout_plugin_id}{$list->mmenu('no','payment_checkout_plugin_id','checkout','name',$VAR.payment_checkout_plugin_id,'active=1','',true)}
{osb f=tf field=total_amt}
{osb f=tf field=fees_amt}
{osb f=tf field=notes}
-
-
- -
- -
-
diff --git a/themes/default/blocks/payment/allocate.tpl b/themes/default/blocks/payment/allocate.tpl deleted file mode 100644 index 72872614..00000000 --- a/themes/default/blocks/payment/allocate.tpl +++ /dev/null @@ -1,51 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - - -{$method->exe_noauth($meth.0,$meth.1)} -{if ($method->result == false)} - {$block->display('core:method_error')} -{else} - - {include file='file:../core/search_show_pre.tpl'} - - - - - - - - - - - {include file='file:../core/view_td_submit.tpl'} - -
- - - - - - - - - {foreach from=$invoices item=record} - - - - - - - - {/foreach} -
{t}Invoice Date{/t}{t}Invoice Number{/t}{t}Invoice Amount{/t}{t}Invoice Balance{/t}{t}Allocate{/t}
{$list->date($record.date_orig)}{$record.id}{$list->format_currency_num($record.total_amt,$smarty.const.SESS_CURRENCY)} ({$list->format_currency_num($record.credit_amt,$smarty.const.SESS_CURRENCY)}){$list->format_currency_num($record.balance,$smarty.const.SESS_CURRENCY)}
-
 
- -
- -
- - -
- -{/if} diff --git a/themes/default/blocks/payment/search_form.tpl b/themes/default/blocks/payment/search_form.tpl deleted file mode 100644 index fa394a2c..00000000 --- a/themes/default/blocks/payment/search_form.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - -{$method->exe($meth.0,$meth.1)} -{if ($method->result == false)} - {$block->display('core:method_error')} -{else} - -
- - - - - -
- - - - - - - -
{osb f=tt}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {include file='file:../core/search_post.tpl'} -
{osb f=tf field=account_id}{osb f=autoselect module=account return=id field=payment_account_id default=$record.account_id}
{osb f=tf field=source_id}{osb f=autoselect module=account return=id field=payment_source_id default=$record.source_id}
{osb f=tf field=checkout_plugin_id}{$list->menu('','payment_checkout_plugin_id','checkout','name','','form_menu',true)}
{osb f=tf field=billed_currency_id}{$list->menu('','payment_billed_currency_id','currency','name','','form_menu',true)}
{osb f=tf field=date_orig}{$list->calender_search('payment_date_orig',$VAR.payment_date_orig,'form_field','')}
{osb f=tf field=payment_date}{$list->calender_search('payment_payment_date',$VAR.payment_payment_date,'form_field','')}
{osb f=tf field=refund_status}{$list->bool('payment_refund_status','all')}
-
-
- -
- - {$block->display('core:saved_searches')} - {$block->display('core:recent_searches')} -{/if} diff --git a/themes/default/blocks/payment/search_show.tpl b/themes/default/blocks/payment/search_show.tpl deleted file mode 100644 index 2e593f28..00000000 --- a/themes/default/blocks/payment/search_show.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - -{$method->exe($meth.0,$meth.1)} -{if ($method->result == false)} - {$block->display('core:method_error')} -{else} - {include file='file:../core/search_show_pre.tpl'} - {$method->exe_noauth($meth.0,'tpl_search_show',$search_show)} - {include file='file:../core/search_show_post-1.tpl'} - {include file='file:../core/search_show_post-2.tpl'} -{/if} diff --git a/themes/default/blocks/payment/view.tpl b/themes/default/blocks/payment/view.tpl deleted file mode 100644 index 189da889..00000000 --- a/themes/default/blocks/payment/view.tpl +++ /dev/null @@ -1,77 +0,0 @@ -{assign var=meth value=':'|explode:$VAR._page} - - -{$method->exe($meth.0,$meth.1)} -{if ($method->result == false)} - {$block->display('core:method_error')} -{else} - {include file='file:../core/view_pre.tpl'} - - - {if $form_validation} - {$block->display('core:alert_fields')} - {/if} - - -
- - - - - -
- - - - - - - - - {include file='file:../core/view_tr_submit_delete.tpl'} -
{osb f=tt} {$record.id}
- - - - - - - - - - - - - - - - - - - - - - - - - -
{osb f=tf field=account_id}{osb f=autoselect module=account return=id field=payment_account_id default=$record.account_id}
{osb f=tf field=date_payment}{$list->calender_view('payment_date_payment',$record.date_payment,'form_field')}
{osb f=tf field=checkout_plugin_id}{$list->mmenu('no','payment_checkout_plugin_id','checkout','name',$record.checkout_plugin_id,'active=1','',true)}
{osb f=tf field=total_amt}
{osb f=tf field=fees_amt}
{osb f=tf field=notes}
-
-
- - {include file='file:../core/view_post.tpl'} -
- - - - -{/if}