Hide before/after quantities when dragged (as they don't make any sens).
[order_line_extra.git] / item_schedule.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/session.inc");
15 include_once($path_to_root . "/includes/ui/ui_lists.inc");
16 include_once($path_to_root . "/includes/ui/ui_globals.inc");
17 include_once($path_to_root . "/includes/ui/ui_input.inc");
18 include_once($path_to_root . "/reporting/includes/reporting.inc");
19
20 //include_once("includes/item_scheduler.inc");
21 include_once("hincludes/lib/php/Boot.class.php");
22
23 $page_security = 'SA_ORDERLINEX_EDIT';
24 add_access_extensions();
25
26 $_SESSION['page_title'] = _($help_context = "Item schedule");
27
28
29 $js = "";
30 page($_SESSION['page_title'], false, false, "", $js);
31
32 //---------------------------------------------------------------------------------------------
33
34 start_form();
35
36 start_table(TABLESTYLE_NOBORDER);
37 start_row();
38
39 if (isset($_GET['stock_id']))
40 {
41         $_POST['stock_id'] = $_GET['stock_id'];
42 }
43
44 //if (!@$_GET['popup'])
45         start_form();
46
47 if (!isset($_POST['stock_id']))
48         $_POST['stock_id'] = get_global_stock_item();
49
50 $stock_id = $_POST['stock_id'];
51         stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
52
53 end_row();
54 end_table(1);
55
56 $scheduler = new ItemScheduler($stock_id, 'DEF');
57
58 div_start('item_schedule');
59 start_table(TABLESTYLE);
60 $th = $scheduler->tableHeader();
61
62 table_header($th);
63
64 $scheduler->generateTable();
65
66 end_table();
67 div_end();
68
69
70 submit_center_first('Update', _("Update"), '', 'default', false);
71 submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
72
73
74
75 end_form();
76 end_page();
77 ?>
78 <style type='text/css'>
79 tr.partial {
80         color: darkred;
81 }
82
83 tr.partial  td:nth-child(5) {
84         background: pink;
85 }
86
87 tr.location {
88         font-weight: normal;
89                 background: #8f8;
90 }
91 tr.on_time {
92 }
93
94 tr.late {
95                 background: #fc8;
96 }
97
98 tr.soldout {
99                 background: pink;
100 }
101
102 tr.tDnD_whileDrag {
103         background: #ccc;
104         border: 2px solid black;
105 }
106 tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
107         color: transparent;
108         background: transparent;
109 }
110 </style>
111 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
112 <script src="js/jquery.tablednd.0.8.min.js"></script>
113 <script text="text/javascript">
114         console.log('hello')
115         $(document).ready(function() {
116                 console.log('ready')
117                 $('#item_schedule table').tableDnD()
118         }
119         )
120 </script>