From: <dai...@us...> - 2011-11-08 09:03:16
|
Revision: 4742 http://web-erp.svn.sourceforge.net/web-erp/?rev=4742&view=rev Author: daintree Date: 2011-11-08 09:03:06 +0000 (Tue, 08 Nov 2011) Log Message: ----------- bug fixes Modified Paths: -------------- trunk/CounterSales.php trunk/CustomerReceipt.php trunk/GoodsReceived.php trunk/SelectSupplier.php trunk/Stocks.php trunk/UpgradeDatabase.php trunk/doc/Change.log trunk/includes/Add_SerialItems.php trunk/includes/GetConfig.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/CounterSales.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -39,7 +39,6 @@ foreach ($_POST as $FormVariable => $Quantity) { if (mb_strpos($FormVariable,'OrderQty')!==false) { $NewItemArray[$_POST['StockID' . mb_substr($FormVariable,8)]] = filter_number_format($Quantity); - echo '<br/> The quantitiy entered was ' . filter_number_format($Quantity) . ' the quantity for ' . $_POST['StockID' . mb_substr($FormVariable,8)] . ' unfiltered was: ' . $Quantity; } } } @@ -2022,7 +2021,7 @@ echo $TableHeader; $i = 0; $j = 1; - $k=0; //row colour counter + $k = 0; //row colour counter while ($myrow=DB_fetch_array($result2)) { // This code needs sorting out, but until then : @@ -2097,15 +2096,16 @@ $OnOrder = $PurchQty + $WoQty; $Available = $QOH - $DemandQty + $OnOrder; - + printf('<td>%s</font></td> <td>%s</td> <td>%s</td> - <td style="text-align:center">%s</td> - <td style="text-align:center">%s</td> - <td style="text-align:center">%s</td> - <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="OrderQty%s" value="0" /><input type="hidden" name="StockID%s" value="%s" /> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><input class="number" tabindex="'.strval($j+7).'" type="text" size="6" name="OrderQty%s" value="0" /> + <input type="hidden" name="StockID%s" value="%s" /> </td> </tr>', $myrow['stockid'], @@ -2189,10 +2189,13 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; - echo '<tr><td><input type="hidden" name="previous" value="'.strval($Offset-1).'" /><input tabindex="'.strval($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"><input type="hidden" name="SelectingOrderItems" value="1" /><input tabindex="'.strval($j+8).'" type="submit" value="'._('Add to Sale').'" /></td>'; - echo '<td><input type="hidden" name="NextList" value="'.strval($Offset+1).'" /><input tabindex="'.strval($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; - $TableHeader = '<tr><th>' . _('Code') . '</th> + echo '<tr> + <td><input type="hidden" name="previous" value="'.strval($Offset-1).'" /><input tabindex="'.strval($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td> + <td style="text-align:center" colspan="6"><input type="hidden" name="SelectingOrderItems" value="1" /><input tabindex="'.strval($j+8).'" type="submit" value="'._('Add to Sale').'" /></td> + <td><input type="hidden" name="NextList" value="'.strval($Offset+1).'" /><input tabindex="'.strval($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td> + </tr>'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> <th>' . _('On Hand') . '</th> @@ -2284,7 +2287,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="OrderQty%s" value="0" /></font><input type="hidden" name="StockID%s" value="%s" /></td> + <td><input class="number" tabindex="'.strval($j+7).'" type="text" size="6" name="OrderQty%s" value="0" /></font><input type="hidden" name="StockID%s" value="%s" /></td> </tr>', $myrow['stockid'], $myrow['description'], @@ -2300,6 +2303,7 @@ $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } $j++; + $i++; #end of page full new headings if } #end of while loop Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/CustomerReceipt.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -33,11 +33,11 @@ echo '<br />'; prnMsg(_('A bank account must be selected for this receipt'), 'warn'); - $BankAccountEmpty=TRUE; + $BankAccountEmpty=true; } else if(isset($_GET['NewReceipt'])) { - $BankAccountEmpty=TRUE; + $BankAccountEmpty=true; } else { - $BankAccountEmpty=FALSE; + $BankAccountEmpty=false; } if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ @@ -47,17 +47,21 @@ /*Get the bank account currency and set that too */ $SQL = "SELECT bankaccountname, - currcode + currcode, + decimalplaces FROM bankaccounts + INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev WHERE accountcode='" . $_POST['BankAccount']."'"; $ErrMsg =_('The bank account name cannot be retrieved because'); $result= DB_query($SQL,$db,$ErrMsg); if (DB_num_rows($result)==1){ - $myrow = DB_fetch_row($result); - $_SESSION['ReceiptBatch']->BankAccountName = $myrow[0]; - $_SESSION['ReceiptBatch']->AccountCurrency=$myrow[1]; + $myrow = DB_fetch_array($result); + $_SESSION['ReceiptBatch']->BankAccountName = $myrow['bankaccountname']; + $_SESSION['ReceiptBatch']->AccountCurrency=$myrow['currcode']; + $_SESSION['ReceiptBatch']->CurrDecimalPlaces=$myrow['decimalplaces']; unset($result); } elseif (DB_num_rows($result)==0 AND !$BankAccountEmpty){ prnMsg( _('The bank account number') . ' ' . $_POST['BankAccount'] . ' ' . _('is not set up as a bank account'),'error'); Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/GoodsReceived.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -83,7 +83,7 @@ echo '<table class="selection"> <tr> <td>'. _('Date Goods/Service Received'). ':</td> - <td><input type="text" class="date" alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". + <td><input type="text" class="date" alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength="10" size="10" onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name="DefaultReceivedDate" value="' . $_POST['DefaultReceivedDate'] . '"></td> </tr> </table> Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/SelectSupplier.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -321,7 +321,7 @@ } else { echo '<div class="centre"><br />'; echo '<tr><td colspan="2">'; - echo '<table width=45% colspan=2 border=2 cellpadding=4>'; + echo '<table width="45%" class="selection">'; echo '<tr><th width=33%>' . _('Supplier Mapping') . '</th></tr>'; echo '</td><td valign=top>'; /* Mapping */ echo '<div class="centre">' . _('Mapping is enabled, Map will display below.') . '</div>'; @@ -338,13 +338,13 @@ suppliersince, currencies.decimalplaces AS currdecimalplaces FROM suppliers INNER JOIN currencies - ON supplier.currcode=currencies.currabrev + ON suppliers.currcode=currencies.currabrev WHERE suppliers.supplierid ='" . $_SESSION['SupplierID'] . "'"; $ErrMsg = _('An error occurred in retrieving the information'); $DataResult = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($DataResult); // Select some more data about the supplier - $SQL = "SELECT sum(-ovamount) AS total FROM supptrans WHERE supplierno = '" . $_SESSION['SupplierID'] . "' and type != '20'"; + $SQL = "SELECT SUM(-ovamount) AS total FROM supptrans WHERE supplierno = '" . $_SESSION['SupplierID'] . "' and type != '20'"; $Total1Result = DB_query($SQL, $db); $row = DB_fetch_array($Total1Result); echo '<br />'; Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/Stocks.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -754,7 +754,9 @@ discountcategory, taxcatid, decimalplaces, - nextserialno + nextserialno, + pansize, + shrinkfactor FROM stockmaster WHERE stockid = '".$StockID."'"; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/UpgradeDatabase.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -44,7 +44,9 @@ prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts.') . '<br />' . _('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'] . '<br /><a target="_blank" href="' . $rootpath . '/BackupDatabase.php">' ._('Click to do a database backup now before proceeding!') . '</a>','info'); echo '<input type="hidden" name="OldVersion" value="' . $_SESSION['VersionNumber'] . '" />'; - echo '<div class="centre"><input type="submit" name="DoUpgrade" value="' . _('Perform Database Upgrade') . '" /></div>'; + echo '<div class="centre"> + <input type="submit" name="DoUpgrade" value="' . _('Perform Database Upgrade') . '" /> + </div>'; } } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/doc/Change.log 2011-11-08 09:03:06 UTC (rev 4742) @@ -1,5 +1,9 @@ webERP Change Log +8/11/11 Phil: includes/GetConfig.php no longer casts the VersionNumber to a double - issue highlighted by Tim +8/11/11 Felix Lim: includes/InputSerialItems.php and InputSerialItemsKeyed.php now sends $identifier +8/11/11 Phil: fixed bugs reported by Ron Wong and Don SelectSupplier.php sql error missed "s" off suppliers and CustomerReceipt.php - had not populated new class variable (property) of CurrDecimalPlaces + 6/11/11 Release 4.06RC1 30/10/11 Exson: Modification to Stocks.php to avoid losing PanSize and ShrinkFactor Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/includes/Add_SerialItems.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -80,7 +80,7 @@ $_POST['Bundles']=0; } //echo count($_POST['Bundles']); - for ($i=0;$i < count($_POST['Bundles']);$i++){ /*there is an entry in the multi select list box */ + for ($i=0;$i < count($_POST['Bundles']) AND $_POST['Bundles']!=0;$i++){ /*there is an entry in the multi select list box */ if ($LineItem->Serialised==1){ /*only if the item is serialised */ $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0 ? 1:-1) ); } else { Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/includes/GetConfig.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -8,12 +8,12 @@ $sql = "SELECT confname, confvalue FROM config"; $ErrMsg = _('Could not get the configuration parameters from the database because'); $ConfigResult = DB_query($sql,$db,$ErrMsg); - while( $myrow = DB_fetch_row($ConfigResult) ) { - if (is_numeric($myrow[1]) and $myrow[0]!='DefaultPriceList'){ + while( $myrow = DB_fetch_array($ConfigResult) ) { + if (is_numeric($myrow['confvalue']) AND $myrow['confname']!='DefaultPriceList' AND $myrow['confname']!='VersionNumber'){ //the variable name is given by $myrow[0] - $_SESSION[$myrow[0]] = (double) $myrow[1]; + $_SESSION[$myrow['confname']] = (double) $myrow['confvalue']; } else { - $_SESSION[$myrow[0]] = $myrow[1]; + $_SESSION[$myrow['confname']] = $myrow['confvalue']; } } //end loop through all config variables $_SESSION['CompanyDefaultsLoaded'] = true; Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/includes/InputSerialItems.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -48,7 +48,7 @@ $invalid_imports = 0; $valid = true; -echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) .'" enctype="multipart/form-data" >'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) .'?identifier='.$identifier.'" enctype="multipart/form-data" >'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="LineNo" value="' . $LineNo . '">'; echo '<input type=hidden name="StockID" value="'. $StockID. '">'; @@ -84,9 +84,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier.'&EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier.'&DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br /></div>'; $sql="SELECT perishable FROM stockmaster Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2011-11-06 07:09:21 UTC (rev 4741) +++ trunk/includes/InputSerialItemsKeyed.php 2011-11-08 09:03:06 UTC (rev 4742) @@ -55,9 +55,9 @@ echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; echo '<td class="number">' . $Bundle->ExpiryDate . '</td>'; } - - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'&identifier='.$identifier.'">'. _('Delete'). '</a></td> + </tr>'; + $TotalQuantity += $Bundle->BundleQty; } @@ -84,7 +84,7 @@ echo $tableheader; -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier.'" name="Ga6uF5Wa" method="post"> <input type=hidden name="LineNo" value="' . $LineNo . '"> <input type=hidden name="StockID" value="' . $StockID . '"> <input type=hidden name="EntryType" value="KEYED">'; @@ -101,7 +101,8 @@ if ($EditControlled){ foreach ($LineItem->SerialItems as $Bundle){ - echo '<tr><td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" value="' .$Bundle->BundleRef.'" size="21" maxlength="20" /></td>'; + echo '<tr> + <td valign=top><input type="text" name="SerialNo'. $StartAddingAt .'" value="' .$Bundle->BundleRef.'" size="21" maxlength="20" /></td>'; /*if the item is controlled not serialised - batch quantity required so just enter bundle refs into the form for entry of quantities manually */ @@ -110,10 +111,10 @@ echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>'; } else if ($LineItem->Serialised==0 and $Perishable==1) { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size=11 - value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength="10"></tr>'; } else { echo '<td><input type="text" class="number" name="Qty' . $StartAddingAt .'" size=11 - value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + value="'. locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength="10"></tr>'; } $StartAddingAt++; @@ -138,13 +139,22 @@ } } -echo '</table>'; -echo '<br /><div class=centre><input type="submit" name="AddBatches" value="'. _('Enter'). '"></div>'; -echo '</form></td><td valign="top">'; +echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="AddBatches" value="'. _('Enter'). '" /> + </div> + + </form> + </td> + <td valign="top">'; if ($ShowExisting){ include('includes/InputSerialItemsExisting.php'); } -echo '</td></tr></table><script type="text/javascript"> +echo '</td> + </tr> + </table> + <script type="text/javascript"> //<![CDATA[ document.Ga6uF5Wa.SerialNo0.focus(); //]]> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |