_("Name"),
_("Type"),
_("Date") =>'date',
- _("Due Date") => array('date', 'ord'=>'asc'),
+ _("Due Date") => array('name'=>'due_date', 'date', 'ord'=>'asc'),
_("Closed") => array('fun'=>'is_closed'),
_("Balance") => array('type'=>'amount', 'insert'=>true, 'fun'=>'sum_dimension'),
array('insert'=>true, 'fun'=>'edit_link')
}
$sql = "$select FROM $from $where";
- if($group) $sql.= " GROUP BY $group";
+ if ($group) $sql.= " GROUP BY $group";
$ord = array();
- foreach( $this->columns as $col) {
+ foreach ($this->columns as $col) {
if (isset($col['ord'])) {
if ( $col['ord'] != '' && isset($col['name'])) {
$ord[] = $col['name'] .' '. $col['ord'];
//
function _init()
{
+ global $go_debug;
+
if ($this->ready == false ) {
$sql = $this->_sql_gen(true);
$result = db_query($sql, 'Error reading record set');
$row = db_fetch_row($result);
$this->rec_count = $row[0];
$this->max_page = ceil($this->rec_count/$this->page_len);
+
+ if ($go_debug) { // FIX - need column name parsing, but for now:
+ // check if field names are set explicite in col def
+ // for all initially ordered columns
+ foreach ($this->columns as $col) {
+ if (isset($col['ord']) && $col['ord'] != ''
+ && !isset($col['name'])) {
+ display_warning("Result field names must be set
+ for all intially ordered db_pager columns.");
+ }
+ }
+ }
$this->set_page(1);
$this->ready = true;
}
_("Transaction Type") => array('fun'=>'systype_name'),
_("#") => array('fun'=>'trans_view'),
_("Reference"),
- _("Date") => array('type'=>'date', 'ord'=>'asc'),
+ _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'asc'),
_("Supplier") => array('ord'=>''),
_("Currency") => array('align'=>'center'),
_("Total") => 'amount',
_("Supplier") => array('ord'=>''),
_("Location"),
_("Supplier's Reference"),
- _("Order Date") => array('type'=>'date', 'ord'=>'desc'),
+ _("Order Date") => array('name'=>'ord_date', 'type'=>'date', 'ord'=>'desc'),
_("Currency") => array('align'=>'center'),
_("Order Total") => 'amount',
array('insert'=>true, 'fun'=>'prt_link'),
_("Reference"),
_("Supplier") => array('ord'=>''),
_("Supp Reference"),
- _("Date") => array('type'=>'date', 'ord'=>'asc'),
+ _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'asc'),
_("Due Date") => array('fun'=>'due_date'),
_("Currency") => array('align'=>'center'),
_("Debit") => array('align'=>'right', 'fun'=>'fmt_debit'),
_("Reference"),
_("Supplier"),
_("Supplier's Reference"),
- _("Date") => array('type'=>'date', 'ord'=>'desc'),
+ _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'desc'),
_("Due Date") => array('type'=>'date', 'fun'=>'due_date'),
_("Currency") => array('align'=>'center'),
_("Debit") => array('align'=>'right', 'fun'=>'fmt_debit'),
_("Transaction Type") => array('fun'=>'systype_name'),
_("#") => array('fun'=>'trans_view'),
_("Reference"),
- _("Date") => array('type'=>'date', 'ord'=>'asc'),
+ _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'asc'),
_("Customer") => array('ord'=>''),
_("Currency") => array('align'=>'center'),
_("Total") => 'amount',
_("#") => array('fun'=>'view_link'),
_("Reference"),
_("Order") => array('fun'=>'order_link'),
- _("Date") => array('type'=>'date', 'ord'=>'asc'),
+ _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'asc'),
_("Due Date") => array('type'=>'date', 'fun'=>'due_date'),
_("Customer"),
_("Currency") => array('align'=>'center'),