Display available quantity in order line view (for customer)
[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 update_extra_order_details();
27
28
29 $js = "";
30 if ($use_popup_windows)
31         $js .= get_js_open_window(900, 600);
32 if ($use_date_picker)
33         $js .= get_js_date_picker();
34 page($_SESSION['page_title'], false, false, "", $js);
35
36 //---------------------------------------------------------------------------------------------
37
38 start_form();
39
40 start_table(TABLESTYLE_NOBORDER);
41 start_row();
42
43
44 if(!isset($_POST['customer_id'])) {
45         if(isset($_GET['customer_id'])) {
46                 $customer_id = $_GET['customer_id'];
47                 $_POST['customer_id'] = $customer_id;
48         }
49 else $customer_id = null;
50
51 }
52 else {
53         $customer_id = $_POST['customer_id'];
54 }
55 customer_list_cells(_("Select a customer: "), 'customer_id', $customer_id, true, true);
56
57
58
59
60
61 //submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
62
63 end_row();
64
65 end_table(1);
66
67 //---------------------------------------------------------------------------------------------
68 //      Orders inquiry table
69 //
70 if($customer_id) {
71         $sql = get_order_details_extra($customer_id, 'DEF');
72         $cols = array(
73                 'detail_id' => 'skip'
74                 ,       _("Order #") => array('fun'=>'view_link', 'ord' => '')
75                 ,_("Item Code") => array('ord' => '', 'fun' => 'item_link')
76                 ,_("Quantity") => array('type' => 'qty', 'dec' => 0)
77                 ,_("Available") => array('type' => 'qty', 'dec' => 0, 'ord' => '')
78         ,_("Required Date") => array('fun' => 'input_date_details', 'ord' => '')
79         ,_("Comment") => array('fun' => 'input_comment_details', 'ord' => '')
80         );
81 }
82 else {
83         $sql = get_order_summary();
84         $cols = array(
85         'customer id' => 'skip',
86 _("Customer") => array('ord' => '', 'fun' => 'customer_link'),
87 _("Branch") => array('ord' => ''),
88 _("Delivery Date") => array('ord' => '', 'type' => 'date'),
89 _("Quantity") => array('ord' => '', 'type' => 'qty', 'dec' => 0),
90 _("Amount") => array('ord' => '', 'type' => 'amount'),
91 _("required date") => array('ord' => '', 'type' => 'date'),
92 _("Comments") => array('ord' => '', 'fun' => 'aggregate_comment'),
93 _("comment 2 ") =>  'skip'
94         );
95 }
96
97
98 $table =& new_db_pager('orders_tbl', $sql, $cols);
99
100 $table->width = "80%";
101
102 display_db_pager($table);
103
104 br(1);
105 submit_center_first('Update', _("Update"), '', 'default', false);
106 submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
107
108         end_form();
109         end_page();
110 ?>
111 <style>
112 span.tooltip{ display:none;}
113 span.tooltip {
114       position: absolute;
115                         right: -0px;
116                         top: 20px;
117       width: 200px;
118       color: rgb(113, 157, 171);
119       background: rgb(255, 255, 255);
120       border: 1px solid rgb(113, 157, 171);
121 }
122
123 :hover > span.tooltip, span.tooltip:hover {
124         display: inline;
125 }
126 span.before-tooltip {
127         color: #800;
128         font-style: italic;
129         position: relative;
130 }
131
132 </style>