|
From: <dai...@us...> - 2014-04-06 02:43:47
|
Revision: 6671
http://sourceforge.net/p/web-erp/reponame/6671
Author: daintree
Date: 2014-04-06 02:43:36 +0000 (Sun, 06 Apr 2014)
Log Message:
-----------
Andrew Galuski mods
Modified Paths:
--------------
trunk/FormDesigner.php
trunk/GoodsReceived.php
trunk/ReprintGRN.php
trunk/SelectWorkOrder.php
trunk/WorkOrderEntry.php
trunk/WorkOrderIssue.php
trunk/doc/Change.log
trunk/includes/PDFStarter.php
trunk/sql/mysql/upgrade4.11-4.12.sql
Modified: trunk/FormDesigner.php
===================================================================
--- trunk/FormDesigner.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/FormDesigner.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -155,6 +155,18 @@
case 'PickingList.xml':
echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/PDFPickingList.php?' . SID .'TransNo=Preview">';
break;
+ case 'QALabel.xml':
+ echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/PDFQALabel.php?' . SID .'GRNNo=Preview&PONo=1">';
+ break;
+ case 'WOPaperwork.xml':
+ echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/PDFWOPrint.php?' . SID .'WO=Preview">';
+ break;
+ case 'FGLabel.xml':
+ echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/PDFFGLabel.php?' . SID .'WO=Preview">';
+ break;
+ case 'ShippingLabel.xml':
+ echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/PDFShipLabel.php?' . SID .'SO=Preview">';
+ break;
}
} else {
/* otherwise check that the web server has write premissions on the companies
@@ -182,7 +194,8 @@
while (false !== ($file = readdir($handle))) {
if ($file[0]!='.') {
$FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$file);
- echo '<option value="'.$file.'">' . _($FormDesign['name']) . '</option>';
+ //echo "name is". $FormDesign['name'];
+ echo '<option value="'.$file.'">' . /*_(*/ $FormDesign['name'] /*)*/ . '</option>';
}
}
closedir($handle);
@@ -205,7 +218,7 @@
_('All measurements are in PostScript points (72 points = 25,4 mm).') . '<br /> '.
_('All coordinates are measured from the lower left corner of the sheet to the top left corner of the element.') . '</div><br />';
-$Papers=array('A4_Landscape', 'A4_Portrait', 'A5_Landscape', 'A5_Portrait', 'A3_Landscape', 'A3_Portrait', 'Letter_Portrait', 'Letter_Landscape', 'Legal_Portrait', 'Legal_Landscape'); // Possible paper sizes/orientations
+$Papers=array('A4_Landscape', 'A4_Portrait', 'A5_Landscape', 'A5_Portrait', 'A6_Landscape', 'A3_Landscape', 'A3_Portrait', 'Letter_Portrait', 'Letter_Landscape', 'Legal_Portrait', 'Legal_Landscape'); // Possible paper sizes/orientations amg adds A6
echo '<form method="post" id="Form" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . '">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
Modified: trunk/GoodsReceived.php
===================================================================
--- trunk/GoodsReceived.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/GoodsReceived.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -304,19 +304,7 @@
$Changes=0;
$LineNo=1;
- if(DB_num_rows($Result)==0){//Those goods must have been received by another user. So should destroy the session data and show warning to users
- prnMsg(_('This order has been changed or invoiced since this delivery was started to be actioned').' . '._('Processing halted'),'error');
- echo '<div class="centre"><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' .
- _('Select a different purchase order for receiving goods against') . '</a></div>';
- unset($_SESSION['PO'.$identifier]->LineItems);
- unset($_SESSION['PO'.$identifier]);
- unset($_POST['ProcessGoodsReceived']);
- echo '</div>';
- echo '</form>';
- include ('includes/footer.inc');
- exit;
- }
while ($myrow = DB_fetch_array($Result)) {
if ($_SESSION['PO'.$identifier]->LineItems[$LineNo]->GLCode != $myrow['glcode'] OR
@@ -745,8 +733,11 @@
<a href="PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'">' . _('Print this Goods Received Note (GRN)') . '</a>
<br />
<br />
+ <a href="PDFQALabel.php?GRNNo='.$GRN .'&PONo='.$PONo.'">' . _('Print QA Labels for this Receipt') . '</a>
+ <br />
+ <br />
<a href="' . $RootPath . '/PO_SelectOSPurchOrder.php">' . _('Select a different purchase order for receiving goods against'). '</a>
- </div>';
+ </div>';
/*end of process goods received entry */
echo '</div>';
echo '</form>';
Modified: trunk/ReprintGRN.php
===================================================================
--- trunk/ReprintGRN.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/ReprintGRN.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -85,7 +85,8 @@
<th>' . _('Item Description') . '</th>
<th>' . _('Delivery Date') . '</th>
<th>' . _('Quantity Received') . '</th>
- </tr>';
+ <th>' . _('Action') . '</th>
+ </tr>';
while ($myrow=DB_fetch_array($result)) {
if ($k==1){
@@ -102,8 +103,9 @@
<td>' . $myrow['itemdescription'] . '</td>
<td>' . $myrow['deliverydate'] . '</td>
<td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>
- <td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>
- </tr>';
+ <td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint GRN ') . '</a>
+ <a href="PDFQALabel.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint QA Label') . '</a></td>
+ </tr>';
}
echo '</table>';
}
Modified: trunk/SelectWorkOrder.php
===================================================================
--- trunk/SelectWorkOrder.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/SelectWorkOrder.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -321,13 +321,14 @@
<th>' . _('Receive') . '</th>
<th>' . _('Issue To') . '</th>
<th>' . _('Costing') . '</th>
+ <th>' . _('Paperwork') . '</th>
<th class="ascending">' . _('Item') . '</th>
<th class="ascending">' . _('Quantity Required') . '</th>
<th class="ascending">' . _('Quantity Received') . '</th>
<th class="ascending">' . _('Quantity Outstanding') . '</th>
<th class="ascending">' . _('Start Date') . '</th>
<th class="ascending">' . _('Required Date') . '</th>
- </tr>';
+ </tr>';
$k=0; //row colour counter
while ($myrow=DB_fetch_array($WorkOrdersResult)) {
@@ -345,6 +346,7 @@
$Receive_WO = $RootPath . '/WorkOrderReceive.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid'];
$Issue_WO = $RootPath . '/WorkOrderIssue.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid'];
$Costing_WO =$RootPath . '/WorkOrderCosting.php?WO=' .$myrow['wo'];
+ $Printing_WO =$RootPath . '/PDFWOPrint.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid'];
$FormatedRequiredByDate = ConvertSQLDate($myrow['requiredby']);
$FormatedStartDate = ConvertSQLDate($myrow['startdate']);
@@ -355,6 +357,7 @@
<td><a href="%s">' . _('Receive') . '</a></td>
<td><a href="%s">' . _('Issue To') . '</a></td>
<td><a href="%s">' . _('Costing') . '</a></td>
+ <td><a href="%s">' . _('Print W/O') . '</a></td>
<td>%s - %s</td>
<td class="number">%s</td>
<td class="number">%s</td>
@@ -368,13 +371,14 @@
$Receive_WO,
$Issue_WO,
$Costing_WO,
+ $Printing_WO,
$myrow['stockid'],
$myrow['description'],
locale_number_format($myrow['qtyreqd'],$myrow['decimalplaces']),
locale_number_format($myrow['qtyrecd'],$myrow['decimalplaces']),
locale_number_format($myrow['qtyreqd']-$myrow['qtyrecd'],$myrow['decimalplaces']),
$FormatedStartDate,
- $FormatedRequiredByDate);
+ $FormatedRequiredByDate);
//end of page full new headings if
}
//end of while loop
Modified: trunk/WorkOrderEntry.php
===================================================================
--- trunk/WorkOrderEntry.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/WorkOrderEntry.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -196,10 +196,8 @@
if (!isset($Offset)) {
$Offset=0;
}
- if($Offset<0){
- $Offset=0;
- }
- if($Offset>$ListPageMax AND $ListPageMax>0 )$Offset=$ListPageMax;
+ if($Offset<0)$Offset=0;
+ if($Offset>$ListPageMax)$Offset=$ListPageMax;
$sql = $sql . ' LIMIT ' . $_SESSION['DisplayRecordsMax'].' OFFSET ' . strval($_SESSION['DisplayRecordsMax']*$Offset);
@@ -293,7 +291,7 @@
'" . $NewItem . "',
'" . $EOQ . "',
'" . $Cost . "'
- )";
+ )";
$ErrMsg = _('The work order item could not be added');
$result = DB_query($sql,$db,$ErrMsg);
@@ -354,6 +352,9 @@
if (!isset($_POST['NextLotSNRef'.$i])) {
$_POST['NextLotSNRef'.$i]='';
}
+ if (!isset($_POST['WOComments'.$i])) {
+ $_POST['WOComments'.$i]='';
+ }
if (isset($_POST['QtyRecd'.$i]) AND $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){
$_POST['OutputQty'.$i]=$_POST['QtyRecd'.$i]; //OutputQty must be >= Qty already reced
}
@@ -375,14 +376,16 @@
}
$sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "',
nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."',
- stdcost ='" . $Cost . "'
+ stdcost ='" . $Cost . "',
+ comments = '". $_POST['WOComments'.$i] ."'
WHERE wo='" . $_POST['WO'] . "'
- AND stockid='" . $_POST['OutputItem'.$i] . "'";
+ AND stockid='" . $_POST['OutputItem'.$i] . "'";
} elseif (isset($_POST['HasWOSerialNos'.$i]) AND $_POST['HasWOSerialNos'.$i]==false) {
$sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "',
- nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."'
+ nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."',
+ comments = '". $_POST['WOComments'.$i] ."'
WHERE wo='" . $_POST['WO'] . "'
- AND stockid='" . $_POST['OutputItem'.$i] . "'";
+ AND stockid='" . $_POST['OutputItem'.$i] . "'";
}
}
@@ -403,6 +406,7 @@
unset($_POST['QtyRecd'.$i]);
unset($_POST['NetLotSNRef'.$i]);
unset($_POST['HasWOSerialNos'.$i]);
+ unset($_POST['WOComments'.$i]);
}
}
} elseif (isset($_POST['delete'])) {
@@ -451,6 +455,7 @@
unset($_POST['QtyRecd'.$i]);
unset($_POST['NetLotSNRef'.$i]);
unset($_POST['HasWOSerialNos'.$i]);
+ unset($_POST['WOComments'.$i]);
}
include('includes/footer.inc');
exit;
@@ -490,10 +495,11 @@
controlled,
serialised,
stockmaster.decimalplaces,
- nextserialno
+ nextserialno,
+ woitems.comments
FROM woitems INNER JOIN stockmaster
ON woitems.stockid=stockmaster.stockid
- WHERE wo='" .$_POST['WO'] . "'",$db,$ErrMsg);
+ WHERE wo='" .$_POST['WO'] . "'",$db,$ErrMsg);
$NumberOfOutputs=DB_num_rows($WOItemsResult);
$i=1;
@@ -502,6 +508,7 @@
$_POST['OutputItemDesc'.$i]=$WOItem['description'];
$_POST['OutputQty' . $i]= $WOItem['qtyreqd'];
$_POST['RecdQty' .$i] =$WOItem['qtyrecd'];
+ $_POST['WOComments' .$i] =$WOItem['comments'];
$_POST['DecimalPlaces' . $i] = $WOItem['decimalplaces'];
if ($WOItem['serialised']==1 AND $WOItem['nextserialno']>0){
$_POST['NextLotSNRef' .$i]=$WOItem['nextserialno'];
@@ -558,11 +565,12 @@
echo '</table>
<br /><table class="selection">';
echo '<tr><th>' . _('Output Item') . '</th>
+ <th>' . _('Comments') . '</th>
<th>' . _('Qty Required') . '</th>
<th>' . _('Qty Received') . '</th>
<th>' . _('Balance Remaining') . '</th>
<th>' . _('Next Lot/SN Ref') . '</th>
- </tr>';
+ </tr>';
$j=0;
if (isset($NumberOfOutputs)){
for ($i=1;$i<=$NumberOfOutputs;$i++){
@@ -575,6 +583,7 @@
}
echo '<td><input type="hidden" name="OutputItem' . $i . '" value="' . $_POST['OutputItem' .$i] . '" />' .
$_POST['OutputItem' . $i] . ' - ' . $_POST['OutputItemDesc' .$i] . '</td>';
+ echo'<td><textarea style="width:100%" rows="5" cols="20" name="WOComments' . $i . '" >' . $_POST['WOComments' . $i] . '</textarea></td>';
if ($_POST['Controlled'.$i]==1 AND $_SESSION['DefineControlledOnWOEntry']==1){
echo '<td class="number">' . locale_number_format($_POST['OutputQty' . $i], $_POST['DecimalPlaces' . $i]) . '</td>';
echo '<input type="hidden" name="OutputQty' . $i .'" value="' . locale_number_format($_POST['OutputQty' . $i]-$_POST['RecdQty' .$i], $_POST['DecimalPlaces' . $i]) . '" />';
@@ -739,4 +748,4 @@
echo '</form>';
include('includes/footer.inc');
-?>
\ No newline at end of file
+?>
Modified: trunk/WorkOrderIssue.php
===================================================================
--- trunk/WorkOrderIssue.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/WorkOrderIssue.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -89,6 +89,26 @@
$InputError=1;
} else {
$QuantityIssued += filter_number_format($_POST['Qty'.$i]);
+
+ if ($_SESSION['ProhibitNegativeStock']==1 and $_POST['BatchRef'.$i] > "") {
+ $SQL = "SELECT quantity from stockserialitems WHERE (stockid= '" . $_POST['IssueItem'] . "')
+ AND (loccode = '" . $_POST['FromLocation'] . "')
+ AND (serialno = '" . $_POST['BatchRef'.$i] . "')";
+ $Result = DB_query($SQL,$db);
+ //$CheckLot = DB_fetch_array($Result);
+ if (DB_num_rows($Result)==0){
+ $InputError = true;
+ prnMsg(_('This issue cannot be processed because the system parameter is set to prohibit negative stock and this batch does not exist'),'error');
+ }
+ else {
+ $CheckLotRow = DB_fetch_row($Result);
+ if ($CheckLotRow[0]<$_POST['Qty'.$i]){
+ $InputError = true;
+ prnMsg(_('This issue cannot be processed because the system parameter is set to prohibit negative stock and this issue would result in this batch going into negative. Please correct the stock first before attempting another issue'),'error');
+ }
+ }
+ }
+
} //end if the qty field is numeric
} // end if the qty field is entered
}//end for the 15 fields available for batch/lot entry
@@ -111,6 +131,7 @@
if ($_SESSION['ProhibitNegativeStock']==1
AND ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B')){
//don't need to check labour or dummy items
+
$SQL = "SELECT quantity FROM locstock
WHERE stockid ='" . $_POST['IssueItem'] . "'
AND loccode ='" . $_POST['FromLocation'] . "'";
@@ -120,7 +141,6 @@
$InputError = true;
prnMsg(_('This issue cannot be processed because the system parameter is set to prohibit negative stock and this issue would result in stock going into negative. Please correct the stock first before attempting another issue'),'error');
}
-
}
if ($InputError==false){
@@ -280,7 +300,7 @@
VALUES ('" . $StkMoveNo . "',
'" . $_POST['IssueItem'] . "',
'" . $_POST['BatchRef'.$i] . "',
- '" . filter_number_format($_POST['Qty'.$i]) . "')";
+ '" . filter_number_format($_POST['Qty'.$i])*-1 . "')";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because');
$DbgMsg = _('The following SQL to insert the serial stock movement records was used');
$Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/doc/Change.log 2014-04-06 02:43:36 UTC (rev 6671)
@@ -1,5 +1,6 @@
webERP Change Log
+6/4/14 Andrew Galuski: Extensions for printing WO documentation new labels and links to print
05/04/14 rchacon: Fixes the bug that emptied ItemDescriptionLanguages.
05/04/14 Exson: Add decimal places check for controlled items quantity input in Add_SerialItems.php and InputSerialItems.php.The wrong decimal places will make this sections quite buggy and problem prone.
05/04/14 Exson: Add a decimal places check in StockAdjustments.php to prevent from wrong decimal places input.
Modified: trunk/includes/PDFStarter.php
===================================================================
--- trunk/includes/PDFStarter.php 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/includes/PDFStarter.php 2014-04-06 02:43:36 UTC (rev 6671)
@@ -160,6 +160,18 @@
$Left_Margin = 36; // Half inch = 72/2
$Right_Margin = 36; // Half inch = 72/2
break;
+
+ case 'A6_Landscape':
+ $DocumentPaper = 'A6';
+ $DocumentOrientation ='L';
+ $Page_Width=417;
+ $Page_Height=295;
+ $Top_Margin=10;
+ $Bottom_Margin=10;
+ $Left_Margin=10;
+ $Right_Margin=10;
+ break;
+
default:
$DocumentOrientation = 'L';
break;
@@ -182,4 +194,5 @@
$pdf->AddPage();
$pdf->cMargin = 0;
/* END Brought from class.pdf.php constructor */
-?>
\ No newline at end of file
+
+?>
Modified: trunk/sql/mysql/upgrade4.11-4.12.sql
===================================================================
--- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-04-05 23:40:13 UTC (rev 6670)
+++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-04-06 02:43:36 UTC (rev 6671)
@@ -1,5 +1,9 @@
INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('600', 'Auto Supplier Number', '0');
INSERT INTO config (confname, confvalue) VALUES ('AutoSupplierNo', '0');
DELETE FROM config WHERE confname='DefaultTheme';
+INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description` ) VALUES ('PDFWOPrint.php', '11', 'Produces W/O Paperwork');
+INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description` ) VALUES ('PDFFGLabel.php', '11', 'Produces FG Labels');
+INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description` ) VALUES ('PDFQALabel.php', '2', 'Produces a QA label on receipt of stock');
+ALTER TABLE `woitems` ADD `comments` LONGBLOB NULL DEFAULT NULL ;
UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber';
|