From: <dai...@us...> - 2011-09-09 03:39:14
|
Revision: 4682 http://web-erp.svn.sourceforge.net/web-erp/?rev=4682&view=rev Author: daintree Date: 2011-09-09 03:39:04 +0000 (Fri, 09 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/EmailConfirmation.php trunk/FTP_RadioBeacon.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/OffersReceived.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/Prices.php trunk/PricesByCost.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/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesInquiry.php trunk/SalesTopItemsInquiry.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/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/doc/Change.log trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php trunk/includes/Login.php trunk/includes/MiscFunctions.php trunk/includes/OutputSerialItems.php trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/phplot/phplot.php trunk/includes/session.inc trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/AgedDebtors.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/AgedSuppliers.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = locale_number_format($DetailTrans['balance'],2); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,2); - $DisplayTotDue = number_format($TotDue,2); - $DisplayTotCurrent = number_format($TotCurr,2); - $DisplayTotOverdue1 = number_format($TotOD1,2); - $DisplayTotOverdue2 = number_format($TotOD2,2); + $DisplayTotBalance = locale_number_format($TotBal,2); + $DisplayTotDue = locale_number_format($TotDue,2); + $DisplayTotCurrent = locale_number_format($TotCurr,2); + $DisplayTotOverdue1 = locale_number_format($TotOD1,2); + $DisplayTotOverdue2 = locale_number_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMExtendedQty.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -216,15 +216,15 @@ $pdf->addTextWrap($Left_Margin+1,$YPos,90,$FontSize,$myrow['component'],'',0,$fill); $pdf->addTextWrap(140,$YPos,30,$FontSize,$myrow['mbflag'],'',0,$fill); $pdf->addTextWrap(170,$YPos,140,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(310,$YPos,50,$FontSize,number_format($myrow['quantity'], + $pdf->addTextWrap(310,$YPos,50,$FontSize,locale_number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(360,$YPos,40,$FontSize,number_format($myrow['qoh'], + $pdf->addTextWrap(360,$YPos,40,$FontSize,locale_number_format($myrow['qoh'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,40,$FontSize,number_format($myrow['poqty'], + $pdf->addTextWrap(400,$YPos,40,$FontSize,locale_number_format($myrow['poqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], + $pdf->addTextWrap(440,$YPos,40,$FontSize,locale_number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,locale_number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMIndented.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -208,7 +208,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMIndentedReverse.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -197,7 +197,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMInquiry.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -116,7 +116,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K'){ $StockOnHand = 'N/A'; } else { - $StockOnHand = number_format($myrow['totalonhand'],2); + $StockOnHand = locale_number_format($myrow['totalonhand'],2); } $tabindex=$j+4; printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> @@ -207,7 +207,7 @@ </tr>', $ComponentLink, $myrow['description'], - number_format($myrow['quantity'],$myrow['decimalplaces']), + locale_number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['standardcost'], $myrow['componentcost']); @@ -219,14 +219,14 @@ $TotalCost += $ParentLabourCost; echo '<tr> <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class=number><b>' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr>'; echo '</table>'; Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMListing.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -83,7 +83,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,80,$FontSize,$BOMList['component'],'left'); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$BOMList['compdescription'],'left'); - $DisplayQuantity = number_format($BOMList['quantity'],$BOMList['decimalplaces']); + $DisplayQuantity = locale_number_format($BOMList['quantity'],$BOMList['decimalplaces']); $LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_frm']),'left'); $LeftOvers = $pdf->addTextWrap(370,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); $LeftOvers = $pdf->addTextWrap(420,$YPos,20,$FontSize,$BOMList['loccode'],'left'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMs.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -129,7 +129,7 @@ if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = number_format($myrow[10],$myrow[11]); + $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> <td>%s</td> @@ -834,7 +834,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ $StockOnHand = _('N/A'); } else { - $StockOnHand = number_format($myrow['totalonhand'],2); + $StockOnHand = locale_number_format($myrow['totalonhand'],2); } $tab = $j+3; printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BankMatching.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -257,8 +257,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), + locale_number_format($myrow['amt'],2), + locale_number_format($Outstanding,2), _('Unclear'), $i, $i, @@ -283,8 +283,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), + locale_number_format($myrow['amt'],2), + locale_number_format($Outstanding,2), $i, $i, $myrow['banktransid'], Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BankReconciliation.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -86,7 +86,7 @@ $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -171,7 +171,7 @@ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -229,8 +229,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - number_format($myrow['amt'],$CurrDecimalPlaces), - number_format($myrow['outstanding'],$CurrDecimalPlaces)); + locale_number_format($myrow['amt'],$CurrDecimalPlaces), + locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -242,7 +242,7 @@ } //end of while loop echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -301,8 +301,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - number_format($myrow['amt'],$CurrDecimalPlaces), - number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + locale_number_format($myrow['amt'],$CurrDecimalPlaces), + locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,13 +316,13 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> </tr>'; $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -55,7 +55,7 @@ echo '<br /><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; -echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; +echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. locale_number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ $StockID = $LineItem->StockID; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -304,9 +304,9 @@ echo '<td>'.$LnItm->StockID.'</td> <td>'.$LnItm->ItemDescription.'</td> - <td class="number">' . number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>'.$LnItm->Units.'</td> - <td class="number">' . number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; + <td class="number">' . locale_number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; if ($LnItm->Controlled==1){ @@ -322,9 +322,9 @@ echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; } } - $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; + $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractBOM.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = locale_number_format($LineTotal,2); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -267,7 +267,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,2); echo '<tr> <td colspan="6" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractCosting.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -94,8 +94,8 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</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>'; $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); @@ -104,8 +104,8 @@ echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> - <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</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> </tr>'; } else { echo '<td colspan="6"></td> @@ -122,17 +122,17 @@ <td>' . $Component->Description . '</td> <td class="number">' . -$Component->Quantity . '</td> <td>' . $Component->Units . '</td> - <td class="number">' . number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</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> </tr>'; } //end if its a component not originally budget for } echo '<tr> <td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td> - <td class="number">' . number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td> - <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; echo '<tr> @@ -154,11 +154,11 @@ echo '<tr><td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_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>' . 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,2) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -197,17 +197,17 @@ <td>' . $OtherChargesRow['suppreference'] . '</td> <td>' .ConvertSQLDate($OtherChargesRow['trandate']) . '</td> <td>' . $OtherChargesRow['narrative'] . '</td> - <td class="number">' . number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . $Anticipated . '</td> </tr>'; $OtherReqtsActual +=$OtherChargesRow['amount']; } -echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> +echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td></tr>'; echo '<tr><td colspan="5"><b>' . _('Total Budget Contract Cost') . '</b></td> - <td class="number"><b>' . number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . locale_number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> <td colspan="5"><b>' . _('Total Actual Contract Cost') . '</b></td> - <td class="number"><b>' . number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . locale_number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '</table>'; @@ -378,7 +378,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['stockact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . ($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); @@ -398,7 +398,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['wipact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . -($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractOtherReqts.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -100,7 +100,7 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractReqtID => $ContractComponent) { $LineTotal = $ContractComponent->Quantity * $ContractComponent->CostPerUnit; - $DisplayLineTotal = number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -118,7 +118,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $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>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/Contracts.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -946,14 +946,14 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,2) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> @@ -979,11 +979,11 @@ <td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } @@ -991,9 +991,9 @@ echo '<br />'; echo'<table class="selection"> <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th>' . _('Contract Price') . '</th> - <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> </table>'; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/CounterSales.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -1,2339 +1,2343 @@ -<?php -/* $Id: CounterSales.php 4469 2011-01-15 02:28:37Z daintree $*/ - -include('includes/DefineCartClass.php'); - -/* Session started in session.inc for password checking and authorisation level check -config.php is in turn included in session.inc $PageSecurity now comes from session.inc (and gets read in by GetConfig.php*/ - -include('includes/session.inc'); - -$title = _('Counter Sales'); - -include('includes/header.inc'); -include('includes/GetPrice.inc'); -include('includes/SQL_CommonFunctions.inc'); -include('includes/GetSalesTransGLCodes.inc'); - -if (empty($_GET['identifier'])) { - $identifier=date('U'); -} else { - $identifier=$_GET['identifier']; -} -if (isset($_SESSION['Items'.$identifier]) AND isset($_POST['CustRef'])){ - //update the Items object variable with the data posted from the form - $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; - $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; - $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; - $_SESSION['Items'.$identifier]->Email = $_POST['Email']; -} - -if (isset($_POST['QuickEntry'])){ - unset($_POST['PartSearch']); -} - -if (isset($_POST['OrderItems'])){ - foreach ($_POST as $key => $value) { - if (mb_strstr($key,'itm')) { - $NewItemArray[mb_substr($key,3)] = trim($value); - } - } -} - -if (isset($_GET['NewItem'])){ - $NewItem = trim($_GET['NewItem']); -} - -if (isset($_GET['NewOrder'])){ - /*New order entry - clear any existing order details from the Items object and initiate a newy*/ - if (isset($_SESSION['Items'.$identifier])){ - unset ($_SESSION['Items'.$identifier]->LineItems); - $_SESSION['Items'.$identifier]->ItemsOrdered=0; - unset ($_SESSION['Items'.$identifier]); - } -} - - -if (!isset($_SESSION['Items'.$identifier])){ - /* It must be a new order being created $_SESSION['Items'.$identifier] would be set up from the order - modification code above if a modification to an existing order. Also $ExistingOrder would be - set to 1. The delivery check screen is where the details of the order are either updated or - inserted depending on the value of ExistingOrder */ - - $_SESSION['ExistingOrder'] = 0; - $_SESSION['Items'.$identifier] = new cart; - $_SESSION['PrintedPackingSlip'] = 0; /*Of course 'cos the order ain't even started !!*/ - /*Get the default customer-branch combo from the user's default location record */ - $sql = "SELECT cashsalecustomer, - cashsalebranch, - locationname, - taxprovinceid - FROM locations - WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; - $result = DB_query($sql,$db); - if (DB_num_rows($result)==0) { - prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); - include('includes/footer.inc'); - exit; - } else { - $myrow = DB_fetch_array($result); //get the only row returned - - if ($myrow['cashsalecustomer']=='' OR $myrow['cashsalebranch']==''){ - prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code and a valid branch code of the customer entered.'),'error'); - include('includes/footer.inc'); - exit; - } - if (isset($_GET['DebtorNo'])) { - $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo']; - $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; - } else { - $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; - $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; - } - - $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; - $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; - $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; - - // Now check to ensure this account exists and set defaults */ - $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms, - currencies.decimalplaces - FROM debtorsmaster INNER JOIN holdreasons - ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN salestypes - ON debtorsmaster.salestype=salestypes.typeabbrev - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; - // echo $sql; - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - $myrow = DB_fetch_array($result); - if ($myrow['dissallowinvoices'] != 1){ - if ($myrow['dissallowinvoices']==2){ - prnMsg($myrow['name'] . ' ' . _('Although this account is defined as the cash sale account for the location. The account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); - } - - $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; - // the sales type is the price list to be used for this sale - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; - $_SESSION['Items'.$identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; - /* now get the branch defaults from the customer branches table CustBranch. */ - - $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays, - custbranch.salesman, - custbranch.taxgroupid, - custbranch.defaultshipvia - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - if (DB_num_rows($result)==0){ - - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); - - if ($debug==1){ - echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; - } - include('includes/footer.inc'); - exit; - } - // add echo - echo '<br />'; - $myrow = DB_fetch_array($result); - - $_SESSION['Items'.$identifier]->DeliverTo = ''; - $_SESSION['Items'.$identifier]->DelAdd1 = $myrow['braddress1']; - $_SESSION['Items'.$identifier]->ShipVia = $myrow['defaultshipvia']; - $_SESSION['Items'.$identifier]->DeliverBlind = $myrow['deliverblind']; - $_SESSION['Items'.$identifier]->SpecialInstructions = $myrow['specialinstructions']; - $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; - $_SESSION['Items'.$identifier]->TaxGroup = $myrow['taxgroupid']; - - if ($_SESSION['Items'.$identifier]->SpecialInstructions) { - prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); - } - - if ($_SESSION['CheckCreditLimits'] > 0) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ - $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); - - if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ - prnMsg(_('The') . ' ' . $myrow['brname'] . ' ' . _('account is currently at or over their credit limit'),'warn'); - } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ - prnMsg(_('No more orders can be placed by') . ' ' . $myrow[0] . ' ' . _(' their account is currently at or over their credit limit'),'warn'); - include('includes/footer.inc'); - exit; - } - } - - } else { - prnMsg($myrow['brname'] . ' ' . _('Although the account is defined as the cash sale account for the location the account is currently on hold. Please contact the credit control personnel to discuss'),'warn'); - } - - } -} // end if its a new sale to be set up ... - -if (isset($_POST['CancelOrder'])) { - - - unset($_SESSION['Items'.$identifier]->LineItems); - $_SESSION['Items'.$identifier]->ItemsOrdered = 0; - unset($_SESSION['Items'.$identifier]); - $_SESSION['Items'.$identifier] = new cart; - - echo '<br /><br />'; - prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; - include('includes/footer.inc'); - exit; - -} else { /*Not cancelling the order */ - - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('Counter Sale') . ' ' ._('from') . ' ' . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('inventory') . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; - echo '</p>'; -} - -if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ - - if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { - $msg='<div class="page_help_text">' . _('Item description has been used in search') . '.</div>'; - } else if ($_POST['StockCode']!='' AND $_POST['Keywords']=='') { - $msg='<div class="page_help_text">' . _('Item Code has been used in search') . '.</div>'; - } else if ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { - $msg='<div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; - } - 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 - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } else if (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 - 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.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - 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.controlled <> 1 - 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 - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - 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 '.number_format($_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)==1){ - $myrow=DB_fetch_array($SearchResult); - $NewItem = $myrow['stockid']; - DB_data_seek($SearchResult,0); - } - if (DB_num_rows($SearchResult)< $_SESSION['DisplayRecordsMax']){ - $Offset=0; - } - -} //end of if search - - -/* Always do the stuff below */ - -echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -//Get The exchange rate used for GPPercent calculations on adding or amending items -if ($_SESSION['Items'.$identifier]->DefaultCurrency != $_SESSION['CompanyRecord']['currencydefault']){ - $ExRateResult = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['Items'.$identifier]->DefaultCurrency . "'",$db); - if (DB_num_rows($ExRateResult)>0){ - $ExRateRow = DB_fetch_row($ExRateResult); - $ExRate = $ExRateRow[0]; - } else { - $ExRate =1; - } -} else { - $ExRate = 1; -} - -/*Process Quick Entry */ -/* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['OrderItems']) - OR isset($_POST['QuickEntry']) - OR isset($_POST['Recalculate'])){ - - /* get the item details from the database and hold them in the cart object */ - - /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ - $Discount = 0; - - $i=1; - while ($i<=$_SESSION['QuickEntries'] - AND isset($_POST['part_' . $i]) - AND $_POST['part_' . $i]!='') { - - $QuickEntryCode = 'part_' . $i; - $QuickEntryQty = 'qty_' . $i; - $QuickEntryPOLine = 'poline_' . $i; - $QuickEntryItemDue = 'ItemDue_' . $i; - - $i++; - - if (isset($_POST[$QuickEntryCode])) { - $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); - } - if (isset($_POST[$QuickEntryQty])) { - $NewItemQty = $_POST[$QuickEntryQty]; - } - if (isset($_POST[$QuickEntryItemDue])) { - $NewItemDue = $_POST[$QuickEntryItemDue]; - } else { - $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); - } - if (isset($_POST[$QuickEntryPOLine])) { - $NewPOLine = $_POST[$QuickEntryPOLine]; - } else { - $NewPOLine = 0; - } - - if (!isset($NewItem)){ - unset($NewItem); - break; /* break out of the loop if nothing in the quick entry fields*/ - } - - if(!Is_Date($NewItemDue)) { - prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); - //Attempt to default the due date to something sensible? - $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); - } - /*Now figure out if the item is a kit set - the field MBFlag='K'*/ - $sql = "SELECT stockmaster.mbflag, - stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; - - $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); - $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); - $KitResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - - - if (DB_num_rows($KitResult)==0){ - prnMsg( _('The item code') . ' ' . $NewItem . ' ' . _('could not be retrieved from the databas... [truncated message content] |