From: <ex...@us...> - 2013-08-14 09:03:01
|
Revision: 6202 http://sourceforge.net/p/web-erp/reponame/6202 Author: exsonqu Date: 2013-08-14 09:02:58 +0000 (Wed, 14 Aug 2013) Log Message: ----------- 14/8/2013 Exson: html5 compatible Modified Paths: -------------- trunk/WorkOrderReceive.php Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2013-08-14 08:39:27 UTC (rev 6201) +++ trunk/WorkOrderReceive.php 2013-08-14 09:02:58 UTC (rev 6202) @@ -856,7 +856,7 @@ echo '</tr> <tr>'; } - echo '<td><input type="textbox" name="SerialNo' . $i . '" '; + echo '<td><input type="textbox" name="SerialNo' . $i . '" placeholder="'._('Serial No').'" '; if ($i==0){ echo 'value="' . $StringBitOfLotSNRef . ($LotSNRefNumeric + 1) . '"'; } @@ -898,8 +898,8 @@ if (($i/5 -intval($i/5))==0){ echo '</tr><tr>'; } - echo '<td><input type="textbox" name="BatchRef' . $i . '" value="' . $WOSNRow[0] . '" /></td> - <td><input type="textbox" class="number" name="Qty' . $i . '" /> + echo '<td><input type="textbox" name="BatchRef' . $i . '" value="' . $WOSNRow[0] . '" placeholder="'._('Batch/Lot No').'" /></td> + <td><input type="textbox" class="number" name="Qty' . $i . '" placeholder="'._('Quantity').'" /> <input type="hidden" name="QualityText' . $i . '" value="' . $WOSNRow[2] . '" /> <input type="hidden" name="QtyReqd' . $i . '" value="' . locale_number_format($WOSNRow[1],'Variable') . '" /></td> </tr>'; @@ -909,7 +909,7 @@ } else { // batches/lots yet to be set up enter them manually for ($i=0;$i<15;$i++){ echo '<tr> - <td><input type="textbox" name="BatchRef' . $i .'" '; + <td><input type="textbox" name="BatchRef' . $i .'" placeholder="'._('Batch/Lot No').'" '; if ($i==0){ echo 'value="' . $StringBitOfLotSNRef . ($LotSNRefNumeric + 1) . '"'; @@ -932,7 +932,7 @@ echo '<tr> <td><input type="hidden" name="CountOfInputs" value="1" /></td> <td>' . _('Quantity Received') . ':</td> - <td><input type="text" class="number" name="Qty" /></td> + <td><input type="text" class="number" name="Qty" required="required" title="'._('The input must be numeric').'" placeholder="'._('Received Qty').'" /></td> </tr> </table>'; echo '<br /> @@ -944,4 +944,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2014-02-15 02:12:51
|
Revision: 6576 http://sourceforge.net/p/web-erp/reponame/6576 Author: exsonqu Date: 2014-02-15 02:12:46 +0000 (Sat, 15 Feb 2014) Log Message: ----------- 15/2/14 Exson: Make perishable control available in WorkOrderReceive.php. Modified Paths: -------------- trunk/WorkOrderReceive.php Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2014-02-14 23:29:14 UTC (rev 6575) +++ trunk/WorkOrderReceive.php 2014-02-15 02:12:46 UTC (rev 6576) @@ -63,6 +63,7 @@ stockmaster.serialised, stockmaster.decimalplaces, stockmaster.units, + stockmaster.perishable, woitems.qtyreqd, woitems.qtyrecd, woitems.stdcost, @@ -112,6 +113,13 @@ } } } //end of lot/batch control + + if (!empty($_POST['ExpiryDate'])){ + if(!is_date($_POST['ExpiryDate'])){ + $InputError = true; + prnMsg(_('The Expiry Date should be in date format'),'error'); + } + } } else { //not controlled - an easy one! if (!is_numeric(filter_number_format($_POST['Qty']))){ $InputError=true; @@ -510,6 +518,23 @@ '" . $_POST['SerialNo' . $i] . "', 1, '" . $QualityText . "')"; + // Store expiry date for perishable product + if(!empty($_POST['ExpiryDate'])){ + + $SQL = "INSERT INTO stockserialitems(stockid, + loccode, + serialno, + quantity, + qualitytext, + expirationdate) + VALUES ('" . $_POST['StockID'] . "', + '" . $_POST['IntoLocation'] . "', + '" . $_POST['SerialNo' . $i] . "', + 1, + '" . $QualityText . "', + '" . FormatDateForSQL($_POST['ExpiryDate']) . "')"; + } + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock item records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -580,6 +605,23 @@ '" . $_POST['BatchRef' . $i] . "', '" . filter_number_format($_POST['Qty'.$i]) . "', '" . $_POST['QualityText'] . "')"; + //If it's a perishable product, add expiry date + + if(!empty($_POST['ExpiryDate'])){ + + $SQL = "INSERT INTO stockserialitems (stockid, + loccode, + serialno, + quantity, + qualitytext, + expirationdate) + VALUES ('" . $_POST['StockID'] . "', + '" . $_POST['IntoLocation'] . "', + '" . $_POST['BatchRef' . $i] . "', + '" . filter_number_format($_POST['Qty'.$i]) . "', + '" . $_POST['QualityText'] . "', + '" . FormatDateForSQL($_POST['ExpiryDate']) . "')"; + } } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock item records was used'); @@ -727,6 +769,7 @@ stockmaster.serialised, stockmaster.decimalplaces, stockmaster.units, + stockmaster.perishable, woitems.qtyreqd, woitems.qtyrecd, woitems.stdcost, @@ -785,8 +828,16 @@ </tr> <tr> <td>' . _('Date Received') . ':</td> - <td>' . Date($_SESSION['DefaultDateFormat']) . '</td> - <td>' . _('Received Into') . ':</td> + <td>' . Date($_SESSION['DefaultDateFormat']) . '</td>'; + //add expiry date for perishable product + if($WORow['perishable']==1){ + echo '<td>' . _('Expiry Date') . ':<td> + <td><input type="text" name="ExpiryDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" + required /> + </td>'; + } + + echo '<td>' . _('Received Into') . ':</td> <td><select name="IntoLocation">'; |
From: <ex...@us...> - 2015-03-13 02:42:21
|
Revision: 7225 http://sourceforge.net/p/web-erp/reponame/7225 Author: exsonqu Date: 2015-03-13 02:42:14 +0000 (Fri, 13 Mar 2015) Log Message: ----------- 13/03/15 Exson: fixed the undefined index noise in WorkOrderReceive.php. Modified Paths: -------------- trunk/WorkOrderReceive.php Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2015-03-13 02:32:31 UTC (rev 7224) +++ trunk/WorkOrderReceive.php 2015-03-13 02:42:14 UTC (rev 7225) @@ -977,6 +977,8 @@ <td><input type="textbox" name="BatchRef' . $i .'" placeholder="'._('Batch/Lot No').'" '; if ($i==0){ + $StringBitOfLotSNRef = isset($StringBitOfLotSNRef)?$StringBitOfLotSNRef:''; + $LotSNRefNumeric = isset($LotSNRefNumeric)?$LotSNRefNumeric:''; echo 'value="' . $StringBitOfLotSNRef . ($LotSNRefNumeric + 1) . '"'; } echo ' /></td> @@ -1009,4 +1011,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2015-05-09 11:11:15
|
Revision: 7293 http://sourceforge.net/p/web-erp/reponame/7293 Author: exsonqu Date: 2015-05-09 11:11:13 +0000 (Sat, 09 May 2015) Log Message: ----------- 09/05/15 Exson: Fixed no input filtering bug which cause input failure and location quantity become mess in WorkOrderReceive.php. But the transaction failure maybe still there. Modified Paths: -------------- trunk/WorkOrderReceive.php Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2015-05-08 14:42:02 UTC (rev 7292) +++ trunk/WorkOrderReceive.php 2015-05-09 11:11:13 UTC (rev 7293) @@ -22,11 +22,14 @@ } echo '<div> <a href="'. $RootPath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a> - <br /> - <a href="'. $RootPath . '/WorkOrderCosting.php?WO=' . $SelectedWO . '">' . _('Back to Costing'). '</a> - <br /> - </div>'; + <br />'; +if(isset($SelectedWO)){ + echo '<a href="'. $RootPath . '/WorkOrderCosting.php?WO=' . $SelectedWO . '">' . _('Back to Costing'). '</a> + <br />'; +} +echo '</div>'; + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . '</p>'; @@ -107,8 +110,12 @@ } } } else { //controlled but not serialised - just lot/batch control - for ($i=0;$i<15;$i++){ - if (mb_strlen($_POST['BatchRef' . $i])>0){ + for ($i=0;$i<$_POST['CountOfInputs'];$i++){ + if(isset($_POST['Qty' . $i]) AND trim($_POST['Qty' . $i]) != '' AND !is_numeric($_POST['Qty' . $i])) { + $InputError = true; + prnMsg(_('The quantity entered is not numeric - a number is expected'),'error'); + } + if (mb_strlen($_POST['BatchRef' . $i])>0 AND (is_numeric($_POST['Qty' . $i]) AND ABS($_POST['Qty' . $i])>0)){ $QuantityReceived += filter_number_format($_POST['Qty' .$i]); } } @@ -452,7 +459,6 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); - $WOReceiptNo = GetNextTransNo(26,$db); /*Insert stock movements - with unit cost */ @@ -576,7 +582,7 @@ /* We need to add the StockSerialItem record and The StockSerialMoves as well */ //need to test if the batch/lot exists first already - if (trim($_POST['BatchRef' .$i]) != ""){ + if (trim($_POST['BatchRef' .$i]) != "" AND (is_numeric($_POST['Qty' . $i]) AND ABS($_POST['Qty' . $i]>0))){ $LastRef = trim($_POST['BatchRef' .$i]); $SQL = "SELECT COUNT(*) FROM stockserialitems WHERE stockid='" . $_POST['StockID'] . "' @@ -597,7 +603,7 @@ WHERE stockid='" . $_POST['StockID'] . "' AND loccode = '" . $_POST['IntoLocation'] . "' AND serialno = '" . $_POST['BatchRef' .$i] . "'"; - } else { + } else if($_POST['Qty' . $i]>0) {//only the positive quantity can be insert into database; if(empty($_POST['ExpiryDate'])){ $SQL = "INSERT INTO stockserialitems (stockid, loccode, @@ -626,6 +632,10 @@ '" . $_POST['QualityText'] . "', '" . FormatDateForSQL($_POST['ExpiryDate']) . "')"; } + } else { + prnMsg(_('The input quantity should not be negative since there are no this lot no existed'),'error'); + include('includes/footer.inc'); + exit; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock item records was used'); @@ -656,7 +666,7 @@ $BatchTotQtyResult = DB_query($SQL); $BatchTotQtyRow = DB_fetch_row($BatchTotQtyResult); - if ($BatchTotQtyRow[0] >= $_POST['QtyReqd'.$i]){ + /* if ($BatchTotQtyRow[0] >= $_POST['QtyReqd'.$i]){ //need to delete the item from woserialnos $SQL = "DELETE FROM woserialnos WHERE wo='" . $_POST['WO'] . "' @@ -665,7 +675,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The predefined batch/lot/bundle record could not be deleted because'); $DbgMsg = _('The following SQL to delete the predefined work order batch/bundle/lot record was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); - } + } */ } if ($_SESSION['QualityLogSamples']==1) { CreateQASample($_POST['StockID'],$_POST['BatchRef'.$i], '', 'Created from Work Order', 0 ,0,$db); |