From: <dai...@us...> - 2011-10-29 09:52:00
|
Revision: 4736 http://web-erp.svn.sourceforge.net/web-erp/?rev=4736&view=rev Author: daintree Date: 2011-10-29 09:51:53 +0000 (Sat, 29 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/PO_PDFPurchOrder.php trunk/doc/Change.log trunk/doc/Manual/ManualContributors.html trunk/includes/Contract_Readin.php trunk/includes/DefineContractClass.php Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/ContractCosting.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -29,6 +29,7 @@ $sql = "SELECT stockmoves.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, SUM(stockmoves.qty) AS quantity, SUM(stockmoves.qty*stockmoves.standardcost) AS totalcost FROM stockmoves INNER JOIN stockmaster @@ -37,7 +38,8 @@ AND stockmoves.reference='" . $_SESSION['Contract'.$identifier]->WO . "' GROUP BY stockmoves.stockid, stockmaster.description, - stockmaster.units"; + stockmaster.units, + stockmaster.decimalplaces"; $ErrMsg = _('Could not get the inventory issues for this contract because'); $InventoryIssuesResult = DB_query($sql,$db,$ErrMsg); $InventoryIssues = array(); @@ -47,7 +49,9 @@ $InventoryIssues[$InventoryIssuesRow['stockid']]->Quantity = $InventoryIssuesRow['quantity']; $InventoryIssues[$InventoryIssuesRow['stockid']]->TotalCost = $InventoryIssuesRow['totalcost']; $InventoryIssues[$InventoryIssuesRow['stockid']]->Units = $InventoryIssuesRow['units']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->DecimalPlaces = $InventoryIssuesRow['decimalplaces']; $InventoryIssues[$InventoryIssuesRow['stockid']]->Matched = 0; + } echo '<p class="page_title_text"> @@ -92,7 +96,7 @@ echo '<tr> <td>' . $Component->StockID . '</td> <td>' . $Component->ItemDescription . '</td> - <td class="number">' . $Component->Quantity . '</td> + <td class="number">' . locale_number_format($Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->UOM . '</td> <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; @@ -102,7 +106,7 @@ if (isset($InventoryIssues[$Component->StockID])){ $InventoryIssues[$Component->StockID]->Matched=1; echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> - <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> + <td class="number">' . locale_number_format(-$InventoryIssues[$Component->StockID]->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -120,7 +124,7 @@ <td colspan="6"></td> <td>' . $Component->StockID . '</td> <td>' . $Component->Description . '</td> - <td class="number">' . -$Component->Quantity . '</td> + <td class="number">' . locale_number_format(-$Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->Units . '</td> <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -152,13 +156,13 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) { echo '<tr><td>' . $Requirement->Requirement . '</td> - <td class="number">' . $Requirement->Quantity . '</td> - <td class="number">' . $Requirement->CostPerUnit . '</td> + <td class="number">' . locale_number_format($Requirement->Quantity,'Variable') . '</td> + <td class="number">' . locale_number_format($Requirement->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -428,10 +432,13 @@ if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; - echo '</form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /> + </div> + </form>'; } include('includes/footer.inc'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/ContractOtherReqts.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -88,10 +88,10 @@ } echo '<tr> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Sub-total') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Sub-total') . '</th> </tr>'; $_SESSION['Contract'.$identifier]->total = 0; @@ -111,17 +111,25 @@ } echo '<td><textarea name="Requirement' . $ContractReqtID . '" cols="30" rows="3">' . $ContractComponent->Requirement . '</textarea></td> - <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> - <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,'Variable') . '" /></td> + <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractReqtID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this contract requirement?') . '\');">' . _('Delete') . '</a></td> + </tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); - echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; - echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; + $DisplayTotal = locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']); + echo '<tr> + <td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" /> + <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /> + </div>'; } /*Only display the contract other requirements lines if there are any !! */ @@ -133,17 +141,30 @@ $_POST['CostPerUnit']=0; } echo '<table class="selection"> - <tr><th colspan="2">' . _('Enter New Requirements') . '</th></tr> - <tr><td>' . _('Requirement Description') . '</td> - <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td></tr>'; -echo '<tr><td>' . _('Quantity Required') . ':</td> - <td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td></tr>'; -echo '<tr><td>' . _('Cost Per Unit') . ':</td> - <td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td></tr>'; -echo '</table>'; - -echo '<br /><div class="centre"><input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /></div>'; - -echo '</form>'; + <tr> + <th colspan="2">' . _('Enter New Requirements') . '</th> + </tr> + <tr> + <td>' . _('Requirement Description') . '</td> + <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td> + </tr> + <tr> + <td>' . _('Quantity Required') . ':</td> + <td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td> + </tr> + <tr> + <td>' . _('Cost Per Unit') . ':</td> + <td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td> + </tr> + + </table> + + <br /> + <div class="centre"> + <input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /> + </div> + + </form>'; + include('includes/footer.inc'); ?> Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/Contracts.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -65,9 +65,9 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_format($_POST['Margin']); $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_format($_POST['ExRate']); /*User hit the button to enter line items - @@ -254,10 +254,10 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_format($_POST['Margin']); $_SESSION['Contract'.$identifier]->Status = $_POST['Status']; $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_format($_POST['ExRate']); /*Get the first work centre for the users location - until we set this up properly */ $result = DB_query("SELECT code FROM workcentres WHERE location='" . $_SESSION['Contract'.$identifier]->LocCode ."'",$db); @@ -305,9 +305,9 @@ $sql = "UPDATE contracts SET categoryid = '" . $_POST['CategoryID'] ."', requireddate = '" . FormatDateForSQL($_POST['RequiredDate']) . "', loccode='" . $_POST['LocCode'] . "', - margin = '" . $_POST['Margin'] . "', + margin = '" . filter_number_format($_POST['Margin']) . "', customerref = '" . $_POST['CustomerRef'] . "', - exrate = '" . $_POST['ExRate'] . "' + exrate = '" . filter_number_format($_POST['ExRate']) . "' WHERE contractref ='" . $_POST['ContractRef'] . "'"; $ErrMsg = _('Cannot update the contract because'); $result = DB_query($sql,$db,$ErrMsg); @@ -404,9 +404,9 @@ '" . $_POST['CategoryID'] . "', '" . $_POST['LocCode'] . "', '" . FormatDateForSQL($_POST['RequiredDate']) . "', - '" . $_POST['Margin'] . "', + '" . filter_number_format($_POST['Margin']) . "', '" . $_POST['CustomerRef'] . "', - '". $_POST['ExRate'] ."')"; + '". filter_number_format($_POST['ExRate']) ."')"; $ErrMsg = _('The new contract could not be added because'); $result = DB_query($sql,$db,$ErrMsg); @@ -895,13 +895,15 @@ $_SESSION['Contract'.$identifier]->Margin =50; } echo '<tr><td>' . _('Gross Profit') . ' %:</td> - <td><input type="text" name="Margin" size="4" maxlength="4" value="' . $_SESSION['Contract'.$identifier]->Margin . '" /></td></tr>'; + <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td></tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ - echo '<tr><td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> - <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" /></td></tr>'; + echo '<tr> + <td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> + <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" /></td> + </tr>'; } else { - echo '<input type="hidden" name="ExRate" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" />'; + echo '<input type="hidden" name="ExRate" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" />'; } echo '<tr><td>' . _('Contract Status') . ':</td><td>'; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/PO_PDFPurchOrder.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -127,7 +127,7 @@ if ($POHeader['status'] != 'Authorised' AND $POHeader['status'] != 'Printed') { include('includes/header.inc'); - prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($OrderStatus),'warn'); + prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($POHeader['status']),'warn'); include('includes/footer.inc'); exit; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/doc/Change.log 2011-10-29 09:51:53 UTC (rev 4736) @@ -9,7 +9,7 @@ 22/9/11 Exson: fixed the bug in GLAccountReport.php for typename from the right table (systypes) in SQL and change locale_number_format for multinational. 17/9/11 Phil: Added WindowsLocale element to LanguagesArray.php and modified UserSettings.php and WWW_Users.php to use the new array definition. Also modified includes/LanguageSetup.php to use the windows locale string in the LanguagesArray as required for proper setting of the locale under windows. 17/9/11 Felix Lim: added serialised field into PrintCustTransPortrait.php to reinstate possiblity for printing serialised items on invoice - not possible in landscape version (PrintCustTrans.php) -12/9/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale +12/9/11-31/10/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed 4/9/11 Phil: Removed the stock code from form entities in SelectOrderItems.php and PO_Items.php to prevent issues with some characters in stock codes as suggested by Tim Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/doc/Manual/ManualContributors.html 2011-10-29 09:51:53 UTC (rev 4736) @@ -41,6 +41,8 @@ <br /><br /> Richard Heyes (html.mime.mail) <br /><br /> +High-Tech Bridge SA Security Research Lab +<br /><br /> Hindra Joshua <br /><br /> Alan Jones @@ -57,6 +59,8 @@ <br /><br /> Ditesh Kumar <br /><br /> +Felix Lim +<br /><br /> David Luo <br /><br /> Wayne McDougall @@ -103,6 +107,8 @@ <br /><br /> Jurgen Schopenhouer <br /><br /> +Fred Schuettler (aguapop - theme) +<br /><br /> Danilo Segan (php-gettext) <br /><br /> Gjergj Sheldija @@ -111,6 +117,8 @@ <br /><br /> Vitaliy Shevkunov <br /><br /> +Marcos Skambraks +<br /><br /> Jake Stride <br /><br /> Matt Taylor Modified: trunk/includes/Contract_Readin.php =================================================================== --- trunk/includes/Contract_Readin.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/includes/Contract_Readin.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -3,28 +3,28 @@ /*Contract_Readin.php is used by the modify existing Contract in Contracts.php and also by ContractCosting.php */ $ContractHeaderSQL = "SELECT contractdescription, - contracts.debtorno, - contracts.branchcode, - contracts.loccode, - status, - categoryid, - orderno, - margin, - wo, - requireddate, - drawing, - exrate, - debtorsmaster.name, - custbranch.brname, - debtorsmaster.currcode - FROM contracts INNER JOIN debtorsmaster - ON contracts.debtorno=debtorsmaster.debtorno - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - AND contracts.branchcode=custbranch.branchcode - WHERE contractref= '" . $ContractRef . "'"; + contracts.debtorno, + contracts.branchcode, + contracts.loccode, + status, + categoryid, + orderno, + margin, + wo, + requireddate, + drawing, + exrate, + debtorsmaster.name, + custbranch.brname, + debtorsmaster.currcode + FROM contracts INNER JOIN debtorsmaster + ON contracts.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + AND contracts.branchcode=custbranch.branchcode + WHERE contractref= '" . $ContractRef . "'"; $ErrMsg = _('The contract cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used and failed was'); @@ -55,14 +55,15 @@ /*now populate the contract BOM array with the items required for the contract */ $ContractBOMsql = "SELECT contractbom.stockid, - stockmaster.description, - contractbom.workcentreadded, - contractbom.quantity, - stockmaster.units, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost - FROM contractbom INNER JOIN stockmaster - ON contractbom.stockid=stockmaster.stockid - WHERE contractref ='" . $ContractRef . "'"; + stockmaster.description, + contractbom.workcentreadded, + contractbom.quantity, + stockmaster.units, + stockmaster.decimalplaces, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost + FROM contractbom INNER JOIN stockmaster + ON contractbom.stockid=stockmaster.stockid + WHERE contractref ='" . $ContractRef . "'"; $ErrMsg = _('The bill of material cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the contract bill of material was'); @@ -75,17 +76,18 @@ $myrow['workcentreadded'], $myrow['quantity'], $myrow['cost'], - $myrow['units']); + $myrow['units'], + $myrow['decimalplaces']); } /* add contract bill of materials BOM lines*/ } //end is there was a contract BOM to add //Now add the contract requirments $ContractReqtsSQL = "SELECT requirement, - quantity, - costperunit, - contractreqid - FROM contractreqts - WHERE contractref ='" . $ContractRef . "' - ORDER BY contractreqid"; + quantity, + costperunit, + contractreqid + FROM contractreqts + WHERE contractref ='" . $ContractRef . "' + ORDER BY contractreqid"; $ErrMsg = _('The other contract requirementscannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the other contract requirments was'); Modified: trunk/includes/DefineContractClass.php =================================================================== --- trunk/includes/DefineContractClass.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/includes/DefineContractClass.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -38,20 +38,22 @@ } function Add_To_ContractBOM($StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM){ + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces){ if (isset($StockID) AND $Quantity!=0){ $this->ContractBOM[$this->BOMComponentCounter] = new ContractComponent($this->BOMComponentCounter, - $StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM); + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces); $this->BOMComponentCounter++; Return 1; } @@ -70,7 +72,11 @@ /*Requirments Methods */ -function Add_To_ContractRequirements($Requirement, $Quantity, $CostPerUnit,$ContractReqID=0){ +function Add_To_ContractRequirements($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0){ + if (isset($Requirement) AND $Quantity!=0 AND $CostPerUnit!=0){ $this->ContractReqts[$this->RequirementsCounter] = new ContractRequirement($Requirement, $Quantity, $CostPerUnit,$ContractReqID); $this->RequirementsCounter++; @@ -95,15 +101,17 @@ var $Quantity; var $ItemCost; var $UOM; + var $DecimalPlaces; function ContractComponent ($ComponentID, - $StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM){ - + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0){ + /* Constructor function to add a new Contract Component object with passed params */ $this->ComponentID = $ComponentID; $this->StockID = $StockID; @@ -112,6 +120,7 @@ $this->Quantity = $Quantity; $this->ItemCost= $ItemCost; $this->UOM = $UOM; + $this->DecimalPlaces = $DecimalPlaces; } } @@ -123,9 +132,9 @@ var $CostPerUnit; function ContractRequirement ($Requirement, - $Quantity, - $CostPerUnit, - $ContractReqID=0){ + $Quantity, + $CostPerUnit, + $ContractReqID=0){ /* Constructor function to add a new Contract Component object with passed params */ $this->Requirement = $Requirement; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |