+display_heading2(_("Delivery Notes"));
+
+$th = array(_("#"), _("Ref"), _("Date"), _("Total"));
+table_header($th);
+
+$sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=13 AND order_=" . $_GET['trans_no'];
+$result = db_query($sql,"The related delivery notes could not be retreived");
+
+$delivery_total = 0;
+$k = 0;
+
+while ($del_row = db_fetch($result))
+{
+
+ alt_table_row_color($k);
+
+ $this_total = $del_row["ov_freight"]+ $del_row["ov_amount"] + $del_row["ov_freight_tax"] + $del_row["ov_gst"] ;
+ $delivery_total += $this_total;
+
+ label_cell(get_customer_trans_view_str($del_row["type"], $del_row["trans_no"]));
+ label_cell($del_row["reference"]);
+ label_cell(sql2date($del_row["tran_date"]));
+ amount_cell($this_total);
+ end_row();
+
+}
+
+label_row(null, price_format($delivery_total), "", "colspan=4 align=right");
+
+end_table();
+echo "</td><td valign='top'>";
+
+start_table($table_style);
+display_heading2(_("Sales Invoices"));