From: <dai...@us...> - 2011-05-30 08:43:36
|
Revision: 4584 http://web-erp.svn.sourceforge.net/web-erp/?rev=4584&view=rev Author: daintree Date: 2011-05-30 08:43:29 +0000 (Mon, 30 May 2011) Log Message: ----------- bug fixes Modified Paths: -------------- trunk/ConfirmDispatchControlled_Invoice.php trunk/GLAccountCSV.php trunk/PcAssignCashToTab.php trunk/PcExpensesTypeTab.php trunk/PricesByCost.php trunk/StockAdjustmentsControlled.php trunk/StockSerialItems.php trunk/doc/Change.log trunk/includes/GetConfig.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsFile.php trunk/includes/OutputSerialItems.php Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -1,10 +1,9 @@ <?php -/* $Revision: 1.13 $ */ + /* $Id$*/ include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Specify Dispatched Controlled Items'); @@ -16,9 +15,9 @@ } elseif (isset($_POST['LineNo'])){ $LineNo = (int)$_POST['LineNo']; } else { - echo '<div class="centre"><a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '">'. - _('Select a line item to invoice').'</a><br>'; - echo '<br>'; + echo '<div class="centre"><a href="' . $rootpath . '/ConfirmDispatch_Invoice.php">'. + _('Select a line item to invoice').'</a><br />'; + echo '<br />'; prnMsg( _('This page can only be opened if a line item on a sales order to be invoiced has been selected') . '. ' . _('Please do that first'),'error'); echo '</div>'; include('includes/footer.inc'); @@ -27,8 +26,8 @@ if (!isset($_SESSION['Items']) OR !isset($_SESSION['ProcessingOrder'])) { /* This page can only be called with a sales order number to invoice */ - echo '<div class="centre"><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Select a sales order to invoice'). - '</a><br>'; + echo '<div class="centre"><a href="' . $rootpath . '/SelectSalesOrder.php">'. _('Select a sales order to invoice'). + '</a><br />'; prnMsg( _('This page can only be opened if a sales order and line item has been selected Please do that first'),'error'); echo '</div>'; include('includes/footer.inc'); @@ -42,8 +41,8 @@ //Make sure this item is really controlled if ( $LineItem->Controlled != 1 ){ - echo '<div class="centre"><a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '">'. _('Back to the Sales Order'). '</a></div>'; - echo '<br>'; + echo '<div class="centre"><a href="' . $rootpath . '/ConfirmDispatch_Invoice.php">'. _('Back to the Sales Order'). '</a></div>'; + echo '<br />'; prnMsg( _('The line item must be defined as controlled to require input of the batch numbers or serial numbers being sold'),'error'); include('includes/footer.inc'); exit; @@ -54,9 +53,9 @@ ********************************************/ echo '<div class="centre">'; -echo '<br><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php?' . SID . '">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; +echo '<br /><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; -echo '<br><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; +echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ $StockID = $LineItem->StockID; @@ -66,7 +65,7 @@ $InOutModifier=1; $ShowExisting=false; -include ('includes/OutputSerialItems.php'); +include ('includes/IutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/GLAccountCSV.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -29,31 +29,31 @@ <tr> <td>'._('Selected Accounts') . ':</td> <td><select name="Account[]" multiple>'; -$sql = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; +$sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $AccountsResult = DB_query($sql,$db); $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; echo '<td>'._('For Period range').':</td> <td><select Name=Period[] multiple>'; -$sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; +$sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); $id=0; while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; } } echo '</select></td></tr>'; @@ -61,25 +61,26 @@ //Select the tag echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; -$SQL = 'SELECT tagref, +$SQL = "SELECT tagref, tagdescription - FROM tags - ORDER BY tagref'; + FROM tags + ORDER BY tagref"; $result=DB_query($SQL,$db); echo '<option value=0>0 - '._('All tags'); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; + echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } echo '</select></td></tr>'; // End select tag -echo "</table><p> -<div class='centre'><input type=submit name='MakeCSV' VALUE='"._('Make CSV File')."'></div></form>"; +echo '</table><p> + <div class="centre"><input type="submit" name="MakeCSV" value="'._('Make CSV File').'"></div> + </form>'; /* End of the Form rest of script is what happens if the show button is hit*/ Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/PcAssignCashToTab.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -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-29 10:04:48 UTC (rev 4583) +++ trunk/PcExpensesTypeTab.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -88,7 +88,6 @@ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); prnMsg($msg,'success'); - unset($_POST['SelectedExpense']); } @@ -96,10 +95,10 @@ $sql="DELETE FROM pctabexpenses WHERE typetabcode='".$SelectedTab."' AND codeexpense='".$SelectedType."'"; + $ErrMsg = _('The Tab Type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Expense code').' '. $SelectedType .' '. _('for type of tab').' '. $SelectedTab .' '. _('has been deleted') ,'success'); - unset ($SelectedType); unset($_GET['delete']); } @@ -111,7 +110,7 @@ or deletion of the records*/ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; //Main table + echo '<table class="selection">'; //Main table echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTab">'; @@ -148,6 +147,10 @@ if (isset($_POST['process'])OR isset($SelectedTab)) { echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Expense Codes for Type of Tab ') . ' ' .$SelectedTab. '</a></div><p>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '">'; $sql = "SELECT pctabexpenses.codeexpense, pcexpenses.description @@ -179,7 +182,7 @@ printf('<td>%s</td> <td>%s</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> + <td><a href="%s?SelectedType=%s&delete=yes&SelectedTab=' . $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'], @@ -193,8 +196,7 @@ if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><table class="selection">'; //Main table echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; @@ -220,11 +222,8 @@ echo '</select></td></tr>'; - - echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '">'; - echo '</td></tr></table>'; // close main table - + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"> <input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/PricesByCost.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -51,56 +51,73 @@ //Update Prices $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { - + /*The logic here goes like this: + * 1. If the price at the same start and end date already exists then do nowt!! + * 2. If not then check if a price with the start date of today already exists - then we should be updating it + * 3. If not either of the above then insert the new price + */ $SQLTestExists = "SELECT price FROM prices WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' AND prices.typeabbrev ='" . $_POST['SalesType'] . "' AND prices.currabrev ='" . $_POST['CurrCode'] . "' AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . date('Y-m-d') . "'"; + AND prices.startdate ='" . $_POST['StartDate_' . $PriceCounter] . "' + AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "' + AND prices.price ='" . $_POST['Price_' . $PriceCounter] . "'"; $TestExistsResult = DB_query($SQLTestExists,$db); - if (DB_num_rows($TestExistsResult)==1){ - //then we are updating - $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' - AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . date('Y-m-d') . "' - AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; - $ResultUpdate = DB_query($SQLUpdate, $db); - } else { - //update the old price to have an end date of yesterday too - $SQLUpdate = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d',-1)) . "' - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' - AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . $_POST['StartDate_' . $PriceCounter] . "' - AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; - $Result = DB_query($SQLUpdate, $db); - //we need to add a new price from today - $SQLInsert = "INSERT INTO prices ( stockid, - price, - typeabbrev, - currabrev, - debtorno, - branchcode, - startdate - ) VALUES ( - '" . $_POST['StockID_' . $PriceCounter] . "', - '" . $_POST['Price_' . $PriceCounter] . "', - '" . $_POST['SalesType'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DebtorNo_' . $PriceCounter] . "', - '" . $_POST['BranchCode_' . $PriceCounter] . "', - '" . date('Y-m-d') . "' - )"; - $ResultInsert = DB_query($SQLInsert, $db); - + if (DB_num_rows($TestExistsResult)==0){ //the price doesn't currently exist + //now check to see if a new price has already been created from start date of today + + $SQLTestExists = "SELECT price FROM prices + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "'"; + $TestExistsResult = DB_query($SQLTestExists,$db); + if (DB_num_rows($TestExistsResult)==1){ + //then we are updating + $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "' + AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; + $ResultUpdate = DB_query($SQLUpdate, $db); + } else { //there is not a price already starting today so need to create one + //update the old price to have an end date of yesterday too + $SQLUpdate = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d',-1)) . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . $_POST['StartDate_' . $PriceCounter] . "' + AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; + $Result = DB_query($SQLUpdate, $db); + //we need to add a new price from today + $SQLInsert = "INSERT INTO prices ( stockid, + price, + typeabbrev, + currabrev, + debtorno, + branchcode, + startdate + ) VALUES ( + '" . $_POST['StockID_' . $PriceCounter] . "', + '" . $_POST['Price_' . $PriceCounter] . "', + '" . $_POST['SalesType'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DebtorNo_' . $PriceCounter] . "', + '" . $_POST['BranchCode_' . $PriceCounter] . "', + '" . date('Y-m-d') . "' + )"; + $ResultInsert = DB_query($SQLInsert, $db); + } } $PriceCounter++; }//end while loop Modified: trunk/StockAdjustmentsControlled.php =================================================================== --- trunk/StockAdjustmentsControlled.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/StockAdjustmentsControlled.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -2,8 +2,6 @@ /* $Id$*/ include('includes/DefineSerialItems.php'); include('includes/DefineStockAdjustment.php'); - -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Adjusting Controlled Items'); @@ -13,8 +11,8 @@ if (!isset($_SESSION['Adjustment'])) { /* This page can only be called when a stock adjustment is pending */ - echo '<div class="centre"><a href="' . $rootpath . '/StockAdjustments.php?' . SID . '&NewAdjustment=Yes">'. _('Enter A Stock Adjustment'). '</a><br>'; - prnMsg( _('This page can only be opened if a stock adjustment for a controlled item has been entered').'<br>','error'); + echo '<div class="centre"><a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">'. _('Enter A Stock Adjustment'). '</a><br />'; + prnMsg( _('This page can only be opened if a stock adjustment for a controlled item has been entered').'<br />','error'); echo '</div>'; include('includes/footer.inc'); exit; @@ -30,8 +28,8 @@ //Make sure this item is really controlled if ( $LineItem->Controlled != 1 ){ - echo '<a href="' . $rootpath . '/StockAdjustments.php?' . SID . '&NewAdjustment=Yes">'._('Enter A Stock Adjustment').'</a>'; - prnMsg('<br>'. _('Notice') . ' - ' . _('The adjusted item must be defined as controlled to require input of the batch numbers or serial numbers being adjusted'),'error'); + echo '<a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">'._('Enter A Stock Adjustment').'</a>'; + prnMsg('<br />'. _('Notice') . ' - ' . _('The adjusted item must be defined as controlled to require input of the batch numbers or serial numbers being adjusted'),'error'); include('includes/footer.inc'); exit; } @@ -39,20 +37,20 @@ /***** get the page going now... *****/ echo '<div class="centre">'; -echo '<br><a href="'.$rootpath.'/StockAdjustments.php?' . SID .'">' . _('Back to Adjustment Screen') . '</a>'; +echo '<br /><a href="'.$rootpath.'/StockAdjustments.php">' . _('Back to Adjustment Screen') . '</a>'; -echo '<br><font size=2><b>'. _('Adjustment of controlled item').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription ; +echo '<br /><font size=2><b>'. _('Adjustment of controlled item').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription ; /** vars needed by InputSerialItem : **/ $LocationOut = $_SESSION['Adjustment']->StockLocation; $StockID = $LineItem->StockID; if ($LineItem->AdjustmentType == 'ADD'){ - echo '<br>'. _('Adding Items').'...'; + echo '<br />'. _('Adding Items').'...'; $ItemMustExist = false; $InOutModifier = 1; $ShowExisting = false; } elseif ($LineItem->AdjustmentType == 'REMOVE'){ - echo '<br>'._('Removing Items').'...'; + echo '<br />'._('Removing Items').'...'; $ItemMustExist = true; $InOutModifier = -1; $ShowExisting = true; Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/StockSerialItems.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -1,8 +1,6 @@ <?php /* $Id$*/ - - include('includes/session.inc'); $title = _('Stock Of Controlled Items'); include('includes/header.inc'); @@ -24,16 +22,16 @@ } $result = DB_query("SELECT description, - units, - mbflag, - decimalplaces, - serialised, - controlled, - perishable - FROM stockmaster - WHERE stockid='".$StockID."'", - $db, - _('Could not retrieve the requested item because')); + units, + mbflag, + decimalplaces, + serialised, + controlled, + perishable + FROM stockmaster + WHERE stockid='".$StockID."'", + $db, + _('Could not retrieve the requested item because')); $myrow = DB_fetch_array($result); @@ -52,21 +50,21 @@ } $result = DB_query("SELECT locationname - FROM locations - WHERE loccode='" . $_GET['Location'] . "'", - $db, - _('Could not retrieve the stock location of the item because'), - _('The SQL used to lookup the location was')); + FROM locations + WHERE loccode='" . $_GET['Location'] . "'", + $db, + _('Could not retrieve the stock location of the item because'), + _('The SQL used to lookup the location was')); $myrow = DB_fetch_row($result); $sql = "SELECT serialno, - quantity, - expirationdate - FROM stockserialitems - WHERE loccode='" . $_GET['Location'] . "' - AND stockid = '" . $StockID . "' - AND quantity <>0"; + quantity, + expirationdate + FROM stockserialitems + WHERE loccode='" . $_GET['Location'] . "' + AND stockid = '" . $StockID . "' + AND quantity <>0"; $ErrMsg = _('The serial numbers/batches held cannot be retrieved because'); @@ -135,7 +133,7 @@ $TotalQuantity += $myrow['quantity']; if ($Serialised == 1){ - echo '<td>'.$myrow['serialno'].'/td>'; + echo '<td>'.$myrow['serialno'].'</td>'; echo '<th></th>'; } else if ($Serialised == 0 and $Perishable==0) { echo '<td>'.$myrow['serialno'].'</td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/doc/Change.log 2011-05-30 08:43:29 UTC (rev 4584) @@ -1,5 +1,12 @@ webERP Change Log +30/5/11 Invoicing of serial items was not happening using includes/OutputSerialItems.php script not includes/InputSerialItems.php script +30/5/11 StockSerialItems.php closing td> tag was missing / +30/5/11 InputSerialItemsFile.php was looking for a hard coded reports dir now used $_SESSION['reports_dir'] +30/5/11 GetConfig.php checks for existence of the decimalplaces field in currencies and inserts it before attemtpting to run the company SQL... +30/5/11 PcExpensesTypeTab.php could not delete Expenses lost TabType value fixed +30/5/11 PriceByCost.php now only makes a new price if the price is actually changed!! + 29/5/11 Version 4.04.1 Release 29/5/11 PricesByCost.php made it so the existing prices had end dates set as yesterday and new prices created from today Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/includes/GetConfig.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -36,7 +36,14 @@ $_SESSION['PageSecurityArray'][$myrow['script']]=$myrow['pagesecurity']; } - + /* + check the decimalplaces field exists in currencies - this was added in 4.0 but is required in 4.04 as it is used everywhere as the default decimal places to show on all home currency amounts + */ + $result = DB_query("SELECT decimalplaces FROM currencies",$db,'','',false,false); + if (DB_error_no($db)!=0) { //then decimalplaces not already a field in currencies + $result = DB_query("ALTER TABLE `currencies` + ADD COLUMN `decimalplaces` tinyint(3) NOT NULL DEFAULT 2 AFTER `hundredsname`",$db); + } /* Also reads all the company data set up in the company record and returns an array */ $sql= "SELECT coyname, @@ -80,7 +87,7 @@ } /*Now read in smtp email settings - not needed in a properly set up server environment - but helps for those who can't control their server .. I think! */ - $sql='SELECT id, + $sql="SELECT id, host, port, heloaddress, @@ -88,7 +95,7 @@ password, timeout, auth - FROM emailsettings'; + FROM emailsettings"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/includes/InputSerialItems.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -98,7 +98,7 @@ $tableheader .= '<tr> <th>'. _('Serial No').'</th> </tr>'; -} else if ($LineItem->Serialised==0 and $Perishable==1){ +} else if ($LineItem->Serialised==0 AND $Perishable==1){ $tableheader = '<tr> <th>'. _('Batch/Roll/Bundle'). ' #</th> <th>'. _('Quantity'). '</th> Modified: trunk/includes/InputSerialItemsFile.php =================================================================== --- trunk/includes/InputSerialItemsFile.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/includes/InputSerialItemsFile.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -20,8 +20,8 @@ $LineNo = $_POST['LineNo']; } -echo '<DIV Align=Center>'; -echo '<TABLE>'; +echo '<div class="centre">'; +echo '<table>'; echo $tableheader; $TotalQuantity = 0; /*Variable to accumulate total quantity received */ @@ -57,7 +57,7 @@ echo '<tr><td align=right><b>'. _('Total Quantity'). ': ' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; echo '<tr><td><hr></td></tr>'; } else { - echo '<tr><td align=right><b>'. _('Total Quantity'). ':</B></TD><TD ALIGN=RIGHT><B>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td align=right><b>'. _('Total Quantity'). ':</b></td><td align=right><b>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; echo '<tr><td colspan=2><hr></td></tr>'; } @@ -96,7 +96,7 @@ $LineItem->SerialItemsValid=false; $_SESSION['CurImportFile']['Processed']=false; $_SESSION['CurImportFile'] = $_FILES['ImportFile']; - $_SESSION['CurImportFile']['tmp_name'] = './reports/'.$LineItem->StockID.'_'.$LineNo.'_'.uniqid(4); + $_SESSION['CurImportFile']['tmp_name'] = $_SESSION['reports_dir'] . '/' . $LineItem->StockID.'_'.$LineNo.'_'.uniqid(4); if (!move_uploaded_file($_FILES['ImportFile']['tmp_name'],$_SESSION['CurImportFile']['tmp_name'])){ prnMsg(_('Error moving temporary file') . '. ' . _('Please check your configuration'),'error' ); $LineItem->SerialItemsValid=false; Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-05-29 10:04:48 UTC (rev 4583) +++ trunk/includes/OutputSerialItems.php 2011-05-30 08:43:29 UTC (rev 4584) @@ -1,5 +1,5 @@ <?php -/* $Id$*/ +/* $Id OutputSerialItems.php 4501 2011-03-03 09:13:12Z daintree $*/ /*Input Serial Items - used for inputing serial numbers or batch/roll/bundle references for controlled items - used in: - ConfirmDispatchControlledInvoice.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |