716dd95ce21b58b8aac2c216acd6f3d2bed3befd
[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 $row_id = $row['id'];
16         return "
17 <input type='text' value='$date' name='detail[$row_id][required_date]'>
18 ";
19 }
20
21 function input_comment_details($row, $comment) {
22 $row_id = $row['id'];
23         return "
24 <input type='text' value='$comment' name='detail[$row_id][comment]'>
25 ";
26 }
27
28 function get_order_details_extra($customer_id) {
29         $sql = "SELECT sod.id
30         , so.order_no
31         , stk_code
32         , quantity - qty_sent
33         , required_date
34         , comment
35         FROM ".TB_PREF."sales_order_details sod
36         JOIN ".TB_PREF."sales_orders so ON (so.order_no = sod.order_no
37                 AND so.trans_type = sod.trans_type
38                 AND so.debtor_no = $customer_id
39         )
40         WHERE quantity > qty_sent
41         ";
42
43         return $sql;
44 }
45 ?>