_("Order") => array('type'=>'spec', 'fun'=>'order_link'),
_("Date") => array('type'=>'date', 'ord'=>'asc'),
_("Due Date") => array('type'=>'spec', 'fun'=>'due_date'),
- _("Customer"),
- _("Currency"),
+ _("Customer") => 'text',
+ _("Currency") => 'text',
_("Debit") => array('type'=>'spec', 'fun'=>'fmt_debit'),
_("Credit") => array('type'=>'insert', 'fun'=>'fmt_credit'),
_("Allocated") => 'amount',
);
if ($_POST['customer_id'] != reserved_words::get_all()) {
- array_remove($cols, 6, 2);
+ $cols[_("Customer")] = 'skip';
+ $cols[_("Currency")] = 'skip';
}
$table =& new_db_pager('doc_tbl', $sql, $cols);
if(get_post('RefreshInquiry'))
{
$table->set_sql($sql);
+ $table->set_columns($cols);
$Ajax->activate('doc_tbl');
}
function due_date($row)
{
- return $row["type"] == 10 ? sql2date($row["due_date"]) : '';
+ return ($row["type"]==20 || $row["type"]==21)? sql2date($row["due_date"]) : '';
}
function fmt_balance($row)
return $value>0 ? price_format($value) : '';
}
+function gl_link($row)
+{
+ return get_gl_view_str($row["type"], $row["trans_no"]);
+}
+
function alloc_link($row)
{
if ($row['type'] == 10)
_("Due Date") => array('type'=>'spec', 'fun'=>'due_date'),
_("Customer") => array('ord'=>''),
_("Branch") => array('ord'=>''),
- _("Currency"),
+ _("Currency") => 'text',
_("Debit") => array('type'=>'spec', 'fun'=>'fmt_debit'),
_("Credit") => array('type'=>'insert', 'fun'=>'fmt_credit'),
+ array('type'=>'insert', 'fun'=>'gl_view'),
array('type'=>'insert', 'fun'=>'alloc_link'),
array('type'=>'insert', 'fun'=>'credit_link'),
array('type'=>'insert', 'fun'=>'edit_link'),
);
if ($_POST['customer_id'] != reserved_words::get_all()) {
- array_remove($cols, 6);
- array_remove($cols, 8);
+ $cols[_("Customer")] = 'skip';
+ $cols[_("Currency")] = 'skip';
}
if(get_post('RefreshInquiry'))
{
$table->set_sql($sql);
+ $table->set_columns($cols);
$Ajax->activate('trans_tbl');
$Ajax->activate('totals_tbl');
}