From: <tim...@us...> - 2010-05-17 17:14:47
|
Revision: 3465 http://web-erp.svn.sourceforge.net/web-erp/?rev=3465&view=rev Author: tim_schofield Date: 2010-05-17 17:14:40 +0000 (Mon, 17 May 2010) Log Message: ----------- Matt Taylor - Changes to MRPPlannedWorkOrders.php Modified Paths: -------------- trunk/MRPPlannedWorkOrders.php trunk/WorkOrderEntry.php trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-3.12.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2010-05-16 06:21:10 UTC (rev 3464) +++ trunk/MRPPlannedWorkOrders.php 2010-05-17 17:14:40 UTC (rev 3465) @@ -16,23 +16,14 @@ include('includes/footer.inc'); exit; } -if (isset($_POST['PrintPDF'])) { +if ( isset($_POST['PrintPDF']) OR isset($_POST['Review']) ) { - include('includes/PDFStarter.php'); - - $pdf->addInfo('Title',_('MRP Planned Work Orders Report')); - $pdf->addInfo('Subject',_('MRP Planned Work Orders')); - - $FontSize=9; - $PageNumber=1; - $line_height=12; - $Xpos = $Left_Margin+1; $wheredate = " "; $reportdate = " "; if (is_Date($_POST['cutoffdate'])) { $formatdate = FormatDateForSQL($_POST['cutoffdate']); $wheredate = ' AND duedate <= "' . $formatdate . '" '; - $reportdate = _(' Through ') . Format_Date($_POST['cutoffdate']); + $reportdate = _(' Through ') . $_POST['cutoffdate']; } if ($_POST['Consolidation'] == 'None') { @@ -122,7 +113,7 @@ exit; } if (DB_num_rows($result)==0){ //then there's nothing to print - $title = _('Print MRP Planned Work Orders'); + $title = _('MRP Planned Work Orders'); include('includes/header.inc'); prnMsg(_('There were no items with demand greater than supply'),'info'); echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; @@ -130,109 +121,201 @@ exit; } - PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$_POST['Consolidation'],$reportdate); - $Total_EXTcost=0; - $Partctr = 0; - $fill = false; - $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted - $FontSize=8; - $holdpart = " "; - $holddescription = " "; - $holdmbflag = " "; - $holdcost = " "; - $holddecimalplaces = 0; - $totalpartqty = 0; - $totalpartcost = 0; - While ($myrow = DB_fetch_array($result,$db)){ - $YPos -=$line_height; + If (isset($_POST['PrintPDF'])) { // Print planned work orders - // Use to alternate between lines with transparent and painted background - if ($_POST['Fill'] == 'yes'){ - $fill=!$fill; - } + include('includes/PDFStarter.php'); - // Print information on part break - if ($Partctr > 0 & $holdpart != $myrow['part']) { - $pdf->addTextWrap(50,$YPos,130,$FontSize,$holddescription,'',0,$fill); - $pdf->addTextWrap(180,$YPos,40,$FontSize,_('Unit Cost: '),'center',0,$fill); - $pdf->addTextWrap(220,$YPos,40,$FontSize,number_format($holdcost,2),'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,number_format($totalpartqty, - $holddecimalplaces),'right',0,$fill); - $pdf->addTextWrap(310,$YPos,60,$FontSize,number_format($totalpartcost,2),'right',0,$fill); - $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); - $totalpartcost = 0; - $totalpartqty = 0; - $YPos -= (2*$line_height); - } + $pdf->addInfo('Title',_('MRP Planned Work Orders Report')); + $pdf->addInfo('Subject',_('MRP Planned Work Orders')); - // Parameters for addTextWrap are defined in /includes/class.pdf.php - // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor - // and False to set to transparent - $FormatedSupDueDate = ConvertSQLDate($myrow['duedate']); - $FormatedSupMRPDate = ConvertSQLDate($myrow['mrpdate']); - $extcost = $myrow['supplyquantity'] * $myrow['computedcost']; - $pdf->addTextWrap($Left_Margin,$YPos,110,$FontSize,$myrow['part'],'',0,$fill); - $pdf->addTextWrap(150,$YPos,50,$FontSize,$FormatedSupDueDate,'right',0,$fill); - $pdf->addTextWrap(200,$YPos,60,$FontSize,$FormatedSupMRPDate,'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,number_format($myrow['supplyquantity'], - $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(310,$YPos,60,$FontSize,number_format($extcost,2),'right',0,$fill); - if ($_POST['Consolidation'] == 'None'){ - $pdf->addTextWrap(370,$YPos,80,$FontSize,$myrow['ordertype'],'right',0,$fill); - $pdf->addTextWrap(450,$YPos,80,$FontSize,$myrow['orderno'],'right',0,$fill); - } else { - $pdf->addTextWrap(370,$YPos,100,$FontSize,$myrow['consolidatedcount'],'right',0,$fill); - }; - $holddescription = $myrow['description']; - $holdpart = $myrow['part']; - $holdmbflag = $myrow['mbflag']; - $holdcost = $myrow['computedcost']; - $holddecimalplaces = $myrow['decimalplaces']; - $totalpartcost += $extcost; - $totalpartqty += $myrow['supplyquantity']; + $FontSize=9; + $PageNumber=1; + $line_height=12; + $Xpos = $Left_Margin+1; - $Total_Extcost += $extcost; - $Partctr++; + PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, + $Page_Width,$Right_Margin,$_POST['Consolidation'],$reportdate); - if ($YPos < $Bottom_Margin + $line_height){ + $Total_EXTcost=0; + $Partctr = 0; + $fill = false; + $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted + $FontSize=8; + $holdpart = " "; + $holddescription = " "; + $holdmbflag = " "; + $holdcost = " "; + $holddecimalplaces = 0; + $totalpartqty = 0; + $totalpartcost = 0; + + While ($myrow = DB_fetch_array($result,$db)){ + $YPos -=$line_height; + + // Use to alternate between lines with transparent and painted background + if ($_POST['Fill'] == 'yes'){ + $fill=!$fill; + } + + // Print information on part break + if ($Partctr > 0 & $holdpart != $myrow['part']) { + $pdf->addTextWrap(50,$YPos,130,$FontSize,$holddescription,'',0,$fill); + $pdf->addTextWrap(180,$YPos,40,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(220,$YPos,40,$FontSize,number_format($holdcost,2),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,number_format($totalpartqty, + $holddecimalplaces),'right',0,$fill); + $pdf->addTextWrap(310,$YPos,60,$FontSize,number_format($totalpartcost,2),'right',0,$fill); + $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); + $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + $totalpartcost = 0; + $totalpartqty = 0; + $YPos -= (2*$line_height); + } + + // Parameters for addTextWrap are defined in /includes/class.pdf.php + // 1) X position 2) Y position 3) Width + // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // and False to set to transparent + $FormatedSupDueDate = ConvertSQLDate($myrow['duedate']); + $FormatedSupMRPDate = ConvertSQLDate($myrow['mrpdate']); + $extcost = $myrow['supplyquantity'] * $myrow['computedcost']; + $pdf->addTextWrap($Left_Margin,$YPos,110,$FontSize,$myrow['part'],'',0,$fill); + $pdf->addTextWrap(150,$YPos,50,$FontSize,$FormatedSupDueDate,'right',0,$fill); + $pdf->addTextWrap(200,$YPos,60,$FontSize,$FormatedSupMRPDate,'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,number_format($myrow['supplyquantity'], + $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(310,$YPos,60,$FontSize,number_format($extcost,2),'right',0,$fill); + if ($_POST['Consolidation'] == 'None'){ + $pdf->addTextWrap(370,$YPos,80,$FontSize,$myrow['ordertype'],'right',0,$fill); + $pdf->addTextWrap(450,$YPos,80,$FontSize,$myrow['orderno'],'right',0,$fill); + } else { + $pdf->addTextWrap(370,$YPos,100,$FontSize,$myrow['consolidatedcount'],'right',0,$fill); + }; + $holddescription = $myrow['description']; + $holdpart = $myrow['part']; + $holdmbflag = $myrow['mbflag']; + $holdcost = $myrow['computedcost']; + $holddecimalplaces = $myrow['decimalplaces']; + $totalpartcost += $extcost; + $totalpartqty += $myrow['supplyquantity']; + + $Total_Extcost += $extcost; + $Partctr++; + + if ($YPos < $Bottom_Margin + $line_height){ + PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, + $Right_Margin,$_POST['Consolidation'],$reportdate); + // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); + } + + } /*end while loop */ + // Print summary information for last part + $YPos -=$line_height; + $pdf->addTextWrap(40,$YPos,130,$FontSize,$holddescription,'',0,$fill); + $pdf->addTextWrap(170,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(220,$YPos,40,$FontSize,number_format($holdcost,2),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,number_format($totalpartqty,$holddecimalplaces),'right',0,$fill); + $pdf->addTextWrap(310,$YPos,60,$FontSize,number_format($totalpartcost,2),'right',0,$fill); + $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); + $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + $FontSize =8; + $YPos -= (2*$line_height); + + if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$reportdate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); + } + /*Print out the grand totals */ + $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Work Orders: '), 'left'); + $pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left'); + $pdf->addTextWrap(200,$YPos,100,$FontSize,_('Total Extended Cost:'), 'right'); + $DisplayTotalVal = number_format($Total_Extcost,2); + $pdf->addTextWrap(310,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_MRP_Planned_Work_Orders_' . Date('Y-m-d') . '.pdf'); + $pdf->__destruct(); + + + + } else { // Review planned work orders + + $title = _('Review/Convert MRP Planned Work Orders'); + include('includes/header.inc'); + + echo " + <br /><br /><form action='MRPConvertWorkOrders.php' method='post'>"; + echo "<div class='centre'><h3>Conolidation: " . $_POST['Consolidation'] . "</h3></div>"; + echo "<div class='centre'><h3>Cutoff Date: " . $_POST['cutoffdate'] . "</h3></div>"; + echo "<table><tr> + <th></th> + <th>" . _('Code') . "</th> + <th>" . _('Description') . "</th> + <th>" . _('MRP Date') . "</th> + <th>" . _('Due Date') . "</th> + <th>" . _('Quantity') . "</th> + <th>" . _('Unit Cost') . "</th> + <th>" . _('Ext. Cost') . "</th> + <th>" . _('Consolidations') . "</th> + </tr>"; + + $totalpartqty = 0; + $totalpartcost = 0; + $j=1; //row ID + $k=0; //row colour counter + While ($myrow = DB_fetch_array($result,$db)){ + + // Alternate row color + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; } - } /*end while loop */ - // Print summary information for last part - $YPos -=$line_height; - $pdf->addTextWrap(40,$YPos,130,$FontSize,$holddescription,'',0,$fill); - $pdf->addTextWrap(170,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); - $pdf->addTextWrap(220,$YPos,40,$FontSize,number_format($holdcost,2),'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,number_format($totalpartqty,$holddecimalplaces),'right',0,$fill); - $pdf->addTextWrap(310,$YPos,60,$FontSize,number_format($totalpartcost,2),'right',0,$fill); - $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); - $FontSize =8; - $YPos -= (2*$line_height); + printf("\n <td><a href='%s/WorkOrderEntry.php?NewItem=%s&ReqQty=%s&ReqDate=%s'>%s</a></td>", + $rootpath, + $myrow['part'], + $myrow['supplyquantity'], + ConvertSQLDate($myrow['duedate']), + _('Convert') + ); + printf("\n <td>%s <input type='hidden' name='%s_part' value='%s' /></td>", $myrow['part'], $j, $myrow['part']); + printf("\n <td>%s</td>", $myrow['description']); + printf("\n <td>%s</td>", ConvertSQLDate($myrow['mrpdate'])); + printf("\n <td>%s</td>", ConvertSQLDate($myrow['duedate'])); + printf("\n <td class=number>%s</td>", number_format($myrow['supplyquantity'],$myrow['decimalplaces'])); + printf("\n <td class=number>%.2f</td>", number_format($myrow['computedcost'],2)); + printf("\n <td class=number>%.2f</td>", number_format($myrow['supplyquantity'] * $myrow['computedcost'],2)); + printf("\n <td class=number>%s</td>", $myrow['consolidatedcount']); + echo "</tr>"; - if ($YPos < $Bottom_Margin + $line_height){ - PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); - // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); + $j++; + $Total_Extcost += ( $myrow['supplyquantity'] * $myrow['computedcost'] ); + + } // end while loop + + // Print out the grand totals + printf(" + <tr><td colspan='4' class='number'>%s %s</td> + <td colspan='4' class='number'>%s %s</td></tr></table> + ", + _('Number of Work Orders: '), + $j-1, + _('Total Extended Cost: '), + number_format($Total_Extcost,2) + ); + + echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + } -/*Print out the grand totals */ - $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Work Orders: '), 'left'); - $pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left'); - $pdf->addTextWrap(200,$YPos,100,$FontSize,_('Total Extended Cost:'), 'right'); - $DisplayTotalVal = number_format($Total_Extcost,2); - $pdf->addTextWrap(310,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_MRP_Planned_Work_Orders_' . Date('Y-m-d') . '.pdf'); - $pdf->__destruct(); + } else { /*The option to print PDF was not hit so display form */ $title=_('MRP Planned Work Orders Reporting'); @@ -249,7 +332,7 @@ echo "<option value='no'>" . _('Plain Print'); echo '</select></td></tr>'; echo '<tr><td>' . _('Cut Off Date') . ":</td><td><input type ='text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='cutoffdate' size='10' value='".date($_SESSION['DefaultDateFormat'])."'></tr>"; - echo "</table></br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table></br><div class='centre'><input type=submit name='Review' value='" . _('Review') . "'> <input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2010-05-16 06:21:10 UTC (rev 3464) +++ trunk/WorkOrderEntry.php 2010-05-17 17:14:40 UTC (rev 3465) @@ -8,33 +8,52 @@ $title = _('Work Order Entry'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . '" alt="">' . ' ' . $title; + + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . '" alt="">' . ' ' . $title; + +if (isset($_GET['ReqDate'])){ + $ReqDate = $_GET['ReqDate']; +} +if (isset($_GET['loccode'])){ + $LocCode = $_GET['loccode']; +} + +// check for new or modify condition if (isset($_REQUEST['WO']) and $_REQUEST['WO']!=''){ + // modify $_POST['WO'] = $_REQUEST['WO']; $EditingExisting = true; } else { + // new $_POST['WO'] = GetNextTransNo(40,$db); - $InsWOResult = DB_query("INSERT INTO workorders (wo, - loccode, - requiredby, - startdate) - VALUES (" . $_POST['WO'] . ", - '" . $_SESSION['UserStockLocation'] . "', - '" . Date('Y-m-d') . "', - '" . Date('Y-m-d'). "')", - $db); + $sql = "INSERT INTO workorders (wo, + loccode, + requiredby, + startdate) + VALUES (" . $_POST['WO'] . ", + '" . (($LocCode) ? $LocCode : $_SESSION['UserStockLocation']) . "', + '" . (($ReqDate) ? $ReqDate : Date('Y-m-d')) . "', + '" . Date('Y-m-d'). "')"; + $InsWOResult = DB_query($sql,$db); } + if (isset($_GET['NewItem'])){ $NewItem = $_GET['NewItem']; } - +if (isset($_GET['ReqQty'])){ + $ReqQty = $_GET['ReqQty']; +} if (!isset($_POST['StockLocation'])){ - if (isset($_SESSION['UserStockLocation'])){ + if (isset($LocCode)){ + $_POST['StockLocation']=$LocCode; + } elseif (isset($_SESSION['UserStockLocation'])){ $_POST['StockLocation']=$_SESSION['UserStockLocation']; } } + if (isset($_POST['Search'])){ If ($_POST['Keywords'] AND $_POST['StockCode']) { @@ -159,7 +178,7 @@ if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity $EOQ = 0; } else { - $EOQ = $CheckItemRow['eoq']; + $EOQ = ($ReqQty) ? $ReqQty : $CheckItemRow['eoq']; } if ($CheckItemRow['mbflag']!='M'){ prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-16 06:21:10 UTC (rev 3464) +++ trunk/doc/Change.log.html 2010-05-17 17:14:40 UTC (rev 3465) @@ -1,19 +1,24 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<P>16/5/10 Phil: javascripts/MiscFunctions.js - not my field ... but could not resist adding some indentation - I struggle at the best of times with javascript but this was a shocker to read!! Hope I didnt mess up anything</p> -<P>16/5/10 Phil: reworked PDFRemittanceAdvices.php - somehow missed from tcpdf work to print utf-8 pdfs</p> -<p>16/5/10 Phil: reworked PDFPriceList to use the new effective dates fields and print out effective prices as at a specified date - showing effective dates on the report - also ditched includes/PDFPriceListPageHeader.php in favour of a PageHeader() function inside PDFPriceList.php. Also made the script work with tcpdf - not sure how it was missed before?</p> -<p>16/5/10 Phil: reworked PricesBasedOnMarkUp.php to insert new prices with effectivity dates and update the prices where effectivity dates specified.</p> -<p>16/5/10 Phil: reworked PricesByCost.php this was bit of a dodgy script - well I found it hard to follow - in the words of Frank Sinatra - I did it my way! Also built in effectivity dates to display and ensure correct prices updated now the primary key of prices is changed.</p> -<p>16/5/10 Phil: Wrote up the manual so that the logic of pricing with effective dates is explained</p> -<p>15/5/10 Phil: Used Lindsay/Ngaraj's nice email address checking function to replace the existing function in MiscFunctions.php and includes MiscFunctions.php in install/save.php to avoid duplication of the function</p> -<p>15/5/10 Phil: $debug variable in UserLogin.php was only set on first login - not subsequent page calls (its not a session variable) - moved it back into session.inc so that full info about bugs is available to sysadmins -<p>15/5/10 Phil: GetPrices.inc Prices.php and Prices_Customer.php - modified to allow default prices - with no end dates - reducing requirement to administer - also updated Prices section of the manual +<P>16/05/10 Phil: javascripts/MiscFunctions.js - not my field ... but could not resist adding some indentation - I struggle at the best of times with javascript but this was a shocker to read!! Hope I didnt mess up anything</p> +<P>16/05/10 Phil: reworked PDFRemittanceAdvices.php - somehow missed from tcpdf work to print utf-8 pdfs</p> +<p>16/05/10 Phil: reworked PDFPriceList to use the new effective dates fields and print out effective prices as at a specified date - showing effective dates on the report - also ditched includes/PDFPriceListPageHeader.php in favour of a PageHeader() function inside PDFPriceList.php. Also made the script work with tcpdf - not sure how it was missed before?</p> +<p>16/05/10 Phil: reworked PricesBasedOnMarkUp.php to insert new prices with effectivity dates and update the prices where effectivity dates specified.</p> +<p>16/05/10 Phil: reworked PricesByCost.php this was bit of a dodgy script - well I found it hard to follow - in the words of Frank Sinatra - I did it my way! Also built in effectivity dates to display and ensure correct prices updated now the primary key of prices is changed.</p> +<p>16/05/10 Phil: Wrote up the manual so that the logic of pricing with effective dates is explained</p> +<p>15/05/10 Phil: Used Lindsay/Ngaraj's nice email address checking function to replace the existing function in MiscFunctions.php and includes MiscFunctions.php in install/save.php to avoid duplication of the function</p> +<p>15/05/10 Phil: $debug variable in UserLogin.php was only set on first login - not subsequent page calls (its not a session variable) - moved it back into session.inc so that full info about bugs is available to sysadmins +<p>15/05/10 Phil: GetPrices.inc Prices.php and Prices_Customer.php - modified to allow default prices - with no end dates - reducing requirement to administer - also updated Prices section of the manual <p>11/05/10 Tim: Exit MRP scripts gracefully if no MRP calculation has been done.</p> <p>08/05/10 Lindsay: API was broken after adding a test for global variable $DatabaseName in ConnectDB_mysql* for this variable being set and using it as DB name if so. The variable of that name in the api_php.php has been changed to $api_DatabaseName.</p> <p>08/05/10 Phil: GetPrices.inc now uses the new price startdate and enddate to return the price which falls within the date range base on the current date. Changes to Prices.php and Prices_Customer.php to allow entry of effective from and effective to dates and updating/deleting of prices with appropriate error trapping and rescheduling of enddates where start and end dates would otherwise overlap.</p> <p>08/05/10 Phil: Found a bug in Date1GreaterThanDate2 function (in includes/DateFunction.inc) with SESSION['DefaultDateFormat'] = 'd/m/Y' this function had been broken </p> <p>06/05/10 Lindsay: Tracker 2929564: dates mangled via QuicK Entry format</p> +<p>06/05/10 Matt Taylor: upgrade3.11.1-3.12.sql : Added default startdate to prices table.</p> +<p>06/05/10 Matt Taylor: weberp-demo.sql : Added startdate and enddate columns to prices table.</p> +<p>06/05/10 Matt Taylor: weberp-new.sql : Added startdate and enddate columns to prices table.</p> +<p>06/05/10 Matt Taylor: WorkOrderEntry.php : Added feature to convert planned work orders.</p> +<p>06/05/10 Matt Taylor: MRPPlannedWorkOrders.php : Added feature to convert planned work orders.</p> <p>05/05/10 Tim: Fix javascript errors in date picker</p> <p>05/05/10 SiteMe: Update to allow RecurringSalesOrdersProcess.php to run via cron</p> <p>05/05/10 SiteMe: Correct statements layout problems caused by the newer version of tcpdf</p> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-16 06:21:10 UTC (rev 3464) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-17 17:14:40 UTC (rev 3465) @@ -153,7 +153,11 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `systypes` VALUES(19, 'Picking List', 0); -ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL; +ALTER TABLE `prices` ADD `startdate` DATE NOT NULL DEFAULT '0000-00-00' , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31'; ALTER TABLE prices DROP PRIMARY KEY , ADD PRIMARY KEY ( `stockid` , `typeabbrev` , `currabrev` , `debtorno` , `startdate` , `enddate` ) ; + +UPDATE prices SET startdate='1999-01-01', enddate='9999-12-31'; + +ALTER TABLE stockcheckfreeze ADD COLUMN stockcheckdate date NOT NULL; UPDATE prices SET startdate='1999-01-01'; Modified: trunk/sql/mysql/weberp-demo.sql =================================================================== --- trunk/sql/mysql/weberp-demo.sql 2010-05-16 06:21:10 UTC (rev 3464) +++ trunk/sql/mysql/weberp-demo.sql 2010-05-17 17:14:40 UTC (rev 3465) @@ -1057,6 +1057,8 @@ `debtorno` varchar(10) NOT NULL DEFAULT '', `price` decimal(20,4) NOT NULL DEFAULT '0.0000', `branchcode` varchar(10) NOT NULL DEFAULT '', + `startdate` DATE NOT NULL DEFAULT '0000-00-00', + `enddate` DATE NOT NULL DEFAULT '9999-12-31', PRIMARY KEY (`stockid`,`typeabbrev`,`currabrev`,`debtorno`), KEY `CurrAbrev` (`currabrev`), KEY `DebtorNo` (`debtorno`), Modified: trunk/sql/mysql/weberp-new.sql =================================================================== --- trunk/sql/mysql/weberp-new.sql 2010-05-16 06:21:10 UTC (rev 3464) +++ trunk/sql/mysql/weberp-new.sql 2010-05-17 17:14:40 UTC (rev 3465) @@ -1058,6 +1058,8 @@ `debtorno` varchar(10) NOT NULL DEFAULT '', `price` decimal(20,4) NOT NULL DEFAULT '0.0000', `branchcode` varchar(10) NOT NULL DEFAULT '', + `startdate` DATE NOT NULL DEFAULT '0000-00-00', + `enddate` DATE NOT NULL DEFAULT '9999-12-31', PRIMARY KEY (`stockid`,`typeabbrev`,`currabrev`,`debtorno`), KEY `CurrAbrev` (`currabrev`), KEY `DebtorNo` (`debtorno`), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |