forked from phpcontrols/inventory-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
incoming-purchases.php
executable file
·56 lines (41 loc) · 1.4 KB
/
incoming-purchases.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
use phpGrid\C_DataGrid;
include_once("phpGrid/conf.php");
include_once('inc/head.php');
?>
<h1>My Inventory Manager</h1>
<?php
$_GET['currentPage'] = 'incoming';
include_once('inc/menu.php');
?>
<button class="add-new-row">Add New Purchase</button>
<?php
$dgPur = new C_DataGrid('SELECT id, PurchaseDate, ProductId, NumberReceived, SupplierId FROM purchases', 'id', 'purchases');
$dgPur->set_col_hidden('id', false);
$dgPur->set_col_title('PurchaseDate', 'Date of Purchase');
$dgPur->set_col_title('ProductId', 'Product');
$dgPur->set_col_title('NumberReceived', 'Number Received');
$dgPur->set_col_title('SupplierId', 'Supplier');
$dgPur->set_col_edittype('ProductId', 'autocomplete', "select id, concat(lpad(id, 8, '0'), ' | ', ProductLabel) from products");
$dgPur->set_col_edittype('SupplierId', 'autocomplete', "select id, supplier from suppliers");
// $dgPur->enable_edit('FORM');
$dgPur->set_pagesize(100);
$dgPur->set_col_width('PurchaseDate', '50px');
$dgPur->set_col_width('NumberReceived', '35px');
$dgPur -> set_group_properties('ProductId', false, true, true, false);
$dgPur -> set_group_summary('NumberReceived','sum');
$dgPur->enable_autowidth(true);
$dgPur->enable_edit('FORM');
$dgPur->display();
?>
Incoming orders increase inventory.
<script>
$(function(){
$(".add-new-row").on("click",function(){
$("#add_purchases").click();
});
});
</script>
<?php
include_once('inc/footer.php');
?>