forked from webERP-team/webERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoodsReceivedControlled.php
85 lines (70 loc) · 2.9 KB
/
GoodsReceivedControlled.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
include('includes/DefinePOClass.php');
include('includes/DefineSerialItems.php');
include('includes/session.php');
$Title = _('Receive Controlled Items');
/* Session started in header.php for password checking and authorisation level check */
include('includes/header.php');
if (empty($_GET['identifier'])) {
if (empty($_POST['identifier'])){
$identifier=date('U');
} else {
$identifier=$_POST['identifier'];
}
} else {
$identifier=$_GET['identifier'];
}
if (!isset($_SESSION['PO'.$identifier])) {
/* This page can only be called with a purchase order number for receiving*/
echo '<div class="centre">
<a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' . _('Select a purchase order to receive'). '</a>
</div>
<br />';
prnMsg( _('This page can only be opened if a purchase order and line item has been selected') . '. ' . _('Please do that first'),'error');
include('includes/footer.php');
exit;
}
if (isset($_GET['LineNo']) AND $_GET['LineNo']>0){
$LineNo = $_GET['LineNo'];
} elseif (isset($_POST['LineNo'])){
$LineNo = $_POST['LineNo'];
} else {
echo '<div class="centre">
<a href="' . $RootPath . '/GoodsReceived.php">' . _('Select a line Item to Receive') . '</a>
</div>';
prnMsg( _('This page can only be opened if a Line Item on a PO has been selected') . '. ' . _('Please do that first'), 'error');
include( 'includes/footer.php');
exit;
}
global $LineItem;
$LineItem = &$_SESSION['PO'.$identifier]->LineItems[$LineNo];
if ($LineItem->Controlled !=1 ){ /*This page only relavent for controlled items */
echo '<div class="centre">
<a href="' . $RootPath . '/GoodsReceived.php">' . _('Back to the Purchase Order'). '</a>
</div>';
prnMsg( _('The line being received must be controlled as defined in the item definition'), 'error');
include('includes/footer.php');
exit;
}
/********************************************
Get the page going....
********************************************/
echo '<div class="centre">
<br />
<a href="'.$RootPath.'/GoodsReceived.php?identifier=' .$identifier . '">' . _('Back To Purchase Order'). ' # '. $_SESSION['PO'.$identifier]->OrderNo . '</a>
<br />
<h4>' . _('Receive controlled item'). ' '. $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' ' . _('on order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</h4>
</div>';
/** vars needed by InputSerialItem : **/
$LocationOut = $_SESSION['PO'.$identifier]->Location;
$ItemMustExist = false;
$StockID = $LineItem->StockID;
$InOutModifier=1;
$ShowExisting = false;
include ('includes/InputSerialItems.php');
//echo '<br /><input type="submit" name=\'AddBatches\' value=\'Enter\' /><br />';
/*TotalQuantity set inside this include file from the sum of the bundles
of the item selected for dispatch */
$_SESSION['PO'.$identifier]->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity;
include( 'includes/footer.php');
?>