|
From: <dai...@us...> - 2011-05-28 11:01:06
|
Revision: 4578
http://web-erp.svn.sourceforge.net/web-erp/?rev=4578&view=rev
Author: daintree
Date: 2011-05-28 11:01:00 +0000 (Sat, 28 May 2011)
Log Message:
-----------
bug fixes reported by Ricard
Modified Paths:
--------------
trunk/MRPShortages.php
trunk/PcAssignCashToTab.php
trunk/PcExpensesTypeTab.php
trunk/SuppTransGLAnalysis.php
trunk/UpgradeDatabase.php
trunk/doc/Change.log
Modified: trunk/MRPShortages.php
===================================================================
--- trunk/MRPShortages.php 2011-05-28 05:38:42 UTC (rev 4577)
+++ trunk/MRPShortages.php 2011-05-28 11:01:00 UTC (rev 4578)
@@ -22,8 +22,13 @@
if (isset($_POST['PrintPDF'])) {
include('includes/PDFStarter.php');
- $pdf->addInfo('Title',_('MRP Shortages Report'));
- $pdf->addInfo('Subject',_('MRP Shortages'));
+ if ($_POST['ReportType'] == 'Shortage'){
+ $pdf->addInfo('Title',_('MRP Shortages Report'));
+ $pdf->addInfo('Subject',_('MRP Shortages'));
+ }else{
+ $pdf->addInfo('Title',_('MRP Excess Report'));
+ $pdf->addInfo('Subject',_('MRP Excess'));
+ }
$FontSize=9;
$PageNumber=1;
$line_height=12;
@@ -89,19 +94,19 @@
(demandtotal.demand - supplytotal.supply) *
(stockmaster.materialcost + stockmaster.labourcost +
stockmaster.overheadcost ) as extcost
- FROM stockmaster
- LEFT JOIN demandtotal ON stockmaster.stockid = demandtotal.part
- LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part
- GROUP BY stockmaster.stockid,
- stockmaster.description,
- stockmaster.mbflag,
- stockmaster.actualcost,
- stockmaster.decimalplaces,
- supplytotal.supply,
- demandtotal.demand,
- extcost
- HAVING demand > supply
- ORDER BY '" . $_POST['Sort']."'";
+ FROM stockmaster
+ LEFT JOIN demandtotal ON stockmaster.stockid = demandtotal.part
+ LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part
+ GROUP BY stockmaster.stockid,
+ stockmaster.description,
+ stockmaster.mbflag,
+ stockmaster.actualcost,
+ stockmaster.decimalplaces,
+ supplytotal.supply,
+ demandtotal.demand,
+ extcost
+ HAVING demand > supply
+ ORDER BY '" . $_POST['Sort']."'";
if ($_POST['CategoryID'] == 'All'){
$SQLCategory = ' ';
@@ -109,6 +114,12 @@
$SQLCategory = "WHERE stockmaster.categoryid = '" . $_POST['CategoryID'] . "'";
}
+ if ($_POST['ReportType'] == 'Shortage'){
+ $SQLHaving = " HAVING demandtotal.demand > supplytotal.supply ";
+ }else{
+ $SQLHaving = " HAVING demandtotal.demand <= supplytotal.supply ";
+ }
+
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
stockmaster.mbflag,
@@ -135,15 +146,15 @@
stockmaster.overheadcost,
computedcost,
supplytotal.supply,
- demandtotal.demand
- HAVING demandtotal.demand > supplytotal.supply
- ORDER BY '" . $_POST['Sort'] . "'";
+ demandtotal.demand "
+ . $SQLHaving .
+ " ORDER BY '" . $_POST['Sort'] . "'";
$result = DB_query($sql,$db,'','',false,true);
if (DB_error_no($db) !=0) {
- $title = _('MRP Shortages') . ' - ' . _('Problem Report');
+ $title = _('MRP Shortages and Excesses') . ' - ' . _('Problem Report');
include('includes/header.inc');
- prnMsg( _('The MRP shortages could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error');
+ prnMsg( _('The MRP shortages and excesses could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error');
echo '<br/><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>';
if ($debug==1){
echo '<br/>' . $sql;
@@ -153,9 +164,9 @@
}
if (DB_num_rows($result) == 0) {
- $title = _('MRP Shortages') . ' - ' . _('Problem Report');
+ $title = _('MRP Shortages and Excesses') . ' - ' . _('Problem Report');
include('includes/header.inc');
- prnMsg( _('No MRP shortages retrieved'), 'warn');
+ prnMsg( _('No MRP shortages - Excess retrieved'), 'warn');
echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>';
if ($debug==1){
echo '<br />' . $sql;
@@ -172,7 +183,14 @@
$fill = false;
$pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted
while ($myrow = DB_fetch_array($result,$db)){
- if ($myrow['demand'] > $myrow['supply']) {
+
+ if ($_POST['ReportType'] == 'Shortage'){
+ $lineToPrint = ($myrow['demand'] > $myrow['supply']);
+ }else{
+ $lineToPrint = ($myrow['demand'] <= $myrow['supply']);
+ }
+
+ if ($lineToPrint) {
$YPos -=$line_height;
$FontSize=8;
@@ -220,15 +238,23 @@
/*Print out the grand totals */
$pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Parts: '), 'left');
$pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left');
+ if ($_POST['ReportType'] == 'Shortage'){
$pdf->addTextWrap(300,$YPos,180,$FontSize,_('Total Extended Shortage:'), 'right');
+ }else{
+ $pdf->addTextWrap(300,$YPos,180,$FontSize,_('Total Extended Excess:'), 'right');
+ }
$DisplayTotalVal = number_format($Total_Shortage,2);
$pdf->addTextWrap(510,$YPos,60,$FontSize,$DisplayTotalVal, 'right');
- $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');
+ if ($_POST['ReportType'] == 'Shortage'){
+ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');
+ }else{
+ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPExcess_' . date('Y-m-d').'.pdf');
+ }
$pdf->__destruct();
} else { /*The option to print PDF was not hit so display form */
- $title=_('MRP Shortages Reporting');
+ $title=_('MRP Shortages - Excess Reporting');
include('includes/header.inc');
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="'
@@ -251,6 +277,12 @@
echo "<option selected value='extcost'>" . _('Extended Shortage Dollars').'</option>';
echo "<option value='stockid'>" . _('Part Number').'</option>';
echo '</select></td></tr>';
+
+ echo '<tr><td>' . _('Shortage-Excess Option') . ":</td><td><select name='ReportType'>";
+ echo "<option selected value='Shortage'>" . _('Report MRP Shortages').'</option>';
+ echo "<option value='Excess'>" . _('Report MRP Excesses').'</option>';
+ echo '</select></td></tr>';
+
echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>";
echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines').'</option>';
echo "<option value='no'>" . _('Plain Print').'</option>';
@@ -277,8 +309,12 @@
$pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']);
$YPos -=$line_height;
+if ($_POST['ReportType'] == 'Shortage'){
+$pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Shortages Report'));
+}else{
+ $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Excess Report'));
+}
-$pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Shortages Report'));
$pdf->addTextWrap($Page_Width-$Right_Margin-110,$YPos,160,$FontSize,_('Printed') . ': ' .
Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left');
@@ -300,9 +336,13 @@
$pdf->addTextWrap(305,$YPos,55,$FontSize,_('Unit Cost'), 'right');
$pdf->addTextWrap(360,$YPos,50,$FontSize,_('Supply'), 'right');
$pdf->addTextWrap(410,$YPos,50,$FontSize,_('Demand'), 'right');
+if ($_POST['ReportType'] == 'Shortage'){
$pdf->addTextWrap(460,$YPos,50,$FontSize,_('Shortage'), 'right');
$pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Shortage'), 'right');
-
+}else{
+ $pdf->addTextWrap(460,$YPos,50,$FontSize,_('Excess'), 'right');
+ $pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Excess'), 'right');
+}
$FontSize=8;
$YPos =$YPos - (2*$line_height);
$PageNumber++;
Modified: trunk/PcAssignCashToTab.php
===================================================================
--- trunk/PcAssignCashToTab.php 2011-05-28 05:38:42 UTC (rev 4577)
+++ trunk/PcAssignCashToTab.php 2011-05-28 11:01:00 UTC (rev 4578)
@@ -198,7 +198,7 @@
}
$sql = "SELECT * FROM pcashdetails
WHERE tabcode='" . $SelectedTabs . "'
- AND date >=DATE_SUB(CURDATE(), INTERVAL , '".$Days."' DAY)
+ AND date >=DATE_SUB(CURDATE(), INTERVAL , ".$Days." DAY)
ORDER BY date, counterindex ASC";
Modified: trunk/PcExpensesTypeTab.php
===================================================================
--- trunk/PcExpensesTypeTab.php 2011-05-28 05:38:42 UTC (rev 4577)
+++ trunk/PcExpensesTypeTab.php 2011-05-28 11:01:00 UTC (rev 4578)
@@ -179,12 +179,14 @@
printf('<td>%s</td>
<td>%s</td>
- <td><a href="%sSelectedType=%s&delete=yes&SelectedTab=' . $_POST['SelectedTab'] . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this code and the expense it may have set up?') . '\');">' . _('Delete') . '</td>
+ <td><a href="%s?SelectedType=%s&delete=yes&SelectedTab=' . $_POST['SelectedTab'] . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this code and the expense it may have set up?') . '\');">' . _('Delete') . '</td>
</tr>',
$myrow['codeexpense'],
$myrow['description'],
- $_SERVER['PHP_SELF'], $myrow['codeexpense'],
- $_SERVER['PHP_SELF'], $myrow['codeexpense']);
+ $_SERVER['PHP_SELF'],
+ $myrow['codeexpense'],
+ $_SERVER['PHP_SELF'],
+ $myrow['codeexpense']);
}
//END WHILE LIST LOOP
echo '</table>';
Modified: trunk/SuppTransGLAnalysis.php
===================================================================
--- trunk/SuppTransGLAnalysis.php 2011-05-28 05:38:42 UTC (rev 4577)
+++ trunk/SuppTransGLAnalysis.php 2011-05-28 11:01:00 UTC (rev 4578)
@@ -136,9 +136,9 @@
if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){
- echo '<br /><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a>';
+ echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div>';
} else {
- echo '<br /><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a>';
+ echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a></div>';
}
/*Set up a form to allow input of new GL entries */
@@ -191,7 +191,7 @@
</tr>
</table><br />';
-echo '<input type="submit" name="AddGLCodeToTrans" value="' . _('Enter GL Line') . '">';
+echo '<div class="centre"><input type="submit" name="AddGLCodeToTrans" value="' . _('Enter GL Line') . '"></div>';
echo '</form>';
include('includes/footer.inc');
Modified: trunk/UpgradeDatabase.php
===================================================================
--- trunk/UpgradeDatabase.php 2011-05-28 05:38:42 UTC (rev 4577)
+++ trunk/UpgradeDatabase.php 2011-05-28 11:01:00 UTC (rev 4578)
@@ -116,6 +116,8 @@
$SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql';
case '4.03.8':
$SQLScripts[] = './sql/mysql/upgrade4.03-4.04.sql';
+ case '4.04':
+ $SQLScripts[] = './sql/mysql/upgrade4.04-4.04.1.sql';
break;
} //end switch
}
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2011-05-28 05:38:42 UTC (rev 4577)
+++ trunk/doc/Change.log 2011-05-28 11:01:00 UTC (rev 4578)
@@ -1,5 +1,10 @@
webERP Change Log
+28/5/11 Ricard PcAssignCashToTab.php quoted the $Days integer parameter to the INTERVAL function incorrectly now fixed
+28/5/11 Ricard reported bug on deletion of PcExpensesTypeTab - incorrectly formed URL and parameters added ?
+28/5/11 Ricard reported mismatch of fields scripts pagesecurity changed to int(11) from tinyint as other tables all refer to as int(11)
+28/5/11 R2-G reported alignment issue with link and button on SuppTransGLAnalysis now fixed
+28/5/11 Ricard: MRPShortages now has an option to report excesses too
28/5/11 Ricard: Fix sql to take quotes out of literals in upgrade script. PDFPrintLabels fix sql to get current price.
28/5/11 Reported by Daniel Brewer Fix SelectSalesOrder.php creation of PO with excluding redundant fields in purchorderdetails that were taken out.
28/5/11 Exson: UpdateCurrencyRateDaily was set to 1 when the option to enable it was clicked - should have been set to today's date in SystemParameters - fixed. Now no error reported bu ConvertSQLDate function when user enables update currencies daily.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|