Skip to content

Commit cac9b6a

Browse files
authored
Update StockMovements.php
1 parent 31ea27f commit cac9b6a

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

StockMovements.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/* $Id$*/
3+
/* $Id: StockMovements.php 7957 2018-02-12 21:53:28Z turbopt $*/
44

55
include('includes/session.php');
66
$Title = _('Stock Movements');
@@ -34,10 +34,10 @@
3434
<div>
3535
<input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />';
3636

37-
if (!isset($_POST['BeforeDate']) OR !Is_Date($_POST['BeforeDate'])){
37+
if (!isset($_POST['BeforeDate']) OR !Is_date($_POST['BeforeDate'])){
3838
$_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']);
3939
}
40-
if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){
40+
if (!isset($_POST['AfterDate']) OR !Is_date($_POST['AfterDate'])){
4141
$_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y')));
4242
}
4343

@@ -57,20 +57,20 @@
5757
AND locationusers.canview=1
5858
ORDER BY locationname";
5959

60-
$resultStkLocs = DB_query($sql);
60+
$resultStkLocs = DB_query($SQL);
6161

6262
while ($myrow=DB_fetch_array($resultStkLocs)){
6363
if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){
6464
if ($myrow['loccode'] == $_POST['StockLocation']){
65-
echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
65+
echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
6666
} else {
67-
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
67+
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
6868
}
6969
} elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){
70-
echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
71-
$_POST['StockLocation']=$myrow['loccode'];
70+
echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
71+
$_POST['StockLocation']=$myrow['loccode'];
7272
} else {
73-
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
73+
echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
7474
}
7575
}
7676

@@ -87,7 +87,7 @@
8787
$SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']);
8888
$SQLAfterDate = FormatDateForSQL($_POST['AfterDate']);
8989

90-
$sql = "SELECT stockmoves.stockid,
90+
$SQL = "SELECT stockmoves.stockid,
9191
systypes.typename,
9292
stockmoves.stkmoveno,
9393
stockmoves.type,
@@ -111,30 +111,30 @@
111111
ON stockmoves.stockid=stockmaster.stockid
112112
WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "'
113113
AND stockmoves.trandate >= '" . $SQLAfterDate . "'
114-
AND stockmoves.stockid = '" . $StockID . "'
115-
AND stockmoves.trandate <= '" . $SQLBeforeDate . "'
116-
AND hidemovt=0
114+
AND stockmoves.stockid = '" . $StockID . "'
115+
AND stockmoves.trandate <= '" . $SQLBeforeDate . "'
116+
AND hidemovt=0
117117
ORDER BY stkmoveno DESC";
118118

119119
$ErrMsg = _('The stock movements for the selected criteria could not be retrieved because') . ' - ';
120120
$DbgMsg = _('The SQL that failed was') . ' ';
121121

122-
$MovtsResult = DB_query($sql, $ErrMsg, $DbgMsg);
122+
$MovtsResult = DB_query($SQL, $ErrMsg, $DbgMsg);
123123

124124
if (DB_num_rows($MovtsResult) > 0) {
125125
$myrow = DB_fetch_array($MovtsResult);
126126

127127
echo '<tr>
128-
<th>' . _('Type') . '</th>
129-
<th>' . _('Number') . '</th>
130-
<th>' . _('Date') . '</th>
131-
<th>' . _('User ID') . '</th>
132-
<th>' . _('Customer') . '</th>
133-
<th>' . _('Branch') . '</th>
134-
<th>' . _('Quantity') . '</th>
135-
<th>' . _('Reference') . '</th>
136-
<th>' . _('Price') . '</th>
137-
<th>' . _('Discount') . '</th>
128+
<th>' . _('Type') . '</th>
129+
<th>' . _('Number') . '</th>
130+
<th>' . _('Date') . '</th>
131+
<th>' . _('User ID') . '</th>
132+
<th>' . _('Customer') . '</th>
133+
<th>' . _('Branch') . '</th>
134+
<th>' . _('Quantity') . '</th>
135+
<th>' . _('Reference') . '</th>
136+
<th>' . _('Price') . '</th>
137+
<th>' . _('Discount') . '</th>
138138
<th>' . _('New Qty') . '</th>';
139139
if ($myrow['controlled'] == 1) {
140140
echo '<th>', _('Serial No.'), '</th>';
@@ -145,7 +145,7 @@
145145

146146
while ($myrow = DB_fetch_array($MovtsResult)) {
147147

148-
$DisplayTranDate = ConvertSQLDate($myrow['trandate']);
148+
$DisplayTranDate = ConvertSQLDate($myrow['trandate']);
149149

150150
$SerialSQL = "SELECT serialno, moveqty FROM stockserialmoves WHERE stockmoveno='" . $myrow['stkmoveno'] . "'";
151151
$SerialResult = DB_query($SerialSQL);
@@ -179,7 +179,7 @@
179179
}
180180
echo '</tr>';
181181

182-
} elseif ($myrow['type']==11){
182+
} elseif ($myrow['type']==11){
183183

184184
echo '<tr class="striped_row">
185185
<td><a target="_blank" href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', urlencode($myrow['transno']), '&amp;InvOrCredit=Credit">', $myrow['typename'], '</a></td>
@@ -198,7 +198,7 @@
198198
}
199199
echo '</tr>';
200200

201-
} else {
201+
} else {
202202

203203
echo '<tr class="striped_row">
204204
<td>', $myrow['typename'], '</td>
@@ -230,8 +230,8 @@
230230
<br /><a href="', $RootPath, '/SelectSalesOrder.php?SelectedStockItem=', urlencode($StockID), '&amp;StockLocation=', urlencode($_POST['StockLocation']), '">', _('Search Outstanding Sales Orders'), '</a>
231231
<br /><a href="', $RootPath, '/SelectCompletedOrder.php?SelectedStockItem=', urlencode($StockID), '">', _('Search Completed Sales Orders'), '</a>
232232
</div>
233-
</div>
234-
</form>';
233+
</div>
234+
</form>';
235235

236236
include('includes/footer.php');
237237

0 commit comments

Comments
 (0)