From: <dai...@us...> - 2011-09-17 22:43:38
|
Revision: 4694 http://web-erp.svn.sourceforge.net/web-erp/?rev=4694&view=rev Author: daintree Date: 2011-09-17 22:43:30 +0000 (Sat, 17 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/SelectOrderItems.php trunk/StockAdjustments.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/Add_SerialItems.php trunk/includes/ConnectDB.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -212,7 +212,7 @@ } foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100); + $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format(filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100); } } @@ -227,7 +227,7 @@ } foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100); + $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format(filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100); } } } //end foreach lineitem @@ -311,15 +311,15 @@ if ($LnItm->Controlled==1){ if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; + echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; } } else { if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; + echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength="12" size="12" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '"></td>'; } } $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; @@ -458,15 +458,15 @@ $_POST['ChargeFreightCost']=0; } if ($_SESSION['Items']->Any_Already_Delivered()==1 and (!isset($_SESSION['Items']->FreightCost) or $_POST['ChargeFreightCost']==0)) { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td> + echo '<td colspan="2" class="number">'. _('Charge Freight Cost inc Tax').'</td> <td><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="0"></td>'; $_SESSION['Items']->FreightCost=0; } else { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td>'; + echo '<td colspan="2" class="number">'. _('Charge Freight Cost inc Tax').'</td>'; if (isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . $_SESSION['Items']->FreightCost . '</td>'; } else { - echo '<td class="number"><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . $_SESSION['Items']->FreightCost . '"></td>'; + echo '<td class="number"><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . $_SESSION['Items']->FreightCost . '" /></td>'; } $_POST['ChargeFreightCost'] = $_SESSION['Items']->FreightCost; } @@ -496,7 +496,7 @@ echo $FreightTaxLine->TaxRate * 100 ; } else { echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . - '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '">'; + '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '" />'; } if ($FreightTaxLine->TaxOnTax ==1){ @@ -587,7 +587,7 @@ /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, stockmaster.description, - locstock.quantity-(" . filter_number_format($OrderLine->QtyDispatched) . "*bom.quantity) AS qtyleft + locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft FROM bom INNER JOIN locstock ON bom.component=locstock.stockid @@ -612,7 +612,7 @@ if ($NegativesFound){ echo '<div class="centre"> - <input type="submit" name="Update" value="' . _('Update'). '"></div>'; + <input type="submit" name="Update" value="' . _('Update'). '" /></div>'; include('includes/footer.inc'); exit; } @@ -679,7 +679,8 @@ while ($myrow = DB_fetch_array($Result)) { - if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { + if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] + OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { echo '<br />'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv; Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/PrintCustTrans.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -281,8 +281,8 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } - $DisplayNet=locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); - $DisplayPrice=locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayNet=locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice=locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty=locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); @@ -355,17 +355,17 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /* Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -865,9 +865,9 @@ echo $RowStarter; - $DisplayPrice = locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -1005,15 +1005,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/PrintCustTransPortrait.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -311,8 +311,8 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); - $DisplayPrice = locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); @@ -424,15 +424,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -891,9 +891,9 @@ echo $RowStarter; - $DisplayPrice =locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayPrice =locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -1029,15 +1029,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],2); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],2); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ echo '<table class="table1"><tr> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/SelectOrderItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -730,10 +730,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -742,9 +741,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' @@ -761,9 +760,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -772,9 +771,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -787,9 +786,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; @@ -797,9 +796,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -816,7 +815,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval(filter_number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset)); + $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval($_SESSION['DefaultDisplayRecordsMax']*$Offset); $ErrMsg = _('There is a problem selecting the part records to display because'); $DbgMsg = _('The SQL used to get the part selection was'); @@ -1056,7 +1055,7 @@ if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ - $Quantity = filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]); + $Quantity = round(filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]),$OrderLine->DecimalPlaces); if (ABS($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); @@ -1164,7 +1163,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = filter_number_format((($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100)); } } } @@ -1292,7 +1291,7 @@ FROM discountmatrix WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <= '" . $QuantityOfDiscCat . "'",$db); + AND quantitybreak <= '" . filter_number_format($QuantityOfDiscCat) . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0] == NULL){ $DiscountMatrixRate = 0; @@ -1365,22 +1364,22 @@ echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> <td>' . $OrderLine->ItemDescription . '</td>'; - echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . $OrderLine->Quantity . '>'; + echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces) . '>'; if ($QtyRemain != $QtyOrdered){ - echo '<br />'.$OrderLine->QtyInv.' of '.$OrderLine->Quantity.' invoiced'; + echo '<br />'.locale_number_format($OrderLine->QtyInv,$OrderLine->DecimalPlaces) .' of '.locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces).' invoiced'; } echo '</td> - <td class="number">' . $OrderLine->QOHatLoc . '</td> + <td class="number">' . locale_number_format($OrderLine->QOHatLoc,$OrderLine->DecimalPlaces) . '</td> <td>' . $OrderLine->Units . '</td>'; if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ /*OK to display with discount if it is an internal user with appropriate permissions */ - echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> - <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> - <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; + echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '></td> + <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '></td> + <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . locale_number_format($OrderLine->GPPercent,2) . '></td>'; } else { - echo '<td class=number>' . $OrderLine->Price . '</td><td></td>'; - echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . $OrderLine->Price . '>'; + echo '<td class=number>' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; + echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '>'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ $RemTxt = _('Clear Remaining'); Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/StockAdjustments.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -36,12 +36,12 @@ $_SESSION['Adjustment']->Serialised = $myrow['serialised']; $_SESSION['Adjustment']->DecimalPlaces = $myrow['decimalplaces']; $_SESSION['Adjustment']->SerialItems = array(); - if (!isset($_SESSION['Adjustment']->Quantity)or !is_numeric($_SESSION['Adjustment']->Quantity)){ + if (!isset($_SESSION['Adjustment']->Quantity) OR !is_numeric($_SESSION['Adjustment']->Quantity)){ $_SESSION['Adjustment']->Quantity=0; } $NewAdjustment = true; } elseif (isset($_POST['StockID'])){ - if(isset($_POST['StockID']) and $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ + if(isset($_POST['StockID']) AND $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ $NewAdjustment = true; $_SESSION['Adjustment']->StockID = trim(mb_strtoupper($_POST['StockID'])); $StockID = trim(mb_strtoupper($_POST['StockID'])); @@ -49,10 +49,10 @@ $_SESSION['Adjustment']->tag = $_POST['tag']; $_SESSION['Adjustment']->Narrative = $_POST['Narrative']; $_SESSION['Adjustment']->StockLocation = $_POST['StockLocation']; - if ($_POST['Quantity']=='' or !is_numeric($_POST['Quantity'])){ + if ($_POST['Quantity']=='' or !is_numeric(filter_number_format($_POST['Quantity']))){ $_POST['Quantity']=0; } - $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; + $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . @@ -94,7 +94,7 @@ exit; } -if (isset($_POST['EnterAdjustment']) && $_POST['EnterAdjustment']!= ''){ +if (isset($_POST['EnterAdjustment']) AND $_POST['EnterAdjustment']!= ''){ $InputError = false; /*Start by hoping for the best */ $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $_SESSION['Adjustment']->StockID . "'",$db); @@ -149,7 +149,7 @@ $QtyOnHandPrior = 0; } - $SQL = "INSERT INTO stockmoves ( stockid, + $SQL = "INSERT INTO stockmoves (stockid, type, transno, loccode, @@ -175,7 +175,6 @@ $DbgMsg = _('The following SQL to insert the stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Get the ID of the StockMove... */ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); @@ -188,11 +187,10 @@ /*First need to check if the serial items already exists or not */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('Unable to determine if the serial item exists'); $Result = DB_query($SQL,$db,$ErrMsg); $SerialItemExistsRow = DB_fetch_row($Result); @@ -200,10 +198,9 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -308,7 +305,7 @@ $Result = DB_Txn_Commit($db); - $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity ; + $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . locale_number_format($_SESSION['Adjustment']->Quantity,$_SESSION['Adjustment']->DecimalPlaces) ; prnMsg( $ConfirmationText,'success'); if ($_SESSION['InventoryManagerEmail']!=''){ @@ -323,22 +320,24 @@ }/* end if the user hit enter the adjustment */ -echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_SESSION['Adjustment'])) { $StockID=''; $Controlled= 0; $Quantity = 0; + $DecimalPlaces =2; } else { $StockID = $_SESSION['Adjustment']->StockID; $Controlled = $_SESSION['Adjustment']->Controlled; $Quantity = $_SESSION['Adjustment']->Quantity; - $sql="SELECT materialcost, labourcost, overheadcost, units FROM stockmaster WHERE stockid='".$StockID."'"; + $sql="SELECT materialcost, labourcost, overheadcost, units, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $_SESSION['Adjustment']->PartUnit=$myrow['units']; $_SESSION['Adjustment']->StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost']; + $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; @@ -359,10 +358,10 @@ echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (isset($_SESSION['Adjustment']) and mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ +if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Adjustment']->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Adjustment']->PartUnit . ' ) - ' . _('Unit Cost').' = ' . - locale_number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; + locale_money_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; } echo '<tr><td>'. _('Adjustment to Stock At Location').':</td> @@ -373,25 +372,28 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ if ($myrow['loccode'] == $_SESSION['Adjustment']->StockLocation){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname']; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } echo '</select></td></tr>'; -if (isset($_SESSION['Adjustment']) and !isset($_SESSION['Adjustment']->Narrative)) { +if (isset($_SESSION['Adjustment']) AND !isset($_SESSION['Adjustment']->Narrative)) { $_SESSION['Adjustment']->Narrative = ''; + $Narrative =''; +} else { + $Narrative =''; } echo '<tr><td>'. _('Comments On Why').':</td> - <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; + <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $Narrative . '"></td></tr>'; echo '<tr><td>'._('Adjustment Quantity').':</td>'; @@ -400,26 +402,26 @@ if ($_SESSION['Adjustment']->StockLocation == ''){ $_SESSION['Adjustment']->StockLocation = $_SESSION['UserStockLocation']; } - echo '<input type="HIDDEN" name="Quantity" Value="' . $_SESSION['Adjustment']->Quantity . '"> - '.$_SESSION['Adjustment']->Quantity.' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&' . SID . '">'._('Remove').'</a>] - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&' . SID . '">'._('Add').'</a>]'; + echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment']->Quantity . '"> + '.locale_number_format($_SESSION['Adjustment']->Quantity,$DecimalPlaces) .' + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD">'._('Add').'</a>]'; } else { - echo '<input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; + echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '">'; } echo '</td></tr>'; //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'; + ORDER BY tagref"; $result=DB_query($SQL,$db); -echo '<option value=0>0 - None'; +echo '<option value=0>0 - ' . _('None') . '</option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag==$myrow['tagref']){ + if (isset($_SESSION['Adjustment']->tag) AND $_SESSION['Adjustment']->tag==$myrow['tagref']){ echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']. '</option>'; @@ -428,7 +430,7 @@ echo '</select></td>'; // End select tag -echo '</table><div class="centre"><br /><input type=submit name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"><br />'; +echo '</table><div class="centre"><br /><input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"><br />'; if (!isset($_POST['StockLocation'])) { $_POST['StockLocation']=''; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/UpgradeDatabase.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -112,6 +112,7 @@ $SQLScripts[] = './sql/mysql/upgrade4.04.5-4.05.sql'; case '4.05': case '4.05.1': + case '4.05.2': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06': break; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/WWW_Users.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -133,13 +133,13 @@ $UpdatePassword = "password='" . CryptPass($_POST['Password']) . "',"; } - $sql = "UPDATE www_users SET realname='" . $_POST['RealName'] . "', - customerid='" . $_POST['Cust'] ."', - phone='" . $_POST['Phone'] ."', - email='" . $_POST['Email'] ."', + $sql = "UPDATE www_users SET realname='" . DB_escape_string($_POST['RealName']) . "', + customerid='" . DB_escape_string($_POST['Cust']) ."', + phone='" . DB_escape_string($_POST['Phone']) ."', + email='" . DB_escape_string($_POST['Email'] ."', " . $UpdatePassword . " - branchcode='" . $_POST['BranchCode'] . "', - supplierid='" . $_POST['SupplierID'] . "', + branchcode='" . DB_escape_string($_POST['BranchCode']) . "', + supplierid='" . DB_escape_string($_POST['SupplierID']) . "', salesman='" . $_POST['Salesman'] . "', pagesize='" . $_POST['PageSize'] . "', fullaccess='" . $_POST['Access'] . "', @@ -171,15 +171,15 @@ theme, language, pdflanguage) - VALUES ('" . $_POST['UserID'] . "', - '" . $_POST['RealName'] ."', - '" . $_POST['Cust'] ."', - '" . $_POST['BranchCode'] ."', - '" . $_POST['SupplierID'] ."', + VALUES ('" . DB_escape_string($_POST['UserID']) . "', + '" . DB_escape_string($_POST['RealName']) ."', + '" . DB_escape_string($_POST['Cust']) ."', + '" . DB_escape_string($_POST['BranchCode']) ."', + '" . DB_escape_string($_POST['SupplierID']) ."', '" . $_POST['Salesman'] . "', '" . CryptPass($_POST['Password']) ."', - '" . $_POST['Phone'] . "', - '" . $_POST['Email'] ."', + '" . DB_escape_string($_POST['Phone']) . "', + '" . DB_escape_string($_POST['Email']) ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/doc/Change.log 2011-09-17 22:43:30 UTC (rev 4694) @@ -1,5 +1,6 @@ webERP Change Log +17/9/11 Phil: Added WindowsLocale element to LanguagesArray.php and modified UserSettings.php and WWW_Users.php to use the new array definition. Also modified includes/LanguageSetup.php to use the windows locale string in the LanguagesArray as required for proper setting of the locale under windows. 17/9/11 Felix Lim: added serialised field into PrintCustTransPortrait.php to reinstate possiblity for printing serialised items on invoice - not possible in landscape version (PrintCustTrans.php) 12/9/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/Add_SerialItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -56,17 +56,21 @@ if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being added exists with a Quantity that is not Zero (0)!'), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being removed exists with a Quantity that is not One (1)!'), 'error'); $SerialError = true; } } - + if (isset($_POST['ExpiryDate' . $i])){ + $ExpiryDate = $_POST['ExpiryDate' . $i]; + } else { + $ExpiryDate ='0000-00-00'; + } if (!$SerialError){ - $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $_POST['ExpiryDate' . $i]); + $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $ExpiryDate); } } } /* end if posted Serialno . i is not blank */ @@ -92,7 +96,7 @@ /******************************************** Add a Sequence of Items and save entries ********************************************/ -if ( isset($_POST['AddSequence']) && $_POST['AddSequence']!='') { +if ( isset($_POST['AddSequence']) AND $_POST['AddSequence']!='') { // do some quick validation $BeginNo = $_POST['BeginNo']; $EndNo = $_POST['EndNo']; @@ -151,7 +155,7 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($pieces[0] != "" && $pieces[1] != "" && is_numeric($pieces[1]) && $pieces[1] > 0 ){ + if($pieces[0] != "" AND $pieces[1] != "" AND is_numeric($pieces[1]) AND $pieces[1] > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); @@ -198,10 +202,10 @@ $SerialError = false; if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); $SerialError = true; } @@ -248,7 +252,7 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($Item->BundleRef != "" && $Item->BundleQty != "" && is_numeric($Item->BundleQty) && $Item->BundleQty > 0 ){ + if($Item->BundleRef != "" AND $Item->BundleQty != "" AND is_numeric($Item->BundleQty) AND $Item->BundleQty > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); @@ -295,10 +299,10 @@ $SerialError = false; if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); $SerialError = true; } Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/ConnectDB.inc 2011-09-17 22:43:30 UTC (rev 4694) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.05.1'; //must update manually every time there is a DB change +$Version='4.05.2'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/InputSerialItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -48,7 +48,7 @@ $invalid_imports = 0; $valid = true; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" enctype="multipart/form-data" >'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'" 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="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?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-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/InputSerialItemsKeyed.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -50,13 +50,13 @@ echo '<td>' . $Bundle->BundleRef . '</td>'; if ($LineItem->Serialised==0 and $Perishable==0){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; } else if ($LineItem->Serialised==0 and $Perishable==1){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; - echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; $TotalQuantity += $Bundle->BundleQty; } @@ -64,27 +64,26 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><B>'. _('Total Quantity'). ':</b></td><td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } /*Close off old table */ -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; /*in the first column add a table for the input of newies */ -echo '<table class=selection>'; +echo '<table class="selection">'; echo $tableheader; echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name="LineNo" value="' . $LineNo . '"> <input type=hidden name="StockID" value="' . $StockID . '"> - <input type=hidden name="identifier" value="' . $identifier . '"> <input type=hidden name="EntryType" value="KEYED">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['EditControlled']) ) { Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/LanguageSetup.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -30,7 +30,7 @@ } else { // it's a windows server $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); } -//$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); +$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); $LocaleInfo = localeconv(); if ($LocaleInfo['mon_decimal_point']==''){ Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-17 22:43:30 UTC (rev 4694) @@ -1,5 +1,5 @@ ALTER TABLE stockmaster DROP lastcurcostdate; ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; INSERT INTO `config` (`confname` ,`confvalue`) -VALUES ('InventoryManagerEmail', 'in...@yo...'); -UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file +VALUES ('InventoryManagerEmail', ''); +UPDATE config SET confvalue='4.05.2' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |