+ return systypes::name($type);
+}
+
+function order_view($row)
+{
+ return $row['order_']>0 ?
+ get_customer_trans_view_str(systypes::sales_order(), $row['order_'])
+ : "";
+}
+
+function trans_view($trans)
+{
+ return get_trans_view_str($trans["type"], $trans["trans_no"]);
+}
+
+function due_date($row)
+{
+ return $row["type"] == 10 ? $row["due_date"] : '';
+}
+
+function gl_view($row)
+{
+ return get_gl_view_str($row["type"], $row["trans_no"]);
+}
+
+function fmt_debit($row)
+{
+ $value =
+ $row['type']==11 || $row['type']==12 || $row['type']==2 ?
+ -$row["TotalAmount"] : $row["TotalAmount"];
+ return $value>=0 ? price_format($value) : '';
+
+}
+
+function fmt_credit($row)
+{
+ $value =
+ !($row['type']==11 || $row['type']==12 || $row['type']==2) ?
+ -$row["TotalAmount"] : $row["TotalAmount"];
+ return $value>0 ? price_format($value) : '';
+}
+
+function credit_link($row)
+{
+ return $row['type'] == 10 && $row["TotalAmount"] - $row["Allocated"] > 0 ?
+ pager_link(_("Credit This"),
+ "/sales/customer_credit_invoice.php?InvoiceNumber=".
+ $row['trans_no'], ICON_CREDIT)
+ : '';
+}
+
+function edit_link($row)
+{
+ $str = '';
+
+ switch($row['type']) {
+ case 10:
+ if (get_voided_entry(10, $row["trans_no"]) === false && $row['Allocated'] == 0)
+ $str = "/sales/customer_invoice.php?ModifyInvoice=".$row['trans_no'];
+ break;
+ case 11:
+ if (get_voided_entry(11, $row["trans_no"]) === false && $row['Allocated'] == 0) // 2008-11-19 Joe Hunt
+ {
+ if ($row['order_']==0) // free-hand credit note
+ $str = "/sales/credit_note_entry.php?ModifyCredit=".$row['trans_no'];
+ else // credit invoice
+ $str = "/sales/customer_credit_invoice.php?ModifyCredit=".$row['trans_no'];
+ }
+ break;
+ case 13:
+ if (get_voided_entry(13, $row["trans_no"]) === false)
+ $str = "/sales/customer_delivery.php?ModifyDelivery=".$row['trans_no'];
+ break;
+ }
+ if ($str != "")
+ return pager_link(_('Edit'), $str, ICON_EDIT);
+ return '';
+}
+
+function prt_link($row)
+{
+ if ($row['type'] != 12 && $row['type'] != 2) // customer payment or bank deposit printout not defined yet.
+ return print_document_link($row['trans_no'], _("Print"), true, $row['type'], ICON_PRINT);
+}
+
+function check_overdue($row)
+{
+ return $row['OverDue'] == 1
+ && (abs($row["TotalAmount"]) - $row["Allocated"] != 0);
+}
+//------------------------------------------------------------------------------------------------