From: <dai...@us...> - 2014-01-24 20:32:34
|
Revision: 6549 http://sourceforge.net/p/web-erp/reponame/6549 Author: daintree Date: 2014-01-24 20:32:31 +0000 (Fri, 24 Jan 2014) Log Message: ----------- Andrew Galuski work and fix ups as advised by Tim Modified Paths: -------------- trunk/PDFGrn.php trunk/PDFStockTransfer.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/PDFGrnHeader.inc trunk/sql/mysql/upgrade4.11.2-4.11.3.sql Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2014-01-24 09:27:46 UTC (rev 6548) +++ trunk/PDFGrn.php 2014-01-24 20:32:31 UTC (rev 6549) @@ -14,9 +14,9 @@ // Set the paper size/orintation $PaperSize = $FormDesign->PaperSize; -$PageNumber=1; $line_height=$FormDesign->LineHeight; include('includes/PDFStarter.php'); +$PageNumber=1; $pdf->addInfo('Title', _('Goods Received Note') ); if ($GRNNo == 'Preview'){ @@ -98,18 +98,25 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$Page_Height-$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize, $myrow['itemcode']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $myrow['itemdescription']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate); + /*resmart mods */ + /*$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate);*/ + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate, 'right'); + /*resmart ends*/ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x,$Page_Height-$YPos,$FormDesign->Data->Column4->Length,$FormDesign->Data->Column4->FontSize, $SuppliersQuantity, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x,$Page_Height-$YPos,$FormDesign->Data->Column5->Length,$FormDesign->Data->Column5->FontSize, $myrow['suppliersunit'], 'left'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x,$Page_Height-$YPos,$FormDesign->Data->Column6->Length,$FormDesign->Data->Column6->FontSize, $OurUnitsQuantity, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x,$Page_Height-$YPos,$FormDesign->Data->Column7->Length,$FormDesign->Data->Column7->FontSize, $myrow['units'], 'left'); $YPos += $line_height; + /*resmoart mods*/ + /* move to after serial print if($FooterPrintedInPage == 0){ $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize, _('Date of Receipt: ') . $DeliveryDate); $LeftOvers = $pdf->addText($FormDesign->SignedFor->x,$Page_Height-$FormDesign->SignedFor->y,$FormDesign->SignedFor->FontSize, _('Signed for ').'______________________'); $FooterPrintedInPage= 1; } + */ + /*resmart ends*/ if ($YPos >= $FormDesign->LineAboveFooter->starty){ /* We reached the end of the page so finsih off the page and start a newy */ @@ -118,6 +125,48 @@ $YPos=$FormDesign->Data->y; include ('includes/PDFGrnHeader.inc'); } //end if need a new page headed up + + /*resmart mods*/ + $SQL = "SELECT stockmaster.controlled + FROM stockmaster WHERE stockid ='" . $myrow['itemcode'] . "'"; + $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); + $ControlledRow = DB_fetch_row($CheckControlledResult); + + if ($ControlledRow[0]==1) { /*Then its a controlled item */ + $SQL = "SELECT stockserialmoves.serialno, + stockserialmoves.moveqty + FROM stockmoves INNER JOIN stockserialmoves + ON stockmoves.stkmoveno= stockserialmoves.stockmoveno + WHERE stockmoves.stockid='" . $myrow['itemcode'] . "' + AND stockmoves.type =25 + AND stockmoves.transno='" . $GRNNo . "'"; + $GetStockMoveResult = DB_query($SQL,$db,_('Could not retrieve the stock movement reference number which is required in order to retrieve details of the serial items that came in with this GRN')); + while ($SerialStockMoves = DB_fetch_array($GetStockMoveResult)){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x-20,$Page_Height-$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize, _('Lot/Serial:'),'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $SerialStockMoves['serialno']); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $SerialStockMoves['moveqty'],'right'); + $YPos += $line_height; + + if ($YPos >= $FormDesign->LineAboveFooter->starty){ + $FooterPrintedInPage= 0; + $YPos=$FormDesign->Data->y; + include ('includes/PDFGrnHeader.inc'); + } //end if need a new page headed up + } //while SerialStockMoves + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, ' '); + $YPos += $line_height; + if ($YPos >= $FormDesign->LineAboveFooter->starty){ + $FooterPrintedInPage= 0; + $YPos=$FormDesign->Data->y; + include ('includes/PDFGrnHeader.inc'); + } //end if need a new page headed up + } //controlled item*/ + /*resmart ends*/ + if($FooterPrintedInPage == 0){ + $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize, _('Date of Receipt: ') . $DeliveryDate); + $LeftOvers = $pdf->addText($FormDesign->SignedFor->x,$Page_Height-$FormDesign->SignedFor->y,$FormDesign->SignedFor->FontSize, _('Signed for ').'______________________'); + $FooterPrintedInPage= 1; + } } //end of loop around GRNs to print Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2014-01-24 09:27:46 UTC (rev 6548) +++ trunk/PDFStockTransfer.php 2014-01-24 20:32:31 UTC (rev 6549) @@ -86,7 +86,10 @@ $Description=$myrow['description']; $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos-10,300-$Left_Margin,$FontSize, $StockID); - $LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize-2, $Description); + /*resmoart mods*/ + /*$LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize-2, $Description);*/ + $LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize, $Description); + /*resmart ends*/ $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos-10,300-$Left_Margin,$FontSize, $From); $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos-10,300-$Left_Margin,$FontSize, $To); $LeftOvers = $pdf->addTextWrap($Left_Margin+475,$YPos-10,300-$Left_Margin,$FontSize, $Quantity); @@ -96,6 +99,39 @@ if ($YPos < $Bottom_Margin + $line_height){ include('includes/PDFStockTransferHeader.inc'); } + /*resmart mods*/ + $SQL = "SELECT stockmaster.controlled + FROM stockmaster WHERE stockid ='" . $StockID . "'"; + $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); + $ControlledRow = DB_fetch_row($CheckControlledResult); + + if ($ControlledRow[0]==1) { /*Then its a controlled item */ + $SQL = "SELECT stockserialmoves.serialno, + stockserialmoves.moveqty + FROM stockmoves INNER JOIN stockserialmoves + ON stockmoves.stkmoveno= stockserialmoves.stockmoveno + WHERE stockmoves.stockid='" . $StockID . "' + AND stockmoves.type =16 + AND qty > 0 + AND stockmoves.transno='" .$_GET['TransferNo']. "'"; + $GetStockMoveResult = DB_query($SQL,$db,_('Could not retrieve the stock movement reference number which is required in order to retrieve details of the serial items that came in with this GRN')); + while ($SerialStockMoves = DB_fetch_array($GetStockMoveResult)){ + $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos-10,300-$Left_Margin,$FontSize, _('Lot/Serial:')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize, $SerialStockMoves['serialno']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos-10,300-$Left_Margin,$FontSize, $SerialStockMoves['moveqty']); + $YPos=$YPos-$line_height; + + if ($YPos < $Bottom_Margin + $line_height){ + include('includes/PDFStockTransferHeader.inc'); + } //while SerialStockMoves + } + $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos-10,300-$Left_Margin,$FontSize, ' '); + $YPos=$YPos-$line_height; + if ($YPos < $Bottom_Margin + $line_height){ + include('includes/PDFStockTransferHeader.inc'); + } //controlled item*/ + } + /*resmart ends*/ } $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos-70,300-$Left_Margin,$FontSize, _('Date of transfer: ').$Date); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2014-01-24 09:27:46 UTC (rev 6548) +++ trunk/SelectOrderItems.php 2014-01-24 20:32:31 UTC (rev 6549) @@ -1083,7 +1083,8 @@ if(isset($_GET['Delete'])){ //page called attempting to delete a line - GET['Delete'] = the line number to delete - if($_SESSION['Items'.$identifier]->Some_Already_Delivered($_GET['Delete']) == 0){ + $QuantityAlreadyDelivered = $_SESSION['Items'.$identifier]->Some_Already_Delivered($_GET['Delete']); + if($QuantityAlreadyDelivered == 0){ $_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete'], 'Yes', $identifier); /*Do update DB */ } else { $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-01-24 09:27:46 UTC (rev 6548) +++ trunk/doc/Change.log 2014-01-24 20:32:31 UTC (rev 6549) @@ -1,5 +1,6 @@ webERP Change Log +24/1/14 Andrew Galuski: Display serial items on GRN printouts 23/1/14 Phil: Fixed incompatible error traps on hyphens between new customers and new branches. Now both allow hyphens. Also prevented deletion of the last customer branch. Customer branches are now deleted when a customer is attempted to be deleted provided there are no dependent records. 19/01/14 Exson: Add sales man login control and modify the PDF to download to harmony with other files and solve backward failure problem in PrintCustStatements.php. 18/01/14 Paul T: Change property name value to uppercase to match use in the script. [causing input loss] Modified: trunk/includes/PDFGrnHeader.inc =================================================================== --- trunk/includes/PDFGrnHeader.inc 2014-01-24 09:27:46 UTC (rev 6548) +++ trunk/includes/PDFGrnHeader.inc 2014-01-24 20:32:31 UTC (rev 6549) @@ -27,7 +27,10 @@ /*set up the headings */ $LeftOvers = $pdf->addText($FormDesign->Headings->Column1->x,$Page_Height - $FormDesign->Headings->Column1->y, $FormDesign->Headings->Column1->FontSize, _('Item Number')); $LeftOvers = $pdf->addText($FormDesign->Headings->Column2->x,$Page_Height - $FormDesign->Headings->Column2->y, $FormDesign->Headings->Column2->FontSize, _('Description')); -$LeftOvers = $pdf->addText($FormDesign->Headings->Column3->x,$Page_Height - $FormDesign->Headings->Column3->y, $FormDesign->Headings->Column3->FontSize, _('Date Recd')); +/*resmart mods*/ +$LeftOvers = $pdf->addText($FormDesign->Headings->Column3->x,$Page_Height - $FormDesign->Headings->Column3->y, $FormDesign->Headings->Column3->FontSize, str_pad(_('Date Recd'),22,' ',STR_PAD_LEFT)); +//$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column3->x,$Page_Height - $FormDesign->Headings->Column3->y, $FormDesign->Headings->Column4->Length, $FormDesign->Headings->Column3->FontSize, _('Date Recd'), 'right'); +/*resmart ends*/ $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column4->x,$Page_Height - $FormDesign->Headings->Column4->y, $FormDesign->Headings->Column4->Length, $FormDesign->Headings->Column4->FontSize, _('Qty in Suppliers UOM'), 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y, $FormDesign->Headings->Column5->Length, $FormDesign->Headings->Column5->FontSize, _('Qty in Stock UOM'), 'right'); Modified: trunk/sql/mysql/upgrade4.11.2-4.11.3.sql =================================================================== --- trunk/sql/mysql/upgrade4.11.2-4.11.3.sql 2014-01-24 09:27:46 UTC (rev 6548) +++ trunk/sql/mysql/upgrade4.11.2-4.11.3.sql 2014-01-24 20:32:31 UTC (rev 6549) @@ -1,7 +1,7 @@ ALTER table stockmoves CHANGE reference reference varchar(100) NOT NULL DEFAULT ''; -alter table stockcatproperties drop foreign key stockcatproperties_ibfk_2; -alter table stockcatproperties drop foreign key stockcatproperties_ibfk_3; -ALTER TABLE `emailsettings` CHANGE `username` `username` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL +alter table stockcatproperties drop foreign key stockcatproperties_ibfk_2; +alter table stockcatproperties drop foreign key stockcatproperties_ibfk_3; +ALTER TABLE `emailsettings` CHANGE `username` `username` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; CREATE TABLE IF NOT EXISTS `pricematrix` ( `salestype` char(2) NOT NULL DEFAULT '', `stockid` varchar(20) NOT NULL DEFAULT '', |