0c0b09763223e4110af391060ebb63692577d911
[order_line_extra.git] / includes / order_lines.inc
1 <?php
2 include_once($path_to_root."/includes/ui/ui_input.inc");
3 function view_link($dummy, $order_no)
4 {
5         return  get_customer_trans_view_str(ST_SALESORDER, $order_no);
6 }
7
8 function order_link($row)
9 {
10   return pager_link( _("Sales Order"),
11         "/sales/sales_order_entry.php?NewQuoteToSalesOrder=" .$row['order_no'], ICON_DOC);
12 }
13
14 function input_date_details($row, $date) {
15  return date_cells( null, 'name');
16
17 }
18
19 function input_comment_details($row, $comment) {
20         return label_cell($comment); 
21 }
22
23 function get_order_details_extra($customer_id) {
24         $sql = "SELECT so.order_no
25         , stk_code
26         , quantity - qty_sent
27         , required_date
28         , comment
29         FROM ".TB_PREF."sales_order_details sod
30         JOIN ".TB_PREF."sales_orders so ON (so.order_no = sod.order_no
31                 AND so.trans_type = sod.trans_type
32                 AND so.debtor_no = $customer_id
33         )
34         WHERE quantity > qty_sent
35         ";
36
37         return $sql;
38 }
39 ?>