Date work (js + empty value)
[order_line_extra.git] / includes / order_lines.inc
index 138af425876d53c9c9c86122b442d488addbdc40..050fa825c6a9b6828d70782b6ceb4fde114fc16e 100644 (file)
@@ -1,4 +1,11 @@
 <?php
+include_once($path_to_root."/includes/ui/ui_input.inc");
+
+function compute_input_name($row, $field) {
+       $row_id = $row['id'];
+       return "detail[$row_id][$field]";
+}
+
 function view_link($dummy, $order_no)
 {
        return  get_customer_trans_view_str(ST_SALESORDER, $order_no);
@@ -10,8 +17,32 @@ function order_link($row)
        "/sales/sales_order_entry.php?NewQuoteToSalesOrder=" .$row['order_no'], ICON_DOC);
 }
 
+function input_date_details($row, $date) {
+$row_id = $row['id'];
+       $name = compute_input_name($row, 'required_date');
+
+$_POST[$name] = sql2date($date);
+
+       start_extract_cell();
+               date_cells (null, $name, 'title', null, 0,0,1001);
+       return end_extract_cell();
+
+
+       return "
+<input type='text' value='$date' name='$name'>
+";
+}
+
+function input_comment_details($row, $comment) {
+$row_id = $row['id'];
+       return "
+<input type='text' value='$comment' name='detail[$row_id][comment]'>
+";
+}
+
 function get_order_details_extra($customer_id) {
-       $sql = "SELECT so.order_no
+       $sql = "SELECT sod.id
+       , so.order_no
        , stk_code
        , quantity - qty_sent
        , required_date