Thread: [Weberp-svn] SF.net SVN: weberp:[8079] trunk (Page 8)
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-09-04 22:09:37
|
Revision: 8079 http://weberp.svn.sourceforge.net/weberp/?rev=8079&view=rev Author: tim_schofield Date: 2011-09-04 22:09:30 +0000 (Sun, 04 Sep 2011) Log Message: ----------- Correctly show the locale number formats Modified Paths: -------------- trunk/SuppInvGRNs.php trunk/includes/DefineSuppTransClass.php Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2011-09-04 22:09:19 UTC (rev 8078) +++ trunk/SuppInvGRNs.php 2011-09-04 22:09:30 UTC (rev 8079) @@ -53,6 +53,9 @@ $InputError=False; $Hold=False; + $_POST['This_QuantityInv'] = filter_number_input($_POST['This_QuantityInv']); + $_POST['QtyRecd'] = filter_number_input($_POST['QtyRecd']); + $_POST['Prev_QuantityInv'] = filter_number_input($_POST['Prev_QuantityInv']); if ($_POST['This_QuantityInv'] >= ($_POST['QtyRecd'] - $_POST['Prev_QuantityInv'])){ $Complete = True; } else { @@ -69,6 +72,7 @@ $InputError = True; prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be invoiced at this price'),'error'); } elseif ($_SESSION['Check_Price_Charged_vs_Order_Price'] == True) { + $_POST['ChgPrice'] = filter_number_input($_POST['ChgPrice']); if ($_POST['ChgPrice']/$_POST['OrderPrice'] > (1+ ($_SESSION['OverChargeProportion'] / 100))){ prnMsg(_('The price being invoiced is more than the purchase order price by more than') . ' ' . $_SESSION['OverChargeProportion'] . '%. ' . _('The system is set up to prohibit this so will put this invoice on hold until it is authorised'),'warn'); @@ -79,20 +83,22 @@ if ($InputError==False){ // $_SESSION['SuppTrans']->Remove_GRN_From_Trans($_POST['GRNNumber']); $_SESSION['SuppTrans']->Modify_GRN_To_Trans($_POST['GRNNumber'], - $_POST['PODetailItem'], - $_POST['ItemCode'], - $_POST['ItemDescription'], - $_POST['QtyRecd'], - $_POST['Prev_QuantityInv'], - $_POST['This_QuantityInv'], - $_POST['OrderPrice'], - $_POST['ChgPrice'], - $Complete, - $_POST['StdCostUnit'], - $_POST['ShiptRef'], - $_POST['JobRef'], - $_POST['GLCode'], - $Hold); + $_POST['PODetailItem'], + $_POST['ItemCode'], + $_POST['ItemDescription'], + $_POST['QtyRecd'], + $_POST['Prev_QuantityInv'], + $_POST['This_QuantityInv'], + $_POST['OrderPrice'], + $_POST['ChgPrice'], + $Complete, + $_POST['StdCostUnit'], + $_POST['ShiptRef'], + $_POST['JobRef'], + $_POST['GLCode'], + $Hold, + 0, + $_POST['DecimalPlaces']); } } @@ -125,9 +131,9 @@ echo '<tr><td>' . $EnteredGRN->GRNNo . '</td> <td>' . $EnteredGRN->ItemCode . '</td> <td>' . $EnteredGRN->ItemDescription . '</td> - <td class="number">' . number_format($EnteredGRN->This_QuantityInv,2) . '</td> - <td class="number">' . number_format($EnteredGRN->ChgPrice,2) . '</td> - <td class="number">' . number_format($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,2) . '</td> + <td class="number">' . stock_number_format($EnteredGRN->This_QuantityInv,$EnteredGRN->DecimalPlaces) . '</td> + <td class="number">' . currency_number_format($EnteredGRN->ChgPrice,$_SESSION['SuppTrans']->CurrCode) . '</td> + <td class="number">' . currency_number_format($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,$_SESSION['SuppTrans']->CurrCode) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Modify=' . $EnteredGRN->GRNNo . '">'. _('Modify') . '</a></td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $EnteredGRN->GRNNo . '">' . _('Delete') . '</a></td> </tr>'; @@ -152,25 +158,29 @@ /* Now get all the outstanding GRNs for this supplier from the database*/ $SQL = "SELECT grnbatch, - grnno, - purchorderdetails.orderno, - purchorderdetails.unitprice, - grns.itemcode, - grns.deliverydate, - grns.itemdescription, - grns.qtyrecd, - grns.quantityinv, - grns.stdcostunit, - purchorderdetails.glcode, - purchorderdetails.shiptref, - purchorderdetails.jobref, - purchorderdetails.podetailitem, - purchorderdetails.assetid - FROM grns INNER JOIN purchorderdetails - ON grns.podetailitem=purchorderdetails.podetailitem - WHERE grns.supplierid ='" . $_SESSION['SuppTrans']->SupplierID . "' - AND grns.qtyrecd - grns.quantityinv > 0 - ORDER BY grns.grnno"; + grnno, + purchorderdetails.orderno, + purchorderdetails.unitprice, + grns.itemcode, + grns.deliverydate, + grns.itemdescription, + grns.qtyrecd, + grns.quantityinv, + grns.stdcostunit, + purchorderdetails.glcode, + purchorderdetails.shiptref, + purchorderdetails.jobref, + purchorderdetails.podetailitem, + purchorderdetails.assetid, + stockmaster.decimalplaces + FROM grns + INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + INNER JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE grns.supplierid ='" . $_SESSION['SuppTrans']->SupplierID . "' + AND grns.qtyrecd - grns.quantityinv > 0 + ORDER BY grns.grnno"; $GRNResults = DB_query($SQL,$db); if (DB_num_rows($GRNResults)==0){ @@ -212,12 +222,13 @@ $myrow['jobref'], $myrow['glcode'], $myrow['orderno'], - $myrow['assetid']); + $myrow['assetid'], + 0, + $myrow['decimalplaces']); } } } - //if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ if (isset($_GET['Modify'])){ $GRNNo = $_GET['Modify']; @@ -237,10 +248,10 @@ echo '<tr> <td>' . $GRNTmp->GRNNo . '</td> <td>' . $GRNTmp->ItemCode . ' ' . $GRNTmp->ItemDescription . '</td> - <td class="number">' . number_format($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv,2) . '</td> - <td><input type="text" class="number" name="This_QuantityInv" value="' . $GRNTmp->This_QuantityInv . '" size="11" maxlength="10" /></td> - <td class="number">' . $GRNTmp->OrderPrice . '</td> - <td><input type="text" class="number" name="ChgPrice" value="' . $GRNTmp->ChgPrice . '" size="11" maxlength="10" /></td> + <td class="number">' . stock_number_format($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv, $GRNTmp->DecimalPlaces) . '</td> + <td><input type="text" class="number" name="This_QuantityInv" value="' . stock_number_format($GRNTmp->This_QuantityInv, $GRNTmp->DecimalPlaces) . '" size="11" maxlength="10" /></td> + <td class="number">' . currency_number_format($GRNTmp->OrderPrice, $_SESSION['SuppTrans']->CurrCode) . '</td> + <td><input type="text" class="number" name="ChgPrice" value="' . currency_number_format($GRNTmp->ChgPrice, $_SESSION['SuppTrans']->CurrCode) . '" size="11" maxlength="10" /></td> </tr>'; echo '</table>'; @@ -248,12 +259,11 @@ echo '<input type="hidden" name='ShiptRef' Value='' />"; echo "Unfortunately, the shipment that this purchase order line item was allocated to has been closed - if you add this item to the transaction then no shipments will not be updated. If you wish to allocate the order line item to a different shipment the order must be modified first."; } else { */ - echo '<input type="hidden" name="ShiptRef" value="' . $GRNTmp->ShiptRef . '" />'; + echo '<input type="hidden" name="ShiptRef" value="' . $GRNTmp->ShiptRef . '" />'; // } echo '<div class="centre"><p><input type="submit" name="ModifyGRN" value="' . _('Modify Line') . '" /></p></div>'; - echo '<input type="hidden" name="GRNNumber" value="' . $GRNTmp->GRNNo . '" />'; echo '<input type="hidden" name="ItemCode" value="' . $GRNTmp->ItemCode . '" />'; echo '<input type="hidden" name="ItemDescription" value="' . $GRNTmp->ItemDescription . '" />'; @@ -265,8 +275,8 @@ echo '<input type="hidden" name="GLCode" value="' . $GRNTmp->GLCode . '" />'; echo '<input type="hidden" name="PODetailItem" value="' . $GRNTmp->PODetailItem . '" />'; echo '<input type="hidden" name="AssetID" value="' . $GRNTmp->AssetID . '" />'; -} -else { + echo '<input type="hidden" name="DecimalPlaces" value="' . $GRNTmp->DecimalPlaces . '" />'; +} else { if (count( $_SESSION['SuppTransTmp']->GRNs)>0){ /*if there are any outstanding GRNs then */ echo '<table cellpadding="1" colspan="7" class="selection">'; echo '<tr><th colspan="10"><font size="3" color="navy">' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</font></th></tr>'; @@ -283,42 +293,34 @@ <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> </tr>'; - $i = 0; $POs = array(); + echo $tableheader; foreach ($_SESSION['SuppTransTmp']->GRNs as $GRNTmp){ - $_SESSION['SuppTransTmp']->GRNs[$GRNTmp->GRNNo]->This_QuantityInv = $GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv; + $_SESSION['SuppTransTmp']->GRNs[$GRNTmp->GRNNo]->This_QuantityInv = $GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv; - if (isset($POs[$GRNTmp->PONo]) and $POs[$GRNTmp->PONo] != $GRNTmp->PONo) { - $POs[$GRNTmp->PONo] = $GRNTmp->PONo; - echo '<tr><td><input type="submit" name="AddPOToTrans" value="' . $GRNTmp->PONo . '" /></td><td colspan="3" />' . _('Add Whole PO to Invoice') . '</td></tr>'; - $i = 0; + if (isset($POs[$GRNTmp->PONo]) and $POs[$GRNTmp->PONo] != $GRNTmp->PONo) { + $POs[$GRNTmp->PONo] = $GRNTmp->PONo; + echo '<tr><td><input type="submit" name="AddPOToTrans" value="' . $GRNTmp->PONo . '" /></td><td colspan="3" />' . _('Add Whole PO to Invoice') . '</td></tr>'; } - if ($i == 0){ - echo $tableheader; + if (isset($_POST['SelectAll'])) { + echo '<tr><td><input type="checkbox" checked name="GRNNo_' . $GRNTmp->GRNNo . '" /></td>'; + } else { + echo '<tr><td><input type="checkbox" name="GRNNo_' . $GRNTmp->GRNNo . '" /></td>'; + } + echo '<td>' . $GRNTmp->GRNNo . '</td> + <td>' . $GRNTmp->PONo . '</td> + <td>' . $GRNTmp->ItemCode . '</td> + <td>' . $GRNTmp->ItemDescription . '</td> + <td class="number">' . stock_number_format($GRNTmp->QtyRecd,$GRNTmp->DecimalPlaces) . '</td> + <td class="number">' . stock_number_format($GRNTmp->Prev_QuantityInv,$GRNTmp->DecimalPlaces) . '</td> + <td class="number">' . stock_number_format(($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv),$GRNTmp->DecimalPlaces) . '</td> + <td class="number">' . currency_number_format($GRNTmp->OrderPrice, $_SESSION['SuppTrans']->CurrCode) . '</td> + <td class="number">' . currency_number_format($GRNTmp->OrderPrice * ($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv),$_SESSION['SuppTrans']->CurrCode) . '</td> + </tr>'; } - if (isset($_POST['SelectAll'])) { - echo '<tr><td><input type="checkbox" checked name="GRNNo_' . $GRNTmp->GRNNo . '" /></td>'; - } else { - echo '<tr><td><input type="checkbox" name="GRNNo_' . $GRNTmp->GRNNo . '" /></td>'; - } - echo '<td>' . $GRNTmp->GRNNo . '</td> - <td>' . $GRNTmp->PONo . '</td> - <td>' . $GRNTmp->ItemCode . '</td> - <td>' . $GRNTmp->ItemDescription . '</td> - <td class="number">' . $GRNTmp->QtyRecd . '</td> - <td class="number">' . $GRNTmp->Prev_QuantityInv . '</td> - <td class="number">' . ($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv) . '</td> - <td class="number">' . $GRNTmp->OrderPrice . '</td> - <td class="number">' . number_format($GRNTmp->OrderPrice * ($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv),2) . '</td> - </tr>'; - $i++; - if ($i>15){ - $i=0; - } - } echo '</table>'; - echo '<br /><div class="centre"><input type="submit" name="SelectAll" Value="' . _('Select All') . '" />'; + echo '<br /><div class="centre"><input type="submit" name="SelectAll" value="' . _('Select All') . '" />'; echo '<input type="submit" name="DeSelectAll" value="' . _('Deselect All') . '" />'; echo '<br /><input type="submit" name="AddGRNToTrans" value="' . _('Add to Invoice') . '" /></div>'; } Modified: trunk/includes/DefineSuppTransClass.php =================================================================== --- trunk/includes/DefineSuppTransClass.php 2011-09-04 22:09:19 UTC (rev 8078) +++ trunk/includes/DefineSuppTransClass.php 2011-09-04 22:09:30 UTC (rev 8079) @@ -100,6 +100,7 @@ $GLCode, $PONo, $AssetID=0, + $Hold=0, $DecimalPlaces=2){ if ($This_QuantityInv!=0 AND isset($This_QuantityInv)){ @@ -119,7 +120,8 @@ $GLCode, $PONo, $AssetID, - $DecimalPlaces=2); + $Hold, + $DecimalPlaces); Return 1; } Return 0; @@ -140,12 +142,12 @@ $JobRef, $GLCode, $Hold, - $PONo, $AssetID=0, $DecimalPlaces=2){ if ($This_QuantityInv!=0 and isset($This_QuantityInv)){ - $this->GRNs[$GRNNo]->Modify($PODetailItem, + $this->GRNs[$GRNNo]->Modify($GRNNo, + $PODetailItem, $ItemCode, $ItemDescription, $QtyRecd, @@ -158,6 +160,7 @@ $ShiptRef, $JobRef, $GLCode, + $DecimalPlaces, $Hold ); Return 1; } @@ -301,9 +304,8 @@ $PONo, $AssetID, $Hold=0, - $DecimalPlaces=2){ + $DecimalPlaces){ - /* Constructor function to add a new GRNs object with passed params */ $this->GRNNo = $GRNNo; $this->PODetailItem = $PODetailItem; @@ -325,7 +327,8 @@ $this->DecimalPlaces = $DecimalPlaces; } - function Modify ($PODetailItem, + function Modify ($GRNNo, + $PODetailItem, $ItemCode, $ItemDescription, $QtyRecd, @@ -338,6 +341,7 @@ $ShiptRef, $JobRef, $GLCode, + $DecimalPlaces, $Hold){ /* Modify function to edit a GRNs object with passed params */ @@ -353,6 +357,7 @@ $this->StdCostUnit = $StdCostUnit; $this->ShiptRef = $ShiptRef; $this->JobRef = $JobRef; + $this->DecimalPlaces = $DecimalPlaces; $this->Hold = $Hold; $this->GLCode = $GLCode; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-06 09:13:48
|
Revision: 8103 http://weberp.svn.sourceforge.net/weberp/?rev=8103&view=rev Author: tim_schofield Date: 2011-09-06 09:13:42 +0000 (Tue, 06 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/StockAdjustments.php trunk/includes/DefineStockAdjustment.php Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-06 09:13:31 UTC (rev 8102) +++ trunk/StockAdjustments.php 2011-09-06 09:13:42 UTC (rev 8103) @@ -45,9 +45,12 @@ $_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']==''){ $_POST['Quantity']=0; + } else { + $_POST['Quantity'] = filter_number_input($_POST['Quantity']); } +echo $_POST['Quantity']; $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; } @@ -382,12 +385,12 @@ if ($_SESSION['Adjustment']->StockLocation == ''){ $_SESSION['Adjustment']->StockLocation = $_SESSION['UserStockLocation']; } - echo '<input type="HIDDEN" name="Quantity" value="' . $_SESSION['Adjustment']->Quantity . '" /> - '.$_SESSION['Adjustment']->Quantity.' + echo '<input type="hidden" name="Quantity" value="' . stock_number_format($_SESSION['Adjustment']->Quantity , $_SESSION['Adjustment']->DecimalPlaces). '" /> + '.stock_number_format($_SESSION['Adjustment']->Quantity, $_SESSION['Adjustment']->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="' . stock_number_format($Quantity, $_SESSION['Adjustment']->DecimalPlaces) . '" />'; } echo '</td></tr>'; //Select the tag Modified: trunk/includes/DefineStockAdjustment.php =================================================================== --- trunk/includes/DefineStockAdjustment.php 2011-09-06 09:13:31 UTC (rev 8102) +++ trunk/includes/DefineStockAdjustment.php 2011-09-06 09:13:42 UTC (rev 8103) @@ -2,31 +2,31 @@ /* $Id$*/ class StockAdjustment { - var $StockID; - Var $StockLocation; - var $Controlled; - var $Serialised; - var $ItemDescription; - Var $PartUnit; - Var $StandardCost; - Var $DecimalPlaces; - Var $Quantity; - var $tag; - var $SerialItems; /*array to hold controlled items*/ + var $StockID; + var $StockLocation; + var $Controlled; + var $Serialised; + var $ItemDescription; + var $PartUnit; + var $StandardCost; + var $DecimalPlaces; + var $Quantity; + var $tag; + var $SerialItems; /*array to hold controlled items*/ - //Constructor - function StockAdjustment(){ - $this->StockID = ''; - $this->StockLocation = ''; - $this->Controlled = ''; - $this->Serialised = ''; - $this->ItemDescription = ''; - $this->PartUnit = ''; - $this->StandardCost = 0; - $this->DecimalPlaces = 0; - $this->SerialItems = array(); - $Quantity =0; - $this->tag=0; - } + //Constructor + function StockAdjustment(){ + $this->StockID = ''; + $this->StockLocation = ''; + $this->Controlled = ''; + $this->Serialised = ''; + $this->ItemDescription = ''; + $this->PartUnit = ''; + $this->StandardCost = 0; + $this->DecimalPlaces = 0; + $this->SerialItems = array(); + $Quantity =0; + $this->tag=0; + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-06 09:14:05
|
Revision: 8104 http://weberp.svn.sourceforge.net/weberp/?rev=8104&view=rev Author: tim_schofield Date: 2011-09-06 09:13:58 +0000 (Tue, 06 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/Shipments.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/includes/DefineShiptClass.php trunk/includes/LanguageSetup.php Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2011-09-06 09:13:42 UTC (rev 8103) +++ trunk/Shipments.php 2011-09-06 09:13:58 UTC (rev 8104) @@ -250,6 +250,7 @@ purchorderdetails.quantityrecd, purchorderdetails.deliverydate, stockmaster.units, + stockmaster.decimalplaces, purchorderdetails.qtyinvoiced FROM purchorderdetails INNER JOIN stockmaster ON purchorderdetails.itemcode=stockmaster.stockid @@ -277,6 +278,7 @@ $myrow['quantityord'], $myrow['quantityrecd'], $StandardCost, + $myrow['decimalplaces'], $db); } @@ -411,12 +413,13 @@ echo '<td>'.$LnItm->OrderNo.'</td> - <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td><td class="number">' . number_format($LnItm->QuantityOrd,2) . '</td> + <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td> + <td class="number">' . stock_number_format($LnItm->QuantityOrd,$LnItm->DecimalPlaces) . '</td> <td>'. $LnItm->UOM .'</td> - <td class="number">' . number_format($LnItm->QuantityRecd,2) . '</td> - <td class="number">' . number_format($LnItm->QtyInvoiced,2) . '</td> - <td class="number">' . number_format($LnItm->UnitPrice,2) . '</td> - <td class="number">' . number_format($LnItm->StdCostUnit,2) . '</td> + <td class="number">' . stock_number_format($LnItm->QuantityRecd,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . stock_number_format($LnItm->QtyInvoiced,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . currency_number_format($LnItm->UnitPrice,$_SESSION['Shipment']->CurrCode) . '</td> + <td class="number">' . currency_number_format($LnItm->StdCostUnit,$_SESSION['Shipment']->CurrCode) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->PODetailItem . '">'. _('Delete'). '</a></td> </tr>'; }//for each line on the shipment @@ -437,7 +440,8 @@ purchorderdetails.quantityord, purchorderdetails.quantityrecd, purchorderdetails.deliverydate, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno INNER JOIN stockmaster @@ -488,9 +492,9 @@ echo '<td>' . $myrow['orderno'] . '</td> <td>' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'] . '</td> - <td class="number">' . number_format($myrow['quantityord'],2) . '</td> + <td class="number">' . stock_number_format($myrow['quantityord'],$myrow['decimalplaces']) . '</td> <td>' . $myrow['units'] . '</td> - <td class="number">' . number_format($myrow['quantityrecd'],2) . '</td> + <td class="number">' . stock_number_format($myrow['quantityrecd'],$myrow['decimalplaces']) . '</td> <td class="number">' . ConvertSQLDate($myrow['deliverydate']) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Add=' . $myrow['podetailitem'] . '">'. _('Add').'</a></td> </tr>'; Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-09-06 09:13:42 UTC (rev 8103) +++ trunk/SpecialOrder.php 2011-09-06 09:13:58 UTC (rev 8104) @@ -541,10 +541,7 @@ echo '<div class="centre"><b>' . _('Special Order Summary') . '</b></div>'; echo '<table cellpadding="2" colspan="7" border="1">'; - $sql = "SELECT currencydefault FROM companies"; - $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); - $DefaultCurrency = $myrow[0]; + $DefaultCurrency = $_SESSION['CompanyRecord']['currencydefault']; echo '<tr> <th>' . _('Item Description') . '</th> @@ -564,13 +561,13 @@ $LineTotal = $SPLLine->Quantity * $SPLLine->Price; $LineCostTotal = $SPLLine->Quantity * $SPLLine->Cost; - $DisplayLineTotal = number_format($LineTotal,2); - $DisplayLineCostTotal = number_format($LineCostTotal,2); - $DisplayLineTotalCurr = number_format($LineTotal/$_SESSION['SPL']->CustCurrExRate,2); - $DisplayLineCostTotalCurr = number_format($LineCostTotal/$_SESSION['SPL']->SuppCurrExRate,2); - $DisplayCost = number_format($SPLLine->Cost,2); - $DisplayPrice = number_format($SPLLine->Price,2); - $DisplayQuantity = number_format($SPLLine->Quantity,2); + $DisplayLineTotal = currency_number_format($LineTotal,$DefaultCurrency); + $DisplayLineCostTotal = currency_number_format($LineCostTotal,$_SESSION['SPL']->SuppCurrCode); + $DisplayLineTotalCurr = currency_number_format($LineTotal/$_SESSION['SPL']->CustCurrExRate,$_SESSION['SPL']->CustCurrCode); + $DisplayLineCostTotalCurr = currency_number_format($LineCostTotal/$_SESSION['SPL']->SuppCurrExRate,$_SESSION['SPL']->SuppCurrCode); + $DisplayCost = currency_number_format($SPLLine->Cost,$_SESSION['SPL']->SuppCurrCode); + $DisplayPrice = currency_number_format($SPLLine->Price,$_SESSION['SPL']->CustCurrCode); + $DisplayQuantity = currency_number_format($SPLLine->Quantity,$DefaultCurrency); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -593,7 +590,7 @@ $_SESSION['SPL']->total = $_SESSION['SPL']->total + $DisplayLineTotalCurr; } - $DisplayTotal = number_format($_SESSION['SPL']->total,2); + $DisplayTotal = currency_number_format($_SESSION['SPL']->total,$DefaultCurrency); echo '<tr> <td colspan="8" class="number">' . _('TOTAL Excl Tax') . '</td> <td class="number"><b>'.$DisplayTotal.'</b></td> Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-06 09:13:42 UTC (rev 8103) +++ trunk/StockAdjustments.php 2011-09-06 09:13:58 UTC (rev 8104) @@ -50,7 +50,6 @@ } else { $_POST['Quantity'] = filter_number_input($_POST['Quantity']); } -echo $_POST['Quantity']; $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; } @@ -348,7 +347,7 @@ 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').' = ' . - number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; + currency_number_format($_SESSION['Adjustment']->StandardCost,$_SESSION['CompanyRecord']['currencydefault']) . '</font></td></tr>'; } echo '<tr><td>'. _('Adjustment to Stock At Location').':</td><td><select name="StockLocation"> '; Modified: trunk/includes/DefineShiptClass.php =================================================================== --- trunk/includes/DefineShiptClass.php 2011-09-06 09:13:42 UTC (rev 8103) +++ trunk/includes/DefineShiptClass.php 2011-09-06 09:13:58 UTC (rev 8104) @@ -34,9 +34,21 @@ $QuantityOrd, $QuantityRecd, $StdCostUnit, + $DecimalPlaces, &$db){ - $this->LineItems[$PODetailItem]= new LineDetails($PODetailItem,$OrderNo,$StockID,$ItemDescr, $QtyInvoiced, $UnitPrice, $UOM, $DelDate, $QuantityOrd, $QuantityRecd, $StdCostUnit); + $this->LineItems[$PODetailItem]= new LineDetails($PODetailItem, + $OrderNo, + $StockID, + $ItemDescr, + $QtyInvoiced, + $UnitPrice, + $UOM, + $DelDate, + $QuantityOrd, + $QuantityRecd, + $StdCostUnit, + $DecimalPlaces); $sql = "UPDATE purchorderdetails SET shiptref = '" . $this->ShiptRef . "' WHERE podetailitem = '" . $PODetailItem . "'"; @@ -74,9 +86,21 @@ var $QuantityOrd; var $QuantityRecd; var $StdCostUnit; + var $DecimalPlaces; - function LineDetails ($PODetailItem, $OrderNo, $StockID, $ItemDescr, $QtyInvoiced, $UnitPrice, $UOM, $DelDate, $QuantityOrd, $QuantityRecd, $StdCostUnit){ + function LineDetails ($PODetailItem, + $OrderNo, + $StockID, + $ItemDescr, + $QtyInvoiced, + $UnitPrice, + $UOM, + $DelDate, + $QuantityOrd, + $QuantityRecd, + $StdCostUnit, + $DecimalPlaces){ /* Constructor function to add a new LineDetail object with passed params */ $this->PODetailItem = $PODetailItem; @@ -90,6 +114,7 @@ $this->QuantityRecd = $QuantityRecd; $this->QuantityOrd = $QuantityOrd; $this->StdCostUnit = $StdCostUnit; + $this->DecimalPlaces = $DecimalPlaces; } } Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-06 09:13:42 UTC (rev 8103) +++ trunk/includes/LanguageSetup.php 2011-09-06 09:13:58 UTC (rev 8104) @@ -31,7 +31,7 @@ //$Locale = setlocale (LC_CTYPE, $_SESSION['Language']); //$Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); -// $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver + $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver if ($_SESSION['Language']=='tr_TR.utf8') { $Locale = setlocale(LC_CTYPE, 'C'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-06 19:42:48
|
Revision: 8109 http://weberp.svn.sourceforge.net/weberp/?rev=8109&view=rev Author: tim_schofield Date: 2011-09-06 19:42:42 +0000 (Tue, 06 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/SelectRecurringSalesOrder.php trunk/css/silverwolf/default.css Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2011-09-06 19:42:31 UTC (rev 8108) +++ trunk/SelectRecurringSalesOrder.php 2011-09-06 19:42:42 UTC (rev 8109) @@ -38,6 +38,7 @@ $SQL = "SELECT recurringsalesorders.recurrorderno, debtorsmaster.name, + debtorsmaster.currcode, custbranch.brname, recurringsalesorders.customerref, recurringsalesorders.orddate, @@ -101,7 +102,7 @@ $ModifyPage = $rootpath . '/RecurringSalesOrders.php?ModifyRecurringSalesOrder=' . $myrow['recurrorderno']; $FormatedLastRecurrence = ConvertSQLDate($myrow['lastrecurrence']); $FormatedStopDate = ConvertSQLDate($myrow['stopdate']); - $FormatedOrderValue = number_format($myrow['ordervalue'],2); + $FormatedOrderValue = currency_number_format($myrow['ordervalue'],$myrow['currcode']); printf('<td><a href="%s">%s</a></td> <td>%s</td> Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2011-09-06 19:42:31 UTC (rev 8108) +++ trunk/css/silverwolf/default.css 2011-09-06 19:42:42 UTC (rev 8109) @@ -616,9 +616,9 @@ padding-top: 2px; padding-bottom: 2px; font-weight: bold; - font-size: 100%; - color: black; - background-color: #cccce5; + font-size: 150%; + color: white; + background-color: #B0B0D5; width: 33%; border-style: solid; border-width: 1px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-06 19:43:00
|
Revision: 8110 http://weberp.svn.sourceforge.net/weberp/?rev=8110&view=rev Author: tim_schofield Date: 2011-09-06 19:42:54 +0000 (Tue, 06 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/SelectProduct.php trunk/includes/ConnectDB_mysqli.inc Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-09-06 19:42:42 UTC (rev 8109) +++ trunk/SelectProduct.php 2011-09-06 19:42:54 UTC (rev 8110) @@ -69,7 +69,7 @@ $Its_A_Dummy = false; $Its_A_Kitset = false; $Its_A_Labour_Item = false; - echo '<table width="90%"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . '</b></th></tr>'; + echo '<table width="90%" class="selection"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . '</b></th></tr>'; echo '<tr><td width="40%" valign="top"> <table align="left">'; //nested table echo '<tr><th class="number">' . _('Item Type:') . '</th><td colspan="2" class="select">'; @@ -107,13 +107,14 @@ echo _('N/A'); } echo '</td><th class="number">' . _('Units') . ':</th><td class="select">' . $myrow['units'] . '</td></tr>'; - echo '<tr><th class="number">' . _('Volume') . ':</th><td class="select" colspan="2">' . number_format($myrow['volume'], 3) . '</td> - <th class="number">' . _('Weight') . ':</th><td class="select">' . number_format($myrow['kgs'], 3) . '</td> - <th class="number">' . _('EOQ') . ':</th><td class="select">' . number_format($myrow['eoq'], $myrow['decimalplaces']) . '</td></tr>'; + echo '<tr><th class="number">' . _('Volume') . ':</th><td class="select" colspan="2">' . stock_number_format($myrow['volume'], 3) . '</td> + <th class="number">' . _('Weight') . ':</th><td class="select">' . stock_number_format($myrow['kgs'], 3) . '</td> + <th class="number">' . _('EOQ') . ':</th><td class="select">' . stock_number_format($myrow['eoq'], $myrow['decimalplaces']) . '</td></tr>'; if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<tr><th>' . _('Sell Price') . ':</th><td class="select">'; $PriceResult = DB_query("SELECT sales_type as typeabbrev, price, + currabrev, decimalplaces FROM prices LEFT JOIN salestypes @@ -141,22 +142,22 @@ echo _('No Default Price Set in Home Currency') . '</td>'; $Price = 0; } else { - $PriceRow = DB_fetch_row($PriceResult); - $Price = $PriceRow[1]; - echo $PriceRow[0] . '</td><td class="select">' . number_format($Price, 2) . '</td> + $PriceRow = DB_fetch_array($PriceResult); + $Price = $PriceRow['price']; + echo $PriceRow['typeabbrev'] . '</td><td class="select">' . currency_number_format($Price, $PriceRow['currabrev']) . '</td> <th class="number">' . _('Gross Profit') . '</th><td class="select">'; if ($Price > 0) { - $GP = number_format(($Price - $Cost) * 100 / $Price, 2); + $GP = currency_number_format(($Price - $Cost) * 100 / $Price, $PriceRow['currabrev']); } else { $GP = _('N/A'); } echo $GP . '%' . '</td></tr>'; while ($PriceRow = DB_fetch_row($PriceResult)) { - $Price = $PriceRow[1]; - echo '<tr><th></th><td class="select">' . $PriceRow[0] . '</td><td class="select">' . number_format($Price, 2) . '</td> + $Price = $PriceRow['price']; + echo '<tr><th></th><td class="select">' . $PriceRow['typeabbrev'] . '</td><td class="select">' . currency_number_format($Price, $PriceRow['currabrev']) . '</td> <th class="number">' . _('Gross Profit') . '</th><td class="select">'; if ($Price > 0) { - $GP = number_format(($Price - $Cost) * 100 / $Price, 2); + $GP = currency_number_format(($Price - $Cost) * 100 / $Price, $PriceRow['currabrev']); } else { $GP = _('N/A'); } @@ -177,7 +178,7 @@ } else { $Cost = $myrow['cost']; } - echo '<th class="number">' . _('Cost') . '</th><td class="select">' . number_format($Cost, 3) . '</td>'; + echo '<th class="number">' . _('Cost') . '</th><td class="select">' . currency_number_format($Cost, $_SESSION['CompanyRecord']['currencydefault']) . '</td>'; } //end of if PricesSecuirty allows viewing of prices echo '</table>'; //end of first nested table // Item Category Property mod: display the item properties @@ -275,7 +276,7 @@ FROM locstock WHERE stockid = '" . $StockID . "'", $db); $QOHRow = DB_fetch_row($QOHResult); - $QOH = number_format($QOHRow[0], $myrow['decimalplaces']); + $QOH = stock_number_format($QOHRow[0], $myrow['decimalplaces']); $QOOSQL="SELECT SUM((purchorderdetails.quantityord*purchorderdetails.conversionfactor) - (purchorderdetails.quantityrecd*purchorderdetails.conversionfactor)) FROM purchorders @@ -305,7 +306,7 @@ $QOORow = DB_fetch_row($QOOResult); $QOO+= $QOORow[0]; } - $QOO = number_format($QOO, $myrow['decimalplaces']); + $QOO = stock_number_format($QOO, $myrow['decimalplaces']); break; } $Demand = 0; @@ -347,7 +348,7 @@ $Demand+= $DemandRow[0]; } echo '<tr><th class="number" width="15%">' . _('Quantity On Hand') . ':</th><td width="17%" class="select">' . $QOH . '</td></tr>'; - echo '<tr><th class="number" width="15%">' . _('Quantity Demand') . ':</th><td width="17%" class="select">' . number_format($Demand, $myrow['decimalplaces']) . '</td></tr>'; + echo '<tr><th class="number" width="15%">' . _('Quantity Demand') . ':</th><td width="17%" class="select">' . stock_number_format($Demand, $myrow['decimalplaces']) . '</td></tr>'; echo '<tr><th class="number" width="15%">' . _('Quantity On Order') . ':</th><td width="17%" class="select">' . $QOO . '</td></tr> </table>'; //end of nested table echo '</td>'; //end cell of master table @@ -375,11 +376,11 @@ ORDER BY purchdata.preferred DESC, purchdata.effectivefrom DESC", $db); while ($SuppRow = DB_fetch_array($SuppResult)) { echo '<tr><td class="select">' . $SuppRow['suppname'] . '</td> - <td class="select">' . number_format($SuppRow['price'] / $SuppRow['conversionfactor'], 2) . '</td> + <td class="select">' . currency_number_format($SuppRow['price'] / $SuppRow['conversionfactor'], $SuppRow['currcode']) . '</td> <td class="select">' . $SuppRow['currcode'] . '</td> <td class="select">' . ConvertSQLDate($SuppRow['effectivefrom']) . '</td> <td class="select">' . $SuppRow['leadtime'] . '</td> - <td class="select">' . $SuppRow['minorderqty'] . '</td>'; + <td class="select">' . stock_number_format($SuppRow['minorderqty'], $myrow['decimalplaces']) . '</td>'; if ($SuppRow['preferred']==1) { //then this is the preferred supplier echo '<td class="select">' . _('Yes') . '</td>'; @@ -394,7 +395,7 @@ DB_data_seek($result, 0); } echo '</td></tr></table><br />'; // end first item details table - echo '<table width="90%"><tr> + echo '<table width="90%" class="selection" cellpadding="1"><tr> <th width="33%">' . _('Item Inquiries') . '</th> <th width="33%">' . _('Item Transactions') . '</th> <th width="33%">' . _('Item Maintenance') . '</th> @@ -749,7 +750,7 @@ if ($myrow['mbflag'] == 'D') { $qoh = _('N/A'); } else { - $qoh = number_format($myrow['qoh'], $myrow['decimalplaces']); + $qoh = stock_number_format($myrow['qoh'], $myrow['decimalplaces']); } echo '<td><input type="submit" name="Select" value="'.$myrow['stockid'].'" /></td> <td>'.$myrow['description'].'</td> Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2011-09-06 19:42:42 UTC (rev 8109) +++ trunk/includes/ConnectDB_mysqli.inc 2011-09-06 19:42:54 UTC (rev 8110) @@ -14,7 +14,7 @@ $mysqlport = 3306; } $db = mysqli_connect($host , $dbuser, $dbpassword,$_SESSION['DatabaseName'], $mysqlport); -//$result=DB_query("SET sql_mode = ONLY_FULL_GROUP_BY", $db); +$result=DB_query("SET sql_mode = ''", $db); //printf("tried making mysql-i Connection.\n"); //$varabc = mysqli_client_encoding($db); //printf("client encoding is %s\n", $varabc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-11 21:39:18
|
Revision: 8131 http://weberp.svn.sourceforge.net/weberp/?rev=8131&view=rev Author: tim_schofield Date: 2011-09-11 21:39:12 +0000 (Sun, 11 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/Prices.php trunk/includes/class.pdf.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-09-11 21:38:57 UTC (rev 8130) +++ trunk/Prices.php 2011-09-11 21:39:12 UTC (rev 8131) @@ -67,7 +67,7 @@ //first off validate inputs sensible // This gives some date in 1999?? $ZeroDate = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,0,0,0)); - + $_POST['Price'] = filter_currency_input($_POST['Price']); if (!is_double((double) trim($_POST['Price'])) OR $_POST['Price']=='') { $InputError = 1; prnMsg( _('The price entered must be numeric'),'error'); @@ -107,7 +107,7 @@ $sql = "UPDATE prices SET typeabbrev='" . $_POST['TypeAbbrev'] . "', currabrev='" . $_POST['CurrAbrev'] . "', - price='" . $_POST['Price'] . "', + price='" . filter_currency_input($_POST['Price']) . "', units='" . $_POST['Units'] . "', conversionfactor='" . $_POST['ConversionFactor'] . "', decimalplaces='" . $_POST['DecimalPlaces'] . "', @@ -154,15 +154,15 @@ startdate, enddate, price) - values ('".$Item."', + VALUES ('".$Item."', '" . $_POST['TypeAbbrev'] . "', '" . $_POST['CurrAbrev'] . "', '" . $_POST['Units'] . "', - '" . $_POST['ConversionFactor'] . "', + '" . filter_number_input($_POST['ConversionFactor']) . "', '" . $_POST['DecimalPlaces'] . "', '" . FormatDateForSQL($_POST['StartDate']) . "', '" . $SQLEndDate. "', - '" . $_POST['Price'] . "')"; + '" . filter_currency_input($_POST['Price']) . "')"; $ErrMsg = _('The new price could not be added'); $result = DB_query($sql,$db,$ErrMsg); @@ -259,9 +259,9 @@ echo '<td>'.$myrow['sales_type'].'</td> <td>'.$myrow['currency'].'</td> <td>'.$myrow['units'].'</td> - <td class="number">'.$myrow['conversionfactor'].'</td> + <td class="number">'.stock_number_format($myrow['conversionfactor'],4).'</td> <td class="number">'.$myrow['decimalplaces'].'</td> - <td class="number">'.number_format($myrow['price'],2).'</td> + <td class="number">'.currency_number_format($myrow['price'],$myrow['currabrev']).'</td> <td>'.ConvertSQLDate($myrow['startdate']).'</td> <td>'.$EndDateDisplay.'</td> </tr>'; @@ -269,9 +269,9 @@ echo '<td>'.$myrow['sales_type'].'</td> <td>'.$myrow['currency'].'</td> <td>'.$myrow['units'].'</td> - <td class="number">'.$myrow['conversionfactor'].'</td> + <td class="number">'.stock_number_format($myrow['conversionfactor']).'</td> <td class="number">'.$myrow['decimalplaces'].'</td> - <td class="number">'.number_format($myrow['price'],2).'</td> + <td class="number">'.currency_number_format($myrow['price'],$myrow['currabrev']).'</td> <td>'.ConvertSQLDate($myrow['startdate']).'</td> <td>'.$EndDateDisplay.'</td> </tr>'; @@ -397,18 +397,18 @@ echo '<tr><td>'. _('Decimal Places') . '<br />'._('to display').'</td>'; if(isset($_POST['DecimalPlaces'])) { - echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="' . $_POST['DecimalPlaces'] . '" />'; + echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="' . stock_number_format($_POST['DecimalPlaces'],0) . '" />'; } else { - echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value=0" />'; + echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="0" />'; } echo '</td></tr>'; echo '<tr><td>'. _('Conversion Factor') . '<br />'._('to stock units').'</td>'; if(isset($_POST['ConversionFactor'])) { - echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . $_POST['ConversionFactor'] . '" />'; + echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . stock_number_format($_POST['ConversionFactor'],4) . '" />'; } else { - echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="1" />'; + echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . stock_number_format(1.0000,4) . '" />'; } echo '</td></tr>'; @@ -416,9 +416,9 @@ echo '<tr><td>'. _('Price') . ':</td>'; if(isset($_POST['Price'])) { - echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . $_POST['Price'] . '" />'; + echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . currency_number_format($_POST['Price'],$_POST['CurrAbrev']) . '" />'; } else { - echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="0" />'; + echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . currency_number_format(0,$_POST['CurrAbrev']) . '" />'; } echo '</td></tr>'; Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2011-09-11 21:38:57 UTC (rev 8130) +++ trunk/includes/class.pdf.php 2011-09-11 21:39:12 UTC (rev 8131) @@ -150,8 +150,8 @@ if ($angle != 0){ $a = -1*deg2rad((float)$angle); $tmp = "\n q "; - $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; - $tmp .= sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' cm'; + $tmp .= number_format(cos($a),3,'.','').' '.number_format((-1*sin($a)),3,'.','').' '.number_format(sin($a),3,'.','').' '.number_format(cos($a),3,'.','').' '; + $tmp .= number_format($x0,3,'.','').' '.number_format($y0,3,'.','').' cm'; $x0=0; $y0=0; } else { @@ -164,7 +164,7 @@ $c0 = -$r1*sin($t1); $d0 = $r2*cos($t1); - $tmp.="\n".sprintf('%.3f',$a0).' '.sprintf('%.3f',$b0).' m '; + $tmp.="\n".number_format($a0,3,'.','').' '.number_format($b0,3,'.','').' m '; for ($i=1;$i<=$nSeg;$i++){ // draw this bit of the total curve $t1 = $i*$dt+$astart; @@ -172,8 +172,8 @@ $b1 = $y0+$r2*sin($t1); $c1 = -$r1*sin($t1); $d1 = $r2*cos($t1); - $tmp.="\n".sprintf('%.3f',($a0+$c0*$dtm)).' '.sprintf('%.3f',($b0+$d0*$dtm)); - $tmp.= ' '.sprintf('%.3f',($a1-$c1*$dtm)).' '.sprintf('%.3f',($b1-$d1*$dtm)).' '.sprintf('%.3f',$a1).' '.sprintf('%.3f',$b1).' c'; + $tmp.="\n".number_format(($a0+$c0*$dtm),3,'.','').' '.number_format($b0+$d0*$dtm,3,'.',''); + $tmp.= ' '.number_format(($a1-$c1*$dtm),3,'.','').' '.number_format(($b1-$d1*$dtm),3,'.','').' '.number_format($a1,3,'.','').' '.number_format($b1,3,'.','').' c'; $a0=$a1; $b0=$b1; $c0=$c1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-12 07:40:41
|
Revision: 8133 http://weberp.svn.sourceforge.net/weberp/?rev=8133&view=rev Author: tim_schofield Date: 2011-09-12 07:40:32 +0000 (Mon, 12 Sep 2011) Log Message: ----------- Replace function names with those used by Phil Modified Paths: -------------- trunk/Payments.php trunk/Prices.php trunk/Prices_Customer.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PrintSalesOrder_generic.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesInquiry.php trunk/SelectCompletedOrder.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockUsage.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/Tax.php trunk/TopItems.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/build/tests/SupplierTest.php trunk/includes/MiscFunctions.php Property Changed: ---------------- trunk/build/tests/SupplierTest.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/Payments.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -822,7 +822,7 @@ if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . currency_number_format($SuggestedFunctionalExRate,$_SESSION['PaymentDetail']->AccountCurrency) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_money_format($SuggestedFunctionalExRate,$_SESSION['PaymentDetail']->AccountCurrency) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } @@ -830,7 +830,7 @@ $_POST['FunctionalExRate'] = $SuggestedFunctionalExRate; } echo '<tr><td>' . _('Functional Exchange Rate') . ':</td> - <td><input type="text" name="FunctionalExRate" maxlength="10" size="12" value="' . currency_number_format($_POST['FunctionalExRate'], $_SESSION['PaymentDetail']->AccountCurrency) . '" /></td> + <td><input type="text" name="FunctionalExRate" maxlength="10" size="12" value="' . locale_money_format($_POST['FunctionalExRate'], $_SESSION['PaymentDetail']->AccountCurrency) . '" /></td> <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) AND the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td></tr>'; } echo '<tr><td>' . _('Payment type') . ':</td> @@ -978,7 +978,7 @@ if (isset($_POST['GLAmount'])) { echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> - <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value="' . currency_number_format($_POST['GLAmount'], $_SESSION['PaymentDetail']->Currency) . '" /></td> + <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value="' . locale_money_format($_POST['GLAmount'], $_SESSION['PaymentDetail']->Currency) . '" /></td> </tr>'; } else { echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> @@ -1015,7 +1015,7 @@ } echo '<tr> <td align=left>' . $PaymentItem->cheque . '</td> - <td class="number">' . currency_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->Currency) . '</td> + <td class="number">' . locale_money_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->Currency) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> @@ -1023,7 +1023,7 @@ </tr>'; $PaymentTotal += $PaymentItem->Amount; } - echo '<tr><td></td><td class="number"><b>' . currency_number_format($PaymentTotal,$_SESSION['PaymentDetail']->Currency) . '</b></td><td colspan="3"></td></tr></table><br />'; + echo '<tr><td></td><td class="number"><b>' . locale_money_format($PaymentTotal,$_SESSION['PaymentDetail']->Currency) . '</b></td><td colspan="3"></td></tr></table><br />'; echo '<input type="submit" name="CommitBatch" value="' . _('Accept AND Process Payment') . '" />'; } @@ -1032,11 +1032,11 @@ the fields for entry of receipt amt and disc */ echo '<table class="selection"><tr><td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> - <td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . currency_number_format($_SESSION['PaymentDetail']->Amount, $_SESSION['PaymentDetail']->Currency) . '" /></td></tr>'; + <td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . locale_money_format($_SESSION['PaymentDetail']->Amount, $_SESSION['PaymentDetail']->Currency) . '" /></td></tr>'; if (isset($_SESSION['PaymentDetail']->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . currency_number_format($_SESSION['PaymentDetail']->Discount, $_SESSION['PaymentDetail']->Currency) . '" /></td></tr>'; + <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . locale_money_format($_SESSION['PaymentDetail']->Discount, $_SESSION['PaymentDetail']->Currency) . '" /></td></tr>'; echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail']->SuppName . '" />'; } else { echo '<input type="hidden" name="discount" value=0 />'; Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/Prices.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -259,9 +259,9 @@ echo '<td>'.$myrow['sales_type'].'</td> <td>'.$myrow['currency'].'</td> <td>'.$myrow['units'].'</td> - <td class="number">'.stock_number_format($myrow['conversionfactor'],4).'</td> + <td class="number">'.locale_number_format($myrow['conversionfactor'],4).'</td> <td class="number">'.$myrow['decimalplaces'].'</td> - <td class="number">'.currency_number_format($myrow['price'],$myrow['currabrev']).'</td> + <td class="number">'.locale_money_format($myrow['price'],$myrow['currabrev']).'</td> <td>'.ConvertSQLDate($myrow['startdate']).'</td> <td>'.$EndDateDisplay.'</td> </tr>'; @@ -269,9 +269,9 @@ echo '<td>'.$myrow['sales_type'].'</td> <td>'.$myrow['currency'].'</td> <td>'.$myrow['units'].'</td> - <td class="number">'.stock_number_format($myrow['conversionfactor']).'</td> + <td class="number">'.locale_number_format($myrow['conversionfactor']).'</td> <td class="number">'.$myrow['decimalplaces'].'</td> - <td class="number">'.currency_number_format($myrow['price'],$myrow['currabrev']).'</td> + <td class="number">'.locale_money_format($myrow['price'],$myrow['currabrev']).'</td> <td>'.ConvertSQLDate($myrow['startdate']).'</td> <td>'.$EndDateDisplay.'</td> </tr>'; @@ -397,7 +397,7 @@ echo '<tr><td>'. _('Decimal Places') . '<br />'._('to display').'</td>'; if(isset($_POST['DecimalPlaces'])) { - echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="' . stock_number_format($_POST['DecimalPlaces'],0) . '" />'; + echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="' . locale_number_format($_POST['DecimalPlaces'],0) . '" />'; } else { echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="0" />'; } @@ -406,9 +406,9 @@ echo '<tr><td>'. _('Conversion Factor') . '<br />'._('to stock units').'</td>'; if(isset($_POST['ConversionFactor'])) { - echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . stock_number_format($_POST['ConversionFactor'],4) . '" />'; + echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . locale_number_format($_POST['ConversionFactor'],4) . '" />'; } else { - echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . stock_number_format(1.0000,4) . '" />'; + echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . locale_number_format(1.0000,4) . '" />'; } echo '</td></tr>'; @@ -416,9 +416,9 @@ echo '<tr><td>'. _('Price') . ':</td>'; if(isset($_POST['Price'])) { - echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . currency_number_format($_POST['Price'],$_POST['CurrAbrev']) . '" />'; + echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . locale_money_format($_POST['Price'],$_POST['CurrAbrev']) . '" />'; } else { - echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . currency_number_format(0,$_POST['CurrAbrev']) . '" />'; + echo '<td><input type="text" class="number" name="Price" size="12" maxlength="11" value="' . locale_money_format(0,$_POST['CurrAbrev']) . '" />'; } echo '</td></tr>'; Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/Prices_Customer.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -115,9 +115,9 @@ $sql = "UPDATE prices SET typeabbrev='" . $SalesType . "', currabrev='" . $CurrCode . "', - price='" . $_POST['Price'] . "', + price='" . filter_currency_input($_POST['Price']) . "', units='" . $_POST['Units'] . "', - conversionfactor='" . $_POST['ConversionFactor'] . "', + conversionfactor='" . filter_number_input($_POST['ConversionFactor']) . "', decimalplaces='" . $_POST['DecimalPlaces'] . "', branchcode='" . $_POST['Branch'] . "', startdate='" . FormatDateForSQL($_POST['StartDate']) . "', @@ -149,9 +149,9 @@ '".$SalesType."', '".$CurrCode."', '" . $_SESSION['CustomerID'] . "', - '" . $_POST['Price'] . "', + '" . filter_currency_input($_POST['Price']) . "', '" . $_POST['Units'] . "', - '" . $_POST['ConversionFactor'] . "', + '" . filter_number_input($_POST['ConversionFactor']) . "', '" . $_POST['DecimalPlaces'] . "', '" . $_POST['Branch'] . "', '" . FormatDateForSQL($_POST['StartDate']) . "', @@ -243,9 +243,9 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo '<tr class="EvenTableRows"> - <td class="number">'.number_format($myrow['price'],2).'</td> + <td class="number">'.locale_money_format($myrow['price'],$CurrCode).'</td> <td>'.$myrow['units'].'</td> - <td class="number">'.$myrow['conversionfactor'].'</td> + <td class="number">'.locale_number_format($myrow['conversionfactor'],4).'</td> <td class="number">'.$myrow['decimalplaces'].'</td> <td class="date">'.ConvertSQLDate($myrow['startdate']).'</td> <td class="date">'.$EndDateDisplay.'</td> @@ -310,7 +310,7 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo '<tr bgcolor="#CCCCCC"> - <td class="number">'.number_format($myrow['price'],2).'</td> + <td class="number">'.locale_money_format($myrow['price'],$myrow['currcode']).'</td> <td>'.$Branch.'</td> <td>'.$myrow['units'].'</td> <td class="number">'.$myrow['conversionfactor'].'</td> @@ -396,6 +396,7 @@ $sql = "SELECT custbranch.branchcode, custbranch.brname, + debtorsmaster.currcode, currencies.currency FROM custbranch LEFT JOIN debtorsmaster @@ -410,6 +411,7 @@ echo '<td><select name="Branch">'; while ($myrow=DB_fetch_array($result)) { $CustomerCurrency=$myrow['currency']; + $CustomerCurrencyCode=$myrow['currcode']; if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected="True" value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; } else { @@ -449,13 +451,13 @@ echo '<tr><td>'. _('Conversion Factor') . '<br />'._('to stock units').'</td>'; if(isset($_POST['ConversionFactor'])) { - echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . $_POST['ConversionFactor'] . '" /></td></tr>'; + echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . locale_number_format($_POST['ConversionFactor'],4) . '" /></td></tr>'; } else { - echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="1" /></td></tr>'; + echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . locale_number_format(1,4) . '" /></td></tr>'; } echo '<tr><td>' . _('Price') . ':</td> - <td><input type="text" class="number" name="Price" size="11" maxlength="10" value="' . $_POST['Price'] . '" /></td> + <td><input type="text" class="number" name="Price" size="11" maxlength="10" value="' . locale_money_format($_POST['Price'], $CustomerCurrencyCode) . '" /></td> </tr></table>'; Modified: trunk/PrintCheque.php =================================================================== --- trunk/PrintCheque.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintCheque.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -36,7 +36,7 @@ $LeftOvers = $pdf->addTextWrap(75,$YPos,475,$FontSize,$AmountWords, 'left'); $YPos -= 1*$line_height; $LeftOvers = $pdf->addTextWrap($Page_Width-225,$YPos,100,$FontSize,$_SESSION['PaymentDetail']->DatePaid, 'left'); -$LeftOvers = $pdf->addTextWrap($Page_Width-75,$YPos,75,$FontSize,currency_number_format(round($_SESSION['PaymentDetail']->Amount,$_SESSION['Currencies'][$_SESSION['PaymentDetail']->Currency]['DecimalPlaces']),$_SESSION['PaymentDetail']->Currency), 'left'); +$LeftOvers = $pdf->addTextWrap($Page_Width-75,$YPos,75,$FontSize,locale_money_format(round($_SESSION['PaymentDetail']->Amount,$_SESSION['Currencies'][$_SESSION['PaymentDetail']->Currency]['DecimalPlaces']),$_SESSION['PaymentDetail']->Currency), 'left'); $YPos -= 1*$line_height; $LeftOvers = $pdf->addTextWrap(75,$YPos,300,$FontSize,$_SESSION['PaymentDetail']->SuppName, 'left'); @@ -53,7 +53,7 @@ $YPos -= 2*$line_height; $LeftOvers = $pdf->addTextWrap(75,$YPos,300,$FontSize, $AmountWords, 'left'); -$LeftOvers = $pdf->addTextWrap(375,$YPos,100,$FontSize, currency_number_format($_SESSION['PaymentDetail']->Amount,$_SESSION['PaymentDetail']->Currency), 'right'); +$LeftOvers = $pdf->addTextWrap(375,$YPos,100,$FontSize, locale_money_format($_SESSION['PaymentDetail']->Amount,$_SESSION['PaymentDetail']->Currency), 'right'); @@ -70,7 +70,7 @@ $LeftOvers = $pdf->addTextWrap(25,$YPos,75,$FontSize,$_SESSION['PaymentDetail']->DatePaid, 'left'); $LeftOvers = $pdf->addTextWrap(100,$YPos,100,$FontSize,$_SESSION['PaymentDetail']->SupplierID, 'left'); $LeftOvers = $pdf->addTextWrap(250,$YPos,75,$FontSize,$_GET['ChequeNum'], 'left'); -$LeftOvers = $pdf->addTextWrap(350,$YPos,75,$FontSize,currency_number_format(round($_SESSION['PaymentDetail']->Amount,$_SESSION['Currencies'][$_SESSION['PaymentDetail']->Currency]['DecimalPlaces']),$_SESSION['PaymentDetail']->Currency), 'left'); +$LeftOvers = $pdf->addTextWrap(350,$YPos,75,$FontSize,locale_money_format(round($_SESSION['PaymentDetail']->Amount,$_SESSION['Currencies'][$_SESSION['PaymentDetail']->Currency]['DecimalPlaces']),$_SESSION['PaymentDetail']->Currency), 'left'); // remittance advice 2 $YPos -= 15*$line_height; @@ -84,7 +84,7 @@ $LeftOvers = $pdf->addTextWrap(25,$YPos,75,$FontSize,$_SESSION['PaymentDetail']->DatePaid, 'left'); $LeftOvers = $pdf->addTextWrap(100,$YPos,100,$FontSize,$_SESSION['PaymentDetail']->SupplierID, 'left'); $LeftOvers = $pdf->addTextWrap(250,$YPos,75,$FontSize,$_GET['ChequeNum'], 'left'); -$LeftOvers = $pdf->addTextWrap(350,$YPos,75,$FontSize,currency_number_format(round($_SESSION['PaymentDetail']->Amount,$_SESSION['Currencies'][$_SESSION['PaymentDetail']->Currency]['DecimalPlaces']),$_SESSION['PaymentDetail']->Currency), 'left'); +$LeftOvers = $pdf->addTextWrap(350,$YPos,75,$FontSize,locale_money_format(round($_SESSION['PaymentDetail']->Amount,$_SESSION['Currencies'][$_SESSION['PaymentDetail']->Currency]['DecimalPlaces']),$_SESSION['PaymentDetail']->Currency), 'left'); /* UldisN $pdfcode = $pdf->output(); $len = mb_strlen($pdfcode); Modified: trunk/PrintCustOrder.php =================================================================== --- trunk/PrintCustOrder.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintCustOrder.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -163,9 +163,9 @@ while ($myrow2=DB_fetch_array($result)){ - $DisplayQty = stock_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayPrevDel = stock_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); - $DisplayQtySupplied = stock_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQtySupplied = locale_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap(13,$YPos,135,$FontSize,$myrow2['stkcode']); $LeftOvers = $pdf->addTextWrap(148,$YPos,239,$FontSize,$myrow2['description']); Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintCustOrder_generic.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -145,9 +145,9 @@ $ListCount ++; - $DisplayQty = stock_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayPrevDel = stock_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); - $DisplayQtySupplied = stock_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQtySupplied = locale_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($XPos,$YPos,127,$FontSize,$myrow2['stkcode']); $LeftOvers = $pdf->addTextWrap(147,$YPos,255,$FontSize,$myrow2['description']); Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintCustStatements.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -167,8 +167,8 @@ while ($myrow=DB_fetch_array($SetldTrans)){ - $DisplayAlloc = currency_number_format($myrow['alloc'],$StmtHeader['currcode']); - $DisplayOutstanding = currency_number_format($myrow['ostdg'],$StmtHeader['currcode']); + $DisplayAlloc = locale_money_format($myrow['alloc'],$StmtHeader['currcode']); + $DisplayOutstanding = locale_money_format($myrow['ostdg'],$StmtHeader['currcode']); $FontSize=9; @@ -178,10 +178,10 @@ $FontSize=10; if ($myrow['total']>0){ - $DisplayTotal = currency_number_format($myrow['total'],$StmtHeader['currcode']); + $DisplayTotal = locale_money_format($myrow['total'],$StmtHeader['currcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,$DisplayTotal, 'right'); } else { - $DisplayTotal = currency_number_format(-$myrow['total'],$StmtHeader['currcode']); + $DisplayTotal = locale_money_format(-$myrow['total'],$StmtHeader['currcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,60,$FontSize,$DisplayTotal, 'right'); } $LeftOvers = $pdf->addTextWrap($Left_Margin+459,$YPos,60,$FontSize,$DisplayAlloc, 'right'); @@ -218,8 +218,8 @@ while ($myrow=DB_fetch_array($OstdgTrans)){ - $DisplayAlloc = currency_number_format($myrow['alloc'],$StmtHeader['currcode']); - $DisplayOutstanding = currency_number_format($myrow['ostdg'],$StmtHeader['currcode']); + $DisplayAlloc = locale_money_format($myrow['alloc'],$StmtHeader['currcode']); + $DisplayOutstanding = locale_money_format($myrow['ostdg'],$StmtHeader['currcode']); $FontSize=9; $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,$myrow['typename'], 'left'); @@ -228,10 +228,10 @@ $FontSize=10; if ($myrow['total']>0){ - $DisplayTotal = currency_number_format($myrow['total'],$StmtHeader['currcode']); + $DisplayTotal = locale_money_format($myrow['total'],$StmtHeader['currcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,55,$FontSize,$DisplayTotal, 'right'); } else { - $DisplayTotal = currency_number_format(-$myrow['total'],$StmtHeader['currcode']); + $DisplayTotal = locale_money_format(-$myrow['total'],$StmtHeader['currcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,55,$FontSize,$DisplayTotal, 'right'); } @@ -348,11 +348,11 @@ /*Now print out the footer and totals */ - $DisplayDue = currency_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$StmtHeader['currcode']); - $DisplayCurrent = currency_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$StmtHeader['currcode']); - $DisplayBalance = currency_number_format($AgedAnalysis['balance'],$StmtHeader['currcode']); - $DisplayOverdue1 = currency_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$StmtHeader['currcode']); - $DisplayOverdue2 = currency_number_format($AgedAnalysis['overdue2'],$StmtHeader['currcode']); + $DisplayDue = locale_money_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$StmtHeader['currcode']); + $DisplayCurrent = locale_money_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$StmtHeader['currcode']); + $DisplayBalance = locale_money_format($AgedAnalysis['balance'],$StmtHeader['currcode']); + $DisplayOverdue1 = locale_money_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$StmtHeader['currcode']); + $DisplayOverdue2 = locale_money_format($AgedAnalysis['overdue2'],$StmtHeader['currcode']); $pdf->line($Page_Width-$Right_Margin, $Bottom_Margin+(4*$line_height),$Left_Margin,$Bottom_Margin+(4*$line_height)); @@ -382,7 +382,7 @@ if (mb_strlen($StmtHeader['lastpaiddate'])>1 and $StmtHeader['lastpaid']!=0){ $pdf->addText($Left_Margin+5, $Bottom_Margin+13, $FontSize, _('Last payment received').' ' . ConvertSQLDate($StmtHeader['lastpaiddate']) . - ' ' . _('Amount received was').' ' . currency_number_format($StmtHeader['lastpaid'],$StmtHeader['currcode'])); + ' ' . _('Amount received was').' ' . locale_money_format($StmtHeader['lastpaid'],$StmtHeader['currcode'])); } /*also show the total due in the remittance section */ Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintCustTrans.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -249,16 +249,16 @@ if ($myrow2['discountpercent'] == 0) { $DisplayDiscount = ''; } else { - $DisplayDiscount = stock_number_format($myrow2['discountpercent'] * 100, 2) . '%'; + $DisplayDiscount = locale_number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet = currency_number_format($myrow2['fxnet'], $myrow['currcode']); + $DisplayNet = locale_money_format($myrow2['fxnet'], $myrow['currcode']); $DisplayPrice = $myrow2['fxprice']; $DisplayQty = $myrow2['quantity']; $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos,$FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos,$FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $myrow2['description']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos,$FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, currency_number_format($DisplayPrice,$myrow['currcode']), 'right'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x, $YPos,$FormDesign->Data->Column4->Length, $FormDesign->Data->Column4->FontSize, stock_number_format($DisplayQty,$myrow2['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos,$FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, locale_money_format($DisplayPrice,$myrow['currcode']), 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x, $YPos,$FormDesign->Data->Column4->Length, $FormDesign->Data->Column4->FontSize, locale_number_format($DisplayQty,$myrow2['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x, $YPos,$FormDesign->Data->Column5->Length, $FormDesign->Data->Column5->FontSize, $myrow2['units'], 'centre'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x, $YPos,$FormDesign->Data->Column6->Length, $FormDesign->Data->Column6->FontSize, $DisplayDiscount, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x, $YPos,$FormDesign->Data->Column7->Length, $FormDesign->Data->Column7->FontSize, $DisplayNet, 'right'); @@ -312,15 +312,15 @@ $pdf->line($FormDesign->LineAboveFooter->startx, $Page_Height - $FormDesign->LineAboveFooter->starty, $FormDesign->LineAboveFooter->endx, $Page_Height - $FormDesign->LineAboveFooter->endy); /* Now print out the footer and totals */ if ($InvOrCredit == 'Invoice') { - $DisplaySubTot = currency_number_format($myrow['ovamount'], $myrow['currcode']); - $DisplayFreight = currency_number_format($myrow['ovfreight'], $myrow['currcode']); - $DisplayTax = currency_number_format($myrow['ovgst'], $myrow['currcode']); - $DisplayTotal = currency_number_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], $myrow['currcode']); + $DisplaySubTot = locale_money_format($myrow['ovamount'], $myrow['currcode']); + $DisplayFreight = locale_money_format($myrow['ovfreight'], $myrow['currcode']); + $DisplayTax = locale_money_format($myrow['ovgst'], $myrow['currcode']); + $DisplayTotal = locale_money_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], $myrow['currcode']); } else { - $DisplaySubTot = currency_number_format(-$myrow['ovamount'], $myrow['currcode']); - $DisplayFreight = currency_number_format(-$myrow['ovfreight'], $myrow['currcode']); - $DisplayTax = currency_number_format(-$myrow['ovgst'], $myrow['currcode']); - $DisplayTotal = currency_number_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], $myrow['currcode']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'], $myrow['currcode']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'], $myrow['currcode']); + $DisplayTax = locale_money_format(-$myrow['ovgst'], $myrow['currcode']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], $myrow['currcode']); } /* Print out the payment terms */ $pdf->addTextWrap($FormDesign->PaymentTerms->x, $Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->Length, $FormDesign->PaymentTerms->FontSize, _('Payment Terms') . ': ' . $myrow['terms']); @@ -678,13 +678,13 @@ $k = 1; } echo $RowStarter; - $DisplayPrice = currency_number_format($myrow2['fxprice'], $myrow['currcode']); - $DisplayQty = stock_number_format($myrow2['quantity'], $myrow2['decimalplaces']); - $DisplayNet = currency_number_format($myrow2['fxnet'], $myrow['currcode']); + $DisplayPrice = locale_money_format($myrow2['fxprice'], $myrow['currcode']); + $DisplayQty = locale_number_format($myrow2['quantity'], $myrow2['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'], $myrow['currcode']); if ($myrow2['discountpercent'] == 0) { $DisplayDiscount = ''; } else { - $DisplayDiscount = stock_number_format($myrow2['discountpercent'] * 100, 2) . '%'; + $DisplayDiscount = locale_number_format($myrow2['discountpercent'] * 100, 2) . '%'; } printf('<td>%s</td> <td>%s</td> @@ -790,15 +790,15 @@ } /* Now print out the footer and totals */ if ($InvOrCredit == 'Invoice') { - $DisplaySubTot = currency_number_format($myrow['ovamount'], $myrow['currcode']); - $DisplayFreight = currency_number_format($myrow['ovfreight'], $myrow['currcode']); - $DisplayTax = currency_number_format($myrow['ovgst'], $myrow['currcode']); - $DisplayTotal = currency_number_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], $myrow['currcode']); + $DisplaySubTot = locale_money_format($myrow['ovamount'], $myrow['currcode']); + $DisplayFreight = locale_money_format($myrow['ovfreight'], $myrow['currcode']); + $DisplayTax = locale_money_format($myrow['ovgst'], $myrow['currcode']); + $DisplayTotal = locale_money_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], $myrow['currcode']); } else { - $DisplaySubTot = currency_number_format(-$myrow['ovamount'], $myrow['currcode']); - $DisplayFreight = currency_number_format(-$myrow['ovfreight'], $myrow['currcode']); - $DisplayTax = currency_number_format(-$myrow['ovgst'], $myrow['currcode']); - $DisplayTotal = currency_number_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], $myrow['currcode']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'], $myrow['currcode']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'], $myrow['currcode']); + $DisplayTax = locale_money_format(-$myrow['ovgst'], $myrow['currcode']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], $myrow['currcode']); } /*Print out the invoice text entered */ echo '<table class="table1"> Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintCustTransPortrait.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -305,7 +305,7 @@ if ($myrow2['discountpercent'] == 0) { $DisplayDiscount = ''; } else { - $DisplayDiscount = stock_number_format($myrow2['discountpercent'] * 100, 2) . '%'; + $DisplayDiscount = locale_number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } $DisplayNet = $myrow2['fxnet']; @@ -321,11 +321,11 @@ $lines++; } - $LeftOvers = $pdf->addTextWrap($Left_Margin+270,$YPos,76,$FontSize,currency_number_format($DisplayPrice,$myrow['currcode']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,36,$FontSizestock_,stock_number_format($DisplayQty,$myrow2['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+270,$YPos,76,$FontSize,locale_money_format($DisplayPrice,$myrow['currcode']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,36,$FontSizestock_,locale_number_format($DisplayQty,$myrow2['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+390,$YPos,26,$FontSize,$myrow2['units'],'center'); $LeftOvers = $pdf->addTextWrap($Left_Margin+420,$YPos,26,$FontSize,$DisplayDiscount,'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+450,$YPos,72,$FontSize,currency_number_format($DisplayNet,$myrow['currcode']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+450,$YPos,72,$FontSize,locale_money_format($DisplayNet,$myrow['currcode']),'right'); if ($myrow2['controlled']==1){ @@ -421,15 +421,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = currency_number_format($myrow['ovamount'],$myrow['currcode']); - $DisplayFreight = currency_number_format($myrow['ovfreight'],$myrow['currcode']); - $DisplayTax = currency_number_format($myrow['ovgst'],$myrow['currcode']); - $DisplayTotal = currency_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['currcode']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['currcode']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['currcode']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['currcode']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['currcode']); } else { - $DisplaySubTot = currency_number_format(-$myrow['ovamount'],$myrow['currcode']); - $DisplayFreight = currency_number_format(-$myrow['ovfreight'],$myrow['currcode']); - $DisplayTax = currency_number_format(-$myrow['ovgst'],$myrow['currcode']); - $DisplayTotal = currency_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['currcode']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['currcode']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['currcode']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['currcode']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['currcode']); } /*Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -884,14 +884,14 @@ echo $RowStarter; - $DisplayPrice = currency_number_format($myrow2['fxprice'],$myrow['currcode']); - $DisplayQty = stock_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = currency_number_format($myrow2['fxnet'],$myrow['currcode']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['currcode']); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['currcode']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; } else { - $DisplayDiscount = stock_number_format($myrow2['discountpercent']*100,2) . '%'; + $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; } printf ('<td>%s</td> @@ -1015,15 +1015,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = currency_number_format($myrow['ovamount'],$myrow['currcode']); - $DisplayFreight = currency_number_format($myrow['ovfreight'],$myrow['currcode']); - $DisplayTax = currency_number_format($myrow['ovgst'],$myrow['currcode']); - $DisplayTotal = currency_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['currcode']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['currcode']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['currcode']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['currcode']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['currcode']); } else { - $DisplaySubTot = currency_number_format(-$myrow['ovamount'],$myrow['currcode']); - $DisplayFreight = currency_number_format(-$myrow['ovfreight'],$myrow['currcode']); - $DisplayTax = currency_number_format(-$myrow['ovgst'],$myrow['currcode']); - $DisplayTotal = currency_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['currcode']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['currcode']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['currcode']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['currcode']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['currcode']); } /*Print out the invoice text entered */ echo '<table class="table1"><tr> Modified: trunk/PrintSalesOrder_generic.php =================================================================== --- trunk/PrintSalesOrder_generic.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PrintSalesOrder_generic.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -147,9 +147,9 @@ $ListCount ++; - $DisplayQty = stock_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayPrevDel = stock_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); - $DisplayQtySupplied = stock_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQtySupplied = locale_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],$myrow2['decimalplaces']); $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; $LeftOvers = $pdf->addTextWrap($XPos,$YPos,127,$FontSize,$myrow2['stkcode']); $LeftOvers = $pdf->addTextWrap(147,$YPos,355,$FontSize,$itemdesc); Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/PurchData.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -213,7 +213,7 @@ <td><a href="%s?StockID=%s&SupplierID=%s&Delete=1&EffectiveFrom=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this suppliers price?') . '\');">' . _('Delete') . '</a></td> </tr>', $myrow['suppname'], - currency_number_format($myrow['price'], $myrow['currcode']), + locale_money_format($myrow['price'], $myrow['currcode']), $myrow['currcode'], ConvertSQLDate($myrow['effectivefrom']), $myrow['unitname'], @@ -466,7 +466,7 @@ echo '<tr><td>' . _('Currency') . ':</td> <td><input type="hidden" name="CurrCode" . value="' . $CurrCode . '" />' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength="12" size="12" value="' . currency_number_format($_POST['Price'], $CurrCode) . '" /></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength="12" size="12" value="' . locale_money_format($_POST['Price'], $CurrCode) . '" /></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength="10" size="11" value="' . $_POST['EffectiveFrom'] . '" /></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/RecurringSalesOrders.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -332,10 +332,10 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = currency_number_format($LineTotal,$_SESSION['Items'.$identifier]->DefaultCurrency); - $DisplayPrice = currency_number_format($StockItem->Price,$_SESSION['Items'.$identifier]->DefaultCurrency); - $DisplayQuantity = stock_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); - $DisplayDiscount = stock_number_format(($StockItem->DiscountPercent * 100),2); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->DefaultCurrency); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->DefaultCurrency); + $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); + $DisplayDiscount = locale_number_format(($StockItem->DiscountPercent * 100),2); if ($k==1){ @@ -360,7 +360,7 @@ $_SESSION['Items'.$identifier]->totalWeight = $_SESSION['Items'.$identifier]->totalWeight + ($StockItem->Quantity * $StockItem->Weight); } -$DisplayTotal = currency_number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->DefaultCurrency); +$DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->DefaultCurrency); echo '<tr> <td colspan="6" class="number"><b>'. _('TOTAL Excl Tax/Freight') .'</b></td> <td class="number">' . $DisplayTotal . '</td> Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/ReorderLevel.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -85,10 +85,10 @@ $pdf->addTextWrap(50,$YPos,100,$FontSize,$myrow['stockid'],'',0,$fill); $pdf->addTextWrap(150,$YPos,150,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,$myrow['loccode'],'left',0,$fill); - $pdf->addTextWrap(370,$YPos,50,$FontSize,stock_number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(420,$YPos,50,$FontSize,stock_number_format($myrow['reorderlevel'], $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(370,$YPos,50,$FontSize,locale_number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(420,$YPos,50,$FontSize,locale_number_format($myrow['reorderlevel'], $myrow['decimalplaces']),'right',0,$fill); $shortage = $myrow['reorderlevel'] - $myrow['quantity']; - $pdf->addTextWrap(470,$YPos,50,$FontSize,stock_number_format($shortage, $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(470,$YPos,50,$FontSize,locale_number_format($shortage, $myrow['decimalplaces']),'right',0,$fill); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, @@ -116,8 +116,8 @@ // and False to set to transparent $pdf->addTextWrap(310,$YPos,60,$FontSize,$myrow2['loccode'],'left',0,$fill); - $pdf->addTextWrap(370,$YPos,50,$FontSize,stock_number_format($myrow2['quantity'], $myrow2['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(420,$YPos,50,$FontSize,stock_number_format($myrow2['reorderlevel'], $myrow2['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(370,$YPos,50,$FontSize,locale_number_format($myrow2['quantity'], $myrow2['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(420,$YPos,50,$FontSize,locale_number_format($myrow2['reorderlevel'], $myrow2['decimalplaces']),'right',0,$fill); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, Modified: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/ReprintGRN.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -85,7 +85,7 @@ echo '<td>' . $myrow['itemcode'] . '</td>'; echo '<td>' . $myrow['itemdescription'] . '</td>'; echo '<td>' . $myrow['deliverydate'] . '</td>'; - echo '<td class="number">' . stock_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; + echo '<td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; echo '</tr>'; } Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/ReverseGRN.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -300,7 +300,7 @@ '" . $GRN['deliverydate'] . "', '" . $PeriodNo . "', '" . $GRN['glcode'] . "', - '" . _('GRN Reversal for PO') .": " . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . currency_number_format($GRN['stdcostunit'],$GRN['currcode']) . "', + '" . _('GRN Reversal for PO') .": " . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . locale_money_format($GRN['stdcostunit'],$GRN['currcode']) . "', '" . -($GRN['stdcostunit'] * $QtyToReverse) . "' )"; @@ -322,7 +322,7 @@ '" . $GRN['deliverydate'] . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['grnact'] . "', '" - . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . stock_number_format($GRN['stdcostunit'],$GRN['decimalplaces']) . "', + . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . locale_number_format($GRN['stdcostunit'],$GRN['decimalplaces']) . "', '" . $GRN['stdcostunit'] * $QtyToReverse . "' )"; @@ -403,9 +403,9 @@ $k=1; } - $DisplayQtyRecd = stock_number_format($myrow['qtyrecd'],$myrow['decimalplaces']); - $DisplayQtyInv = stock_number_format($myrow['quantityinv'],$myrow['decimalplaces']); - $DisplayQtyRev = stock_number_format($myrow['qtytoreverse'],$myrow['decimalplaces']); + $DisplayQtyRecd = locale_number_format($myrow['qtyrecd'],$myrow['decimalplaces']); + $DisplayQtyInv = locale_number_format($myrow['quantityinv'],$myrow['decimalplaces']); + $DisplayQtyRev = locale_number_format($myrow['qtytoreverse'],$myrow['decimalplaces']); $DisplayDateDel = ConvertSQLDate($myrow['deliverydate']); $LinkToRevGRN = '<a href="' . $_SERVER['PHP_SELF'] . '?GRNNo=' . $myrow['grnno'] . '">' . _('Reverse') . '</a>'; Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/SalesInquiry.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -870,14 +870,14 @@ while ($myrow = DB_fetch_array($result)) { $linectr++; if ($_POST['DateType'] == 'Order') { - printf('%10s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', $myrow['orderno'], $myrow['stkcode'], ConvertSQLDate($myrow['orddate']) , $myrow['debtorno'], $myrow['name'], $myrow['brname'], stock_number_format($myrow['quantity'], $myrow['decimalplaces']) , currency_number_format($myrow['extcost'], $myrow['currcode']) , currency_number_format($myrow['extprice'], $myrow['currcode']) , stock_number_format($myrow['qtyinvoiced'], $myrow['decimalplaces']) , $myrow['linestatus'], ConvertSQLDate($myrow['itemdue']) , $myrow['salesman'], $myrow['area'], $myrow['description']); + printf('%10s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', $myrow['orderno'], $myrow['stkcode'], ConvertSQLDate($myrow['orddate']) , $myrow['debtorno'], $myrow['name'], $myrow['brname'], locale_number_format($myrow['quantity'], $myrow['decimalplaces']) , locale_money_format($myrow['extcost'], $myrow['currcode']) , locale_money_format($myrow['extprice'], $myrow['currcode']) , locale_number_format($myrow['qtyinvoiced'], $myrow['decimalplaces']) , $myrow['linestatus'], ConvertSQLDate($myrow['itemdue']) , $myrow['salesman'], $myrow['area'], $myrow['description']); print '<br/>'; $TotalQty+= $myrow['quantity']; } else { // Detail for Invoiced Date - printf('%10s | %14s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', $myrow['orderno'], $myrow['transno'], $myrow['stkcode'], ConvertSQLDate($myrow['orddate']) , $myrow['debtorno'], $myrow['name'], $myrow['brname'], stock_number_format($myrow['qty'], $myrow['decimalplaces']) , currency_number_format($myrow['extcost'], $myrow['currcode']) , currency_number_format($myrow['extprice'], $myrow['currcode']) , $myrow['linestatus'], ConvertSQLDate($myrow['trandate']) , $myrow['salesman'], $myrow['area'], $myrow['description']); + printf('%10s | %14s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', $myrow['orderno'], $myrow['transno'], $myrow['stkcode'], ConvertSQLDate($myrow['orddate']) , $myrow['debtorno'], $myrow['name'], $myrow['brname'], locale_number_format($myrow['qty'], $myrow['decimalplaces']) , locale_money_format($myrow['extcost'], $myrow['currcode']) , locale_money_format($myrow['extprice'], $myrow['currcode']) , $myrow['linestatus'], ConvertSQLDate($myrow['trandate']) , $myrow['salesman'], $myrow['area'], $myrow['description']); print '<br/>'; $TotalQty+= $myrow['qty']; } @@ -966,7 +966,7 @@ // qty is from stockmoves $displayqty = $myrow['qty']; } - printf(' %-30s | %-40s | %12s | %14s | %14s | %14s | %-40s', $myrow[$summarytype], $myrow[$description], stock_number_format($displayqty, $myrow['decimalplaces']) , currency_number_format($myrow['extcost'], $myrow['currcode']) , currency_number_format($myrow['extprice'], $myrow['currcode']) , stock_number_format($myrow['qtyinvoiced'], $myrow['decimalplaces']) , $column7); + printf(' %-30s | %-40s | %12s | %14s | %14s | %14s | %-40s', $myrow[$summarytype], $myrow[$description], locale_number_format($displayqty, $myrow['decimalplaces']) , locale_money_format($myrow['extcost'], $myrow['currcode']) , locale_money_format($myrow['extprice'], $myrow['currcode']) , locale_number_format($myrow['qtyinvoiced'], $myrow['decimalplaces']) , $column7); print '<br/>'; $TotalQty+= $displayqty; $TotalExtCost+= $myrow['extcost']; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/SelectCompletedOrder.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -559,7 +559,7 @@ $ViewPage = $rootpath . '/OrderDetails.php?OrderNumber=' . $myrow['orderno']; $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); - $FormatedOrderValue = currency_number_format($myrow['ordervalue'],$myrow['currcode']); + $FormatedOrderValue = locale_money_format($myrow['ordervalue'],$myrow['currcode']); printf('<td><a href="%s">%s</a></td> <td>%s</td> Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-09-12 02:27:24 UTC (rev 8132) +++ trunk/SelectCreditItems.php 2011-09-12 07:40:32 UTC (rev 8133) @@ -968,7 +968,7 @@ foreach ($_SESSION['CreditItems'.$identifier]->LineItems as $LineItem) { $LineTotal = $LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent); - $DisplayLineTotal = currency_number_format($LineTotal,$_SESSION['CreditItems'.$identifier]->DefaultCurrency); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['CreditItems'.$identifier]->DefaultCurrency); if ($k==1){ $RowStarter = '<tr class="EvenTableRows">'; @@ -982,16 +982,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value="' . stock_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '" /></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value="' . locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '" /></td>'; } else { echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> <input type="hidden" name="Quantity_' . $LineItem->LineNumber . '" value="' . $LineItem->Quantity . '" /></td>'; } echo '<td>' . $LineItem->Units . '</td> - <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size="10" maxlength="12" value="' . currency_number_format($LineItem->Price, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '" /></td> + <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size="10" maxlength="12" value="' . locale_money_format($LineItem->Price, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '" /></td> <td><input type="checkbox" name="Gross" value="False" /></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size="3" maxlength="3" value="' . stock_number_format(($LineItem->DiscountPercent * 100),2) . '" /> %</td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size="3" maxlength="3" value="' . locale_number_format(($LineItem->DiscountPercent * 100),2) . '" /> %</td> <td class="number">' . $DisplayLineTotal . '</td>'; @@ -1015,7 +1015,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength="4" size="4" value="' . stock_number_format($Tax->TaxRate*100, 2) . '" /> %'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength="4" size="4" value="' . locale_number_format($Tax->TaxRate*100, 2) . '" /> %'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -1030,8 +1030,8 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = currency_number_format($TaxLineTotal ,$_SESSION['CreditItems'.$identifier]->DefaultCurrency); - $DisplayGrossLineTotal = currency_number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems'.$identifier]->DefaultCurrency); + $DisplayTaxAmount = locale_money_format($TaxLineTotal ,$_SESSION['CreditItems'.$identifier]->DefaultCurrency); + $DisplayGrossLineTotal = locale_money_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems'.$identifier]->DefaultCurrency); echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td> @@ -1058,7 +1058,7 @@ echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> - <td><input type="text" class="number" size="6" maxlength="6" name="ChargeFreightCost" value="' . currency_number_format($_SESSION['CreditItems'.$identifier]->FreightCost ,$_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '" /></td>'; + <td><input type="text" class="number" size="6" maxlength="6" name="ChargeFreightCost" value="' . locale_money_format($_SESSION['CreditItems'.$identifier]->FreightCost ,$_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '" /></td>'; $FreightTaxTotal =0; //initialise tax total @@ -1081,7 +1081,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . '" maxlength="4" size="4" value="' . currency_number_format($FreightTaxLine->TaxRate * 100, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '" />'; + echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . '" maxlength="4" size="4" value="' . locale_money_format($FreightTaxLine->TaxRate * 100, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '" />'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems'.$identifier]->FreightCost + $FreightTaxTotal)); @@ -1095,20 +1095,20 @@ } echo '</td>'; - echo '<td class="number">' . currency_number_format($FreightTaxTotal, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</td> - <td class="number">' . currency_number_format($FreightTaxTotal+ $_SESSION['CreditItems'.$identifier]->FreightCost, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</td> + echo '<td class="number">' . locale_money_format($FreightTaxTotal, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</td> + <td class="number">' . locale_money_format($FreightTaxTotal+ $_SESSION['CreditItems'.$identifier]->FreightCost, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; - $DisplayTotal = currency_number_format($_SESSION['CreditItems'.$identifier]->total + $_SESSION['CreditItems'.$identifier]->FreightCost, $_SESSION['CreditItems'.$identifier]->DefaultCurrency); + $DisplayTotal = locale_money_format($_SESSION['CreditItems'.$identifier]->total + $_SESSION['CreditItems'.$identifier]->FreightCost, $_SESSION['CreditItems'.$identifier]->DefaultCurrency); echo '<tr> <td colspan="7" class="number">' . _('Credit Totals') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> <td colspan="2"></td> - <td class="number"><b>' . currency_number_format($TaxTotal, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</b></td> - <td class="number"><b>' . currency_number_format($TaxTotal+($_SESSION['CreditItems'.$identifier]->total + $_SESSION['CreditItems'.$identifier]->FreightCost), $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</b></td> + <td class="number"><b>' . locale_money_format($TaxTotal, $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</b></td> + <td class="number"><b>' . locale_money_format($TaxTotal+($_SESSION['CreditItems'.$identifier]->total + $_SESSION['CreditItems'.$identifier]->FreightCost), $_SESSION['CreditItems'.$identifier]->DefaultCurrency) . '</b></td> </tr></table></font>'; $_SESSION['CreditItems'.$identifier]->TaxTotal=$TaxTotal; $_SESSION['CreditItems'.$identifier]->TaxTotals=$TaxTotals; @@ -1339,7 +1339,7 @@ <td>'.$myrow['units'].'</td> <td><font size="1"><input class="number" type="text" size="6" name="Quantity'.$i.'" value="0" /></font></td> <input type="hidden" name="StockID'.$i.'" value="'.$myrow['stockid'].'" /> - <td class="number">'.currency_number_format($PriceRow['price'],$PriceRow['currabrev']).'</td> + <td class="number">'.locale_money_format($PriceRow['price'],$PriceRow['currabrev']).'</td> </tr>'; echo '<input type="hidden" name="ConversionFactor'.$i.'" value="' . $PriceRow['conversionfactor'] . '" />'; echo '<input type="hidden" name="Units'.$i.'" value="' . $myrow['unit... [truncated message content] |
From: <tim...@us...> - 2011-09-16 20:51:59
|
Revision: 8164 http://weberp.svn.sourceforge.net/weberp/?rev=8164&view=rev Author: tim_schofield Date: 2011-09-16 20:51:51 +0000 (Fri, 16 Sep 2011) Log Message: ----------- Updates to the silverwolf theme Modified Paths: -------------- trunk/ContractBOM.php trunk/CustomerReceipt.php trunk/DeliveryDetails.php trunk/GLJournalInquiry.php trunk/POReport.php trunk/PO_OrderDetails.php trunk/PcAssignCashToTab.php trunk/PcClaimExpensesFromTab.php trunk/PcExpensesTypeTab.php trunk/Prices_Customer.php trunk/RecurringSalesOrders.php trunk/ReprintGRN.php trunk/SelectCreditItems.php trunk/SelectSalesOrder.php trunk/SelectWorkOrder.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shipt_Select.php trunk/StockCostUpdate.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockUsage.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierContacts.php trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/TaxAuthorityRates.php trunk/TaxGroups.php trunk/WhereUsedInquiry.php trunk/WorkOrderStatus.php trunk/Z_UpgradeDatabase.php trunk/css/silverwolf/default.css trunk/includes/phplot/phplot.php trunk/includes/phplot/rgb.inc.php trunk/includes/tcpdf/htmlcolors.php Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/ContractBOM.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -232,7 +232,7 @@ echo '<table cellpadding="2" class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo '<tr><th colspan="7"><font color="navy" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th></tr>'; + echo '<tr><th colspan="7"><font color="#616161" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th></tr>'; } echo '<tr> Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/CustomerReceipt.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -934,7 +934,7 @@ if (isset($_POST['GLEntry']) AND isset($_SESSION['ReceiptBatch'])){ /* Set up a heading for the transaction entry for a GL Receipt */ echo '<br /><table class="selection">'; - echo '<th colspan="2"><font size="2" color="navy">' . _('General Ledger Receipt Entry') . '</font></th>'; + echo '<th colspan="2"><font size="2" color="#616161">' . _('General Ledger Receipt Entry') . '</font></th>'; //Select the tag echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/DeliveryDetails.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -810,9 +810,9 @@ echo '<table cellpading="2" class="selection">'; if ($_SESSION['Items'.$identifier]->Quotation==1){ - echo '<tr><th colspan="7"><font size="2" color="navy">'._('Quotation Summary').'</font></th></tr>'; + echo '<tr><th colspan="7"><font size="2" color="#616161">'._('Quotation Summary').'</font></th></tr>'; } else { - echo '<tr><th colspan="7"><font size="2" color="navy">'._('Order Summary').'</font></th></tr>'; + echo '<tr><th colspan="7"><font size="2" color="#616161">'._('Order Summary').'</font></th></tr>'; } echo '<tr> <th>'. _('Item Code') .'</th> @@ -939,7 +939,7 @@ } echo '<br /><table class="selection">'; -echo '<tr><th colspan="2"><font color="navy" size="3">'._('Delivery Details').'</font></th></tr>'; +echo '<tr><th colspan="2"><font color="#616161" size="3">'._('Delivery Details').'</font></th></tr>'; echo '<tr> <td>'. _('Deliver To') .':</td> <td><input type="text" size="42" maxlength="40" name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '" /></td> Modified: trunk/GLJournalInquiry.php =================================================================== --- trunk/GLJournalInquiry.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/GLJournalInquiry.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -11,7 +11,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; - echo '<tr><th colspan="3"><font color="navy" size="2">' . _('Selection Criteria') . '</font></th></tr>'; + echo '<tr><th colspan="3"><font color="#616161" size="2">' . _('Selection Criteria') . '</font></th></tr>'; $sql = "SELECT typeno FROM systypes WHERE typeid=0"; $result = DB_query($sql, $db); @@ -86,7 +86,7 @@ } if ($myrow['typeno']!=$LastJournal) { - echo '<tr><td colspan="8" bgcolor="navy"></td></tr><tr> + echo '<tr><td colspan="8" bgcolor="#616161"></td></tr><tr> <td>'. ConvertSQLDate($myrow['trandate']) . '</td> <td class="number">'.$myrow['typeno'].'</td>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/POReport.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -630,7 +630,7 @@ else { $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - echo '<tr><th colspan="2"><font size="3" color="navy">' . _('Header Details') . '</font></th></tr>'; + echo '<tr><th colspan="2"><font size="3" color="#616161">' . _('Header Details') . '</font></th></tr>'; echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By ' . $SortBy_Display . '</td></tr>'; echo '<tr><td>' . _('Date Type') . '</td><td>' . $_POST['DateType'] . '</tr>'; echo '<tr><td>' . _('Date Range') . '</td><td>' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '</td></tr>'; Modified: trunk/PO_OrderDetails.php =================================================================== --- trunk/PO_OrderDetails.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/PO_OrderDetails.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -85,7 +85,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="" />' . ' ' . $title . '</p>'; echo '<table class="selection" cellpadding="2">'; -echo '<tr><th colspan="8"><font size="3" color="navy">'. _('Order Header Details'). '</font></th></tr>'; +echo '<tr><th colspan="8"><font size="3" color="#616161">'. _('Order Header Details'). '</font></th></tr>'; echo '<tr><th style="text-align:left">' . _('Supplier Code'). '</td><td><a href="SelectSupplier.php?SupplierID='.$myrow['supplierid'].'">' . $myrow['supplierid'] . '</a></td> <th style="text-align:left">' . _('Supplier Name'). '</td><td><a href="SelectSupplier.php?SupplierID='.$myrow['supplierid'].'">' . $myrow['suppname'] . '</a></td></tr>'; @@ -147,7 +147,7 @@ echo '<table colspan="8" class="selection" cellpadding="0">'; -echo '<tr><th colspan="8"><font size="3" color="navy">'. _('Order Line Details'). '</font></th></tr>'; +echo '<tr><th colspan="8"><font size="3" color="#616161">'. _('Order Line Details'). '</font></th></tr>'; echo '<tr> <th>' . _('Item Code'). '</td> <th>' . _('Item Description'). '</td> Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/PcAssignCashToTab.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -220,7 +220,7 @@ $result = DB_query($sql,$db); echo '<br /><table class="selection">'; - echo '<tr><th colspan="8"><font color="navy" size="2">' . _('Details Of Petty Cash Tab ') . '' .$SelectedTabs. '</form></th></tr>'; + echo '<tr><th colspan="8"><font color="#616161" size="2">' . _('Details Of Petty Cash Tab ') . '' .$SelectedTabs. '</form></th></tr>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><th colspan="8">' . _('Detail Of PC Tab Movements For Last ') .': '; @@ -319,9 +319,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; //Main table if (isset($_GET['SelectedIndex'])) { - echo '<tr><th colspan="2"><font color="navy" size="3">'._('Update Cash Assignment').'</font></th></tr>'; + echo '<tr><th colspan="2"><font color="#616161" size="3">'._('Update Cash Assignment').'</font></th></tr>'; } else { - echo '<tr><th colspan="2"><font color="navy" size="3">'._('New Cash Assignment').'</font></th></tr>'; + echo '<tr><th colspan="2"><font color="#616161" size="3">'._('New Cash Assignment').'</font></th></tr>'; } if ( isset($_GET['edit'])) { Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/PcClaimExpensesFromTab.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -204,7 +204,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; - echo '<tr><th colspan="8"><font color="navy" size="3">' . _('Petty Cash Tab') . ' ' .$SelectedTabs. '</font></th></tr>'; + echo '<tr><th colspan="8"><font color="#616161" size="3">' . _('Petty Cash Tab') . ' ' .$SelectedTabs. '</font></th></tr>'; echo '<tr><th colspan="8">' . _('Detail Of Movements For Last ') .': '; if(!isset ($Days)){ Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/PcExpensesTypeTab.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -157,7 +157,7 @@ $result = DB_query($sql,$db); echo '<br /><table class="selection">'; - echo '<tr><th colspan="3"><font size="2" color="navy">' . _('Expense Codes for Type of Tab ') . ' ' .$SelectedTab. '</font></th></tr>'; + echo '<tr><th colspan="3"><font size="2" color="#616161">' . _('Expense Codes for Type of Tab ') . ' ' .$SelectedTab. '</font></th></tr>'; echo '<tr> <th>' . _('Expense Code') . '</th> <th>' . _('Description') . '</th> Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/Prices_Customer.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -228,7 +228,7 @@ if (DB_num_rows($result) == 0) { echo '<tr><td>' . _('There are no default prices set up for this part in this currency') . '</td></tr>'; } else { - echo '<tr><th colspan="6"><font color="navy" size="2">' . _('Normal Price') . '</font></th></tr>'; + echo '<tr><th colspan="6"><font color="#616161" size="2">' . _('Normal Price') . '</font></th></tr>'; echo '<tr><th>' . _('Price') . '</th> <th>' . _('UOM'). '</th> <th>' . _('Conversion') . '<br />'._('Factor') . '</th> @@ -281,7 +281,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class="selection">'; -echo '<tr><th colspan="9"><font color="navy" size="2">' . _('Special Prices') . '</font></th></tr>'; +echo '<tr><th colspan="9"><font color="#616161" size="2">' . _('Special Prices') . '</font></th></tr>'; if (DB_num_rows($result) == 0) { echo '<tr><td>' . _('There are no special prices set up for this part') . '</td></tr>'; Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/RecurringSalesOrders.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -313,7 +313,7 @@ echo '<table cellpadding="2" colspan="7" class="selection">'; -echo '<tr><th colspan="7"><font size="2" color="navy"><b>'._('Order Line Details').'</b></font></th></tr>'; +echo '<tr><th colspan="7"><font size="2" color="#616161"><b>'._('Order Line Details').'</b></font></th></tr>'; echo '<tr> <th>'. _('Item Code') .'</th> <th>'. _('Item Description') .'</th> @@ -368,7 +368,7 @@ </table>'; echo '<br /><table class="selection">'; -echo '<tr><th colspan="7"><font size="2" color="navy"><b>'._('Order Header Details').'</b></font></th></tr>'; +echo '<tr><th colspan="7"><font size="2" color="#616161"><b>'._('Order Header Details').'</b></font></th></tr>'; echo '<tr> <td>'. _('Deliver To') .':</td> Modified: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/ReprintGRN.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -13,7 +13,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; -echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; +echo '<tr><th colspan="2"><font size="2" color="#616161">' . _('Select a purchase order') . '</th></tr>'; echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; echo '<tr><td colspan="2" style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>'; @@ -63,7 +63,7 @@ } $k=0; echo '<br /><table class="selection">'; - echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; + echo '<tr><th colspan="8"><font size="2" color="#616161">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; echo '<tr><th>' . _('Supplier') . '</th>'; echo '<th>' . _('PO Order line') . '</th>'; echo '<th>' . _('GRN Number') . '</th>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SelectCreditItems.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -1356,7 +1356,7 @@ /*FORM VARIABLES TO POST TO THE CREDIT NOTE 10 AT A TIME WITH PART CODE AND QUANTITY */ echo '<table class="selection">'; - echo '<tr><th colspan="2"><font size="3" color="navy"><b>' . _('Quick Entry') . '</b></font></th></tr>'; + echo '<tr><th colspan="2"><font size="3" color="#616161"><b>' . _('Quick Entry') . '</b></font></th></tr>'; echo '<tr> <th>' . _('Part Code') . '</th> <th>' . _('Quantity') . '</th> Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SelectSalesOrder.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -466,7 +466,7 @@ $result1 = DB_query($SQL,$db); echo '<br /><table class="selection">'; - echo '<tr><th colspan="6"><font size="3" color="navy">' . _('To search for sales orders for a specific part use the part selection facilities below'); + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('To search for sales orders for a specific part use the part selection facilities below'); echo '</th></tr>'; echo '<tr> <td><font size="1">' . _('Select a stock category') . ':</font> Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SelectWorkOrder.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -156,7 +156,7 @@ echo '<table class="selection"> <tr> - <th colspan="6"><font size="3" color="navy">' . _('To search for work orders for a specific item use the item selection facilities below') . '</font></th> + <th colspan="6"><font size="3" color="#616161">' . _('To search for work orders for a specific item use the item selection facilities below') . '</font></th> </tr> <tr> <td><font size="1">' . _('Select a stock category') . ':</font> Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/ShipmentCosting.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -46,7 +46,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; echo '<table class="selection">'; -echo '<tr><th colspan="4"><font size="3" color="navy">'._('Shipment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font size="3" color="#616161">'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> <td><b>' . $_GET['SelectedShipment'] . '</b></td> @@ -137,7 +137,7 @@ } echo '<br /><table cellpadding="2" colspan="7" class="selection">'; - echo '<tr><th colspan="9"><font color="navy" size="3">' . _('Items on shipment'). '</font></th></tr>'; + echo '<tr><th colspan="9"><font color="#616161" size="3">' . _('Items on shipment'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Item'). '</th> @@ -499,7 +499,7 @@ $ChargesResult = DB_query($sql,$db); echo '<table cellpadding="2" colspan="6" class="selection">'; -echo '<tr><th colspan="6"><font color="navy" size="3">' . _('Shipment Charges Against Products'). '</font></th></tr>'; +echo '<tr><th colspan="6"><font color="#616161" size="3">' . _('Shipment Charges Against Products'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -570,7 +570,7 @@ $ChargesResult = DB_query($sql,$db); echo '<table cellpadding="2" colspan="5" class="selection">'; -echo '<tr><th colspan="6"><font color="navy" size="3">'._('General Shipment Charges').'</font></th></tr>'; +echo '<tr><th colspan="6"><font color="#616161" size="3">'._('General Shipment Charges').'</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/Shipments.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -376,7 +376,7 @@ /* Always display all shipment lines */ echo '<br /><table cellpadding="2" colspan="7" class="selection">'; - echo '<tr><th colspan="9"><font color="navy" size="3">'. _('Order Lines On This Shipment'). '</font></th></tr>'; + echo '<tr><th colspan="9"><font color="#616161" size="3">'. _('Order Lines On This Shipment'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Order'). '</th> @@ -456,7 +456,7 @@ if (DB_num_rows($result)>0){ echo '<table cellpadding="2" colspan="7" class="selection">'; - echo '<tr><th colspan="7"><font color="navy" size="3">'. _('Possible Order Lines To Add To This Shipment').'</font></th></tr>'; + echo '<tr><th colspan="7"><font color="#616161" size="3">'. _('Possible Order Lines To Add To This Shipment').'</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Order').'</th> Modified: trunk/Shipt_Select.php =================================================================== --- trunk/Shipt_Select.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/Shipt_Select.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -146,7 +146,7 @@ echo '<table class="selection">'; -echo '<tr><th colspan="5"><font size="3" color="navy">'._('To search for shipments for a specific part use the part selection facilities below') . '</font></th></tr>'; +echo '<tr><th colspan="5"><font size="3" color="#616161">'._('To search for shipments for a specific part use the part selection facilities below') . '</font></th></tr>'; ?> <tr> <td><font size="1"><?php echo _('Select a stock category');?>:</font> Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/StockCostUpdate.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -133,10 +133,10 @@ <th colspan="2">' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" maxlength="20" />'; echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '" /></th></tr>'; echo '<tr> - <th colspan="2"><font color="navy" size="2">' . $StockID . ' - ' . $myrow['description'] . '</font></th> + <th colspan="2"><font color="#616161" size="2">' . $StockID . ' - ' . $myrow['description'] . '</font></th> </tr>'; echo '<tr> - <th colspan="2"><font color="navy" size="2">'. _('Total Quantity On Hand') . ': ' . locale_number_format($myrow['totalqoh'], $myrow['decimalplaces']) . ' ' . $myrow['units'] .'</font></th> + <th colspan="2"><font color="#616161" size="2">'. _('Total Quantity On Hand') . ': ' . locale_number_format($myrow['totalqoh'], $myrow['decimalplaces']) . ' ' . $myrow['units'] .'</font></th> </tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/StockSerialItems.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -68,13 +68,13 @@ echo '<table cellpadding="2" class="selection">'; if ($Serialised==1){ - echo '<tr><th colspan="5"><font color="navy" size="2">' . _('Serialised items in') . ' '; + echo '<tr><th colspan="5"><font color="#616161" size="2">' . _('Serialised items in') . ' '; } else { - echo '<tr><th colspan="11"><font color=navy size="2">' . _('Controlled items in') . ' '; + echo '<tr><th colspan="11"><font color=#616161 size="2">' . _('Controlled items in') . ' '; } echo $myrow[0]. '</font></th></tr>'; -echo '<tr><th colspan="11"><font color="navy" size="2">'.$StockID .'-'. $Description .'</b> (' . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; +echo '<tr><th colspan="11"><font color="#616161" size="2">'.$StockID .'-'. $Description .'</b> (' . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; if ($Serialised == 1){ $tableheader = '<tr> Modified: trunk/StockStatus.php =================================================================== --- trunk/StockStatus.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/StockStatus.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -300,7 +300,7 @@ } if (isset($PriceHistory)) { echo '<br /><table cellpadding="4" class="selection">'; - echo '<tr><th colspan="4"><font color="navy" size="2">' . _('Pricing history for sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo . '</font></th></tr>'; + echo '<tr><th colspan="4"><font color="#616161" size="2">' . _('Pricing history for sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo . '</font></th></tr>'; $tableheader = '<tr> <th>' . _('Date Range') . '</th> <th>' . _('Quantity') . '</th> Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/StockUsage.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -43,13 +43,13 @@ $Its_A_KitSet_Assembly_Or_Dummy =False; if (($myrow[2]=='K') OR ($myrow[2]=='A') OR ($myrow[2]=='D')) { $Its_A_KitSet_Assembly_Or_Dummy =True; - echo '<font color="navy" size="3"><b>' . $StockID - $myrow[0] . '</b></font>'; + echo '<font color="#616161" size="3"><b>' . $StockID - $myrow[0] . '</b></font>'; echo '<br />' . _('The selected item is a dummy or assembly or kit-set item and cannot have a stock holding') . '. ' . _('Please select a different item'); $StockID = ''; } else { - echo '<tr><th><font size="3" color="navy">' . _('Item') . ' :<b> ' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('in units of') . ' :<b> ' . $myrow[1] . ')</b></font></th></tr>'; + echo '<tr><th><font size="3" color="#616161">' . _('Item') . ' :<b> ' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('in units of') . ' :<b> ' . $myrow[1] . ')</b></font></th></tr>'; } echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><tr><td>'; Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SuppCreditGRNs.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -74,7 +74,7 @@ /*Show all the selected GRNs so far from the SESSION['SuppTrans']->GRNs array */ echo '<table cellpadding="0" class="selection">'; -echo '<tr><th colspan="6"><font size="3" color="navy">' . _('Credits Against Goods Received Selected') . '</font></th></tr>'; +echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Credits Against Goods Received Selected') . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('GRN') . '</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -106,8 +106,8 @@ } } -echo '<tr><td colspan="5" class="number"><font size="2" color="navy">' . _('Total Value Credited Against Goods') . ':</font></td> - <td class="number"><font size="2" color="navy"><u>' . locale_money_format($TotalValueCharged,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td></tr>'; +echo '<tr><td colspan="5" class="number"><font size="2" color="#616161">' . _('Total Value Credited Against Goods') . ':</font></td> + <td class="number"><font size="2" color="#616161"><u>' . locale_money_format($TotalValueCharged,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td></tr>'; echo '</table><br /><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a></div>'; /* Now get all the GRNs for this supplier from the database @@ -150,9 +150,9 @@ echo '<br /><table cellpadding="2" colspan="7" class="selection">'; -echo '<tr><th colspan="10"><font size="3" color="navy">' . _('Show Goods Received Since') . ': </font>'; +echo '<tr><th colspan="10"><font size="3" color="#616161">' . _('Show Goods Received Since') . ': </font>'; echo '<input type="text" name="Show_Since" maxlength="11" size="12" class="date" alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '" /> - <font size="3" color="navy"> '; + <font size="3" color="#616161"> '; echo _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('GRN') . '</th> @@ -232,7 +232,7 @@ $myrow = DB_fetch_array($GRNEntryResult); echo '<br /><table class="selection">'; - echo '<tr><th colspan="6"><font size="3" color="navy">' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; echo '<tr><th>' . _('GRN') . '</th> <th>' . _('Item') . '</th> <th>' . _('Quantity') . '<br />' . _('Outstanding') . '</th> Modified: trunk/SuppFixedAssetChgs.php =================================================================== --- trunk/SuppFixedAssetChgs.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SuppFixedAssetChgs.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -89,8 +89,8 @@ } echo '<tr> - <td class="number"><font size="2" color="navy">' . _('Total') . ':</font></td> - <td class="number"><font size="2" color="navy"><U>' . locale_money_format($TotalAssetValue,$_SESSION['SuppTrans']->CurrCode) . '</U></font></td> + <td class="number"><font size="2" color="#616161">' . _('Total') . ':</font></td> + <td class="number"><font size="2" color="#616161"><U>' . locale_money_format($TotalAssetValue,$_SESSION['SuppTrans']->CurrCode) . '</U></font></td> </tr> </table><br />'; Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SuppInvGRNs.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -111,7 +111,7 @@ /*Show all the selected GRNs so far from the SESSION['SuppTrans']->GRNs array */ echo '<table cellpadding="1" class="selection">'; -echo '<tr><th colspan="6"><font size="3" color="navy">' . _('Invoiced Goods Received Selected') . '</font></th></tr>'; +echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Invoiced Goods Received Selected') . '</font></th></tr>'; $tableheader = '<tr bgcolor="#800000"> <th>' . _('Sequence') . ' #</th> @@ -148,8 +148,8 @@ } echo '<tr> - <td colspan="5" align="right"><font size="2" color="navy">' . _('Total Value of Goods Charged') . ':</font></td> - <td class="number"><font size="2" color="navy">' . locale_money_format($TotalValueCharged,$_SESSION['SuppTrans']->CurrCode) . '</font></td> + <td colspan="5" align="right"><font size="2" color="#616161">' . _('Total Value of Goods Charged') . ':</font></td> + <td class="number"><font size="2" color="#616161">' . locale_money_format($TotalValueCharged,$_SESSION['SuppTrans']->CurrCode) . '</font></td> </tr>'; echo '</table>'; echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div><br />'; @@ -235,7 +235,7 @@ $GRNTmp = $_SESSION['SuppTrans']->GRNs[$GRNNo]; echo '<table class="selection">'; - echo '<tr><th colspan="10"><font size="3" color="navy">' . _('GRN Selected For Adding To A Purchase Invoice') . '</font></th></tr>'; + echo '<tr><th colspan="10"><font size="3" color="#616161">' . _('GRN Selected For Adding To A Purchase Invoice') . '</font></th></tr>'; echo '<tr bgcolor=#800000> <th>' . _('Sequence') . ' #</th> <th>' . _('Item') . '</th> @@ -279,7 +279,7 @@ } else { if (count( $_SESSION['SuppTransTmp']->GRNs)>0){ /*if there are any outstanding GRNs then */ echo '<table cellpadding="1" colspan="7" class="selection">'; - echo '<tr><th colspan="10"><font size="3" color="navy">' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</font></th></tr>'; + echo '<tr><th colspan="10"><font size="3" color="#616161">' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</font></th></tr>'; $tableheader = '<tr bgcolor=#800000><th>' . _('Select') . '</th> <th>' . _('Sequence') . ' #</th> Modified: trunk/SuppShiptChgs.php =================================================================== --- trunk/SuppShiptChgs.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SuppShiptChgs.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -99,8 +99,8 @@ } echo '<tr> - <td class="number"><font size="2" color="navy">' . _('Total') . ':</font></td> - <td class="number"><font size="2" color="navy"><u>' . locale_money_format($TotalShiptValue,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td> + <td class="number"><font size="2" color="#616161">' . _('Total') . ':</font></td> + <td class="number"><font size="2" color="#616161"><u>' . locale_money_format($TotalShiptValue,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td> </tr> </table><br />'; Modified: trunk/SuppTransGLAnalysis.php =================================================================== --- trunk/SuppTransGLAnalysis.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SuppTransGLAnalysis.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -134,7 +134,7 @@ echo '<tr> <td colspan="2" class="number"><font size="4" color="blue">' . _('Total') . ':</font></td> - <td class="number"><font size="2" color="navy"><u>' . locale_money_format($TotalGLValue,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td> + <td class="number"><font size="2" color="#616161"><u>' . locale_money_format($TotalGLValue,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td> </tr> </table>'; Modified: trunk/SupplierContacts.php =================================================================== --- trunk/SupplierContacts.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SupplierContacts.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -133,7 +133,7 @@ $result = DB_query($sql, $db); if (DB_num_rows($result)>0){ - echo '<table class="selection"><tr><th colspan="7"><font size="3" color="navy">' . _('Contacts Defined for') . ' - ' . $myrow['suppname'] . '</font></th></tr>'; + echo '<table class="selection"><tr><th colspan="7"><font size="3" color="#616161">' . _('Contacts Defined for') . ' - ' . $myrow['suppname'] . '</font></th></tr>'; echo '<tr><th>' . _('Name') . '</th> <th>' . _('Position') . '</th> Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SupplierTenderCreate.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -220,7 +220,7 @@ echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; - echo '<tr><th colspan="4"><font size="3" color="navy">' . _('Tender header details') . '</font></th></tr>'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Tender header details') . '</font></th></tr>'; echo '<tr><td>' . _('Delivery Must Be Made Before') . '</td>'; echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td></tr>'; @@ -361,7 +361,7 @@ /* Supplier Details */ echo '<tr><td valign="top"><table class="selection">'; - echo '<tr><th colspan="4"><font size="3" color="navy">' . _('Suppliers To Send Tender') . '</font></th></tr>'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Suppliers To Send Tender') . '</font></th></tr>'; echo '<tr><th>'. _('Supplier Code') . '</th><th>' ._('Supplier Name') . '</th><th>' ._('Email Address') . '</th></tr>'; foreach ($_SESSION['tender']->Suppliers as $Supplier) { echo '<tr><td>' . $Supplier->SupplierCode . '</td>'; @@ -373,7 +373,7 @@ /* Item Details */ echo '<td valign="top"><table class="selection">'; - echo '<tr><th colspan="6"><font size="3" color="navy">' . _('Items in Tender') . '</font></th></tr>'; + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Items in Tender') . '</font></th></tr>'; echo '<tr>'; echo '<th>'._('Stock ID').'</th>'; echo '<th>'._('Description').'</th>'; Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/SupplierTenders.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -104,7 +104,7 @@ } } echo '</td>'; - echo '<th colspan="8" style="vertical-align:top"><font size="2" color="navy">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; echo '<th>' . _('Item Description') . '</th>'; @@ -416,7 +416,7 @@ ORDER BY tendersuppliers.tenderid"; $result=DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><th colspan="13"><font size="3" color="navy">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; while ($myrow=DB_fetch_row($result)) { echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -444,7 +444,7 @@ } } echo '</td>'; - echo '<th colspan="8" style="vertical-align:top"><font size="2" color="navy">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; $ItemSQL="SELECT tenderitems.tenderid, Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/TaxAuthorityRates.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -76,7 +76,7 @@ if (DB_num_rows($TaxRatesResult)>0){ echo '<table cellpadding="2" class="selection">'; - echo '<tr><th colspan="3"><font size="3" color="navy">' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th></tr>'; + echo '<tr><th colspan="3"><font size="3" color="#616161">' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('Deliveries From') . '<br />' . _('Tax Province') . '</th> <th>' . _('Tax Category') . '</th> <th>' . _('Tax Rate') . ' %</th></tr>'; Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/TaxGroups.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -264,7 +264,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="SelectedGroup" value="' . $SelectedGroup .'" />'; echo '<table class="selection">'; - echo '<tr><th colspan="3"><font size="3" color="navy">'._('Calculation Order').'</font></th></tr>'; + echo '<tr><th colspan="3"><font size="3" color="#616161">'._('Calculation Order').'</font></th></tr>'; echo '<tr> <th>'._('Tax Authority').'</th> Modified: trunk/WhereUsedInquiry.php =================================================================== --- trunk/WhereUsedInquiry.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/WhereUsedInquiry.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -26,7 +26,7 @@ include('includes/footer.inc'); exit; } - echo '<br /><font color="navy" size="3"><b>'.$StockID - $myrow[0] .'</b> (' . _('in units of') . ' ' . $myrow[1] . ')</font>'; + echo '<br /><font color="#616161" size="3"><b>'.$StockID - $myrow[0] .'</b> (' . _('in units of') . ' ' . $myrow[1] . ')</font>'; } echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><div class="centre">'; Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/WorkOrderStatus.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -79,8 +79,8 @@ echo '</td></tr></table><br />'; //set up options for selection of the item to be issued to the WO - echo '<table class="selection"><tr><th colspan="5"><font size="2" color="navy">' . _('Material Requirements For this Work Order') . '</font></th></tr>'; - echo '<tr><th colspan="4"><font size="2" color="navy">' . _('Stock Issued From') . ' - ' . $LocRow['locationname'] . '</font></th></tr>'; + echo '<table class="selection"><tr><th colspan="5"><font size="2" color="#616161">' . _('Material Requirements For this Work Order') . '</font></th></tr>'; + echo '<tr><th colspan="4"><font size="2" color="#616161">' . _('Stock Issued From') . ' - ' . $LocRow['locationname'] . '</font></th></tr>'; echo '<tr><th colspan="2">' . _('Item') . '</th> <th>' . _('Qty Required') . '</th> <th>' . _('Qty Issued') . '</th> Modified: trunk/Z_UpgradeDatabase.php =================================================================== --- trunk/Z_UpgradeDatabase.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/Z_UpgradeDatabase.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -68,10 +68,10 @@ // echo '</tr>'; } echo '<table class="selection"><tr>'; - echo '<th colspan="4"><font size="2" color="navy"><b>'._('Database Updates Have Been Run').'</b></font></th></tr>'; + echo '<th colspan="4"><font size="2" color="#616161"><b>'._('Database Updates Have Been Run').'</b></font></th></tr>'; echo '<tr><td style="background-color: #fddbdb;color: red;">'.$_SESSION['Updates']['Errors'].' '._('updates have errors in them').'</td></tr>'; echo '<tr><td style="background-color: #b9ecb4;color: #006400;">'.$_SESSION['Updates']['Successes'].' '._('updates have succeeded').'</td></tr>'; - echo '<tr><td style="background-color: #c7ccf6;color: navy;">'.$_SESSION['Updates']['Warnings'].' '._('updates have not been done as the update was unnecessary on this database').'</td></tr>'; + echo '<tr><td style="background-color: #c7ccf6;color: #616161;">'.$_SESSION['Updates']['Warnings'].' '._('updates have not been done as the update was unnecessary on this database').'</td></tr>'; if ($_SESSION['Updates']['Errors']>0) { for ($i=0; $i<sizeOf($_SESSION['Updates']['Messages']); $i++) { echo '<tr><td>'.$_SESSION['Updates']['Messages'][$i].'</td></tr>'; Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/css/silverwolf/default.css 2011-09-16 20:51:51 UTC (rev 8164) @@ -44,12 +44,12 @@ font-size: 100%; font-weight: normal; text-decoration: none; - color: #00f; + color: #676774; } /*links on any screen except quick menu which is overridden when mouse is hovering over them */ a:hover { - color: #00a; + color: #000; text-decoration: underline; } @@ -60,7 +60,7 @@ th { font-weight: normal; - background-color: #cccce5; + background-color: #C3C3C3; font-size: 100%; color: #300; text-align: center; @@ -618,7 +618,7 @@ font-weight: bold; font-size: 150%; color: white; - background-color: #B0B0D5; + background-color: #7A7A89; width: 33%; border-style: solid; border-width: 1px; Modified: trunk/includes/phplot/phplot.php =================================================================== --- trunk/includes/phplot/phplot.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/includes/phplot/phplot.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -511,7 +511,7 @@ 'DimGrey' => array(105, 105, 105), 'gray' => array(190, 190, 190), 'grey' => array(190, 190, 190), - 'navy' => array( 0, 0, 128), + '#616161' => array( 0, 0, 128), 'SlateBlue' => array(106, 90, 205), 'blue' => array( 0, 0, 255), 'SkyBlue' => array(135, 206, 235), Modified: trunk/includes/phplot/rgb.inc.php =================================================================== --- trunk/includes/phplot/rgb.inc.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/includes/phplot/rgb.inc.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -77,8 +77,8 @@ "LightGray" => array(211, 211, 211), "midnight blue" => array( 25, 25, 112), "MidnightBlue" => array( 25, 25, 112), - "navy" => array( 0, 0, 128), - "navy blue" => array( 0, 0, 128), + "#616161" => array( 0, 0, 128), + "#616161 blue" => array( 0, 0, 128), "NavyBlue" => array( 0, 0, 128), "cornflower blue" => array(100, 149, 237), "CornflowerBlue" => array(100, 149, 237), Modified: trunk/includes/tcpdf/htmlcolors.php =================================================================== --- trunk/includes/tcpdf/htmlcolors.php 2011-09-16 20:50:42 UTC (rev 8163) +++ trunk/includes/tcpdf/htmlcolors.php 2011-09-16 20:51:51 UTC (rev 8164) @@ -156,7 +156,7 @@ 'mistyrose' => 'ffe4e1', 'moccasin' => 'ffe4b5', 'navajowhite' => 'ffdead', -'navy' => '000080', +'#616161' => '000080', 'oldlace' => 'fdf5e6', 'olive' => '808000', 'olivedrab' => '6b8e23', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-16 21:21:58
|
Revision: 8165 http://weberp.svn.sourceforge.net/weberp/?rev=8165&view=rev Author: tim_schofield Date: 2011-09-16 21:21:51 +0000 (Fri, 16 Sep 2011) Log Message: ----------- Updates to the silverwolf theme Modified Paths: -------------- trunk/SelectProduct.php trunk/css/silverwolf/default.css Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-09-16 20:51:51 UTC (rev 8164) +++ trunk/SelectProduct.php 2011-09-16 21:21:51 UTC (rev 8165) @@ -77,7 +77,7 @@ echo '<table width="90%" class="selection"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . ' ' . $ItemStatus . '</b></th></tr>'; echo '<tr><td width="40%" valign="top"> <table align="left">'; //nested table - echo '<tr><th class="number">' . _('Item Type:') . '</th> + echo '<tr><th style="text-align:right;">' . _('Item Type:') . '</th> <td colspan="2" class="select">'; switch ($myrow['mbflag']) { case 'A': @@ -104,7 +104,7 @@ echo _('Manufactured Item'); break; } - echo '</td><th class="number">' . _('Control Level:') . '</th><td class="select">'; + echo '</td><th style="text-align:right;">' . _('Control Level:') . '</th><td class="select">'; if ($myrow['serialised'] == 1) { echo _('serialised'); } elseif ($myrow['controlled'] == 1) { @@ -112,13 +112,13 @@ } else { echo _('N/A'); } - echo '</td><th class="number">' . _('Units') . ':</th> + echo '</td><th style="text-align:right;">' . _('Units') . ':</th> <td class="select">' . $myrow['units'] . '</td></tr>'; - echo '<tr><th class="number">' . _('Volume') . ':</th> + echo '<tr><th style="text-align:right;">' . _('Volume') . ':</th> <td class="select" colspan="2">' . locale_number_format($myrow['volume'], 3) . '</td> - <th class="number">' . _('Weight') . ':</th> + <th style="text-align:right;">' . _('Weight') . ':</th> <td class="select">' . locale_number_format($myrow['kgs'], 3) . '</td> - <th class="number">' . _('EOQ') . ':</th> + <th style="text-align:right;">' . _('EOQ') . ':</th> <td class="select">' . locale_number_format($myrow['eoq'], $myrow['decimalplaces']) . '</td></tr>'; if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<tr><th colspan="2">' . _('Sell Price') . ':</th> @@ -150,7 +150,7 @@ $PriceRow = DB_fetch_array($PriceResult); $Price = $PriceRow['price']; echo $PriceRow['typeabbrev'] . '</td><td class="select">' . locale_money_format($Price, $PriceRow['currabrev']) . '</td> - <th class="number">' . _('Gross Profit') . '</th> + <th style="text-align:right;">' . _('Gross Profit') . '</th> <td class="select">'; if ($Price > 0) { $GP = locale_money_format(($Price - $Cost) * 100 / $Price, $PriceRow['currabrev']); @@ -163,7 +163,7 @@ echo '<tr><td></td> <td class="select">' . $PriceRow['typeabbrev'] . '</td> <td class="select">' . locale_money_format($Price, $PriceRow['currabrev']) . '</td> - <th class="number">' . _('Gross Profit') . '</th> + <th style="text-align:right;">' . _('Gross Profit') . '</th> <td class="select">'; if ($Price > 0) { $GP = locale_money_format(($Price - $Cost) * 100 / $Price, $PriceRow['currabrev']); @@ -187,7 +187,7 @@ } else { $Cost = $myrow['cost']; } - echo '<th class="number">' . _('Cost') . '</th> + echo '<th style="text-align:right;">' . _('Cost') . '</th> <td class="select">' . locale_money_format($Cost, $_SESSION['CompanyRecord']['currencydefault']) . '</td>'; } //end of if PricesSecuirty allows viewing of prices echo '</table>'; //end of first nested table @@ -332,11 +332,11 @@ $DemandRow = DB_fetch_row($DemandResult); $Demand+= $DemandRow[0]; } -echo '<tr><th class="number" width="15%">' . _('Quantity On Hand') . ':</th> +echo '<tr><th style="text-align:right;" width="15%">' . _('Quantity On Hand') . ':</th> <td width="17%" class="select">' . $QOH . '</td></tr>'; -echo '<tr><th class="number" width="15%">' . _('Quantity Demand') . ':</th> +echo '<tr><th style="text-align:right;" width="15%">' . _('Quantity Demand') . ':</th> <td width="17%" class="select">' . locale_number_format($Demand, $myrow['decimalplaces']) . '</td></tr>'; -echo '<tr><th class="number" width="15%">' . _('Quantity On Order') . ':</th> +echo '<tr><th style="text-align:right;" width="15%">' . _('Quantity On Order') . ':</th> <td width="17%" class="select">' . $QOO . '</td></tr> </table>'; //end of nested table echo '</td>'; //end cell of master table Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2011-09-16 20:51:51 UTC (rev 8164) +++ trunk/css/silverwolf/default.css 2011-09-16 21:21:51 UTC (rev 8165) @@ -44,7 +44,7 @@ font-size: 100%; font-weight: normal; text-decoration: none; - color: #676774; + color: #5B5B68; } /*links on any screen except quick menu which is overridden when mouse is hovering over them */ @@ -525,7 +525,7 @@ } .main_menu_selected { - background: #aaa url(images/menu_bg_blue.png) 0px -10px repeat-x; + background: #241D1D; border: 1px solid #888; /* position: relative; it's not a div but a table */ text-align: center; @@ -537,11 +537,11 @@ .main_menu_selected:hover { } */ .main_menu_selected a { - color: #00F; + color: #ddd; } .main_menu_selected a:hover { - color: #000; + color: #ffe; text-decoration: none; } @@ -606,7 +606,7 @@ } .menu_group_item p { - color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #000; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -11px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-19 20:00:24
|
Revision: 8174 http://weberp.svn.sourceforge.net/weberp/?rev=8174&view=rev Author: tim_schofield Date: 2011-09-19 20:00:18 +0000 (Mon, 19 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/PcClaimExpensesFromTab.php trunk/includes/LanguageSetup.php Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-09-19 19:59:59 UTC (rev 8173) +++ trunk/PcClaimExpensesFromTab.php 2011-09-19 20:00:18 UTC (rev 8174) @@ -85,12 +85,12 @@ $Errors[$i] = 'TabCode'; $i++; } - + $_POST['amount'] = filter_currency_input($_POST['amount']); if (isset($SelectedIndex) AND $InputError !=1) { $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', codeexpense = '" . $_POST['SelectedExpense'] . "', - amount = '" .- $_POST['amount'] . "', + amount = -'" . $_POST['amount'] . "', notes = '" . $_POST['Notes'] . "', receipt = '" . $_POST['Receipt'] . "' WHERE counterindex = '".$SelectedIndex."'"; @@ -113,9 +113,9 @@ notes, receipt) VALUES ('','" . $_POST['SelectedTabs'] . "', - '".FormatDateForSQL($_POST['Date'])."', + '" . FormatDateForSQL($_POST['Date'])."', '" . $_POST['SelectedExpense'] . "', - '" .- $_POST['amount'] . "', + '-" . $_POST['amount'] . "', '', '', '" . $_POST['Notes'] . "', @@ -197,7 +197,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . $title . '</p>'; /* RICARD */ - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Select another tab') . '</a></div></p>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Select another tab') . '</a></div>'; if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; @@ -223,7 +223,13 @@ unset($_POST['Receipt']); } - $sql = "SELECT * FROM pcashdetails + $sql = "SELECT counterindex, + date, + amount, + notes, + receipt, + authorized + FROM pcashdetails WHERE tabcode='".$SelectedTabs."' AND date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) ORDER BY date, counterindex ASC"; @@ -241,7 +247,7 @@ $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -257,17 +263,21 @@ $ResultDes = DB_query($sqldes,$db); $Description=DB_fetch_array($ResultDes); - if (!isset($Description['0'])){ - $Description['0']='ASSIGNCASH'; + $sql = "SELECT currency FROM pctabs WHERE tabcode='".$SelectedTabs."'"; + $TabResult = DB_query($sql, $db); + $TabRow = DB_fetch_array($TabResult); + + if (!isset($Description['description'])){ + $Description['description']='ASSIGNCASH'; } - if ($myrow['5']=='0000-00-00') { + if ($myrow['authorized']=='0000-00-00') { $AuthorisedDate=_('Unauthorised'); } else { $AuthorisedDate=ConvertSQLDate($myrow['5']); } - if (($myrow['5'] == "0000-00-00") and ($Description['0'] != 'ASSIGNCASH')){ + if (($myrow['date'] == '0000-00-00') and ($Description['0'] != 'ASSIGNCASH')){ // only movements NOT authorized can be modified or deleted printf('<td>%s</td> <td>%s</td> @@ -278,16 +288,16 @@ <td><a href="%sSelectedIndex=%s&SelectedTabs='.$SelectedTabs.'&Days='.$Days.'&edit=yes">' . _('Edit') . '</td> <td><a href="%sSelectedIndex=%s&SelectedTabs='.$SelectedTabs.'&Days='.$Days.'&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this code and the expense it may have set up?') . '");">' . _('Delete') . '</td> </tr>', - ConvertSQLDate($myrow['2']), - $Description['0'], - number_format($myrow['4'],2), + ConvertSQLDate($myrow['date']), + $Description['description'], + locale_money_format($myrow['amount'],$TabRow['currency']), $AuthorisedDate, - $myrow['7'], - $myrow['8'], + $myrow['notes'], + $myrow['receipt'], $_SERVER['PHP_SELF'] . '?', - $myrow['0'], + $myrow['counterindex'], $_SERVER['PHP_SELF'] . '?', - $myrow['0']); + $myrow['counterindex']); } else { printf('<td>%s</td> <td>%s</td> @@ -296,31 +306,31 @@ <td>%s</td> <td>%s</td> </tr>', - ConvertSQLDate($myrow['2']), - $Description['0'], - number_format($myrow['4'],2), + ConvertSQLDate($myrow['date']), + $Description['description'], + locale_money_format($myrow['amount'],$TabRow['currency']), $AuthorisedDate, - $myrow['7'], - $myrow['8']); + $myrow['notes'], + $myrow['receipt']); } } //END WHILE LIST LOOP - $sqlamount="SELECT sum(amount) + $sqlamount="SELECT sum(amount) as amount FROM pcashdetails WHERE tabcode='".$SelectedTabs."'"; $ResultAmount = DB_query($sqlamount,$db); $Amount=DB_fetch_array($ResultAmount); - if (!isset($Amount['0'])) { - $Amount['0']=0; + if (!isset($Amount['amount'])) { + $Amount['amount']=0; } echo '<tr><td colspan="2" class="number">' . _('Current balance') . ':</td> - <td class="number">'.number_format($Amount['0'],2).'</td></tr>'; + <td class="number">'.locale_money_format($Amount['amount'],$TabRow['currency']).'</td></tr>'; echo '</table>'; Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-19 19:59:59 UTC (rev 8173) +++ trunk/includes/LanguageSetup.php 2011-09-19 20:00:18 UTC (rev 8174) @@ -31,7 +31,7 @@ //$Locale = setlocale (LC_CTYPE, $_SESSION['Language']); //$Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); - $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver +// $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver if ($_SESSION['Language']=='tr_TR.utf8') { $Locale = setlocale(LC_CTYPE, 'C'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-26 20:31:16
|
Revision: 8198 http://weberp.svn.sourceforge.net/weberp/?rev=8198&view=rev Author: tim_schofield Date: 2011-09-26 20:31:10 +0000 (Mon, 26 Sep 2011) Log Message: ----------- New table for stockorderitemproperties Modified Paths: -------------- trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/94.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-09-26 20:30:58 UTC (rev 8197) +++ trunk/includes/session.inc 2011-09-26 20:31:10 UTC (rev 8198) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=93; +$DBVersion=94; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/94.php =================================================================== --- trunk/sql/mysql/updates/94.php (rev 0) +++ trunk/sql/mysql/updates/94.php 2011-09-26 20:31:10 UTC (rev 8198) @@ -0,0 +1,20 @@ +<?php + +CreateTable('stockorderitemproperties', "CREATE TABLE `stockorderitemproperties` ( +`stockid` varchar(20) NOT NULL, +`orderno` int(11) NOT NULL, +`orderlineno` int(11) NOT NULL, +`stkcatpropid` int(11) NOT NULL, +`value` varchar(50) NOT NULL, +PRIMARY KEY (`stockid`,`orderno`,`orderlineno`,`stkcatpropid`), +KEY `stockid` (`stockid`), +KEY `orderno` (`orderno`), +KEY `stkcatpropid` (`stkcatpropid`), +KEY `value` (`value`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;", $db); + + + +UpdateDBNo(94, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-03 18:36:29
|
Revision: 8209 http://weberp.svn.sourceforge.net/weberp/?rev=8209&view=rev Author: tim_schofield Date: 2011-10-03 18:36:22 +0000 (Mon, 03 Oct 2011) Log Message: ----------- Add item category properties to sales order entry Modified Paths: -------------- trunk/DeliveryDetails.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-10-02 23:45:01 UTC (rev 8208) +++ trunk/DeliveryDetails.php 2011-10-03 18:36:22 UTC (rev 8209) @@ -417,6 +417,23 @@ $ErrMsg = _('Unable to add the sales order line'); $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg,true); + if (count($StockItem->ItemProperties) > 0) { + foreach ($StockItem->ItemProperties as $PropertyID=>$PropertyValue) { + $ItemPropertiesSQL = "INSERT INTO stockorderitemproperties ( + stockid, + orderno, + orderlineno, + stkcatpropid, + value) + VALUES ( + '" . $StockItem->StockID . "', + '" . $OrderNo . "', + '" . $StockItem->LineNumber . "', + '" . $PropertyID . "', + '" . $PropertyValue . "')"; + $ItemPropertyResult = DB_query($ItemPropertiesSQL,$db,$ErrMsg,$DbgMsg,true); + } + } /*Now check to see if the item is manufactured * and AutoCreateWOs is on * and it is a real order (not just a quotation)*/ @@ -776,6 +793,16 @@ $ErrMsg = _('The updated order line cannot be modified because'); $Upd_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg,true); + foreach ($StockItem->ItemProperties as $PropertyID=>$PropertyValue) { + $ItemPropertiesSQL = "UPDATE stockorderitemproperties + SET value='" . $PropertyValue . "' + WHERE stockid='" . $StockItem->StockID . "' + AND orderno='" . $OrderNo . "' + AND orderlineno='" . $StockItem->LineNumber . "' + AND stkcatpropid='" . $PropertyID . "'"; + $ItemPropertyResult = DB_query($ItemPropertiesSQL,$db,$ErrMsg,$DbgMsg,true); + } + } /* updated line items into sales order details */ $Result=DB_Txn_Commit($db); @@ -832,10 +859,10 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = number_format($LineTotal,2); - $DisplayPrice = number_format($StockItem->Price,2); - $DisplayQuantity = number_format($StockItem->Quantity,$StockItem->DecimalPlaces); - $DisplayDiscount = number_format(($StockItem->DiscountPercent * 100),2); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->DefaultCurrency); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->DefaultCurrency); + $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); + $DisplayDiscount = locale_number_format(($StockItem->DiscountPercent * 100),2); if ($k==1){ @@ -860,14 +887,14 @@ $_SESSION['Items'.$identifier]->totalWeight = $_SESSION['Items'.$identifier]->totalWeight + ($StockItem->Quantity * $StockItem->Weight); } - $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,2); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->DefaultCurrency); echo '<tr class="EvenTableRows"> <td colspan="6" class="number"><b>'. _('TOTAL Excl Tax/Freight') .'</b></td> <td class="number">'.$DisplayTotal.'</td> </tr>'; - $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); - $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); + $DisplayVolume = locale_number_format($_SESSION['Items'.$identifier]->totalVolume,2); + $DisplayWeight = locale_number_format($_SESSION['Items'.$identifier]->totalWeight,2); echo '<br /><tr class="EvenTableRows"><td colspan="3"></td> <td>'. _('Total Weight') .':</td> <td class="number">'.$DisplayWeight.'</td> @@ -895,9 +922,9 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = number_format($LineTotal,2); - $DisplayPrice = number_format($StockItem->Price,2); - $DisplayQuantity = number_format($StockItem->Quantity,$StockItem->DecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->DefaultCurrency); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->DefaultCurrency); + $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); if ($k==1){ echo '<tr class="OddTableRows">'; @@ -919,7 +946,7 @@ } - $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,2); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->DefaultCurrency); echo '<table class="selection"><tr> <td>'. _('Total Weight') .':</td> <td>'.$DisplayWeight .'</td> @@ -927,8 +954,8 @@ <td>'.$DisplayVolume .'</td> </tr></table>'; - $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); - $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); + $DisplayVolume = locale_number_format($_SESSION['Items'.$identifier]->totalVolume,2); + $DisplayWeight = locale_number_format($_SESSION['Items'.$identifier]->totalWeight,2); echo '<table class="selection"><tr> <td>'. _('Total Weight') .':</td> <td>'. $DisplayWeight .'</td> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-10-02 23:45:01 UTC (rev 8208) +++ trunk/SelectOrderItems.php 2011-10-03 18:36:22 UTC (rev 8209) @@ -21,17 +21,22 @@ if (isset($_POST['QuickEntry'])){ unset($_POST['PartSearch']); } - -if (isset($_POST['order_items'])){ - foreach ($_POST as $key => $value) { - if (mb_strstr($key,'StockID')) { - $Index=mb_substr($key, 7); - $StockID=$value; - $NewItem_array[$StockID] = filter_number_input($_POST['Quantity'.$Index]); - $_POST['Units'.$StockID]=$_POST['Units'.$Index]; - $NewItem='Here'; - } +foreach ($_POST as $key => $value) { + if (mb_strstr($key,'StockID')) { + $Index=mb_substr($key, 7); + $StockID=$value; + $NewItem_array[$StockID] = filter_number_input($_POST['Quantity'.$Index]); + $_POST['Units'.$StockID]=$_POST['Units'.$Index]; + $NewItem=True; } + if (mb_strstr($key, 'PropOrderLine')) { + $OrderLinePropertyArray = explode('x', mb_substr($key, 13)); + $OrderLine = $OrderLinePropertyArray[0]; + $Index = $OrderLinePropertyArray[1]; + $PropCategoryID = $_POST['PropID'.$OrderLine.'x'.$Index]; + $PropValue = $_POST['PropValue'.$OrderLine.'x'.$Index]; + $PropertiesArray[$OrderLine][$PropCategoryID] = $PropValue; + } } if (isset($_GET['NewItem'])){ @@ -227,6 +232,21 @@ while ($myrow=db_fetch_array($LineItemsResult)) { if ($myrow['completed']==0){ + + $PropertiesSQL="SELECT stkcatpropid, + value + FROM stockorderitemproperties + WHERE orderno='" . $_GET['ModifyOrderNumber'] . "' + AND orderlineno='" . $myrow['orderlineno'] . "'"; + $PropertiesResult=DB_query($PropertiesSQL, $db); + if (DB_num_rows($PropertiesResult)==0) { + $PropertiesArray=array(); + } else { + while ($MyPropertiesRow=DB_fetch_array($PropertiesResult)) { + $PropertiesArray[$MyPropertiesRow['stkcatpropid']]=$MyPropertiesRow['value']; + } + } + $_SESSION['Items'.$identifier]->add_to_cart($myrow['stkcode'], $myrow['quantity'], $myrow['description'], @@ -254,8 +274,8 @@ $myrow['eoq'], $myrow['nextserialno'], $ExRate, - $myrow['conversionfactor'] ); - + $myrow['conversionfactor'], + $PropertiesArray ); /*Just populating with existing order - no DBUpdates */ } $LastLineNo = $myrow['orderlineno']; @@ -639,12 +659,12 @@ echo '<td><input tabindex="3" type="text" name="CustPhone" size="15" maxlength="18" /></td>'; echo '</tr>'; echo '</table>'; - echo '<br /><div class="centre"><input tabindex="4" type="submit" name="SearchCust" value="' . _('Search Now') . '" />'; - echo '<input tabindex="5" type="reset" value="' . _('Reset') . '" /></div>'; + echo '<br /><div class="centre"><input tabindex="4" type="submit" name="SearchCust" value="' . _('Search Now') . '" />'; + echo '<input tabindex="5" type="reset" value="' . _('Reset') . '" /></div>'; if (isset($result_CustSelect)) { - echo '<table cellpadding="2">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<br /><tr> <th>' . _('Customer') . '</th> @@ -885,11 +905,6 @@ if (DB_num_rows($SearchResult)==0 ){ prnMsg (_('There are no products available meeting the criteria specified'),'info'); } - if (DB_num_rows($SearchResult)==1){ - $myrow=DB_fetch_array($SearchResult); - $NewItem = $myrow['stockid']; - DB_data_seek($SearchResult,0); - } if (DB_num_rows($SearchResult)<$_SESSION['DisplayRecordsMax']){ $Offset=0; } @@ -916,7 +931,7 @@ /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['order_items']) + if (isset($_POST['order_items']) OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ @@ -1156,8 +1171,8 @@ OR ABS($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 OR $OrderLine->Narrative != $Narrative OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] - OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { - + OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber] + OR isset($PropertiesArray)) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, $Price, @@ -1168,7 +1183,8 @@ 'Yes', /*Update DB */ $_POST['ItemDue_' . $OrderLine->LineNumber], $_POST['POLine_' . $OrderLine->LineNumber], - $_POST['GPPercent_' . $OrderLine->LineNumber]); + $_POST['GPPercent_' . $OrderLine->LineNumber], + $PropertiesArray[$OrderLine->LineNumber]); } } //page not called from itself - POST variables not set } @@ -1314,8 +1330,8 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ echo '<br /> - <table width="90%" cellpadding="2" colspan="7"> - <tr bgcolor=#800000>'; + <table width="90%" cellpadding="2" colspan="7" class="selection"> + <tr bgcolor="#800000">'; if($_SESSION['Items'.$identifier]->DefaultPOLine == 1){ echo '<th>' . _('PO Line') . '</th>'; } @@ -1411,6 +1427,75 @@ echo '<input type="hidden" name="Narrative" value="" />'; } + $PropertySQL="SELECT label, + controltype, + stkcatpropid, + numericvalue + FROM stockcatproperties + LEFT JOIN stockmaster + ON stockcatproperties.categoryid=stockmaster.categoryid + WHERE stockmaster.stockid='".$OrderLine->StockID."' + AND reqatsalesorder=1"; + $PropertyResult=DB_query($PropertySQL, $db); + if (DB_num_rows($PropertyResult)>0) { + $PropertyCounter=0; + while ($PropertyRow=DB_fetch_array($PropertyResult)) { + if ($k==1){ + echo '<tr class="OddTableRows">'; + $k=0; + } else { + echo '<tr class="EvenTableRows">'; + $k=1; + } + echo '<td>' . $PropertyRow['label'] . '</td>'; + echo '<input type="hidden" name="PropOrderLine' . $OrderLine->LineNumber . 'x' . $PropertyCounter . '" value="" />'; + echo '<input type="hidden" name="PropID' . $OrderLine->LineNumber . 'x' . $PropertyCounter . '" value="' . $PropertyRow['stkcatpropid'] . '" />'; + switch ($PropertyRow['controltype']) { + case 0: + if ($PropertyRow['numericvalue']==0) { + echo '<td><input type="text" name="PropValue'.$OrderLine->LineNumber . 'x' . $PropertyCounter.'" value="'.$OrderLine->ItemProperties[$PropertyRow['stkcatpropid']].'" /></td>'; + } else { + echo '<td><input type="text" class="number" size="12" name="PropValue'.$OrderLine->LineNumber . 'x' . $PropertyCounter.'" value="'.$OrderLine->ItemProperties[$PropertyRow['stkcatpropid']].'" /></td>'; + } + break; + case 1; //select box + $OptionValues = array(); + if ($PropertyRow['label']=='Manufacturers') { + $sql="SELECT coyname from manufacturers"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $OptionValues[]=$myrow['coyname']; + } + } else { + $OptionValues = explode(',',$PropertyRow['defaultvalue']); + } + echo '<select name="PropValue' . $OrderLine->LineNumber . 'x' . $PropertyCounter . '">'; + foreach ($OptionValues as $PropertyOptionValue){ + if ($PropertyOptionValue == $OrderLine->ItemProperties[$PropertyRow['stkcatpropid']]){ + echo '<option selected="True" value="' . $PropertyOptionValue . '">' . $PropertyOptionValue . '</option>'; + } else { + echo '<option value="' . $PropertyOptionValue . '">' . $PropertyOptionValue . '</option>'; + } + } + echo '</select>'; + break; + case 2; //checkbox + if ($OrderLine->ItemProperties[$PropertyRow['stkcatpropid']]==1){ + echo '<input type="checkbox" name="PropValue' . $OrderLine->LineNumber . 'x' . $PropertyCounter . '" checked="True" />'; + } else { + echo '<input type="checkbox" name="PropValue' . $OrderLine->LineNumber . 'x' . $PropertyCounter . '" />'; + } + break; + case 3: //date box + echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="10" maxlength="10" name="PropValue'.$OrderLine->LineNumber . 'x' . $PropertyCounter.'" value="'.$OrderLine->ItemProperties[$PropertyRow['stkcatpropid']].'" /></td>'; + break; + default: + break; + } + echo '<td colspan="9"></td></tr>'; + $PropertyCounter++; + } + } $_SESSION['Items'.$identifier]->total = $_SESSION['Items'.$identifier]->total + $LineTotal; $_SESSION['Items'.$identifier]->totalVolume = $_SESSION['Items'.$identifier]->totalVolume + $OrderLine->Quantity * $OrderLine->Volume; $_SESSION['Items'.$identifier]->totalWeight = $_SESSION['Items'.$identifier]->totalWeight + $OrderLine->Quantity * $OrderLine->Weight; @@ -1428,7 +1513,7 @@ $DisplayVolume = locale_number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = locale_number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<table><tr class="EvenTableRows"><td>' . _('Total Weight') . ':</td> + echo '<br /><table class="selection"><tr class="EvenTableRows"><td>' . _('Total Weight') . ':</td> <td>' . $DisplayWeight . '</td> <td>' . _('Total Volume') . ':</td> <td>' . $DisplayVolume . '</td> @@ -1436,7 +1521,7 @@ echo '<br /><div class="centre"><input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> - <input type="submit" name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '" /></div><hr />'; + <input type="submit" name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '" /></div>'; } # end of if lines /* Now show the stock item selection search stuff below */ @@ -1592,7 +1677,7 @@ <input tabindex="'.($j+8).'" type="submit" value="'._('Add to Sales Order').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 - + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; echo _('Search for Order Items') . '</p>'; echo '<div class="page_help_text">' . _('Search for Order Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.</div><br />'; Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-10-02 23:45:01 UTC (rev 8208) +++ trunk/includes/DefineCartClass.php 2011-10-03 18:36:22 UTC (rev 8209) @@ -46,15 +46,15 @@ var $ShipVia; var $FreightCost; var $FreightTaxes; - Var $OrderNo; - Var $Consignment; - Var $Quotation; - Var $DeliverBlind; - Var $CreditAvailable; //in customer currency - Var $TaxGroup; - Var $DispatchTaxProvince; - Var $DefaultPOLine; - Var $DeliveryDays; + var $OrderNo; + var $Consignment; + var $Quotation; + var $DeliverBlind; + var $CreditAvailable; //in customer currency + var $TaxGroup; + var $DispatchTaxProvince; + var $DefaultPOLine; + var $DeliveryDays; var $TaxTotals; var $TaxGLCodes; var $BuyerName; @@ -97,7 +97,8 @@ $EOQ=1, $NextSerialNo=0, $ExRate=1, - $ConversionFactor=1){ + $ConversionFactor=1, + $ItemProperties=array()){ if (isset($StockID) AND $StockID!="" AND $Qty>0 AND isset($Qty)){ @@ -136,6 +137,7 @@ $EOQ, $NextSerialNo, $ExRate); + $this->LineItems[$LineNumber]->ItemProperties=$ItemProperties; $this->ItemsOrdered++; if ($UpdateDB=='Yes'){ @@ -189,7 +191,8 @@ $UpdateDB='No', $ItemDue, $POLine, - $GPPercent){ + $GPPercent, + $ItemProperties=array()){ if ($Qty>0){ $this->LineItems[$UpdateLineNumber]->Quantity = $Qty; @@ -202,6 +205,7 @@ $this->LineItems[$UpdateLineNumber]->ItemDue = $ItemDue; $this->LineItems[$UpdateLineNumber]->POLine = $POLine; $this->LineItems[$UpdateLineNumber]->GPPercent = $GPPercent; + $this->LineItems[$UpdateLineNumber]->ItemProperties = $ItemProperties; if ($UpdateDB=='Yes'){ global $db; $result = DB_query("UPDATE salesorderdetails SET quantity='" . $Qty . "', @@ -419,37 +423,38 @@ } /* end of cart class defintion */ Class LineDetails { - Var $LineNumber; - Var $StockID; - Var $ItemDescription; - Var $Quantity; - Var $Price; - Var $DiscountPercent; - Var $Units; + var $LineNumber; + var $StockID; + var $ItemDescription; + var $Quantity; + var $Price; + var $DiscountPercent; + var $Units; var $ConversionFactor; - Var $Volume; - Var $Weight; - Var $ActDispDate; - Var $QtyInv; - Var $QtyDispatched; - Var $StandardCost; - Var $QOHatLoc; - Var $MBflag; /*Make Buy Dummy, Assembly or Kitset */ - Var $DiscCat; /* Discount Category of the item if any */ - Var $Controlled; - Var $Serialised; - Var $DecimalPlaces; + var $Volume; + var $Weight; + var $ActDispDate; + var $QtyInv; + var $QtyDispatched; + var $StandardCost; + var $QOHatLoc; + var $MBflag; /*Make Buy Dummy, Assembly or Kitset */ + var $DiscCat; /* Discount Category of the item if any */ + var $Controlled; + var $Serialised; + var $DecimalPlaces; var $PriceDecimals; - Var $SerialItems; - Var $Narrative; - Var $TaxCategory; - Var $Taxes; - Var $WorkOrderNo; - Var $ItemDue; - Var $POLine; - Var $EOQ; - Var $NextSerialNo; - Var $GPPercent; + var $SerialItems; + var $Narrative; + var $TaxCategory; + var $Taxes; + var $WorkOrderNo; + var $ItemDue; + var $POLine; + var $EOQ; + var $NextSerialNo; + var $GPPercent; + var $ItemProperties; function LineDetails ($LineNumber, $StockItem, @@ -507,6 +512,7 @@ $this->SerialItems = array(); $this->Narrative = $Narrative; $this->Taxes = array(); + $this->ItemProperties = array(); $this->TaxCategory = $TaxCategory; $this->WorkOrderNo = 0; $this->ItemDue = $ItemDue; @@ -525,11 +531,11 @@ } Class Tax { - Var $TaxCalculationOrder; /*the index for the array */ - Var $TaxAuthID; - Var $TaxAuthDescription; - Var $TaxRate; - Var $TaxOnTax; + var $TaxCalculationOrder; /*the index for the array */ + var $TaxAuthID; + var $TaxAuthDescription; + var $TaxRate; + var $TaxOnTax; var $TaxGLCode; function Tax ($TaxCalculationOrder, Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-10-02 23:45:01 UTC (rev 8208) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-10-03 18:36:22 UTC (rev 8209) @@ -161,7 +161,6 @@ $myItemRow['nextserialno'], $ExRate, $ConversionFactor); - } } else { prnMsg(_('The item code') . ' ' . $NewItem . ' ' . _('does not have a cost set up and order entry is set up to prohibit sales of items with no cost data entered'),'warn'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-03 18:40:11
|
Revision: 8227 http://weberp.svn.sourceforge.net/weberp/?rev=8227&view=rev Author: tim_schofield Date: 2011-10-03 18:40:05 +0000 (Mon, 03 Oct 2011) Log Message: ----------- Remove all SELECT * references, only choose those fields that are needed Modified Paths: -------------- trunk/MRP.php trunk/includes/ConstructSQLForUserDefinedSalesReport.inc Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-10-03 18:39:48 UTC (rev 8226) +++ trunk/MRP.php 2011-10-03 18:40:05 UTC (rev 8227) @@ -111,7 +111,9 @@ // part in the array for a level 4 sortpart would be created as a level 3 in levels, the fourth // and last part in sortpart would have a level code of zero, meaning it has no components - $sql = "SELECT * FROM tempbom"; + $sql = "SELECT sortpart, + level + FROM tempbom"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { $parts = explode('%',$myrow['sortpart']); @@ -458,7 +460,12 @@ // part, that serves as a gross requirement for a lower level part, so will read down through // the Bill of Materials to generate those requirements in function LevelNetting(). for ($level = $maxlevel; $level >= $minlevel; $level--) { - $sql = "SELECT * FROM levels WHERE level = '" . $level ."' LIMIT 50000"; //should cover most eventualities!! ... yes indeed :-) + $sql = "SELECT part, + eoq, + pansize, + shrinkfactor + FROM levels + WHERE level = '" . $level ."' LIMIT 50000"; //should cover most eventualities!! ... yes indeed :-) prnMsg('<br />------ ' . _('Processing level') .' ' . $level . ' ------','info'); flush(); @@ -513,7 +520,14 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; // Display parameters from last run - $sql = "SELECT * FROM mrpparameters"; + $sql = "SELECT runtime, + location, + pansizeflag, + shrinkageflag, + eoqflag, + usemrpdemands, + leeway + FROM mrpparameters"; $result = DB_query($sql,$db,'','',false,false); if (DB_error_no($db)==0){ @@ -599,7 +613,14 @@ $DecimalPlaces = $myrow[0]; // Load mrprequirements into $Requirements array - $sql = "SELECT * FROM mrprequirements WHERE part = '" .$part. "' ORDER BY daterequired"; + $sql = "SELECT part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired + FROM mrprequirements WHERE part = '" .$part. "' ORDER BY daterequired"; $result = DB_query($sql,$db); $Requirements = array(); $i = 0; @@ -609,7 +630,17 @@ } //end of while loop // Load mrpsupplies into $supplies array - $sql = "SELECT * FROM mrpsupplies WHERE part = '" .$part. "' ORDER BY duedate"; + $sql = "SELECT id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag + FROM mrpsupplies + WHERE part = '" .$part. "' + ORDER BY duedate"; $result = DB_query($sql,$db); $supplies = array(); $i = 0; Modified: trunk/includes/ConstructSQLForUserDefinedSalesReport.inc =================================================================== --- trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-10-03 18:39:48 UTC (rev 8226) +++ trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-10-03 18:40:05 UTC (rev 8227) @@ -269,7 +269,7 @@ include('includes/footer.inc'); exit; } - $strt_ColNum = 9; /* Start searching after SELECT */ + $strt_ColNum = 9; /* Start searching after SELECT*/ /*find the comma just before the Select Cls statement for the numerator column */ @@ -294,7 +294,7 @@ Exit; } - $strt_ColDen = 7; /* start searching after SELECT */ + $strt_ColDen = 7; /* start searching after SELECT*/ /*find the comma just before the Select Cls statement for the denominator column */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-03 20:06:20
|
Revision: 8231 http://weberp.svn.sourceforge.net/weberp/?rev=8231&view=rev Author: tim_schofield Date: 2011-10-03 20:06:13 +0000 (Mon, 03 Oct 2011) Log Message: ----------- Remove all SELECT * references, only choose those fields that are needed Modified Paths: -------------- trunk/GLBalanceSheet.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTrialBalance.php trunk/geo_displaymap_suppliers.php trunk/includes/UpgradeDB_mysql.inc Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-10-03 20:05:54 UTC (rev 8230) +++ trunk/GLBalanceSheet.php 2011-10-03 20:06:13 UTC (rev 8231) @@ -54,7 +54,7 @@ echo '<br /><div class="centre"><input type="submit" name="ShowBalanceSheet" value="'._('Show on Screen (HTML)').'" /></div>'; echo '<br /><div class="centre"><input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'" /></div>'; - /*Now do the posting while the user is thinking about the period to select */ + /*Now do the posting while the user is thinking about the period to select*/ include ('includes/GLPostings.inc'); } elseif (isset($_POST['PrintPDF'])) { Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-10-03 20:05:54 UTC (rev 8230) +++ trunk/GLProfit_Loss.php 2011-10-03 20:06:13 UTC (rev 8231) @@ -98,7 +98,7 @@ echo '<br /><div class="centre"><input type="submit" name="ShowPL" value="'._('Show on Screen (HTML)').'" /></div>'; echo '<br /><div class="centre"><input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'" /></div>'; - /*Now do the posting while the user is thinking about the period to select */ + /*Now do the posting while the user is thinking about the period to select*/ include ('includes/GLPostings.inc'); Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-10-03 20:05:54 UTC (rev 8230) +++ trunk/GLTagProfit_Loss.php 2011-10-03 20:06:13 UTC (rev 8231) @@ -115,7 +115,7 @@ echo '<div class="centre"><input type="submit" name="ShowPL" value="'._('Show Statement of Income and Expenditure').'" /><br />'; echo '<br /><input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /></div>'; - /*Now do the posting while the user is thinking about the period to select */ + /*Now do the posting while the user is thinking about the period to select*/ include ('includes/GLPostings.inc'); Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2011-10-03 20:05:54 UTC (rev 8230) +++ trunk/GLTrialBalance.php 2011-10-03 20:06:13 UTC (rev 8231) @@ -93,7 +93,7 @@ echo '<div class="centre"><input type="submit" name="ShowTB" value="' . _('Show Trial Balance') .'" />'; echo '<input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /></div>'; -/*Now do the posting while the user is thinking about the period to select */ +/*Now do the posting while the user is thinking about the period to select*/ include ('includes/GLPostings.inc'); Modified: trunk/geo_displaymap_suppliers.php =================================================================== --- trunk/geo_displaymap_suppliers.php 2011-10-03 20:05:54 UTC (rev 8230) +++ trunk/geo_displaymap_suppliers.php 2011-10-03 20:06:13 UTC (rev 8231) @@ -8,7 +8,13 @@ include ('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -$sql="SELECT * FROM geocode_param WHERE 1"; +$sql="SELECT geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param WHERE 1"; $ErrMsg = _('An error occurred in retrieving the currency information');; $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); Modified: trunk/includes/UpgradeDB_mysql.inc =================================================================== --- trunk/includes/UpgradeDB_mysql.inc 2011-10-03 20:05:54 UTC (rev 8230) +++ trunk/includes/UpgradeDB_mysql.inc 2011-10-03 20:06:13 UTC (rev 8231) @@ -316,7 +316,7 @@ function DropPrimaryKey($Table, $OldKey, $db) { $Total=0; foreach ($OldKey as $Field) { - $sql="SELECT * FROM information_schema.key_column_usage WHERE table_name='".$Table."' AND constraint_name='primary' AND + $sql="SELECT table_name FROM information_schema.key_column_usage WHERE table_name='".$Table."' AND constraint_name='primary' AND table_schema='".$_SESSION['DatabaseName']."' AND COLUMN_NAME='".$Field."'"; $result = DB_query($sql, $db); $Total = $Total + DB_num_rows($result); @@ -334,7 +334,7 @@ } function AddPrimaryKey($Table, $Fields, $db) { - $sql="SELECT * FROM information_schema.key_column_usage WHERE table_name='".$Table."' AND constraint_name='primary' AND + $sql="SELECT table_name FROM information_schema.key_column_usage WHERE table_name='".$Table."' AND constraint_name='primary' AND table_schema='".$_SESSION['DatabaseName']."'"; $result = DB_query($sql, $db); if (DB_num_rows($result)!=sizeOf($Fields)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-06 21:19:45
|
Revision: 8245 http://weberp.svn.sourceforge.net/weberp/?rev=8245&view=rev Author: tim_schofield Date: 2011-10-06 21:19:38 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/GLTrialBalance.php trunk/GoodsReceived.php Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2011-10-06 21:19:26 UTC (rev 8244) +++ trunk/GLTrialBalance.php 2011-10-06 21:19:38 UTC (rev 8245) @@ -204,10 +204,10 @@ $pdf->setFont('','B'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Total')); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,number_format($GrpActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpBudget[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); $pdf->line($Left_Margin+250, $YPos,$Left_Margin+500, $YPos); /*Draw the bottom line */ $YPos -= (2 * $line_height); $pdf->setFont('',''); @@ -224,10 +224,10 @@ $pdf->setFont('','B'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Total')); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,number_format($GrpActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpBudget[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); $pdf->line($Left_Margin+250, $YPos,$Left_Margin+500, $YPos); /*Draw the bottom line */ $YPos -= (2 * $line_height); $pdf->setFont('',''); @@ -245,10 +245,10 @@ $pdf->setFont('','B'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Total')); $LeftOvers = $pdf->addTextWrap($Left_Margin+60, $YPos, 190, $FontSize, $ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,number_format($GrpActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpBudget[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); $pdf->line($Left_Margin+250, $YPos,$Left_Margin+500, $YPos); /*Draw the bottom line */ $YPos -= (2 * $line_height); $pdf->setFont('',''); @@ -325,10 +325,10 @@ // Print total for each account $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$myrow['accountcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$myrow['accountname']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,number_format($myrow['monthactual'],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($myrow['monthbudget'],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodActual,2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodBudget,2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,locale_money_format($myrow['monthactual'],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($myrow['monthbudget'],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($AccountPeriodActual,$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['currencydefault']),'right'); $YPos -= $line_height; } //end of while loop @@ -341,10 +341,10 @@ $pdf->setFont('','B'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Total')); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,number_format($GrpActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpBudget[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']),'right'); $pdf->line($Left_Margin+250, $YPos,$Left_Margin+500, $YPos); /*Draw the bottom line */ $YPos -= (2 * $line_height); $ParentGroups[$Level]=''; @@ -359,10 +359,10 @@ $YPos -= (2 * $line_height); $pdf->line($Left_Margin+250, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Check Totals')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,number_format($CheckMonth,2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($CheckBudgetMonth,2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($CheckPeriodActual,2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($CheckPeriodBudget,2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,70,$FontSize,locale_money_format($CheckMonth,$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($CheckBudgetMonth,$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($CheckPeriodActual,$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($CheckPeriodBudget,$_SESSION['CompanyRecord']['currencydefault']),'right'); $pdf->line($Left_Margin+250, $YPos,$Left_Margin+500, $YPos); /* @@ -477,17 +477,17 @@ $ParentGroups[$Level]=''; } elseif ($ParentGroups[$Level]==$myrow['parentgroupname']) { printf('<tr> - <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> + <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> </tr>', $ParentGroups[$Level], - number_format($GrpActual[$Level],2), - number_format($GrpBudget[$Level],2), - number_format($GrpPrdActual[$Level],2), - number_format($GrpPrdBudget[$Level],2)); + locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault'])); $GrpActual[$Level] =0; $GrpBudget[$Level] =0; @@ -497,17 +497,17 @@ } else { do { printf('<tr> - <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> + <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> </tr>', $ParentGroups[$Level], - number_format($GrpActual[$Level],2), - number_format($GrpBudget[$Level],2), - number_format($GrpPrdActual[$Level],2), - number_format($GrpPrdBudget[$Level],2)); + locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault'])); $GrpActual[$Level] =0; $GrpBudget[$Level] =0; @@ -521,17 +521,17 @@ if ($Level>0){ printf('<tr> - <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> + <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> </tr>', $ParentGroups[$Level], - number_format($GrpActual[$Level],2), - number_format($GrpBudget[$Level],2), - number_format($GrpPrdActual[$Level],2), - number_format($GrpPrdBudget[$Level],2)); + locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault'])); $GrpActual[$Level] =0; $GrpBudget[$Level] =0; @@ -609,10 +609,10 @@ </tr>', $ActEnquiryURL, htmlspecialchars($myrow['accountname']), - number_format($myrow['monthactual'],2), - number_format($myrow['monthbudget'],2), - number_format($AccountPeriodActual,2), - number_format($AccountPeriodBudget,2)); + locale_money_format($myrow['monthactual'],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($myrow['monthbudget'],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($AccountPeriodActual,$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['currencydefault'])); $j++; } @@ -626,16 +626,16 @@ } elseif ($ParentGroups[$Level]==$myrow['parentgroupname']) { printf('<tr> <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> </tr>', $ParentGroups[$Level], - number_format($GrpActual[$Level],2), - number_format($GrpBudget[$Level],2), - number_format($GrpPrdActual[$Level],2), - number_format($GrpPrdBudget[$Level],2)); + locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault'])); $GrpActual[$Level] =0; $GrpBudget[$Level] =0; @@ -646,16 +646,16 @@ do { printf('<tr> <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> </tr>', $ParentGroups[$Level], - number_format($GrpActual[$Level],2), - number_format($GrpBudget[$Level],2), - number_format($GrpPrdActual[$Level],2), - number_format($GrpPrdBudget[$Level],2)); + locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault'])); $GrpActual[$Level] =0; $GrpBudget[$Level] =0; @@ -669,17 +669,17 @@ if ($Level >0){ printf('<tr> - <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> - <td class="number"><I>%s</I></td> + <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> + <td class="number"><i>%s</i></td> </tr>', $ParentGroups[$Level], - number_format($GrpActual[$Level],2), - number_format($GrpBudget[$Level],2), - number_format($GrpPrdActual[$Level],2), - number_format($GrpPrdBudget[$Level],2)); + locale_money_format($GrpActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpBudget[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['currencydefault'])); $GrpActual[$Level] =0; $GrpBudget[$Level] =0; @@ -701,10 +701,10 @@ <td class="number">%s</td> <td class="number">%s</td> </tr>', - number_format($CheckMonth,2), - number_format($CheckBudgetMonth,2), - number_format($CheckPeriodActual,2), - number_format($CheckPeriodBudget,2)); + locale_money_format($CheckMonth,$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($CheckBudgetMonth,$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($CheckPeriodActual,$_SESSION['CompanyRecord']['currencydefault']), + locale_money_format($CheckPeriodBudget,$_SESSION['CompanyRecord']['currencydefault'])); echo '</table><br />'; echo '<div class="centre"><input type="submit" name="SelectADifferentPeriod" value="' . _('Select A Different Period') . '" /></div>'; Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-10-06 21:19:26 UTC (rev 8244) +++ trunk/GoodsReceived.php 2011-10-06 21:19:38 UTC (rev 8245) @@ -48,7 +48,7 @@ } } } -print_r($_SESSION['PO']); + $StatusSQL="SELECT status FROM purchorders WHERE orderno='".$_SESSION['PO']->OrderNo . "'"; $StatusResult=DB_query($StatusSQL, $db); $StatusRow=DB_fetch_array($StatusResult); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-06 21:20:27
|
Revision: 8249 http://weberp.svn.sourceforge.net/weberp/?rev=8249&view=rev Author: tim_schofield Date: 2011-10-06 21:20:21 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/GLJournal.php trunk/GLProfit_Loss.php Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-10-06 21:20:09 UTC (rev 8248) +++ trunk/GLJournal.php 2011-10-06 21:20:21 UTC (rev 8249) @@ -95,7 +95,7 @@ '" . ($PeriodNo + 1) . "', '" . $JournalItem->GLCode . "', 'Reversal - " . $JournalItem->Narrative . "', - '" . -($JournalItem->Amount) ."', + -" . $JournalItem->Amount .", '".$JournalItem->tag."' )"; @@ -136,9 +136,9 @@ $_POST['GLCode'] = $extract[0]; } if($_POST['Debit']>0) { - $_POST['GLAmount'] = $_POST['Debit']; + $_POST['GLAmount'] = filter_currency_input($_POST['Debit']); } elseif($_POST['Credit']>0) { - $_POST['GLAmount'] = '-' . $_POST['Credit']; + $_POST['GLAmount'] = '-' . filter_currency_input($_POST['Credit']); } if ($_POST['GLManualCode'] != '' AND is_numeric($_POST['GLManualCode'])){ // If a manual code was entered need to check it exists and isnt a bank account @@ -369,12 +369,12 @@ echo '<td>' . $JournalItem->tag . ' - ' . $tagdescription . '</td>'; echo '<td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; if($JournalItem->Amount>0) { - echo '<td class="number">' . number_format($JournalItem->Amount,2) . '</td><td></td>'; + echo '<td class="number">' . locale_money_format($JournalItem->Amount,$_SESSION['CompanyRecord']['currencydefault']) . '</td><td></td>'; $debittotal=$debittotal+$JournalItem->Amount; } elseif($JournalItem->Amount<0) { $credit=(-1 * $JournalItem->Amount); echo '<td></td> - <td class="number">' . number_format($credit,2) . '</td>'; + <td class="number">' . locale_money_format($credit,$_SESSION['CompanyRecord']['currencydefault']) . '</td>'; $credittotal=$credittotal+$credit; } @@ -385,11 +385,11 @@ echo '<tr class="EvenTableRows"><td></td> <td class="number"><b>' . _('Total') . '</b></td> - <td class="number"><b>' . number_format($debittotal,2) . '</b></td> - <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; + <td class="number"><b>' . locale_money_format($debittotal,$_SESSION['CompanyRecord']['currencydefault']) . '</b></td> + <td class="number"><b>' . locale_money_format($credittotal,$_SESSION['CompanyRecord']['currencydefault']) . '</b></td></tr>'; if ($debittotal!=$credittotal) { echo '<td align="center" style="background-color: #fddbdb"><b>' . _('Required to balance') .' - </b>' . - number_format(abs($debittotal-$credittotal),2); + locale_money_format(abs($debittotal-$credittotal),$_SESSION['CompanyRecord']['currencydefault']); } if ($debittotal>$credittotal) { echo ' ' . _('Credit') . '</td></tr>'; Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-10-06 21:20:09 UTC (rev 8248) +++ trunk/GLProfit_Loss.php 2011-10-06 21:20:21 UTC (rev 8249) @@ -224,9 +224,9 @@ $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($GrpPrdActual[$Level]$_SESSION['CompanyRecord']['currencydefault']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($GrpPrdBudget[$Level]$_SESSION['CompanyRecord']['currencydefault']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($GrpPrdLY[$Level]$_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,locale_money_format($GrpPrdActual[$Level], $_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,locale_money_format($GrpPrdBudget[$Level], $_SESSION['CompanyRecord']['currencydefault']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,locale_money_format($GrpPrdLY[$Level], $_SESSION['CompanyRecord']['currencydefault']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-08 19:57:52
|
Revision: 8268 http://weberp.svn.sourceforge.net/weberp/?rev=8268&view=rev Author: tim_schofield Date: 2011-10-08 19:57:46 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/CustomerInquiry.php trunk/CustomerReceipt.php Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-10-08 19:57:34 UTC (rev 8267) +++ trunk/CustomerInquiry.php 2011-10-08 19:57:46 UTC (rev 8268) @@ -37,6 +37,7 @@ currencies.currency, paymentterms.terms, debtorsmaster.creditlimit, + debtorsmaster.currcode, holdreasons.dissallowinvoices, holdreasons.reasondescription, SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount @@ -122,7 +123,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . - ': ' . number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; + ': ' . locale_money_format($CustomerRecord['creditlimit'],$CustomerRecord['currcode']) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; if ($CustomerRecord['dissallowinvoices']!=0){ echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; @@ -136,11 +137,11 @@ <th width="20%">' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> <th width="20%">' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>'; -echo '<tr><td class="number">' . number_format($CustomerRecord['balance'],2) . '</td> - <td class="number">' . number_format(($CustomerRecord['balance'] - $CustomerRecord['due']),2) . '</td> - <td class="number">' . number_format(($CustomerRecord['due']-$CustomerRecord['overdue1']),2) . '</td> - <td class="number">' . number_format(($CustomerRecord['overdue1']-$CustomerRecord['overdue2']) ,2) . '</td> - <td class="number">' . number_format($CustomerRecord['overdue2'],2) . '</td> +echo '<tr><td class="number">' . locale_money_format($CustomerRecord['balance'],$CustomerRecord['currcode']) . '</td> + <td class="number">' . locale_money_format(($CustomerRecord['balance'] - $CustomerRecord['due']),$CustomerRecord['currcode']) . '</td> + <td class="number">' . locale_money_format(($CustomerRecord['due']-$CustomerRecord['overdue1']),$CustomerRecord['currcode']) . '</td> + <td class="number">' . locale_money_format(($CustomerRecord['overdue1']-$CustomerRecord['overdue2']) ,$CustomerRecord['currcode']) . '</td> + <td class="number">' . locale_money_format($CustomerRecord['overdue2'],$CustomerRecord['currcode']) . '</td> </tr> </table>'; @@ -263,9 +264,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), //$CreditInvoiceFormatString parameters $rootpath, $myrow['transno'], @@ -296,9 +297,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), //CreditInvoiceFormatString parameters $rootpath, $myrow['transno'], @@ -329,9 +330,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), //$PreviewInvoiceFormatString parameters $rootpath, $myrow['transno'], @@ -358,9 +359,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), //$PreviewCreditFormatString parameters $rootpath, $myrow['transno'], @@ -390,9 +391,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), //$PreviewCreditFormatString parameters $rootpath, $myrow['transno'], @@ -424,9 +425,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), $rootpath, $myrow['id'], $rootpath, @@ -443,9 +444,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), $rootpath, $myrow['id']); } @@ -462,9 +463,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), $rootpath, $myrow['type'], $myrow['transno']); @@ -477,9 +478,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2)); + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode'])); } } else { //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries @@ -493,9 +494,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode']), $rootpath, $myrow['type'], $myrow['transno']); @@ -508,9 +509,9 @@ $myrow['reference'], $myrow['invtext'], $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2)); + locale_money_format($myrow['totalamount'],$CustomerRecord['currcode']), + locale_money_format($myrow['allocated'],$CustomerRecord['currcode']), + locale_money_format($myrow['totalamount']-$myrow['allocated'],$CustomerRecord['currcode'])); } } Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-08 19:57:34 UTC (rev 8267) +++ trunk/CustomerReceipt.php 2011-10-08 19:57:46 UTC (rev 8268) @@ -1061,7 +1061,7 @@ } printf('<td><font size="1"> - <input tabindex="'.number_format(12+$j).'" type="submit" name="Select" value="%s" /></font></td> + <input type="submit" name="Select" value="%s" /></font></td> <td>%s</td></tr>', $myrow['debtorno'], $myrow['name']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-08 19:58:03
|
Revision: 8269 http://weberp.svn.sourceforge.net/weberp/?rev=8269&view=rev Author: tim_schofield Date: 2011-10-08 19:57:57 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/CustomerAllocations.php trunk/includes/DefineCustAllocsClass.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-10-08 19:57:46 UTC (rev 8268) +++ trunk/CustomerAllocations.php 2011-10-08 19:57:57 UTC (rev 8269) @@ -41,22 +41,22 @@ // loop through amounts allocated using AllocnItm->ID for each record if (isset($_POST['Amt' . $AllocCounter])) { // allocatable charge amounts - if (!is_numeric($_POST['Amt' . $AllocCounter])) { + if (!is_numeric(filter_currency_input($_POST['Amt' . $AllocCounter]))) { $_POST['Amt' . $AllocCounter] = 0; } - if ($_POST['Amt' . $AllocCounter] < 0) { + if (filter_currency_input($_POST['Amt' . $AllocCounter]) < 0) { prnMsg(_('Amount entered was negative') . '. ' . _('Only positive amounts are allowed') . '.','warn'); $_POST['Amt' . $AllocCounter] = 0; } if (isset($_POST['All' . $AllocCounter]) and $_POST['All' . $AllocCounter] == True) { $_POST['Amt' . $AllocCounter] = $_POST['YetToAlloc' . $AllocCounter]; } - if ($_POST['Amt' . $AllocCounter] > $_POST['YetToAlloc' . $AllocCounter]) { + if (filter_currency_input($_POST['Amt' . $AllocCounter]) > $_POST['YetToAlloc' . $AllocCounter]) { $_POST['Amt' . $AllocCounter]=$_POST['YetToAlloc' . $AllocCounter]; // Amount entered must be smaller than unallocated amount } - $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->AllocAmt = $_POST['Amt' . $AllocCounter]; + $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->AllocAmt = filter_currency_input($_POST['Amt' . $AllocCounter]); // recalcuate the new difference on exchange (a +positive amount is a gain -ve a loss) $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->DiffOnExch = ($_POST['Amt' . $AllocCounter] / $_SESSION['Alloc']->TransExRate) - @@ -115,13 +115,14 @@ } $NewAllocTotal = $AllocnItem->PrevAlloc + $AllocnItem->AllocAmt; $AllAllocations = $AllAllocations + $AllocnItem->AllocAmt; - $Settled = (abs($NewAllocTotal-$AllocnItem->TransAmount) < 0.005) ? 1 : 0; + $Settled = (abs(filter_currency_input($NewAllocTotal-$AllocnItem->TransAmount)) < 0.005) ? 1 : 0; $SQL = "UPDATE debtortrans SET diffonexch='" . $AllocnItem->DiffOnExch . "', - alloc = '" . $NewAllocTotal . "', + alloc = '" . filter_currency_input($NewAllocTotal) . "', settled = '" . $Settled . "' WHERE id = '" . $AllocnItem->ID."'"; + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not update difference on exchange'; } @@ -222,6 +223,7 @@ debtortrans.trandate, debtortrans.debtorno, debtorsmaster.name, + debtorsmaster.currcode, rate, (debtortrans.ovamount+debtortrans.ovgst+debtortrans.ovfreight+debtortrans.ovdiscount) as total, debtortrans.diffonexch, @@ -247,6 +249,7 @@ $_SESSION['Alloc']->TransAmt = $myrow['total']; $_SESSION['Alloc']->PrevDiffOnExch = $myrow['diffonexch']; $_SESSION['Alloc']->TransDate = ConvertSQLDate($myrow['trandate']); + $_SESSION['Alloc']->CurrCode = $myrow['currcode']; // First get transactions that have outstanding balances $SQL = "SELECT debtortrans.id, @@ -349,7 +352,7 @@ if ($_SESSION['Alloc']->TransExRate != 1) { echo '<br />'._('Amount in customer currency').' <b>' . - number_format(-$_SESSION['Alloc']->TransAmt,2) . + locale_money_format(-$_SESSION['Alloc']->TransAmt,$_SESSION['Alloc']->CurrCode) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } @@ -384,15 +387,15 @@ echo '<td>' . $AllocnItem->TransType . '</td> <td>' . $AllocnItem->TypeNo . '</td> <td class="number">' . $AllocnItem->TransDate . '</td> - <td class="number">' . number_format($AllocnItem->TransAmount,2) . '</td> - <td class="number">' . number_format($YetToAlloc,2) . '</td>'; + <td class="number">' . locale_money_format($AllocnItem->TransAmount,$_SESSION['Alloc']->CurrCode) . '</td> + <td class="number">' . locale_money_format($YetToAlloc,$_SESSION['Alloc']->CurrCode) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; + echo '<td>' . $curTrans .'</td><td class="number">' . locale_money_format($balance,$_SESSION['Alloc']->CurrCode) . '</td></tr>'; } else { - echo '<input type="hidden" name="YetToAlloc"' . $Counter . '" value="' . round($YetToAlloc,2) . '" /></td>'; + echo '<input type="hidden" name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '" /></td>'; echo '<td class="number">'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { @@ -402,9 +405,9 @@ } $balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; - echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength="12" size="13" value="' . round($AllocnItem->AllocAmt,2) . '" /> - <input type="hidden" name="AllocID"' . $Counter . '" value="' . $AllocnItem->ID . '" /></td> - <td class="number">' . number_format($balance,2) . '</td></tr>'; + echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength="12" size="13" value="' . locale_money_format($AllocnItem->AllocAmt,$_SESSION['Alloc']->CurrCode) . '" /> + <input type="hidden" name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '" /></td> + <td class="number">' . locale_money_format($balance,$_SESSION['Alloc']->CurrCode) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; @@ -412,14 +415,14 @@ echo '<tr> <td colspan="5" class="number"><b>'._('Total Allocated').':</b></td> - <td class="number"><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; + <td class="number"><b><u>' . locale_money_format($TotalAllocated,$_SESSION['Alloc']->CurrCode) . '</u></b></td>'; $j++; echo '<td rowspan="2"> <input tabindex='.$j.' type="submit" name="RefreshAllocTotal" value="' . _('Recalculate Total To Allocate') . '" /></td>'; echo '<tr> <td colspan="5" class="number"><b>'._('Left to allocate').'</b></td> - <td class="number"><b>' . number_format($remaining-$TotalAllocated,2).'</b></td> + <td class="number"><b>' . locale_money_format($remaining-$TotalAllocated,$_SESSION['Alloc']->CurrCode).'</b></td> </tr>'; echo '</table><br />'; echo '<input type="hidden" name="TotalNumberOfAllocs" value="' . $Counter . '" />'; @@ -432,24 +435,26 @@ unset($_SESSION['Alloc']); $SQL = "SELECT debtortrans.id, - debtortrans.transno, - systypes.typename, - debtortrans.type, - debtortrans.debtorno, - debtorsmaster.name, - debtortrans.trandate, - debtortrans.reference, - debtortrans.rate, - debtortrans.ovamount+debtortrans.ovgst+debtortrans.ovdiscount+debtortrans.ovfreight as total, - debtortrans.alloc FROM debtortrans, - debtorsmaster, - systypes - WHERE debtortrans.type=systypes.typeid AND - debtortrans.debtorno=debtorsmaster.debtorno AND - debtortrans.debtorno='" . $_GET['DebtorNo'] . "' AND - (type=12 or type=11) AND - debtortrans.settled=0 - ORDER BY debtortrans.id"; + debtortrans.transno, + systypes.typename, + debtortrans.type, + debtortrans.debtorno, + debtorsmaster.name, + debtorsmaster.currcode, + debtortrans.trandate, + debtortrans.reference, + debtortrans.rate, + debtortrans.ovamount+debtortrans.ovgst+debtortrans.ovdiscount+debtortrans.ovfreight as total, + debtortrans.alloc + FROM debtortrans, + debtorsmaster, + systypes + WHERE debtortrans.type=systypes.typeid + AND debtortrans.debtorno=debtorsmaster.debtorno + AND debtortrans.debtorno='" . $_GET['DebtorNo'] . "' + AND (type=12 or type=11) + AND debtortrans.settled=0 + ORDER BY debtortrans.id"; $result = DB_query($SQL,$db); if (DB_num_rows($result)==0) { @@ -473,8 +478,8 @@ <td>' . $myrow['debtorno'] . '</td> <td>' . $myrow['transno'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> - <td class="number">' . number_format($myrow['total'],2) . '</td> - <td class="number">' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + <td class="number">' . locale_money_format($myrow['total'],$myrow['currcode']) . '</td> + <td class="number">' . locale_money_format($myrow['total']-$myrow['alloc'],$myrow['currcode']) . '</td>'; echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); @@ -491,6 +496,7 @@ debtortrans.type, debtortrans.debtorno, debtorsmaster.name, + debtorsmaster.currcode, debtortrans.trandate, debtortrans.reference, debtortrans.rate, @@ -517,7 +523,7 @@ if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { - echo '<tr class="OddTableRows"><td colspan="7" class="number">' . number_format($balance,2) . '</td><td><b>Balance</b></td></tr>'; + echo '<tr class="OddTableRows"><td colspan="7" class="number">' . locale_money_format($balance,$myrow['currcode']) . '</td><td><b>Balance</b></td></tr>'; } $balance = 0; @@ -554,15 +560,15 @@ <td>' . $myrow['debtorno'] . '</td> <td>' . $myrow['transno'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> - <td class="number">' . number_format($myrow['total'],2) . '</td> - <td class="number">' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + <td class="number">' . locale_money_format($myrow['total'],$myrow['currcode']) . '</td> + <td class="number">' . locale_money_format($myrow['total']-$myrow['alloc'],$myrow['currcode']) . '</td>'; echo '<td>' . $allocate . '</td></tr>'; if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } - echo '<tr class="OddTableRows"><td colspan="7" class="number">' . number_format($balance,2) . '</td><td><b>Balance</b></td></tr>'; + echo '<tr class="OddTableRows"><td colspan="7" class="number">' . locale_money_format($balance,$myrow['currcode']) . '</td><td><b>Balance</b></td></tr>'; } } DB_free_result($result); Modified: trunk/includes/DefineCustAllocsClass.php =================================================================== --- trunk/includes/DefineCustAllocsClass.php 2011-10-08 19:57:46 UTC (rev 8268) +++ trunk/includes/DefineCustAllocsClass.php 2011-10-08 19:57:57 UTC (rev 8269) @@ -10,6 +10,7 @@ var $CustomerName; var $TransType; var $TransTypeName; + var $CurrCode; var $TransNo; var $TransDate; var $TransExRate; /*Exchange rate of the transaction being allocated */ @@ -27,7 +28,7 @@ $this->Allocs[$ID] = new Allocn($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID); Return 1; - + } function remove_alloc_item($AllocnID){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-11 11:32:57
|
Revision: 8275 http://weberp.svn.sourceforge.net/weberp/?rev=8275&view=rev Author: tim_schofield Date: 2011-10-11 11:32:48 +0000 (Tue, 11 Oct 2011) Log Message: ----------- Extra database tables for internal requisitions Modified Paths: -------------- trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/95.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-11 11:32:33 UTC (rev 8274) +++ trunk/includes/session.inc 2011-10-11 11:32:48 UTC (rev 8275) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=94; +$DBVersion=95; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/95.php =================================================================== --- trunk/sql/mysql/updates/95.php (rev 0) +++ trunk/sql/mysql/updates/95.php 2011-10-11 11:32:48 UTC (rev 8275) @@ -0,0 +1,32 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('Departments.php',11), array('script', 'security'), array('Departments.php',11), $db); +InsertRecord('pagesecurity', array('script', 'security'), array('StockTransfers_departments.php',11), array('script', 'security'), array('StockTransfers_departments.php',11), $db); +InsertRecord('pagesecurity', array('script', 'security'), array('PDFStockTransfer_departments.php',11), array('script', 'security'), array('PDFStockTransfer_departments.php',11), $db); + +CreateTable('departments', "CREATE TABLE departments ( +`departmentid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +`description` VARCHAR (100) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); + +CreateTable('dispatch', "CREATE TABLE dispatch ( +`dispatchid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +`loccode` VARCHAR (5) NOT NULL DEFAULT '', +`departmentid` INT NOT NULL DEFAULT 0, +`despatchdate` DATE NOT NULL DEFAULT '0000-00-00', +`narrative` TEXT NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); + +CreateTable('dispatchitems', "CREATE TABLE dispatchitems ( +`dispatchitemsid` INT NOT NULL DEFAULT 0, +`dispatchid` INT NOT NULL DEFAULT 0, +`itemid` VARCHAR (30) NOT NULL DEFAULT '', +`quantity` DOUBLE NOT NULL DEFAULT 0 +) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); + +UpdateDBNo(95, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-13 17:52:52
|
Revision: 8277 http://weberp.svn.sourceforge.net/weberp/?rev=8277&view=rev Author: tim_schofield Date: 2011-10-13 17:52:45 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Add in field for authoriser of requests Modified Paths: -------------- trunk/Departments.php trunk/sql/mysql/updates/95.php Modified: trunk/Departments.php =================================================================== --- trunk/Departments.php 2011-10-13 17:52:28 UTC (rev 8276) +++ trunk/Departments.php 2011-10-13 17:52:45 UTC (rev 8277) @@ -60,7 +60,8 @@ $OldDepartmentName = $myrow[0]; $sql = array(); $sql[] = "UPDATE departments - SET description='" . $_POST['DepartmentName'] . "' + SET description='" . $_POST['DepartmentName'] . "', + authoriser='" . $_POST['Authoriser'] . "' WHERE description ".LIKE." '".$OldDepartmentName."'"; } else { $InputError = 1; @@ -79,9 +80,11 @@ prnMsg( _('There is already a Department with the specified name.'),'error'); } else { $sql = "INSERT INTO departments ( - description ) + description, + authoriser ) VALUES ( - '" . $_POST['DepartmentName'] ."' + '" . $_POST['DepartmentName'] ."', + '" . $_POST['Authoriser'] ."' )"; } $msg = _('The new department has been created'); @@ -158,7 +161,8 @@ or deletion of the records*/ $sql = "SELECT departmentid, - description + description, + authoriser FROM departments ORDER BY departmentid"; @@ -167,11 +171,12 @@ echo '<table class="selection"> <tr> - <th>' . _('Departments') . '</th> + <th>' . _('Department Name') . '</th> + <th>' . _('Authoriser') . '</th> </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -181,9 +186,10 @@ $k++; } - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td>' . $myrow['description'] . '</td>'; + echo '<td>' . $myrow['authoriser'] . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow['departmentid'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow['departmentid'] . '&delete=1">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -192,7 +198,7 @@ if (isset($SelectedDepartmentID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Verify Departments') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('View all Departments') . '</a></div>'; } echo '<br />'; @@ -230,8 +236,19 @@ } echo '<tr> <td>' . _('Department Name') . ':' . '</td> - <td><input type="text" name="DepartmentName" size="30" maxlength="30" value="' . $_POST['DepartmentName'] . '"></td> + <td><input type="text" name="DepartmentName" size="50" maxlength="100" value="' . $_POST['DepartmentName'] . '"></td> </tr>'; + echo '<tr><td>'._('Authoriser').'</td><td><select name="Authoriser">'; + $usersql="SELECT userid FROM www_users"; + $userresult=DB_query($usersql,$db); + while ($myrow=DB_fetch_array($userresult)) { + if ($myrow['userid']==$UserID) { + echo '<option selected="True" value="'.$myrow['userid'].'">'.$myrow['userid'].'</option>'; + } else { + echo '<option value="'.$myrow['userid'].'">'.$myrow['userid'].'</option>'; + } + } + echo '</select></td></tr>'; echo '</table><br />'; echo '<div class="centre"><input type="submit" name="Submit" value=' . _('Enter Information') . '></div>'; Modified: trunk/sql/mysql/updates/95.php =================================================================== --- trunk/sql/mysql/updates/95.php 2011-10-13 17:52:28 UTC (rev 8276) +++ trunk/sql/mysql/updates/95.php 2011-10-13 17:52:45 UTC (rev 8277) @@ -9,7 +9,8 @@ CreateTable('departments', "CREATE TABLE departments ( `departmentid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, -`description` VARCHAR (100) NOT NULL DEFAULT '' +`description` VARCHAR (100) NOT NULL DEFAULT '', +`authoriser` varchar (20) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); CreateTable('dispatch', "CREATE TABLE dispatch ( @@ -23,7 +24,7 @@ CreateTable('dispatchitems', "CREATE TABLE dispatchitems ( `dispatchitemsid` INT NOT NULL DEFAULT 0, `dispatchid` INT NOT NULL DEFAULT 0, -`itemid` VARCHAR (30) NOT NULL DEFAULT '', +`stockid` VARCHAR (20) NOT NULL DEFAULT '', `quantity` DOUBLE NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-13 17:53:09
|
Revision: 8278 http://weberp.svn.sourceforge.net/weberp/?rev=8278&view=rev Author: tim_schofield Date: 2011-10-13 17:53:03 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Only show menu items that a user is authorised to use Modified Paths: -------------- trunk/includes/session.inc trunk/index.php trunk/sql/mysql/updates/95.php Added Paths: ----------- trunk/sql/mysql/updates/96.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-13 17:52:45 UTC (rev 8277) +++ trunk/includes/session.inc 2011-10-13 17:53:03 UTC (rev 8278) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=95; +$DBVersion=96; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-10-13 17:52:45 UTC (rev 8277) +++ trunk/index.php 2011-10-13 17:53:03 UTC (rev 8278) @@ -607,11 +607,15 @@ $i=0; foreach ($MenuItems[$_SESSION['Module']]['Transactions']['Caption'] as $Caption) { /* Transactions Menu Item */ - echo '<tr> + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> <td class="menu_group_item"> <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i] .'">' . $Caption . '</a></p> </td> </tr>'; + } $i++; } echo '</table>'; @@ -635,11 +639,15 @@ $i=0; foreach ($MenuItems[$_SESSION['Module']]['Reports']['Caption'] as $Caption) { /* Transactions Menu Item */ - echo '<tr> + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Reports']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> <td class="menu_group_item"> <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Reports']['URL'][$i] .'">' . $Caption . '</a></p> </td> </tr>'; + } $i++; } echo GetRptLinks($_SESSION['Module']); @@ -664,11 +672,15 @@ $i=0; foreach ($MenuItems[$_SESSION['Module']]['Maintenance']['Caption'] as $Caption) { /* Transactions Menu Item */ - echo '<tr> + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Maintenance']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> <td class="menu_group_item"> <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Maintenance']['URL'][$i] .'">' . $Caption . '</a></p> </td> - </tr>'; + </tr>'; + } $i++; } echo '</table>'; Modified: trunk/sql/mysql/updates/95.php =================================================================== --- trunk/sql/mysql/updates/95.php 2011-10-13 17:52:45 UTC (rev 8277) +++ trunk/sql/mysql/updates/95.php 2011-10-13 17:53:03 UTC (rev 8278) @@ -18,6 +18,7 @@ `loccode` VARCHAR (5) NOT NULL DEFAULT '', `departmentid` INT NOT NULL DEFAULT 0, `despatchdate` DATE NOT NULL DEFAULT '0000-00-00', +`authorised` TINYINT NOT NULL DEFAULT 0, `narrative` TEXT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); Added: trunk/sql/mysql/updates/96.php =================================================================== --- trunk/sql/mysql/updates/96.php (rev 0) +++ trunk/sql/mysql/updates/96.php 2011-10-13 17:53:03 UTC (rev 8278) @@ -0,0 +1,11 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('RecurringSalesOrdersProcess.php',1), array('script', 'security'), array('RecurringSalesOrdersProcess.php',1), $db); +InsertRecord('pagesecurity', array('script', 'security'), array('reportwriter/admin/ReportCreator.php',15), array('script', 'security'), array('reportwriter/admin/ReportCreator.php',15), $db); + +UpdateDBNo(96, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-13 17:53:41
|
Revision: 8281 http://weberp.svn.sourceforge.net/weberp/?rev=8281&view=rev Author: tim_schofield Date: 2011-10-13 17:53:35 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Updates to the database for internal material requests Modified Paths: -------------- trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/97.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-13 17:53:24 UTC (rev 8280) +++ trunk/includes/session.inc 2011-10-13 17:53:35 UTC (rev 8281) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=96; +$DBVersion=97; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/97.php =================================================================== --- trunk/sql/mysql/updates/97.php (rev 0) +++ trunk/sql/mysql/updates/97.php 2011-10-13 17:53:35 UTC (rev 8281) @@ -0,0 +1,20 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('doc/Manual/ManualContents.php',1), array('script', 'security'), array('doc/Manual/ManualContents.php',1), $db); + +RenameTable('dispatch', 'stockrequest', $db); +RenameTable('dispatchitems', 'stockrequestitems', $db); + +AddColumn('decimalplaces', 'stockrequestitems', 'int', 'not null', 0, 'quantity', $db); +AddColumn('uom', 'stockrequestitems', 'varchar(20)', 'not null', '', 'decimalplaces', $db); + +ChangeColumnType('dispatchid', 'stockrequest', 'INT (11)', 'NOT NULL', 0, $db); + +InsertRecord('systypes', array('typeid'), array('38'), array('typeid', 'typename', 'typeno'), array('38', 'Stock Requests', '0'), $db); + +UpdateDBNo(97, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-13 17:53:55
|
Revision: 8282 http://weberp.svn.sourceforge.net/weberp/?rev=8282&view=rev Author: tim_schofield Date: 2011-10-13 17:53:48 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Scripts to create an internal stock request Modified Paths: -------------- trunk/StockTransfers_departments.php Added Paths: ----------- trunk/includes/DefineStockRequestClass.php Modified: trunk/StockTransfers_departments.php =================================================================== --- trunk/StockTransfers_departments.php 2011-10-13 17:53:35 UTC (rev 8281) +++ trunk/StockTransfers_departments.php 2011-10-13 17:53:48 UTC (rev 8282) @@ -1,604 +1,717 @@ <?php /* $Id: StockTransfers.php 4576 2011-05-27 10:59:20Z daintree $*/ -$PageSecurity=1; -include('includes/DefineSerialItems.php'); -include('includes/DefineStockTransfers.php'); +include('includes/DefineStockRequestClass.php'); + include('includes/session.inc'); -$title = _('Despacho de Materiales'); +$title = _('Create an Internal Materials Request'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); if (isset($_GET['New'])) { unset($_SESSION['Transfer']); + $_SESSION['Request'] = new StockRequest(); } -if (isset($_GET['From'])) { - $_POST['StockLocationFrom']=$_GET['From']; - $_POST['StockLocationTo']=$_GET['To']; - $_POST['Quantity']=$_GET['Quantity']; -} - -if (isset($_POST['CheckCode'])) { - - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; - - if (strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; - } else { - $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; +if (isset($_POST['Update'])) { + $InputError=0; + if ($_POST['Department']=='') { + prnMsg( _('You must select a Department for the request'), 'error'); + $InputError=1; } - $ErrMsg=_('The stock information cannot be retrieved because'); - $DbgMsg=_('The SQL to get the stock description was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection> - <tr><th>'._('Stock Code').'</th> - <th>'._('Stock Description').'</th> - </tr>'; - while ($myrow = DB_fetch_array($result)) { - echo '<tr><td>'.$myrow['stockid'].'</td> - <td>'.$myrow['description'].'</td> - <td><a href="' . $rootpath . '/StockTransfers_departments.php?StockID='.$myrow['stockid'].'&Description='.$myrow['description'].'&NewTransfer=Yes&Quantity='.$_POST['Quantity'].'&From='.$_POST['StockLocationFrom'].'&To='.$_POST['StockLocationTo'].'">' - ._('Transfer').'</a></td> - </tr>'; - + if ($_POST['Location']=='') { + prnMsg( _('You must select a Location to request the items from'), 'error'); + $InputError=1; } - echo '</table>'; - include('includes/footer.inc'); - exit; + if ($InputError==0) { + $_SESSION['Request']->Department=$_POST['Department']; + $_SESSION['Request']->Location=$_POST['Location']; + $_SESSION['Request']->DispatchDate=$_POST['DispatchDate']; + $_SESSION['Request']->Narrative=$_POST['Narrative']; + } } -$NewTransfer = false; /*initialise this first then determine from form inputs */ - -if (isset($_GET['NewTransfer'])){ - unset($_SESSION['Transfer']); - unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual trsnsfers */ - $NewTransfer=$_GET['NewTransfer']; +if (isset($_POST['Edit'])) { + $_SESSION['Request']->LineItems[$_POST['LineNumber']]->Quantity=$_POST['Quantity']; } - -if (isset($_GET['StockID'])){ /*carry the stockid through to the form for additional inputs */ - - $_POST['StockID'] = trim(strtoupper($_GET['StockID'])); - -} elseif (isset($_POST['StockID'])){ /* initiate a new transfer only if the StockID is different to the previous entry */ - - if (isset($_SESSION['Transfer']) AND $_POST['StockID'] != $_SESSION['Transfer']->TransferItem[0]->StockID){ - unset($_SESSION['Transfer']); - $NewTransfer = true; - } +if (isset($_GET['Delete'])) { + unset($_SESSION['Request']->LineItems[$_GET['Delete']]); + echo '<br />'; + prnMsg( _('The line was successfully deleted'), 'success'); + echo '<br />'; } -if ($NewTransfer){ - - $_SESSION['Transfer']= new StockTransfer(0, - $_POST['StockLocationFrom'], - '', - $_POST['StockLocationTo'], - '', - Date($_SESSION['DefaultDateFormat']) - ); - $result = DB_query("SELECT description, - units, - mbflag, - materialcost+labourcost+overheadcost as standardcost, - controlled, - serialised, - perishable, - decimalplaces - FROM stockmaster - WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", - $db); - - if (DB_num_rows($result) == 0){ - prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); - } elseif (DB_num_rows($result)>0){ - $myrow = DB_fetch_row($result); - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow['description'], - $_POST['Quantity'], - $myrow['units'], - $myrow['controlled'], - $myrow['serialised'], - $myrow['perishable'], - $myrow['decimalplaces']); - - - $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; - - if ($myrow[2]=='D' OR $myrow[2]=='A' OR $myrow[2]=='K'){ - prnMsg(_('The part entered is either or a dummy part or an assembly or a kit-set part') . '. ' . _('These parts are not physical parts and no stock holding is maintained for them') . '. ' . _('Stock Transfers are therefore not possible'),'warn'); - echo '.<hr>'; - echo '<a href="' . $rootpath . '/StockTransfers.php?NewTransfer=Yes">' . _('Enter another Transfer') . '</a>'; - unset ($_SESSION['Transfer']); - include ('includes/footer.inc'); - exit; +foreach ($_POST as $key => $value) { + if (mb_strstr($key,'StockID')) { + $Index=mb_substr($key, 7); + if (filter_number_input($_POST['Quantity'.$Index])>0) { + $StockID=$value; + $ItemDescription=$_POST['ItemDescription'.$Index]; + $DecimalPlaces=$_POST['DecimalPlaces'.$Index]; + $NewItem_array[$StockID] = filter_number_input($_POST['Quantity'.$Index]); + $_POST['Units'.$StockID]=$_POST['Units'.$Index]; + $_SESSION['Request']->AddLine($StockID, $ItemDescription, $NewItem_array[$StockID], $_POST['Units'.$StockID], $DecimalPlaces); } } - } -if (isset($_POST['Quantity']) AND isset($_SESSION['Transfer']->TransferItem[0]->Controlled) AND $_SESSION['Transfer']->TransferItem[0]->Controlled==0){ - $_SESSION['Transfer']->TransferItem[0]->Quantity = $_POST['Quantity']; -} -if ( isset($_POST['StockLocationFrom']) AND $_POST['StockLocationFrom']!= $_SESSION['Transfer']->StockLocationFrom ){ - $_SESSION['Transfer']->StockLocationFrom = $_POST['StockLocationFrom']; - $_SESSION['Transfer']->StockLocationTo = $_POST['StockLocationTo']; - $_SESSION['Transfer']->TransferItem[0]->Quantity=$_POST['Quantity']; - $_SESSION['Transfer']->TransferItem[0]->SerialItems=array(); -} -if ( isset($_POST['StockLocationTo']) ){ - $_SESSION['Transfer']->StockLocationTo = $_POST['StockLocationTo']; -} - -if ( isset($_POST['EnterTransfer']) ){ - - - - $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID ."'",$db); - $myrow = DB_fetch_row($result); - $InputError = false; - if (DB_num_rows($result)==0) { - echo '<p>'; - prnMsg(_('The entered item code does not exist'), 'error'); - $InputError = true; - } elseif (!is_numeric($_SESSION['Transfer']->TransferItem[0]->Quantity)){ - echo '<p>'; - prnMsg( _('The quantity entered must be numeric'), 'error' ); - $InputError = true; - } elseif ($_SESSION['Transfer']->TransferItem[0]->Quantity <= 0){ - echo '<p>'; - prnMsg( _('The quantity entered must be a positive number greater than zero'), 'error'); - //****************************ENVIAMOS LA POSIBILIDAD DE IMPRIMIR LA ORDEN DE CASO DE QUE HAYAN ARTICULOS CREADOS*************** - if($_SESSION['dispatch']){ - echo '</br><a href="PDFStockTransfer_departments.php?TransferNo='.$_SESSION['dispatch'].'">' . _('Imprimir Transferencia') . '</a>'; - } - - $InputError = true; +if (isset($_POST['Submit'])) { + DB_Txn_Begin($db); + $InputError=0; + if ($_SESSION['Request']->Department=='') { + prnMsg( _('You must select a Department for the request'), 'error'); + $InputError=1; } - if ($_SESSION['Transfer']->StockLocationFrom==$_SESSION['Transfer']->StockLocationTo){ - echo '<p>'; - prnMsg( _('The locations to transfer from and to must be different'), 'error'); - $InputError = true; + if ($_SESSION['Request']->Location=='') { + prnMsg( _('You must select a Location to request the items from'), 'error'); + $InputError=1; } + if ($InputError==0) { + $RequestNo = GetNextTransNo(38, $db); + $HeaderSQL="INSERT INTO stockrequest (dispatchid, + loccode, + departmentid, + despatchdate, + narrative) + VALUES( + '" . $RequestNo . "', + '" . $_SESSION['Request']->Location . "', + '" . $_SESSION['Request']->Department . "', + '" . FormatDateForSQL($_SESSION['Request']->DispatchDate) . "', + '" . $_SESSION['Request']->Narrative . "' + )"; + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The request header record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the request header record was used'); + $Result = DB_query($HeaderSQL,$db,$ErrMsg,$DbgMsg,true); - if ($InputError==False) { -/*All inputs must be sensible so make the stock movement records and update the locations stocks */ + foreach ($_SESSION['Request']->LineItems as $LineItems) { + $LineSQL="INSERT INTO stockrequestitems (dispatchitemsid, + dispatchid, + itemid, + quantity, + decimalplaces, + uom) + VALUES( + '".$LineItems->LineNumber."', + '".$RequestNo."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->DecimalPlaces."', + '".$LineItems->UOM."' + )"; + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The request line record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the request header record was used'); + $Result = DB_query($LineSQL,$db,$ErrMsg,$DbgMsg,true); - //$TransferNumber = GetNextTransNo(16,$db); - $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db); - $SQLTransferDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat'])); - - $Result = DB_Txn_Begin($db); - - // Need to get the current location quantity will need it later for the stock movement - $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode= '" . $_SESSION['Transfer']->StockLocationFrom . "'"; - - $ErrMsg = _('Could not retrieve the QOH at the sending location because'); - $DbgMsg = _('The SQL that failed was'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; - } else { - // There must actually be some error this should never happen - $QtyOnHandPrior = 0; } - if ($_SESSION['ProhibitNegativeStock']==1 AND $QtyOnHandPrior<$_SESSION['Transfer']->TransferItem[0]->Quantity) { - prnMsg( _('No Se Puede Realizar La Transferencia Debido a que no hay suficientes articulos en stock'), 'warn'); - echo "<a href='StockTransfers_departments.php'>Continuar Despachos</a>"; - include('includes/footer.inc'); - exit; - } - if(!$_SESSION['dispatch']){ - // Insert the stock movement for the stock going out of the from location - $SQL = "INSERT INTO dispatch(dispatchid,departmentid,despatchdate,narrative) - VALUES (NULL, - '" . $_SESSION['Transfer']->StockLocationTo ."', - '" . $SQLTransferDate . "','' - )"; - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); - $DbgMsg = _('The following SQL to insert the stock movement record was used'); - /*Get the ID of the StockMove... */ - $StkMoveNo = DB_Last_Insert_ID($db,'dispatch','stkmoveno'); - $num_despacho=$StkMoveNo; - $_SESSION['dispatch']=$num_despacho; - } + } + DB_Txn_Commit($db); + prnMsg( _('The internal stock request has been entered and now needs to be authorised'), 'success'); + echo '<br /><div class="centre"><a href="'. $_SERVER['PHP_SELF'] . '?New=Yes">' . _('Create another request') . '</a></div>'; + include('includes/footer.inc'); + unset($_SESSION['Request']); + exit; +} - //inserto en despacho items el articulo correspondiente - $SQL1 = "INSERT INTO dispatchitems(dispatchitemsid,dispatchid,itemid,quantity,loccode) - VALUES (NULL, - '" . $_SESSION['dispatch'] . "', - '" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - '" . round($_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces) . "','" . $_SESSION['Transfer']->StockLocationFrom . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); - $DbgMsg = _('The following SQL to insert the stock movement record was used'); - $Result = DB_query($SQL1,$db,$ErrMsg,$DbgMsg,true); -/*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . + '" alt="" />' . ' ' . $title . '</p>'; - if ($_SESSION['Transfer']->TransferItem[0]->Controlled ==1){ - foreach($_SESSION['Transfer']->TransferItem[0]->SerialItems as $Item){ - /*We need to add or update the StockSerialItem record and - The StockSerialMoves as well */ +if (isset($_GET['Edit'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Edit the Request Line') . '</font></th></tr>'; + echo '<tr> + <td>' . _('Line number') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->LineNumber . '</td> + </tr>'; + echo '<tr> + <td>' . _('Stock Code') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->StockID . '</td> + </tr>'; + echo '<tr> + <td>' . _('Item Description') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->ItemDescription . '</td> + </tr>'; + echo '<tr> + <td>' . _('Unit of Measure') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->UOM . '</td> + </tr>'; + echo '<tr> + <td>' . _('Quantity Requested') . '</td> + <td><input type="text" class="number" name="Quantity" value="' . locale_number_format($_SESSION['Request']->LineItems[$_GET['Edit']]->Quantity, $_SESSION['Request']->LineItems[$_GET['Edit']]->DecimalPlaces) . '" /></td> + </tr>'; + echo '<input type="hidden" name="LineNumber" value="' . $_SESSION['Request']->LineItems[$_GET['Edit']]->LineNumber . '" />'; + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Edit" value="' . _('Update Line') . '" /></div></form>'; + include('includes/footer.inc'); + exit; +} - /*First need to check if the serial items already exists or not in the location from */ - $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - AND serialno='" . $Item->BundleRef . "'"; +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $ErrMsg = _('The entered item code does not exist'); - $Result = DB_query($SQL,$db,$ErrMsg); - $SerialItemExistsRow = DB_fetch_row($Result); +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font color="navy" size="2">' . _('Internal Stock Request Details') . '</font></th></tr>'; +echo '<tr><td>' . _('Department') . ':</td>'; - if ($SerialItemExistsRow[0]==1){ +$sql="SELECT departmentid, + description + FROM departments + ORDER BY description"; - $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "', - expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' - WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - AND serialno='" . $Item->BundleRef . "'"; +$result=DB_query($sql, $db); +echo '<td><select name="Department">'; +echo '<option value="">' . _('Select your department') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_SESSION['Request']->Department) and $_SESSION['Request']->Department==$myrow['departmentid']){ + echo '<option selected="True" value="' . $myrow['departmentid'] . '">' . $myrow['departmentid'].' - ' .htmlentities($myrow['description'], ENT_QUOTES,'UTF-8').'</option>'; + } else { + echo '<option value="' . $myrow['departmentid'] . '">' . $myrow['departmentid'].' - ' .htmlentities($myrow['description'], ENT_QUOTES,'UTF-8').'</option>'; + } +} +echo '</select></td></tr>'; - $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'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - } else { - /*Need to insert a new serial item record */ - $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - expirationdate, - quantity) - VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - '" . $_SESSION['Transfer']->StockLocationFrom . "', - '" . $Item->BundleRef . "', - '" . FormatDateForSQL($Item->ExpiryDate) . "', - '" . -$Item->BundleQty . "')"; +echo '<tr><td>' . _('Location from which to request stock') . ':</td>'; +$sql="SELECT loccode, + locationname + FROM locations + ORDER BY locationname"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); - $DbgMsg = _('The following SQL to insert the serial stock item record was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - } +$result=DB_query($sql, $db); +echo '<td><select name="Location">'; +echo '<option value="">' . _('Select a Location') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_SESSION['Request']->Location) and $_SESSION['Request']->Location==$myrow['loccode']){ + echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['loccode'].' - ' .htmlentities($myrow['locationname'], ENT_QUOTES,'UTF-8').'</option>'; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'].' - ' .htmlentities($myrow['locationname'], ENT_QUOTES,'UTF-8').'</option>'; + } +} +echo '</select></td></tr>'; +echo '<tr><td>' . _('Date when required') . ':</td>'; +echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DispatchDate" maxlength="10" size="11" value="' . $_SESSION['Request']->DispatchDate . '" /></td>'; - /* now insert the serial stock movement */ +echo '<tr><td>' . _('Narrative') . ':</td>'; +echo '<td><textarea name="Narrative" cols="30">'.$_SESSION['Request']->Narrative.'</textarea></td>'; - $SQL = "INSERT INTO stockserialmoves ( - stockmoveno, - stockid, - serialno, - moveqty) - VALUES ( - '" . $StkMoveNo . "', - '" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "' - )"; +echo '</table><br />'; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); +echo '<div class="centre"><input type="submit" name="Update" value="' . _('Update') . '" /></div>'; - }/* foreach controlled item in the serialitems array */ - } /*end if the transferred item is a controlled item */ +echo '</div></form>'; +if (!isset($_SESSION['Request']->Location)) { + include('includes/footer.inc'); + exit; +} - // Need to get the current location quantity will need it later for the stock movement - $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode= '" . $_SESSION['Transfer']->StockLocationTo . "'"; - $ErrMsg = _('Could not retrieve QOH at the destination because'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg,true); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; - } else { - // There must actually be some error this should never happen - $QtyOnHandPrior = 0; - } +//****************MUESTRO LA TABLA CON LOS REGISTROS DE LA TRANSFERENCIA************************************* +$i = 0; //Line Item Array pointer +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<br /><table class="selection">'; +echo '<tr><th colspan="7"><font size="2" color="navy">' . _('Details of Items Requested') . '</font></th></tr>'; - // Insert the stock movement for the stock coming into the to location - $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) - VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - 16, - '" . $TransferNumber . "', - '" . $_SESSION['Transfer']->StockLocationTo . "', - '" . $SQLTransferDate . "', - '" . $PeriodNo . "', - '" . _('From') . " " . $_SESSION['Transfer']->StockLocationFrom . "', - '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "', - '" . ($QtyOnHandPrior + $_SESSION['Transfer']->TransferItem[0]->Quantity) . "' - )"; +$tableheader = '<tr> + <th>'. _('Line Number') . '</th> + <th>'. _('Item Code') . '</th> + <th>'. _('Item Description'). '</th> + <th>'. _('Quantity Required'). '</th> + <th>'. _('UOM'). '</th> + </tr>'; +echo $tableheader; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); - $DbgMsg = _('The following SQL to insert the stock movement record was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); +$k=0; - /*Get the ID of the StockMove... */ - $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); +foreach ($_SESSION['Request']->LineItems as $LineItems) { -/*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ - - if ($_SESSION['Transfer']->TransferItem[0]->Controlled ==1){ - foreach($_SESSION['Transfer']->TransferItem[0]->SerialItems as $Item){ - /*We need to add or update the StockSerialItem record and - The StockSerialMoves as well */ - - /*First need to check if the serial items already exists or not in the location from */ - $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - AND serialno='" . $Item->BundleRef . "'"; - - $ErrMsg = _('Could not determine if the serial item exists in the transfer to location'); - $Result = DB_query($SQL,$db,$ErrMsg); - $SerialItemExistsRow = DB_fetch_row($Result); - - if ($SerialItemExistsRow[0]==1){ - - $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "', - expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' - WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - 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'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - } else { - /*Need to insert a new serial item record */ - $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - expirationdate, - quantity) - VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - '" . $_SESSION['Transfer']->StockLocationTo . "', - '" . $Item->BundleRef . "', - '" . FormatDateForSQL($Item->ExpiryDate) . "', - '" . $Item->BundleQty . "')"; - - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); - $DbgMsg = _('The following SQL to insert the serial stock item record was used:'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - } - - - /* now insert the serial stock movement */ - - $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES ('" . $StkMoveNo . "', - '" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - - }/* foreach controlled item in the serialitems array */ - } /*end if the transfer item is a controlled item */ - - - $SQL = "UPDATE locstock SET quantity = quantity - '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "' - WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; - - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); - $DbgMsg = _('The following SQL to update the location stock record was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - - $SQL = "UPDATE locstock - SET quantity = quantity + '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "' - WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "'"; - - - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); - $DbgMsg = _('The following SQL to update the location stock record was used'); - $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - - $Result = DB_Txn_Commit($db); - - prnMsg(_('An inventory transfer of').' ' . $_SESSION['Transfer']->TransferItem[0]->StockID . ' - ' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to') . ' ' . $_SESSION['Transfer']->StockLocationTo . ' '._('for a quantity of').' ' . $_SESSION['Transfer']->TransferItem[0]->Quantity,'success'); - - - //********************************FINALIZAR EL DESPACHO**************************************** - unset ($_SESSION['Transfer']); - if($_POST['EnterTransfer']=="Finalizar_Transferencia"){ - echo '</br><a href="PDFStockTransfer_departments.php?TransferNo='.$_SESSION['dispatch'].'">' . _('Imprimir Transferencia') . '</a>'; - unset ($_SESSION['dispatch']); - include ('includes/footer.inc'); - exit; - } - //********************************************************************************************* + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; } + echo '<td>' . $LineItems->LineNumber . '</td> + <td>' . $LineItems->StockID . '</td> + <td>' . $LineItems->ItemDescription . '</td> + <td class="number">' . locale_number_format($LineItems->Quantity, $LineItems->DecimalPlaces) . '</td> + <td>' . $LineItems->UOM . '</td> + <td><a href="'. $_SERVER['PHP_SELF'] . '?Edit='.$LineItems->LineNumber.'">' . _('Edit') . '</a></td> + <td><a href="'. $_SERVER['PHP_SELF'] . '?Delete='.$LineItems->LineNumber.'">' . _('Delete') . '</a></td> + </tr>'; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . $title . '</p>'; +echo '</table><br />'; +echo '<div class="centre"><input type="submit" name="Submit" value="' . _('Submit') . '" /></div><br />'; -echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -if (!isset($_GET['Description'])) { - $_GET['Description']=''; +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items'). '</p>'; +$SQL = "SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; +$result1 = DB_query($SQL, $db); +if (DB_num_rows($result1) == 0) { + echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + exit; } -echo '<table class=selection><tr><td>'. _('Stock Code'). ':</td><td>'; -if (isset($_POST['StockID'])) { - echo '<input type=text name="StockID" size=21 value="' . $_POST['StockID'] . '" maxlength=20></td></tr>'; +echo '<table class="selection"><tr>'; +echo '<td>' . _('In Stock Category') . ':'; +echo '<select name="StockCat">'; +if (!isset($_POST['StockCat'])) { + $_POST['StockCat'] = ""; +} +if ($_POST['StockCat'] == 'All') { + echo '<option selected="True" value="All">' . _('All').'</option>'; } else { - echo '<input type=text name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<option value="All">' . _('All').'</option>'; } -echo '<tr><td>'. _('Partial Description'). ':</td><td><input type=text name="StockText" size=21 value="' . - $_GET['Description'] .'"></td><td>'._('Partial Stock Code'). ':</td><td>'; -if (isset($_POST['StockID'])) { - echo '<input type=text name="StockCode" size=21 value="' . $_POST['StockID'] .'" maxlength=20>'; +while ($myrow1 = DB_fetch_array($result1)) { + if ($myrow1['categoryid'] == $_POST['StockCat']) { + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; + } +} +echo '</select></td>'; +echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; +if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { - echo '<input type=text name="StockCode" size=21 value="" maxlength=20>'; + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } -echo '</td><td><input type=submit name="CheckCode" value="'._('Check Part').'"></td></tr>'; - -if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) and strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ - echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; +echo '</td></tr><tr><td></td>'; +echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; +echo '<td>'; +if (isset($_POST['StockCode'])) { + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; +} else { + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } +echo '</td></tr></table><br />'; +echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br />'; +echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; +echo '</form>'; -echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; -$sql = "SELECT loccode, locationname FROM locations"; -$resultStkLocs = DB_query($sql,$db); -while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_SESSION['Transfer']->StockLocationFrom)){ - if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationFrom){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; +if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ + + if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { + prnMsg ( _('Order Item description has been used in search'), 'warn' ); + } elseif ($_POST['StockCode']!='' AND $_POST['Keywords']=='') { + prnMsg ( _('Stock Code has been used in search'), 'warn' ); + } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { + prnMsg ( _('Stock Category has been used in search'), 'warn' ); + } + if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { + //insert wildcard characters in spaces + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - $_SESSION['Transfer']->StockLocationFrom=$myrow['loccode'] . '</option>'; - } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } -} -echo '</select></td></tr>'; + } elseif (mb_strlen($_POST['StockCode'])>0){ -echo '<tr><td>'. _('To Stock Location').': </td><td><select name="StockLocationTo"> '; + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); + $SearchString = '%' . $_POST['StockCode'] . '%'; -$sql1 = "SELECT departmentid, description FROM departments"; -$resultStkLocs1 = DB_query($sql1,$db); + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } -while ($myrow=DB_fetch_array($resultStkLocs1)){ - if (isset($_SESSION['Transfer']) AND isset($_SESSION['Transfer']->StockLocationTo)){ - if ($myrow['departmentid'] == $_SESSION['Transfer']->StockLocationTo){ - echo '<option selected Value="' . $myrow['departmentid'] . '">' . $myrow['description'] . '</option>'; + } else { + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { - echo '<option value="' . $myrow['departmentid'] . '">' . $myrow['description'] . '</option>'; + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } - } elseif ($myrow['departmentid']==$_SESSION['UserStockLocation'] AND isset($_SESSION['Transfer'])){ - echo '<option selected Value="' . $myrow['departmentid'] . '">' . $myrow['description'] . '</option>'; - $_SESSION['Transfer']->StockLocationTo=$myrow['departmentid'] . '</option>'; - } else { - echo '<option value="' . $myrow['departmentid'] . '">' . $myrow['description'] . '</option>'; } -} -echo '</select></td></tr>'; + if (isset($_POST['Next'])) { + $Offset = $_POST['nextlist']; + } + if (isset($_POST['Prev'])) { + $Offset = $_POST['previous']; + } + if (!isset($Offset) or $Offset<0) { + $Offset=0; + } + $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.($_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'); + $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); -echo '<tr><td>'._('Transfer Quantity').':</td>'; + if (DB_num_rows($SearchResult)==0 ){ + prnMsg (_('There are no products available meeting the criteria specified'),'info'); + } + if (DB_num_rows($SearchResult)<$_SESSION['DisplayRecordsMax']){ + $Offset=0; + } -if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) AND $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . - '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; -} elseif (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; -} else { - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; -} - -echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br /> -<input type="submit" name="EnterTransfer" value="' . _('Finalizar_Transferencia') . '"><br />'; - - -if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { - $StockID=$_POST['StockID']; -} else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $StockID=$_SESSION['Transfer']->TransferItem[0]->StockID; -} else { - $StockID=''; -} -if (isset($_SESSION['Transfer'])) { - echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; - echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; - echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; - echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; - echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; -} -echo '</div></form>'; -//****************MUESTRO LA TABLA CON LOS REGISTROS DE LA TRANSFERENCIA************************************* - $i = 0; //Line Item Array pointer - echo "<br><table class=selection>"; - echo '<tr><th colspan=7><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['dispatch'] . - ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to'). ' ' . - $_SESSION['Transfer']->StockLocationTo . '</font></th></tr>'; - - $tableheader = '<tr> - <th>'. _('Item Code') . '</th> - <th>'. _('Item Description'). '</th> - <th>'. _('Quantity Dispatched'). '</th> - <th>'. _('Desde el Almacen'). '</th> - <th>'. _('Al Dpto.'). '</th> - <th>'. _('Date'). '</th> - </tr>'; - echo $tableheader; - $k=0; - //***************************CONSULTO LOS ARTICULOS VINCULADOS CON LA ORDEN DE DESPACHO***************** - $sql="SELECT stockmaster.stockid, stockmaster.description, dispatchitems.quantity, departments.description as namedepartments,loccode,despatchdate -FROM dispatch, dispatchitems, stockmaster, departments -WHERE departments.departmentid=dispatch.departmentid and stockmaster.stockid = dispatchitems.itemid -AND dispatch.dispatchid = dispatchitems.dispatchid -AND dispatchitems.`dispatchid` ='".$_SESSION['dispatch']."'"; - $result=DB_query($sql, $db); - while ($myrow=DB_fetch_array($result)){ - - if ($k==1){ +} //end of if search +/* display list if there is more than one record */ +if (isset($searchresult) AND !isset($_POST['Select'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $ListCount = DB_num_rows($searchresult); + if ($ListCount > 0) { + // If the user hit the search button and there is more than one item to show + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + if (isset($_POST['Next'])) { + if ($_POST['PageOffset'] < $ListPageMax) { + $_POST['PageOffset'] = $_POST['PageOffset'] + 1; + } + } + if (isset($_POST['Previous'])) { + if ($_POST['PageOffset'] > 1) { + $_POST['PageOffset'] = $_POST['PageOffset'] - 1; + } + } + if ($_POST['PageOffset'] > $ListPageMax) { + $_POST['PageOffset'] = $ListPageMax; + } + if ($ListPageMax > 1) { + echo '<div class="centre"><br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset">'; + $ListPage = 1; + while ($ListPage <= $ListPageMax) { + if ($ListPage == $_POST['PageOffset']) { + echo '<option value=' . $ListPage . ' selected>' . $ListPage . '</option>'; + } else { + echo '<option value=' . $ListPage . '>' . $ListPage . '</option>'; + } + $ListPage++; + } + echo '</select> + <input type="submit" name="Go" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '<input type="hidden" name=Keywords value="'.$_POST['Keywords'].'" />'; + echo '<input type="hidden" name=StockCat value="'.$_POST['StockCat'].'" />'; + echo '<input type="hidden" name=StockCode value="'.$_POST['StockCode'].'" />'; +// echo '<input type="hidden" name=Search value="Search" />'; + echo '<br /></div>'; + } + echo '<table cellpadding="2" colspan="7">'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Qty On Hand') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Stock Status') . '</th> + </tr>'; + echo $tableheader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + if (DB_num_rows($searchresult) <> 0) { + DB_data_seek($searchresult, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); + } + while (($myrow = DB_fetch_array($searchresult)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + if ($k == 1) { echo '<tr class="EvenTableRows">'; - $k=0; + $k = 0; } else { echo '<tr class="OddTableRows">'; $k++; } - echo '<td class=number>' . $myrow['stockid'] . '</td> - <td>' . $myrow['description'] . '</td> - <td>' . $myrow['quantity'] . '</td> + if ($myrow['mbflag'] == 'D') { + $qoh = _('N/A'); + } else { + $qoh = locale_number_format($myrow['qoh'], $myrow['decimalplaces']); + } + if ($myrow['discontinued']==1){ + $ItemStatus = '<font class="bad">' . _('Obsolete') . '</font>'; + } else { + $ItemStatus =''; + } - <td>' . $myrow['loccode'] . '</td> - <td>' . $myrow['namedepartments'] . '</td> - <td>' . ConvertSQLDate($myrow['despatchdate']) . '</td></tr>'; + echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> + <td>'.$myrow['description'].'</td> + <td class="number">' . $qoh . '</td> + <td>' . $myrow['units'] . '</td> + <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> + <td>' . $ItemStatus . '</td> + </tr>'; + $j++; + if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { + $j = 1; + echo $tableheader; + } + $RowIndex = $RowIndex + 1; + //end of page full new headings if + } + //end of while loop + echo '</table></form><br />'; + } +} +/* end display list if there is more than one record */ +if (isset($SearchResult)) { + echo '<br />'; + echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; + echo '<br />'; + $j = 1; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" 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="'.($Offset-1).'" /> + <input tabindex="'.($j+8).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; + echo '<td style="text-align:center" colspan="6"> + <input type="hidden" name="order_items" value="1" /> + <input tabindex="'.($j+9).'" type="submit" value="'._('Add to Requisition').'" /></td>'; + echo '<td> + <input type="hidden" name="nextlist" value="'.($Offset+1).'" /> + <input tabindex="'.($j+10).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; + $TableHeader = '<tr><th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('On Demand') . '</th> + <th>' . _('On Order') . '</th> + <th>' . _('Available') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $TableHeader; + $ImageSource = _('No Image'); + + $k=0; //row colour counter + $i=0; + while ($myrow=DB_fetch_array($SearchResult)) { + $PriceSQL="SELECT currabrev, + price, + units as customerunits, + conversionfactor, + decimalplaces as pricedecimal + FROM prices + WHERE '".date('Y-m-d')."' between startdate and enddate"; + $PriceResult=DB_query($PriceSQL, $db); + if (DB_num_rows($PriceResult)==0) { + $PriceSQL="SELECT currabrev, + price, + units as customerunits, + conversionfactor, + decimalplaces as pricedecimal + FROM prices + WHERE stockid='".$myrow['stockid']."' + AND '".date('Y-m-d')."' between startdate and enddate"; + $PriceResult=DB_query($PriceSQL, $db); } + $PriceRow=DB_fetch_array($PriceResult); + if (DB_num_rows($PriceResult)==0) { + $PriceRow['price']=0; + $PriceRow['customerunits']=$myrow['stockunits']; + $PriceRow['conversionfactor']=1; + $PriceRow['pricedecimal']=2; + } + if ($PriceRow['conversionfactor']=='') { + $PriceRow['conversionfactor']=1; + } + // Find the quantity in stock at location + if ($myrow['decimalplaces']=='') { + $DecimalPlacesSQL="SELECT decimalplaces + FROM stockmaster + WHERE stockid='" .$myrow['stockid'] . "'"; + $DecimalPlacesResult = DB_query($DecimalPlacesSQL, $db); + $DecimalPlacesRow = DB_fetch_array($DecimalPlacesResult); + $DecimalPlaces = $DecimalPlacesRow['decimalplaces']; + } else { + $DecimalPlaces=$myrow['decimalplaces']; + } - echo '</table>'; + $QOHSQL = "SELECT sum(locstock.quantity) AS qoh + FROM locstock + WHERE locstock.stockid='" .$myrow['stockid'] . "' AND + loccode = '" . $_SESSION['Request']->Location . "'"; + $QOHResult = DB_query($QOHSQL,$db); + $QOHRow = DB_fetch_array($QOHResult); + $QOH = $QOHRow['qoh']/$PriceRow['conversionfactor']; + // Find the quantity on outstanding sales orders + $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*salesorderdetails.conversionfactor AS dem + FROM salesorderdetails, + salesorders + WHERE salesorders.orderno = salesorderdetails.orderno AND + salesorders.fromstkloc='" . $_SESSION['Request']->Location . "' AND + salesorderdetails.completed=0 AND + salesorders.quotation=0 AND + salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; + $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Request']->Location . ' ' . _('cannot be retrieved because'); + $DemandResult = DB_query($sql,$db,$ErrMsg); -//********************************************************************************************************* + $DemandRow = DB_fetch_row($DemandResult); + if ($DemandRow[0] != null){ + $DemandQty = $DemandRow[0]/$PriceRow['conversionfactor']; + } else { + $DemandQty = 0; + } + // Find the quantity on purchase orders + $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd)*purchorderdetails.conversionfactor AS dem + FROM purchorderdetails LEFT JOIN purchorders + ON purchorderdetails.orderno=purchorders.orderno + WHERE purchorderdetails.completed=0 + AND purchorders.status<>'Cancelled' + AND purchorders.status<>'Rejected' + AND purchorderdetails.itemcode='" . $myrow['stockid'] . "'"; + $ErrMsg = _('The order details for this product cannot be retrieved because'); + $PurchResult = db_query($sql,$db,$ErrMsg); + $PurchRow = db_fetch_row($PurchResult); + if ($PurchRow[0]!=null){ + $PurchQty = $PurchRow[0]/$PriceRow['conversionfactor']; + } else { + $PurchQty = 0; + } + // Find the quantity on works orders + $sql = "SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) AS dedm + FROM woitems + WHERE stockid='" . $myrow['stockid'] ."'"; + $ErrMsg = _('The order details for this product cannot be retrieved because'); + $WoResult = db_query($sql,$db,$ErrMsg); + $WoRow = db_fetch_row($WoResult); + if ($WoRow[0]!=null){ + $WoQty = $WoRow[0]; + } else { + $WoQty = 0; + } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + $OnOrder = $PurchQty + $WoQty; + $Available = $QOH - $DemandQty + $OnOrder; + if ($PriceRow['customerunits']=='') { + $myrow['units']=$myrow['stockunits']; + } else { + $myrow['units']=$PriceRow['customerunits']; + } + echo '<td>'.$myrow['stockid'].'</font></td> + <td>'.$myrow['description'].'</td> + <td>'.$myrow['units'].'</td> + <td class="number">'.locale_number_format($QOH,$DecimalPlaces).'</td> + <td class="number">'.locale_number_format($DemandQty,$DecimalPlaces).'</td> + <td class="number">'.locale_number_format($OnOrder, $DecimalPlaces).'</td> + <td class="number">'.locale_number_format($Available,$DecimalPlaces).'</td> + <td><font size="1"><input class="number" tabindex="'.($j+7).'" type="text" size="6" name="Quantity'.$i.'" value="0" /> + <input type="hidden" name="StockID'.$i.'" value="'.$myrow['stockid'].'" /> + </td> + </tr>'; + echo '<input type="hidden" name="DecimalPlaces'.$i.'" value="' . $myrow['decimalplaces'] . '" />'; + echo '<input type="hidden" name="ItemDescription'.$i.'" value="' . $myrow['description'] . '" />'; + echo '<input type="hidden" name="ConversionFactor'.$i.'" value="' . $PriceRow['conversionfactor'] . '" />'; + echo '<input type="hidden" name="Units'.$i.'" value="' . $myrow['units'] . '" />'; + if ($j==1) { + $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; + } + $i++; +#end of page full new headings if + } +#end of while loop + echo '<tr><td><input type="hidden" name="previous" value="'.($Offset-1).'" /> + <input tabindex="'.($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; + echo '<td style="text-align:center" colspan="6"><input type="hidden" name="order_items" value="1" /> + <input tabindex="'.($j+8).'" type="submit" value="'._('Add to Requisition').'" /></td>'; + echo '<td><input type="hidden" name="nextlist" value="'.($Offset+1).'" /> + <input tabindex="'.($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td><tr/>'; + echo '</table></form>'; + echo $jsCall; +}#end if SearchResults to show +//********************************************************************************************************* include('includes/footer.inc'); ?> \ No newline at end of file Added: trunk/includes/DefineStockRequestClass.php =================================================================== --- trunk/includes/DefineStockRequestClass.php (rev 0) +++ trunk/includes/DefineStockRequestClass.php 2011-10-13 17:53:48 UTC (rev 8282) @@ -0,0 +1,62 @@ +<?php + +Class StockRequest { + + var $LineItems; /*array of objects of class LineDetails using the product id as the pointer */ + var $DispatchDate; + var $Location; + var $Department; + var $Narrative; + var $LineCounter=0; + + function StockRequest(){ + /*Constructor function initialises a new shopping cart */ + $this->DispatchDate = date($_SESSION['DefaultDateFormat']); + $this->LineItems=array(); + } + + function AddLine($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber=-1) { + + if ($LineNumber==-1){ + $LineNumber = $this->LineCounter; + } + $this->LineItems[$LineNumber]=new LineDetails($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber); + $this->LineCounter = $LineNumber + 1; + } +} + +Class LineDetails { + var $StockID; + var $ItemDescription; + var $Quantity; + var $UOM; + var $LineNumber; + + function LineDetails($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber) { + + $this->LineNumber=$LineNumber; + $this->StockID=$StockID; + $this->ItemDescription=$ItemDescription; + $this->Quantity=$Quantity; + $this->DecimalPlaces=$DecimalPlaces; + $this->UOM=$UOM; + } + +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-13 17:54:09
|
Revision: 8283 http://weberp.svn.sourceforge.net/weberp/?rev=8283&view=rev Author: tim_schofield Date: 2011-10-13 17:54:01 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Rename script to a more relevant name Added Paths: ----------- trunk/InternalStockRequest.php Removed Paths: ------------- trunk/StockTransfers_departments.php Copied: trunk/InternalStockRequest.php (from rev 8282, trunk/StockTransfers_departments.php) =================================================================== --- trunk/InternalStockRequest.php (rev 0) +++ trunk/InternalStockRequest.php 2011-10-13 17:54:01 UTC (rev 8283) @@ -0,0 +1,717 @@ +<?php + +/* $Id: StockTransfers.php 4576 2011-05-27 10:59:20Z daintree $*/ + +include('includes/DefineStockRequestClass.php'); + +include('includes/session.inc'); +$title = _('Create an Internal Materials Request'); + +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); + +if (isset($_GET['New'])) { + unset($_SESSION['Transfer']); + $_SESSION['Request'] = new StockRequest(); +} + +if (isset($_POST['Update'])) { + $InputError=0; + if ($_POST['Department']=='') { + prnMsg( _('You must select a Department for the request'), 'error'); + $InputError=1; + } + if ($_POST['Location']=='') { + prnMsg( _('You must select a Location to request the items from'), 'error'); + $InputError=1; + } + if ($InputError==0) { + $_SESSION['Request']->Department=$_POST['Department']; + $_SESSION['Request']->Location=$_POST['Location']; + $_SESSION['Request']->DispatchDate=$_POST['DispatchDate']; + $_SESSION['Request']->Narrative=$_POST['Narrative']; + } +} + +if (isset($_POST['Edit'])) { + $_SESSION['Request']->LineItems[$_POST['LineNumber']]->Quantity=$_POST['Quantity']; +} + +if (isset($_GET['Delete'])) { + unset($_SESSION['Request']->LineItems[$_GET['Delete']]); + echo '<br />'; + prnMsg( _('The line was successfully deleted'), 'success'); + echo '<br />'; +} + +foreach ($_POST as $key => $value) { + if (mb_strstr($key,'StockID')) { + $Index=mb_substr($key, 7); + if (filter_number_input($_POST['Quantity'.$Index])>0) { + $StockID=$value; + $ItemDescription=$_POST['ItemDescription'.$Index]; + $DecimalPlaces=$_POST['DecimalPlaces'.$Index]; + $NewItem_array[$StockID] = filter_number_input($_POST['Quantity'.$Index]); + $_POST['Units'.$StockID]=$_POST['Units'.$Index]; + $_SESSION['Request']->AddLine($StockID, $ItemDescription, $NewItem_array[$StockID], $_POST['Units'.$StockID], $DecimalPlaces); + } + } +} + +if (isset($_POST['Submit'])) { + DB_Txn_Begin($db); + $InputError=0; + if ($_SESSION['Request']->Department=='') { + prnMsg( _('You must select a Department for the request'), 'error'); + $InputError=1; + } + if ($_SESSION['Request']->Location=='') { + prnMsg( _('You must select a Location to request the items from'), 'error'); + $InputError=1; + } + if ($InputError==0) { + $RequestNo = GetNextTransNo(38, $db); + $HeaderSQL="INSERT INTO stockrequest (dispatchid, + loccode, + departmentid, + despatchdate, + narrative) + VALUES( + '" . $RequestNo . "', + '" . $_SESSION['Request']->Location . "', + '" . $_SESSION['Request']->Department . "', + '" . FormatDateForSQL($_SESSION['Request']->DispatchDate) . "', + '" . $_SESSION['Request']->Narrative . "' + )"; + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The request header record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the request header record was used'); + $Result = DB_query($HeaderSQL,$db,$ErrMsg,$DbgMsg,true); + + foreach ($_SESSION['Request']->LineItems as $LineItems) { + $LineSQL="INSERT INTO stockrequestitems (dispatchitemsid, + dispatchid, + itemid, + quantity, + decimalplaces, + uom) + VALUES( + '".$LineItems->LineNumber."', + '".$RequestNo."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->DecimalPlaces."', + '".$LineItems->UOM."' + )"; + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The request line record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the request header record was used'); + $Result = DB_query($LineSQL,$db,$ErrMsg,$DbgMsg,true); + + } + + } + DB_Txn_Commit($db); + prnMsg( _('The internal stock request has been entered and now needs to be authorised'), 'success'); + echo '<br /><div class="centre"><a href="'. $_SERVER['PHP_SELF'] . '?New=Yes">' . _('Create another request') . '</a></div>'; + include('includes/footer.inc'); + unset($_SESSION['Request']); + exit; +} + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . + '" alt="" />' . ' ' . $title . '</p>'; + +if (isset($_GET['Edit'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Edit the Request Line') . '</font></th></tr>'; + echo '<tr> + <td>' . _('Line number') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->LineNumber . '</td> + </tr>'; + echo '<tr> + <td>' . _('Stock Code') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->StockID . '</td> + </tr>'; + echo '<tr> + <td>' . _('Item Description') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->ItemDescription . '</td> + </tr>'; + echo '<tr> + <td>' . _('Unit of Measure') . '</td> + <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->UOM . '</td> + </tr>'; + echo '<tr> + <td>' . _('Quantity Requested') . '</td> + <td><input type="text" class="number" name="Quantity" value="' . locale_number_format($_SESSION['Request']->LineItems[$_GET['Edit']]->Quantity, $_SESSION['Request']->LineItems[$_GET['Edit']]->DecimalPlaces) . '" /></td> + </tr>'; + echo '<input type="hidden" name="LineNumber" value="' . $_SESSION['Request']->LineItems[$_GET['Edit']]->LineNumber . '" />'; + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Edit" value="' . _('Update Line') . '" /></div></form>'; + include('includes/footer.inc'); + exit; +} + +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font color="navy" size="2">' . _('Internal Stock Request Details') . '</font></th></tr>'; +echo '<tr><td>' . _('Department') . ':</td>'; + +$sql="SELECT departmentid, + description + FROM departments + ORDER BY description"; + +$result=DB_query($sql, $db); +echo '<td><select name="Department">'; +echo '<option value="">' . _('Select your department') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_SESSION['Request']->Department) and $_SESSION['Request']->Department==$myrow['departmentid']){ + echo '<option selected="True" value="' . $myrow['departmentid'] . '">' . $myrow['departmentid'].' - ' .htmlentities($myrow['description'], ENT_QUOTES,'UTF-8').'</option>'; + } else { + echo '<option value="' . $myrow['departmentid'] . '">' . $myrow['departmentid'].' - ' .htmlentities($myrow['description'], ENT_QUOTES,'UTF-8').'</option>'; + } +} +echo '</select></td></tr>'; + +echo '<tr><td>' . _('Location from which to request stock') . ':</td>'; +$sql="SELECT loccode, + locationname + FROM locations + ORDER BY locationname"; + +$result=DB_query($sql, $db); +echo '<td><select name="Location">'; +echo '<option value="">' . _('Select a Location') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_SESSION['Request']->Location) and $_SESSION['Request']->Location==$myrow['loccode']){ + echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['loccode'].' - ' .htmlentities($myrow['locationname'], ENT_QUOTES,'UTF-8').'</option>'; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'].' - ' .htmlentities($myrow['locationname'], ENT_QUOTES,'UTF-8').'</option>'; + } +} +echo '</select></td></tr>'; + +echo '<tr><td>' . _('Date when required') . ':</td>'; +echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DispatchDate" maxlength="10" size="11" value="' . $_SESSION['Request']->DispatchDate . '" /></td>'; + +echo '<tr><td>' . _('Narrative') . ':</td>'; +echo '<td><textarea name="Narrative" cols="30">'.$_SESSION['Request']->Narrative.'</textarea></td>'; + +echo '</table><br />'; + +echo '<div class="centre"><input type="submit" name="Update" value="' . _('Update') . '" /></div>'; + +echo '</div></form>'; + +if (!isset($_SESSION['Request']->Location)) { + include('includes/footer.inc'); + exit; +} + +//****************MUESTRO LA TABLA CON LOS REGISTROS DE LA TRANSFERENCIA************************************* +$i = 0; //Line Item Array pointer +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<br /><table class="selection">'; +echo '<tr><th colspan="7"><font size="2" color="navy">' . _('Details of Items Requested') . '</font></th></tr>'; + +$tableheader = '<tr> + <th>'. _('Line Number') . '</th> + <th>'. _('Item Code') . '</th> + <th>'. _('Item Description'). '</th> + <th>'. _('Quantity Required'). '</th> + <th>'. _('UOM'). '</th> + </tr>'; +echo $tableheader; + +$k=0; + +foreach ($_SESSION['Request']->LineItems as $LineItems) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + echo '<td>' . $LineItems->LineNumber . '</td> + <td>' . $LineItems->StockID . '</td> + <td>' . $LineItems->ItemDescription . '</td> + <td class="number">' . locale_number_format($LineItems->Quantity, $LineItems->DecimalPlaces) . '</td> + <td>' . $LineItems->UOM . '</td> + <td><a href="'. $_SERVER['PHP_SELF'] . '?Edit='.$LineItems->LineNumber.'">' . _('Edit') . '</a></td> + <td><a href="'. $_SERVER['PHP_SELF'] . '?Delete='.$LineItems->LineNumber.'">' . _('Delete') . '</a></td> + </tr>'; + +} + +echo '</table><br />'; +echo '<div class="centre"><input type="submit" name="Submit" value="' . _('Submit') . '" /></div><br />'; + +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items'). '</p>'; +$SQL = "SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; +$result1 = DB_query($SQL, $db); +if (DB_num_rows($result1) == 0) { + echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + exit; +} +echo '<table class="selection"><tr>'; +echo '<td>' . _('In Stock Category') . ':'; +echo '<select name="StockCat">'; +if (!isset($_POST['StockCat'])) { + $_POST['StockCat'] = ""; +} +if ($_POST['StockCat'] == 'All') { + echo '<option selected="True" value="All">' . _('All').'</option>'; +} else { + echo '<option value="All">' . _('All').'</option>'; +} +while ($myrow1 = DB_fetch_array($result1)) { + if ($myrow1['categoryid'] == $_POST['StockCat']) { + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; + } +} +echo '</select></td>'; +echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; +if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; +} else { + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; +} +echo '</td></tr><tr><td></td>'; +echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; +echo '<td>'; +if (isset($_POST['StockCode'])) { + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; +} else { + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; +} +echo '</td></tr></table><br />'; +echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br />'; +echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; +echo '</form>'; + + +if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ + + if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { + prnMsg ( _('Order Item description has been used in search'), 'warn' ); + } elseif ($_POST['StockCode']!='' AND $_POST['Keywords']=='') { + prnMsg ( _('Stock Code has been used in search'), 'warn' ); + } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { + prnMsg ( _('Stock Category has been used in search'), 'warn' ); + } + if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { + //insert wildcard characters in spaces + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } elseif (mb_strlen($_POST['StockCode'])>0){ + + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); + $SearchString = '%' . $_POST['StockCode'] . '%'; + + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } else { + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units as stockunits, + stockmaster.decimalplaces + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + } + + if (isset($_POST['Next'])) { + $Offset = $_POST['nextlist']; + } + if (isset($_POST['Prev'])) { + $Offset = $_POST['previous']; + } + if (!isset($Offset) or $Offset<0) { + $Offset=0; + } + $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.($_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'); + $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); + + if (DB_num_rows($SearchResult)==0 ){ + prnMsg (_('There are no products available meeting the criteria specified'),'info'); + } + if (DB_num_rows($SearchResult)<$_SESSION['DisplayRecordsMax']){ + $Offset=0; + } + +} //end of if search +/* display list if there is more than one record */ +if (isset($searchresult) AND !isset($_POST['Select'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $ListCount = DB_num_rows($searchresult); + if ($ListCount > 0) { + // If the user hit the search button and there is more than one item to show + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + if (isset($_POST['Next'])) { + if ($_POST['PageOffset'] < $ListPageMax) { + $_POST['PageOffset'] = $_POST['PageOffset'] + 1; + } + } + if (isset($_POST['Previous'])) { + if ($_POST['PageOffset'] > 1) { + $_POST['PageOffset'] = $_POST['PageOffset'] - 1; + } + } + if ($_POST['PageOffset'] > $ListPageMax) { + $_POST['PageOffset'] = $ListPageMax; + } + if ($ListPageMax > 1) { + echo '<div class="centre"><br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset">'; + $ListPage = 1; + while ($ListPage <= $ListPageMax) { + if ($ListPage == $_POST['PageOffset']) { + echo '<option value=' . $ListPage . ' selected>' . $ListPage . '</option>'; + } else { + echo '<option value=' . $ListPage . '>' . $ListPage . '</option>'; + } + $ListPage++; + } + echo '</select> + <input type="submit" name="Go" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '<input type="hidden" name=Keywords value="'.$_POST['Keywords'].'" />'; + echo '<input type="hidden" name=StockCat value="'.$_POST['StockCat'].'" />'; + echo '<input type="hidden" name=StockCode value="'.$_POST['StockCode'].'" />'; +// echo '<input type="hidden" name=Search value="Search" />'; + echo '<br /></div>'; + } + echo '<table cellpadding="2" colspan="7">'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Qty On Hand') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Stock Status') . '</th> + </tr>'; + echo $tableheader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + if (DB_num_rows($searchresult) <> 0) { + DB_data_seek($searchresult, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); + } + while (($myrow = DB_fetch_array($searchresult)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + if ($myrow['mbflag'] == 'D') { + $qoh = _('N/A'); + } else { + $qoh = locale_number_format($myrow['qoh'], $myrow['decimalplaces']); + } + if ($myrow['discontinued']==1){ + $ItemStatus = '<font class="bad">' . _('Obsolete') . '</font>'; + } else { + $ItemStatus =''; + } + + echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> + <td>'.$myrow['description'].'</td> + <td class="number">' . $qoh . '</td> + <td>' . $myrow['units'] . '</td> + <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> + <td>' . $ItemStatus . '</td> + </tr>'; + $j++; + if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { + $j = 1; + echo $tableheader; + } + $RowIndex = $RowIndex + 1; + //end of page full new headings if + } + //end of while loop + echo '</table></form><br />'; + } +} +/* end display list if there is more than one record */ + +if (isset($SearchResult)) { + echo '<br />'; + echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; + echo '<br />'; + $j = 1; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" 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="'.($Offset-1).'" /> + <input tabindex="'.($j+8).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; + echo '<td style="text-align:center" colspan="6"> + <input type="hidden" name="order_items" value="1" /> + <input tabindex="'.($j+9).'" type="submit" value="'._('Add to Requisition').'" /></td>'; + echo '<td> + <input type="hidden" name="nextlist" value="'.($Offset+1).'" /> + <input tabindex="'.($j+10).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; + $TableHeader = '<tr><th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('On Demand') . '</th> + <th>' . _('On Order') . '</th> + <th>' . _('Available') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $TableHeader; + $ImageSource = _('No Image'); + + $k=0; //row colour counter + $i=0; + while ($myrow=DB_fetch_array($SearchResult)) { + $PriceSQL="SELECT currabrev, + price, + units as customerunits, + conversionfactor, + decimalplaces as pricedecimal + FROM prices + WHERE '".date('Y-m-d')."' between startdate and enddate"; + $PriceResult=DB_query($PriceSQL, $db); + if (DB_num_rows($PriceResult)==0) { + $PriceSQL="SELECT currabrev, + price, + units as customerunits, + conversionfactor, + decimalplaces as pricedecimal + FROM prices + WHERE stockid='".$myrow['stockid']."' + AND '".date('Y-m-d')."' between startdate and enddate"; + $PriceResult=DB_query($PriceSQL, $db); + } + $PriceRow=DB_fetch_array($PriceResult); + if (DB_num_rows($PriceResult)==0) { + $PriceRow['price']=0; + $PriceRow['customerunits']=$myrow['stockunits']; + $PriceRow['conversionfactor']=1; + $PriceRow['pricedecimal']=2; + } + if ($PriceRow['conversionfactor']=='') { + $PriceRow['conversionfactor']=1; + } + // Find the quantity in stock at location + if ($myrow['decimalplaces']=='') { + $DecimalPlacesSQL="SELECT decimalplaces + FROM stockmaster + WHERE stockid='" .$myrow['stockid'] . "'"; + $DecimalPlacesResult = DB_query($DecimalPlacesSQL, $db); + $DecimalPlacesRow = DB_fetch_array($DecimalPlacesResult); + $DecimalPlaces = $DecimalPlacesRow['decimalplaces']; + } else { + $DecimalPlaces=$myrow['decimalplaces']; + } + + $QOHSQL = "SELECT sum(locstock.quantity) AS qoh + FROM locstock + WHERE locstock.stockid='" .$myrow['stockid'] . "' AND + loccode = '" . $_SESSION['Request']->Location . "'"; + $QOHResult = DB_query($QOHSQL,$db); + $QOHRow = DB_fetch_array($QOHResult); + $QOH = $QOHRow['qoh']/$PriceRow['conversionfactor']; + + // Find the quantity on outstanding sales orders + $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*salesorderdetails.conversionfactor AS dem + FROM salesorderdetails, + salesorders + WHERE salesorders.orderno = salesorderdetails.orderno AND + salesorders.fromstkloc='" . $_SESSION['Request']->Location . "' AND + salesorderdetails.completed=0 AND + salesorders.quotation=0 AND + salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; + $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Request']->Location . ' ' . _('cannot be retrieved because'); + $DemandResult = DB_query($sql,$db,$ErrMsg); + + $DemandRow = DB_fetch_row($DemandResult); + if ($DemandRow[0] != null){ + $DemandQty = $DemandRow[0]/$PriceRow['conversionfactor']; + } else { + $DemandQty = 0; + } + + // Find the quantity on purchase orders + $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd)*purchorderdetails.conversionfactor AS dem + FROM purchorderdetails LEFT JOIN purchorders + ON purchorderdetails.orderno=purchorders.orderno + WHERE purchorderdetails.completed=0 + AND purchorders.status<>'Cancelled' + AND purchorders.status<>'Rejected' + AND purchorderdetails.itemcode='" . $myrow['stockid'] . "'"; + + $ErrMsg = _('The order details for this product cannot be retrieved because'); + $PurchResult = db_query($sql,$db,$ErrMsg); + + $PurchRow = db_fetch_row($PurchResult); + if ($PurchRow[0]!=null){ + $PurchQty = $PurchRow[0]/$PriceRow['conversionfactor']; + } else { + $PurchQty = 0; + } + + // Find the quantity on works orders + $sql = "SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) AS dedm + FROM woitems + WHERE stockid='" . $myrow['stockid'] ."'"; + $ErrMsg = _('The order details for this product cannot be retrieved because'); + $WoResult = db_query($sql,$db,$ErrMsg); + + $WoRow = db_fetch_row($WoResult); + if ($WoRow[0]!=null){ + $WoQty = $WoRow[0]; + } else { + $WoQty = 0; + } + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + $OnOrder = $PurchQty + $WoQty; + $Available = $QOH - $DemandQty + $OnOrder; + if ($PriceRow['customerunits']=='') { + $myrow['units']=$myrow['stockunits']; + } else { + $myrow['units']=$PriceRow['customerunits']; + } + echo '<td>'.$myrow['stockid'].'</font></td> + <td>'.$myrow['description'].'</td> + <td>'.$myrow['units'].'</td> + <td class="number">'.locale_number_format($QOH,$DecimalPlaces).'</td> + <td class="number">'.locale_number_format($DemandQty,$DecimalPlaces).'</td> + <td class="number">'.locale_number_format($OnOrder, $DecimalPlaces).'</td> + <td class="number">'.locale_number_format($Available,$DecimalPlaces).'</td> + <td><font size="1"><input class="number" tabindex="'.($j+7).'" type="text" size="6" name="Quantity'.$i.'" value="0" /> + <input type="hidden" name="StockID'.$i.'" value="'.$myrow['stockid'].'" /> + </td> + </tr>'; + echo '<input type="hidden" name="DecimalPlaces'.$i.'" value="' . $myrow['decimalplaces'] . '" />'; + echo '<input type="hidden" name="ItemDescription'.$i.'" value="' . $myrow['description'] . '" />'; + echo '<input type="hidden" name="ConversionFactor'.$i.'" value="' . $PriceRow['conversionfactor'] . '" />'; + echo '<input type="hidden" name="Units'.$i.'" value="' . $myrow['units'] . '" />'; + if ($j==1) { + $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; + } + $i++; +#end of page full new headings if + } +#end of while loop + echo '<tr><td><input type="hidden" name="previous" value="'.($Offset-1).'" /> + <input tabindex="'.($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; + echo '<td style="text-align:center" colspan="6"><input type="hidden" name="order_items" value="1" /> + <input tabindex="'.($j+8).'" type="submit" value="'._('Add to Requisition').'" /></td>'; + echo '<td><input type="hidden" name="nextlist" value="'.($Offset+1).'" /> + <input tabindex="'.($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td><tr/>'; + echo '</table></form>'; + echo $jsCall; + +}#end if SearchResults to show + +//********************************************************************************************************* +include('includes/footer.inc'); +?> \ No newline at end of file Deleted: trunk/StockTransfers_departments.php =================================================================== --- trunk/StockTransfers_departments.php 2011-10-13 17:53:48 UTC (rev 8282) +++ trunk/StockTransfers_departments.php 2011-10-13 17:54:01 UTC (rev 8283) @@ -1,717 +0,0 @@ -<?php - -/* $Id: StockTransfers.php 4576 2011-05-27 10:59:20Z daintree $*/ - -include('includes/DefineStockRequestClass.php'); - -include('includes/session.inc'); -$title = _('Create an Internal Materials Request'); - -include('includes/header.inc'); -include('includes/SQL_CommonFunctions.inc'); - -if (isset($_GET['New'])) { - unset($_SESSION['Transfer']); - $_SESSION['Request'] = new StockRequest(); -} - -if (isset($_POST['Update'])) { - $InputError=0; - if ($_POST['Department']=='') { - prnMsg( _('You must select a Department for the request'), 'error'); - $InputError=1; - } - if ($_POST['Location']=='') { - prnMsg( _('You must select a Location to request the items from'), 'error'); - $InputError=1; - } - if ($InputError==0) { - $_SESSION['Request']->Department=$_POST['Department']; - $_SESSION['Request']->Location=$_POST['Location']; - $_SESSION['Request']->DispatchDate=$_POST['DispatchDate']; - $_SESSION['Request']->Narrative=$_POST['Narrative']; - } -} - -if (isset($_POST['Edit'])) { - $_SESSION['Request']->LineItems[$_POST['LineNumber']]->Quantity=$_POST['Quantity']; -} - -if (isset($_GET['Delete'])) { - unset($_SESSION['Request']->LineItems[$_GET['Delete']]); - echo '<br />'; - prnMsg( _('The line was successfully deleted'), 'success'); - echo '<br />'; -} - -foreach ($_POST as $key => $value) { - if (mb_strstr($key,'StockID')) { - $Index=mb_substr($key, 7); - if (filter_number_input($_POST['Quantity'.$Index])>0) { - $StockID=$value; - $ItemDescription=$_POST['ItemDescription'.$Index]; - $DecimalPlaces=$_POST['DecimalPlaces'.$Index]; - $NewItem_array[$StockID] = filter_number_input($_POST['Quantity'.$Index]); - $_POST['Units'.$StockID]=$_POST['Units'.$Index]; - $_SESSION['Request']->AddLine($StockID, $ItemDescription, $NewItem_array[$StockID], $_POST['Units'.$StockID], $DecimalPlaces); - } - } -} - -if (isset($_POST['Submit'])) { - DB_Txn_Begin($db); - $InputError=0; - if ($_SESSION['Request']->Department=='') { - prnMsg( _('You must select a Department for the request'), 'error'); - $InputError=1; - } - if ($_SESSION['Request']->Location=='') { - prnMsg( _('You must select a Location to request the items from'), 'error'); - $InputError=1; - } - if ($InputError==0) { - $RequestNo = GetNextTransNo(38, $db); - $HeaderSQL="INSERT INTO stockrequest (dispatchid, - loccode, - departmentid, - despatchdate, - narrative) - VALUES( - '" . $RequestNo . "', - '" . $_SESSION['Request']->Location . "', - '" . $_SESSION['Request']->Department . "', - '" . FormatDateForSQL($_SESSION['Request']->DispatchDate) . "', - '" . $_SESSION['Request']->Narrative . "' - )"; - $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The request header record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the request header record was used'); - $Result = DB_query($HeaderSQL,$db,$ErrMsg,$DbgMsg,true); - - foreach ($_SESSION['Request']->LineItems as $LineItems) { - $LineSQL="INSERT INTO stockrequestitems (dispatchitemsid, - dispatchid, - itemid, - quantity, - decimalplaces, - uom) - VALUES( - '".$LineItems->LineNumber."', - '".$RequestNo."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->DecimalPlaces."', - '".$LineItems->UOM."' - )"; - $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The request line record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the request header record was used'); - $Result = DB_query($LineSQL,$db,$ErrMsg,$DbgMsg,true); - - } - - } - DB_Txn_Commit($db); - prnMsg( _('The internal stock request has been entered and now needs to be authorised'), 'success'); - echo '<br /><div class="centre"><a href="'. $_SERVER['PHP_SELF'] . '?New=Yes">' . _('Create another request') . '</a></div>'; - include('includes/footer.inc'); - unset($_SESSION['Request']); - exit; -} - -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . $title . '</p>'; - -if (isset($_GET['Edit'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Edit the Request Line') . '</font></th></tr>'; - echo '<tr> - <td>' . _('Line number') . '</td> - <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->LineNumber . '</td> - </tr>'; - echo '<tr> - <td>' . _('Stock Code') . '</td> - <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->StockID . '</td> - </tr>'; - echo '<tr> - <td>' . _('Item Description') . '</td> - <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->ItemDescription . '</td> - </tr>'; - echo '<tr> - <td>' . _('Unit of Measure') . '</td> - <td>' . $_SESSION['Request']->LineItems[$_GET['Edit']]->UOM . '</td> - </tr>'; - echo '<tr> - <td>' . _('Quantity Requested') . '</td> - <td><input type="text" class="number" name="Quantity" value="' . locale_number_format($_SESSION['Request']->LineItems[$_GET['Edit']]->Quantity, $_SESSION['Request']->LineItems[$_GET['Edit']]->DecimalPlaces) . '" /></td> - </tr>'; - echo '<input type="hidden" name="LineNumber" value="' . $_SESSION['Request']->LineItems[$_GET['Edit']]->LineNumber . '" />'; - echo '</table><br />'; - echo '<div class="centre"><input type="submit" name="Edit" value="' . _('Update Line') . '" /></div></form>'; - include('includes/footer.inc'); - exit; -} - -echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -echo '<table class="selection">'; -echo '<tr><th colspan="2"><font color="navy" size="2">' . _('Internal Stock Request Details') . '</font></th></tr>'; -echo '<tr><td>' . _('Department') . ':</td>'; - -$sql="SELECT departmentid, - description - FROM departments - ORDER BY description"; - -$result=DB_query($sql, $db); -echo '<td><select name="Department">'; -echo '<option value="">' . _('Select your department') . '</option>'; -while ($myrow=DB_fetch_array($result)){ - if (isset($_SESSION['Request']->Department) and $_SESSION['Request']->Department==$myrow['departmentid']){ - echo '<option selected="True" value="' . $myrow['departmentid'] . '">' . $myrow['departmentid'].' - ' .htmlentities($myrow['description'], ENT_QUOTES,'UTF-8').'</option>'; - } else { - echo '<option value="' . $myrow['departmentid'] . '">' . $myrow['departmentid'].' - ' .htmlentities($myrow['description'], ENT_QUOTES,'UTF-8').'</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Location from which to request stock') . ':</td>'; -$sql="SELECT loccode, - locationname - FROM locations - ORDER BY locationname"; - -$result=DB_query($sql, $db); -echo '<td><select name="Location">'; -echo '<option value="">' . _('Select a Location') . '</option>'; -while ($myrow=DB_fetch_array($result)){ - if (isset($_SESSION['Request']->Location) and $_SESSION['Request']->Location==$myrow['loccode']){ - echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['loccode'].' - ' .htmlentities($myrow['locationname'], ENT_QUOTES,'UTF-8').'</option>'; - } else { - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'].' - ' .htmlentities($myrow['locationname'], ENT_QUOTES,'UTF-8').'</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Date when required') . ':</td>'; -echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DispatchDate" maxlength="10" size="11" value="' . $_SESSION['Request']->DispatchDate . '" /></td>'; - -echo '<tr><td>' . _('Narrative') . ':</td>'; -echo '<td><textarea name="Narrative" cols="30">'.$_SESSION['Request']->Narrative.'</textarea></td>'; - -echo '</table><br />'; - -echo '<div class="centre"><input type="submit" name="Update" value="' . _('Update') . '" /></div>'; - -echo '</div></form>'; - -if (!isset($_SESSION['Request']->Location)) { - include('includes/footer.inc'); - exit; -} - -//****************MUESTRO LA TABLA CON LOS REGISTROS DE LA TRANSFERENCIA************************************* -$i = 0; //Line Item Array pointer -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br /><table class="selection">'; -echo '<tr><th colspan="7"><font size="2" color="navy">' . _('Details of Items Requested') . '</font></th></tr>'; - -$tableheader = '<tr> - <th>'. _('Line Number') . '</th> - <th>'. _('Item Code') . '</th> - <th>'. _('Item Description'). '</th> - <th>'. _('Quantity Required'). '</th> - <th>'. _('UOM'). '</th> - </tr>'; -echo $tableheader; - -$k=0; - -foreach ($_SESSION['Request']->LineItems as $LineItems) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - echo '<td>' . $LineItems->LineNumber . '</td> - <td>' . $LineItems->StockID . '</td> - <td>' . $LineItems->ItemDescription . '</td> - <td class="number">' . locale_number_format($LineItems->Quantity, $LineItems->DecimalPlaces) . '</td> - <td>' . $LineItems->UOM . '</td> - <td><a href="'. $_SERVER['PHP_SELF'] . '?Edit='.$LineItems->LineNumber.'">' . _('Edit') . '</a></td> - <td><a href="'. $_SERVER['PHP_SELF'] . '?Delete='.$LineItems->LineNumber.'">' . _('Delete') . '</a></td> - </tr>'; - -} - -echo '</table><br />'; -echo '<div class="centre"><input type="submit" name="Submit" value="' . _('Submit') . '" /></div><br />'; - -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items'). '</p>'; -$SQL = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; -$result1 = DB_query($SQL, $db); -if (DB_num_rows($result1) == 0) { - echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; - echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; - exit; -} -echo '<table class="selection"><tr>'; -echo '<td>' . _('In Stock Category') . ':'; -echo '<select name="StockCat">'; -if (!isset($_POST['StockCat'])) { - $_POST['StockCat'] = ""; -} -if ($_POST['StockCat'] == 'All') { - echo '<option selected="True" value="All">' . _('All').'</option>'; -} else { - echo '<option value="All">' . _('All').'</option>'; -} -while ($myrow1 = DB_fetch_array($result1)) { - if ($myrow1['categoryid'] == $_POST['StockCat']) { - echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; - } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; - } -} -echo '</select></td>'; -echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; -if (isset($_POST['Keywords'])) { - echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; -} else { - echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; -} -echo '</td></tr><tr><td></td>'; -echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; -echo '<td>'; -if (isset($_POST['StockCode'])) { - echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; -} else { - echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; -} -echo '</td></tr></table><br />'; -echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br />'; -echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; -echo '</form>'; - - -if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ - - if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { - prnMsg ( _('Order Item description has been used in search'), 'warn' ); - } elseif ($_POST['StockCode']!='' AND $_POST['Keywords']=='') { - prnMsg ( _('Stock Code has been used in search'), 'warn' ); - } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { - prnMsg ( _('Stock Category has been used in search'), 'warn' ); - } - if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { - //insert wildcard characters in spaces - $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); - $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units as stockunits, - stockmaster.decimalplaces - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units as stockunits, - stockmaster.decimalplaces - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } elseif (mb_strlen($_POST['StockCode'])>0){ - - $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); - $SearchString = '%' . $_POST['StockCode'] . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units as stockunits, - stockmaster.decimalplaces - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units as stockunits, - stockmaster.decimalplaces - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } else { - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units as stockunits, - stockmaster.decimalplaces - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units as stockunits, - stockmaster.decimalplaces - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - } - - if (isset($_POST['Next'])) { - $Offset = $_POST['nextlist']; - } - if (isset($_POST['Prev'])) { - $Offset = $_POST['previous']; - } - if (!isset($Offset) or $Offset<0) { - $Offset=0; - } - $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.($_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'); - $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); - - if (DB_num_rows($SearchResult)==0 ){ - prnMsg (_('There are no products available meeting the criteria specified'),'info'); - } - if (DB_num_rows($SearchResult)<$_SESSION['DisplayRecordsMax']){ - $Offset=0; - } - -} //end of if search -/* display list if there is more than one record */ -if (isset($searchresult) AND !isset($_POST['Select'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $ListCount = DB_num_rows($searchresult); - if ($ListCount > 0) { - // If the user hit the search button and there is more than one item to show - $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); - if (isset($_POST['Next'])) { - if ($_POST['PageOffset'] < $ListPageMax) { - $_POST['PageOffset'] = $_POST['PageOffset'] + 1; - } - } - if (isset($_POST['Previous'])) { - if ($_POST['PageOffset'] > 1) { - $_POST['PageOffset'] = $_POST['PageOffset'] - 1; - } - } - if ($_POST['PageOffset'] > $ListPageMax) { - $_POST['PageOffset'] = $ListPageMax; - } - if ($ListPageMax > 1) { - echo '<div class="centre"><br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; - echo '<select name="PageOffset">'; - $ListPage = 1; - while ($ListPage <= $ListPageMax) { - if ($ListPage == $_POST['PageOffset']) { - echo '<option value=' . $ListPage . ' selected>' . $ListPage . '</option>'; - } else { - echo '<option value=' . $ListPage . '>' . $ListPage . '</option>'; - } - $ListPage++; - } - echo '</select> - <input type="submit" name="Go" value="' . _('Go') . '" /> - <input type="submit" name="Previous" value="' . _('Previous') . '" /> - <input type="submit" name="Next" value="' . _('Next') . '" />'; - echo '<input type="hidden" name=Keywords value="'.$_POST['Keywords'].'" />'; - echo '<input type="hidden" name=StockCat value="'.$_POST['StockCat'].'" />'; - echo '<input type="hidden" name=StockCode value="'.$_POST['StockCode'].'" />'; -// echo '<input type="hidden" name=Search value="Search" />'; - echo '<br /></div>'; - } - echo '<table cellpadding="2" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Total Qty On Hand') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Stock Status') . '</th> - </tr>'; - echo $tableheader; - $j = 1; - $k = 0; //row counter to determine background colour - $RowIndex = 0; - if (DB_num_rows($searchresult) <> 0) { - DB_data_seek($searchresult, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); - } - while (($myrow = DB_fetch_array($searchresult)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { - if ($k == 1) { - echo '<tr class="EvenTableRows">'; - $k = 0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - if ($myrow['mbflag'] == 'D') { - $qoh = _('N/A'); - } else { - $qoh = locale_number_format($myrow['qoh'], $myrow['decimalplaces']); - } - if ($myrow['discontinued']==1){ - $ItemStatus = '<font class="bad">' . _('Obsolete') . '</font>'; - } else { - $ItemStatus =''; - } - - echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> - <td>'.$myrow['description'].'</td> - <td class="number">' . $qoh . '</td> - <td>' . $myrow['units'] . '</td> - <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> - <td>' . $ItemStatus . '</td> - </tr>'; - $j++; - if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { - $j = 1; - echo $tableheader; - } - $RowIndex = $RowIndex + 1; - //end of page full new headings if - } - //end of while loop - echo '</table></form><br />'; - } -} -/* end display list if there is more than one record */ - -if (isset($SearchResult)) { - echo '<br />'; - echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; - echo '<br />'; - $j = 1; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" 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="'.($Offset-1).'" /> - <input tabindex="'.($j+8).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"> - <input type="hidden" name="order_items" value="1" /> - <input tabindex="'.($j+9).'" type="submit" value="'._('Add to Requisition').'" /></td>'; - echo '<td> - <input type="hidden" name="nextlist" value="'.($Offset+1).'" /> - <input tabindex="'.($j+10).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('On Demand') . '</th> - <th>' . _('On Order') . '</th> - <th>' . _('Available') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $TableHeader; - $ImageSource = _('No Image'); - - $k=0; //row colour counter - $i=0; - while ($myrow=DB_fetch_array($SearchResult)) { - $PriceSQL="SELECT currabrev, - price, - units as customerunits, - conversionfactor, - decimalplaces as pricedecimal - FROM prices - WHERE '".date('Y-m-d')."' between startdate and enddate"; - $PriceResult=DB_query($PriceSQL, $db); - if (DB_num_rows($PriceResult)==0) { - $PriceSQL="SELECT currabrev, - price, - units as customerunits, - conversionfactor, - decimalplaces as pricedecimal - FROM prices - WHERE stockid='".$myrow['stockid']."' - AND '".date('Y-m-d')."' between startdate and enddate"; - $PriceResult=DB_query($PriceSQL, $db); - } - $PriceRow=DB_fetch_array($PriceResult); - if (DB_num_rows($PriceResult)==0) { - $PriceRow['price']=0; - $PriceRow['customerunits']=$myrow['stockunits']; - $PriceRow['conversionfactor']=1; - $PriceRow['pricedecimal']=2; - } - if ($PriceRow['conversionfactor']=='') { - $PriceRow['conversionfactor']=1; - } - // Find the quantity in stock at location - if ($myrow['decimalplaces']=='') { - $DecimalPlacesSQL="SELECT decimalplaces - FROM stockmaster - WHERE stockid='" .$myrow['stockid'] . "'"; - $DecimalPlacesResult = DB_query($DecimalPlacesSQL, $db); - $DecimalPlacesRow = DB_fetch_array($DecimalPlacesResult); - $DecimalPlaces = $DecimalPlacesRow['decimalplaces']; - } else { - $DecimalPlaces=$myrow['decimalplaces']; - } - - $QOHSQL = "SELECT sum(locstock.quantity) AS qoh - FROM locstock - WHERE locstock.stockid='" .$myrow['stockid'] . "' AND - loccode = '" . $_SESSION['Request']->Location . "'"; - $QOHResult = DB_query($QOHSQL,$db); - $QOHRow = DB_fetch_array($QOHResult); - $QOH = $QOHRow['qoh']/$PriceRow['conversionfactor']; - - // Find the quantity on outstanding sales orders - $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*salesorderdetails.conversionfactor AS dem - FROM salesorderdetails, - salesorders - WHERE salesorders.orderno = salesorderdetails.orderno AND - salesorders.fromstkloc='" . $_SESSION['Request']->Location . "' AND - salesorderdetails.completed=0 AND - salesorders.quotation=0 AND - salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; - $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Request']->Location . ' ' . _('cannot be retrieved because'); - $DemandResult = DB_query($sql,$db,$ErrMsg); - - $DemandRow = DB_fetch_row($DemandResult); - if ($DemandRow[0] != null){ - $DemandQty = $DemandRow[0]/$PriceRow['conversionfactor']; - } else { - $DemandQty = 0; - } - - // Find the quantity on purchase orders - $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd)*purchorderdetails.conversionfactor AS dem - FROM purchorderdetails LEFT JOIN purchorders - ON purchorderdetails.orderno=purchorders.orderno - WHERE purchorderdetails.completed=0 - AND purchorders.status<>'Cancelled' - AND purchorders.status<>'Rejected' - AND purchorderdetails.itemcode='" . $myrow['stockid'] . "'"; - - $ErrMsg = _('The order details for this product cannot be retrieved because'); - $PurchResult = db_query($sql,$db,$ErrMsg); - - $PurchRow = db_fetch_row($PurchResult); - if ($PurchRow[0]!=null){ - $PurchQty = $PurchRow[0]/$PriceRow['conversionfactor']; - } else { - $PurchQty = 0; - } - - // Find the quantity on works orders - $sql = "SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) AS dedm - FROM woitems - WHERE stockid='" . $myrow['stockid'] ."'"; - $ErrMsg = _('The order details for this product cannot be retrieved because'); - $WoResult = db_query($sql,$db,$ErrMsg); - - $WoRow = db_fetch_row($WoResult); - if ($WoRow[0]!=null){ - $WoQty = $WoRow[0]; - } else { - $WoQty = 0; - } - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - $OnOrder = $PurchQty + $WoQty; - $Available = $QOH - $DemandQty + $OnOrder; - if ($PriceRow['customerunits']=='') { - $myrow['units']=$myrow['stockunits']; - } else { - $myrow['units']=$PriceRow['customerunits']; - } - echo '<td>'.$myrow['stockid'].'</font></td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['units'].'</td> - <td class="number">'.locale_number_format($QOH,$DecimalPlaces).'</td> - <td class="number">'.locale_number_format($DemandQty,$DecimalPlaces).'</td> - <td class="number">'.locale_number_format($OnOrder, $DecimalPlaces).'</td> - <td class="number">'.locale_number_format($Available,$DecimalPlaces).'</td> - <td><font size="1"><input class="number" tabindex="'.($j+7).'" type="text" size="6" name="Quantity'.$i.'" value="0" /> - <input type="hidden" name="StockID'.$i.'" value="'.$myrow['stockid'].'" /> - </td> - </tr>'; - echo '<input type="hidden" name="DecimalPlaces'.$i.'" value="' . $myrow['decimalplaces'] . '" />'; - echo '<input type="hidden" name="ItemDescription'.$i.'" value="' . $myrow['description'] . '" />'; - echo '<input type="hidden" name="ConversionFactor'.$i.'" value="' . $PriceRow['conversionfactor'] . '" />'; - echo '<input type="hidden" name="Units'.$i.'" value="' . $myrow['units'] . '" />'; - if ($j==1) { - $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; - } - $i++; -#end of page full new headings if - } -#end of while loop - echo '<tr><td><input type="hidden" name="previous" value="'.($Offset-1).'" /> - <input tabindex="'.($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"><input type="hidden" name="order_items" value="1" /> - <input tabindex="'.($j+8).'" type="submit" value="'._('Add to Requisition').'" /></td>'; - echo '<td><input type="hidden" name="nextlist" value="'.($Offset+1).'" /> - <input tabindex="'.($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td><tr/>'; - echo '</table></form>'; - echo $jsCall; - -}#end if SearchResults to show - -//********************************************************************************************************* -include('includes/footer.inc'); -?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-13 18:15:01
|
Revision: 8284 http://weberp.svn.sourceforge.net/weberp/?rev=8284&view=rev Author: tim_schofield Date: 2011-10-13 18:14:55 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Add new script to index.php Modified Paths: -------------- trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/sql/mysql/updates/98.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-13 17:54:01 UTC (rev 8283) +++ trunk/includes/session.inc 2011-10-13 18:14:55 UTC (rev 8284) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=97; +$DBVersion=98; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-10-13 17:54:01 UTC (rev 8283) +++ trunk/index.php 2011-10-13 18:14:55 UTC (rev 8284) @@ -193,7 +193,8 @@ _('Inventory Location Transfers'), _('Inventory Adjustments'), _('Reverse Goods Received'), - _('Enter Stock Counts') + _('Enter Stock Counts'), + _('Create a New Internal Stock Request') ); $MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', '/StockLocTransfer.php', @@ -201,7 +202,8 @@ '/StockTransfers.php?New=Yes', '/StockAdjustments.php?NewAdjustment=Yes', '/ReverseGRN.php', - '/StockCounts.php' + '/StockCounts.php', + '/InternalStockRequest.php?New=Yes' ); $MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), Added: trunk/sql/mysql/updates/98.php =================================================================== --- trunk/sql/mysql/updates/98.php (rev 0) +++ trunk/sql/mysql/updates/98.php 2011-10-13 18:14:55 UTC (rev 8284) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +UpdateField('pagesecurity', 'script', 'InternalStockRequest.php', 'script=\'StockTransfers_departments.php\'', $db); + +UpdateDBNo(98, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |