Splitter Test written. Doesn't pass.
[order_line_extra.git] / order_lines_view.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $path_to_root = "../..";
13
14 include_once($path_to_root . "/includes/db_pager.inc");
15 include_once($path_to_root . "/includes/session.inc");
16 include_once($path_to_root . "/sales/includes/sales_ui.inc");
17 include_once($path_to_root . "/reporting/includes/reporting.inc");
18
19 include_once("includes/order_lines.inc");
20
21 $page_security = 'SA_ORDERLINEX_EDIT';
22 add_access_extensions();
23
24 $_SESSION['page_title'] = _($help_context = "Edit lines extra parameters");
25
26 // Process POST
27 update_extra_order_details();
28 split_order_details();
29
30
31 $js = "";
32 if ($use_popup_windows)
33         $js .= get_js_open_window(900, 600);
34 if ($use_date_picker)
35         $js .= get_js_date_picker();
36 page($_SESSION['page_title'], false, false, "", $js);
37
38 //---------------------------------------------------------------------------------------------
39
40 start_form();
41
42 start_table(TABLESTYLE_NOBORDER);
43 start_row();
44
45
46 if(!isset($_POST['customer_id'])) {
47         if(isset($_GET['customer_id'])) {
48                 $customer_id = $_GET['customer_id'];
49                 $_POST['customer_id'] = $customer_id;
50         }
51 else $customer_id = null;
52
53 }
54 else {
55         $customer_id = $_POST['customer_id'];
56 }
57 customer_list_cells(_("Select a customer: "), 'customer_id', $customer_id, true, true);
58
59
60
61
62
63 //submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
64
65 end_row();
66
67 end_table(1);
68
69 //---------------------------------------------------------------------------------------------
70 //      Orders inquiry table
71 //
72 if($customer_id) {
73         $sql = get_order_details_extra($customer_id, 'DEF');
74         $cols = array(
75                 'detail_id' => 'skip'
76                 ,       _("Order #") => array('fun'=>'view_link', 'ord' => '')
77                 ,_("Item Code") => array('ord' => '', 'fun' => 'item_link')
78                 ,_("Quantity") => array('type' => 'qty', 'dec' => 0)
79                 ,_("Available") => array('fun' => 'available_quantity', 'dec' => 0, 'ord' => '')
80                 ,_("Before") => 'skip'
81                 ,_("Priority") => array('fun' => 'input_priority_date_details', 'ord' => '')
82                 ,_("Hold Until") => array('fun' => 'input_hold_until_date_details', 'ord' => '')
83                 ,_("Require By") => array('fun' => 'input_required_date_details', 'ord' => '')
84                 ,_("Expiry Date") => array('fun' => 'input_expiry_date_details', 'ord' => '')
85         ,_("Comment") => array('fun' => 'input_comment_details', 'ord' => '')
86         );
87 }
88 else {
89         $sql = get_order_summary('DEF');
90         $cols = array(
91         'customer id' => 'skip',
92 _("Customer") => array('ord' => '', 'fun' => 'customer_link'),
93 _("Branch") => array('ord' => ''),
94 _("Delivery Date") => array('ord' => '', 'type' => 'date'),
95 _("Quantity") => array('ord' => '', 'type' => 'qty', 'dec' => 0),
96 _("Amount") => array('ord' => '', 'type' => 'amount'),
97 _("Avail. Q") => array('ord' => '', 'type' => 'qty', 'dec' => 0),
98 _("Avail. A") => array('ord' => '', 'type' => 'amount', 'dec' => 0),
99 _("required date") => array('ord' => '', 'type' => 'date'),
100 _("Comments") => array('ord' => '', 'fun' => 'aggregate_comment'),
101 _("comment 2 ") =>  'skip'
102         );
103 }
104
105
106 $table =& new_db_pager('orders_tbl', $sql, $cols);
107
108 $table->width = "80%";
109
110 display_db_pager($table);
111
112 function display_split_area() {
113 start_table(TABLESTYLE_NOBORDER);
114 date_cells('Start', 'name', 'title');
115 date_cells('End', 'name', 'title');
116 qty_cells('Max', 'huu', 6);
117 submit_cells('Split', 'Split');
118 end_table();
119
120 }
121 display_split_area();
122
123
124 br(1);
125 submit_center_first('Update', _("Update"), '', 'default', false);
126 submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
127
128         end_form();
129         end_page();
130 ?>
131 <style>
132 span.tooltip{ display:none;}
133 span.tooltip {
134       position: absolute;
135                         right: -0px;
136                         top: 20px;
137       width: 200px;
138       color: rgb(113, 157, 171);
139       background: rgb(255, 255, 255);
140       border: 1px solid rgb(113, 157, 171);
141 }
142
143 :hover > span.tooltip, span.tooltip:hover {
144         display: inline;
145 }
146 span.before-tooltip {
147         color: #800;
148         font-style: italic;
149         position: relative;
150 }
151
152 </style>