From: <dai...@us...> - 2011-07-02 23:05:11
|
Revision: 4618 http://web-erp.svn.sourceforge.net/web-erp/?rev=4618&view=rev Author: daintree Date: 2011-07-02 23:04:59 +0000 (Sat, 02 Jul 2011) Log Message: ----------- <br> replaced with <br /> Modified Paths: -------------- trunk/Areas.php trunk/BankMatching.php trunk/CustomerBranches.php trunk/CustomerReceipt.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/EDIMessageFormat.php trunk/EDIProcessOrders.php trunk/EmailConfirmation.php trunk/EmailCustTrans.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/FormDesigner.php trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLAccounts.php trunk/GLBalanceSheet.php trunk/GLTagProfit_Loss.php trunk/GLTrialBalance.php trunk/GeocodeSetup.php trunk/GetStockImage.php trunk/GoodsReceivedControlled.php trunk/InventoryPlanningPrefSupplier.php trunk/Labels.php trunk/Locations.php trunk/MRPCalendar.php trunk/MRPDemandTypes.php trunk/MRPPlannedPurchaseOrders.php trunk/MailInventoryValuation.php trunk/Numbers/Words/lang.cs.php trunk/Numbers/Words/lang.lt.php trunk/OrderDetails.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFPeriodStockTransListing.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Chk_ShiptRef_JobRef.php trunk/PO_OrderDetails.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/PaymentTerms.php trunk/PcExpenses.php trunk/PcTabs.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCustOrder.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/SMTPServer.php trunk/SalesAnalReptCols.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesGraph.php trunk/SalesPeople.php trunk/SalesTopItemsInquiry.php trunk/SalesTypes.php trunk/SelectAsset.php trunk/SelectCreditItems.php trunk/SelectGLAccount.php trunk/SelectSalesOrder.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php trunk/StockAdjustments.php trunk/StockCostUpdate.php trunk/StockCounts.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocTransferReceive.php trunk/StockSerialItemResearch.php trunk/StockTransferControlled.php trunk/StockUsageGraph.php trunk/SuppContractChgs.php trunk/SuppFixedAssetChgs.php trunk/SuppLoginSetup.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SupplierContacts.php trunk/SupplierInvoice.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxProvinces.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeStockCategory.php trunk/Z_CheckAllocs.php trunk/Z_DeleteInvoice.php trunk/Z_ImportChartOfAccounts.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeNewCompany.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_UpdateChartDetailsBFwd.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_index.php trunk/Z_poAddLanguage.php trunk/Z_poEditLangHeader.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/Z_poRebuildDefault.php trunk/doc/Manual/ManualAPIFunctions.php trunk/geocode.php trunk/includes/DefineLabelClass.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/includes/OutputSerialItems.php trunk/includes/tcpdf/2dbarcodes.php trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/tcpdf.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/Manual/ManualARInquiries.html trunk/locale/de_DE.utf8/Manual/ManualARReports.html trunk/locale/de_DE.utf8/Manual/ManualARTransactions.html trunk/locale/de_DE.utf8/Manual/ManualAccountsPayable.html trunk/locale/de_DE.utf8/Manual/ManualAccountsReceivable.html trunk/locale/de_DE.utf8/Manual/ManualContents.php trunk/locale/de_DE.utf8/Manual/ManualContributors.html trunk/locale/de_DE.utf8/Manual/ManualCreatingNewSystem.html trunk/locale/de_DE.utf8/Manual/ManualCreditStatus.html trunk/locale/de_DE.utf8/Manual/ManualDevelopmentStructure.html trunk/locale/de_DE.utf8/Manual/ManualGeneralLedger.html trunk/locale/de_DE.utf8/Manual/ManualGettingStarted.html trunk/locale/de_DE.utf8/Manual/ManualHeader.html trunk/locale/de_DE.utf8/Manual/ManualIntroduction.html trunk/locale/de_DE.utf8/Manual/ManualInventory.html trunk/locale/de_DE.utf8/Manual/ManualManufacturing.html trunk/locale/de_DE.utf8/Manual/ManualMultilanguage.html trunk/locale/de_DE.utf8/Manual/ManualNewScripts.html trunk/locale/de_DE.utf8/Manual/ManualPaymentTerms.html trunk/locale/de_DE.utf8/Manual/ManualPrices.html trunk/locale/de_DE.utf8/Manual/ManualReportBuilder.html trunk/locale/de_DE.utf8/Manual/ManualRequirements.html trunk/locale/de_DE.utf8/Manual/ManualSalesAnalysis.html trunk/locale/de_DE.utf8/Manual/ManualSalesOrders.html trunk/locale/de_DE.utf8/Manual/ManualSalesPeople.html trunk/locale/de_DE.utf8/Manual/ManualSalesTypes.html trunk/locale/de_DE.utf8/Manual/ManualSecuritySchema.html trunk/locale/de_DE.utf8/Manual/ManualSecuritySchemaorig.html trunk/locale/de_DE.utf8/Manual/ManualShipments.html trunk/locale/de_DE.utf8/Manual/ManualSpecialUtilities.html trunk/locale/de_DE.utf8/Manual/ManualSystemConventions.html trunk/locale/de_DE.utf8/Manual/ManualTax.html trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages-P-Y.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php trunk/locale/zh_CN.utf8/Manual/ManualContents.php trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/Manual/ManualAPIFunctions.php trunk/locale/zh_HK.utf8/Manual/ManualContents.php trunk/reportwriter/FormMaker.php trunk/reportwriter/WriteReport.inc trunk/reportwriter/admin/RCFunctions.inc trunk/reportwriter/admin/forms/ReportsCritSetup.html trunk/reportwriter/admin/forms/ReportsImport.html trunk/reportwriter/admin/forms/TplFrmCBlk.html trunk/reportwriter/admin/forms/TplFrmCDta.html trunk/reportwriter/admin/forms/TplFrmData.html trunk/reportwriter/admin/forms/TplFrmLine.html trunk/reportwriter/admin/forms/TplFrmPgNum.html trunk/reportwriter/admin/forms/TplFrmRect.html trunk/reportwriter/admin/forms/TplFrmTBlk.html trunk/reportwriter/admin/forms/TplFrmTbl.html trunk/reportwriter/admin/forms/TplFrmText.html trunk/reportwriter/admin/forms/TplFrmTtl.html trunk/reportwriter/forms/TplFrmLine.html trunk/reportwriter/languages/en_US/reports.php trunk/sql/mysql/upgrade2.9-2.9a.sql trunk/sql/mysql/weberp-demo.sql Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/Areas.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -113,7 +113,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this area because customer branches have been created using this area'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches using this area code'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches using this area code'); } else { $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.area ='$SelectedArea'"; @@ -122,7 +122,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this area because sales analysis records exist that use this area'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records referring this area code'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records referring this area code'); } } @@ -178,7 +178,7 @@ if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><br>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/BankMatching.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -75,7 +75,7 @@ $_POST['ShowTransactions'] = True; } -echo '<div class="page_help_text">' . _('Use this screen to match webERP Receipts and Payments to your Bank Statement. Check your bank statement and click the check-box when you find the matching transaction.') . '</div><br>'; +echo '<div class="page_help_text">' . _('Use this screen to match webERP Receipts and Payments to your Bank Statement. Check your bank statement and click the check-box when you find the matching transaction.') . '</div><br />'; echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -136,7 +136,7 @@ echo '</select></td></tr>'; -echo '</table><br><div class="centre"><input tabindex="6" type=submit name="ShowTransactions" value="' . _('Show selected') . ' ' . $TypeName . '">'; +echo '</table><br /><div class="centre"><input tabindex="6" type=submit name="ShowTransactions" value="' . _('Show selected') . ' ' . $TypeName . '">'; echo '<p><a href="' . $rootpath . '/BankReconciliation.php">' . _('Show reconciliation') . '</a></div>'; echo '<hr />'; Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/CustomerBranches.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -534,7 +534,7 @@ if (isset($SelectedBranch)) { echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } - echo '<br><table class="selection">'; + echo '<br /><table class="selection">'; echo '<tr><th colspan=2><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; echo '<tr><td>'._('Branch Code').':</td><td>'; Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/CustomerReceipt.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -571,7 +571,7 @@ if (DB_error_no($db) !=0) { prnMsg(_('The searched customer records requested cannot be retrieved because') . ' - ' . DB_error_msg($db),'error'); if ($debug==1){ - prnMsg(_('SQL used to retrieve the customer details was') . '<br>' . $sql,'error'); + prnMsg(_('SQL used to retrieve the customer details was') . '<br />' . $sql,'error'); } } elseif (DB_num_rows($CustomerSearchResult)==1){ $myrow=DB_fetch_array($CustomerSearchResult); @@ -723,7 +723,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="">' . ' ' . _('Enter Customer Receipt') . '</p>'; echo '<div class="page_help_text">' . _('To enter a payment TO a customer (ie. to pay out a credit note), enter a negative payment amount.') . '</div>'; } -echo '<br><table class=selection><tr><td>' . _('Bank Account') . ':</td> +echo '<br /><table class=selection><tr><td>' . _('Bank Account') . ':</td> <td><select tabindex=1 name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; if (DB_num_rows($AccountsResults)==0){ @@ -895,7 +895,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . $_SESSION['CustomerRecord']['name'] . ' - (' . _('All amounts stated in') . ' ' . $_SESSION['CustomerRecord']['currency'] . ')' . _('Terms') . ': ' . $_SESSION['CustomerRecord']['terms'] . '<br/>' . _('Credit Limit') . ': ' . number_format($_SESSION['CustomerRecord']['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $_SESSION['CustomerRecord']['reasondescription']; if ($_SESSION['CustomerRecord']['dissallowinvoices']!=0){ - echo '<br><font color=red size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br/>'; + echo '<br /><font color=red size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br/>'; } echo '<table width="90%" class=selection> @@ -914,7 +914,7 @@ <td class=number>' . number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,2) . '</td> <td class=number>' . number_format($_SESSION['CustomerRecord']['overdue2'],2) . '</td> </tr> - </table><br>'; + </table><br />'; echo '<table class="selection">'; @@ -1009,7 +1009,7 @@ echo '<td>' . _('Narrative') . ':</td>'; echo '<td><textarea name="Narrative" cols=40 rows=1></textarea></td>'; echo '</table>'; - echo '<br><div class="centre"><input tabindex=14 type="submit" name="Process" value="' . _('Accept') . '">'; + echo '<br /><div class="centre"><input tabindex=14 type="submit" name="Process" value="' . _('Accept') . '">'; echo '<input tabindex=14 type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_SESSION['ReceiptBatch']) AND !isset($_POST['GLEntry'])){ @@ -1028,7 +1028,7 @@ echo '<td>' . _('Customer invoice number') . ':</td>'; echo '<td><input tabindex=11 type="text" name="CustInvNo" size=8 maxlength=8></td>'; echo '</tr></table>'; - echo '<div class="centre"><br>'; + echo '<div class="centre"><br />'; echo '<input tabindex=11 type=submit name="Search" value="' . _('Search Now') . '">'; echo '<br/><br/><input tabindex=12 type=submit name="GLEntry" value="' . _('Enter A GL Receipt') . '"><br /></div>'; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/DailyBankTransactions.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -58,7 +58,7 @@ </tr>'; echo '</table>'; - echo '<br><div class="centre"><input type="submit" name="Show" value="' . _('Show transactions'). '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="Show" value="' . _('Show transactions'). '"></div>'; echo '</form>'; } else { $SQL = "SELECT bankaccountname, @@ -133,7 +133,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><div class="centre"><input type="submit" name="Return" value="' . _('Select Another Date'). '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="Return" value="' . _('Select Another Date'). '"></div>'; echo '</form>'; } include('includes/footer.inc'); Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/DailySalesInquiry.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -8,7 +8,7 @@ include('includes/DefineCartClass.php'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . '</p>'; -echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br>'; +echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br />'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/EDIMessageFormat.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -162,7 +162,7 @@ echo '</table><p>'; if (DB_num_rows($result)==0){ echo '<div class="centre"><input tabindex=1 type=submit name="NewEDIInvMsg" value="' . - _('Create New EDI Invoice Message From Default Template') . '"></div><br>'; + _('Create New EDI Invoice Message From Default Template') . '"></div><br />'; } } //end of ifs SelectedLine is not set @@ -240,7 +240,7 @@ echo '<td>'; echo '<input tabindex=4 type="Text" name="LineText" size=50 maxlength=50 VALUE='.$_POST['LineText'] .'>'; echo '</td></tr>'; -echo '</table><br>'; +echo '</table><br />'; if (isset($_GET['SelectedMessageLine'])) { echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '"></div>'; } else { Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/EDIProcessOrders.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -58,7 +58,7 @@ while (false !== ($OrderFile=readdir($dirhandle))){ /*there are files in the incoming orders dir */ $TryNextFile = False; - echo "<br>$OrderFile"; + echo "<br />$OrderFile"; /*Counter that keeps track of the array pointer for the 1st seg in the current seg group */ $FirstSegInGrp =0; @@ -79,7 +79,7 @@ while ($LineText = fgets($fp) AND $TryNextFile != True){ /* get each line of the order file */ $LineText = StripTrailingComma($LineText); - echo "<br>".$LineText; + echo "<br />".$LineText; if ($SegTag != substr($LineText,0,3)){ $SegCounter=1; @@ -87,7 +87,7 @@ } else { $SegCounter++; if ($SegCounter > $Seg[$SegID]['MaxOccur']){ - $EmailText = $EmailText . "\n" . _('The EANCOM Standard only allows for') . ' ' . $Seg[$SegID]['MaxOccur'] . ' ' ._('occurrences of the segment') . ' ' . $Seg[$SegID]['SegTag'] . ' ' . _('this is the') . ' ' . $SegCounter . ' ' . _('occurrence') . '<br>' . _('The segment line read as follows') . ':<br>' . $LineText; + $EmailText = $EmailText . "\n" . _('The EANCOM Standard only allows for') . ' ' . $Seg[$SegID]['MaxOccur'] . ' ' ._('occurrences of the segment') . ' ' . $Seg[$SegID]['SegTag'] . ' ' . _('this is the') . ' ' . $SegCounter . ' ' . _('occurrence') . '<br />' . _('The segment line read as follows') . ':<br />' . $LineText; } } @@ -114,12 +114,12 @@ if ($SegTag != $Seg[$SegID]['SegTag']){ - $EmailText .= "\n" . _('ERROR') . ': ' . _('Unable to identify segment tag') . ' ' . $SegTag . ' ' . _('from the message line') . '<br>' . $LineText . '<br><font color=RED><b>' . _('This message processing has been aborted and separate advice will be required from the customer to obtain details of the order') . '<b></font>'; + $EmailText .= "\n" . _('ERROR') . ': ' . _('Unable to identify segment tag') . ' ' . $SegTag . ' ' . _('from the message line') . '<br />' . $LineText . '<br /><font color=RED><b>' . _('This message processing has been aborted and separate advice will be required from the customer to obtain details of the order') . '<b></font>'; $TryNextFile = True; } - echo '<br>' . _('The segment tag') . ' ' . $SegTag . ' ' . _('is being processed'); + echo '<br />' . _('The segment tag') . ' ' . $SegTag . ' ' . _('is being processed'); switch ($SegTag){ case 'UNH': $UNH_elements = explode ('+',substr($LineText,4)); @@ -181,13 +181,13 @@ } /*end switch for type of order */ if (isset($BGM_elements[1])){ - echo '<br>echo BGM_elements[1] ' .$BGM_elements[1]; + echo '<br />echo BGM_elements[1] ' .$BGM_elements[1]; $BGM_C106 = explode(':',$BGM_elements[1]); $Order->CustRef = $BGM_C106[0]; $EmailText .= "\n" . _('Customers order ref') . ': ' . $BGM_C106[0]; } if (isset($BGM_elements[2])){ - echo "<br>echo BGM_elements[2] " .$BGM_elements[2]; + echo "<br />echo BGM_elements[2] " .$BGM_elements[2]; $BGM_1225 = explode(':',$BGM_elements[2]); $MsgFunction = $BGM_1225[0]; @@ -222,7 +222,7 @@ if (isset($BGM_1225[1])){ $ResponseCode = $BGM_1225[1]; - echo '<br>' . _('Response Code') . ': ' . $ResponseCode; + echo '<br />' . _('Response Code') . ': ' . $ResponseCode; switch ($ResponseCode) { case 'AC': $EmailText .= "\n" . _('Please acknowledge to customer with detail and changes made to the order'); Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/EmailConfirmation.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -9,12 +9,12 @@ If (!isset($_GET['TransNo']) OR $_GET['TransNo']==""){ $title = _('Select Order To Print'); include('includes/header.inc'); - echo '<div class="centre"><br><br><br>'; + echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit(); } @@ -65,12 +65,12 @@ if (DB_num_rows($result)==0){ $title = _('Print Packing Slip Error'); include('includes/header.inc'); - echo '<div class="centre"><br><br><br>'; + echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ @@ -86,17 +86,17 @@ echo '<p>'; prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br>' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); + '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; - echo '<br><br><br>'; + echo '<br /><br /><br />'; echo _('Or select another Order Number to Print'); echo '<table class="table_index"><tr><td class="menu_group_item"> <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit; @@ -125,11 +125,11 @@ $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax'] . "</td></tr>"; $MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['email'] . "<br><br><br></td></tr>"; + $_SESSION['CompanyRecord']['email'] . "<br /><br /><br /></td></tr>"; $MailMessage = $MailMessage . "<Table><tr><td align='center' colspan='4'> <h2> Order Acknowledgement</h2></td></tr>"; $MailMessage = $MailMessage . "<tr><td align='center' colspan='4'> <b>Order Number " . - $_GET['TransNo'] . "</b><br><br><br></td></tr>"; + $_GET['TransNo'] . "</b><br /><br /><br /></td></tr>"; $MailMessage = $MailMessage . "<tr><td colspan='4'> <b>Delivered To:</b></td></tr>"; $MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . $myrow['deliverto'] . "</td></tr>"; @@ -139,12 +139,12 @@ { $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd2'] . "</td></tr>"; $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd3'] . - ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']. "<br><br><br></td></tr>"; + ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']. "<br /><br /><br /></td></tr>"; } else { $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd3'] . ' ' . - $myrow['deladd4'] . ' ' . $myrow['deladd5'] . "<br><br><br></td></tr>"; + $myrow['deladd4'] . ' ' . $myrow['deladd5'] . "<br /><br /><br /></td></tr>"; } $MailMessage = $MailMessage . "</table><table border='1' width='50%'><tr>"; if($_REQUEST['POLine'] == 1){ @@ -205,7 +205,7 @@ } /*end if there are order details to show on the order*/ $MailMessage = $MailMessage . "</Table></body></html>"; -// echo $MailMessage . "=mailMessage<br>"; +// echo $MailMessage . "=mailMessage<br />"; IF(mail( $MailTo, $MailSubject, $MailMessage, $headers )){ echo " The following E-Mail was sent to $MailTo:"; } @@ -225,7 +225,7 @@ <td align='center' colspan='4'> <h2> Order Acknowledgement</h2></td> </tr> <tr> - <td align='center' colspan='4'> <b>Order Number <?=$_GET['TransNo']?> </b><br><br><br></td> + <td align='center' colspan='4'> <b>Order Number <?=$_GET['TransNo']?> </b><br /><br /><br /></td> </tr> <tr> <td colspan='2' nowrap width="50%"> <b><?=$_SESSION['CompanyRecord']['coyname']?></b></td> @@ -251,10 +251,10 @@ </tr> <tr> <td colspan='2' nowrap width="50%"> - <b><?=$_SESSION['CompanyRecord']['email']?><br><br><br> + <b><?=$_SESSION['CompanyRecord']['email']?><br /><br /><br /> </td> <td nowrap width="50%"> - <b><?=$myrow['deladd3']?> <?=$myrow['deladd4'] ?> <?=$myrow['deladd5']?><br><br><br> + <b><?=$myrow['deladd3']?> <?=$myrow['deladd4'] ?> <?=$myrow['deladd5']?><br /><br /><br /> </td> </tr> </table> Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/EmailCustTrans.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -64,7 +64,7 @@ <td><input type="text" name="EmailAddr" maxlength=60 size=60 value="' . $EmailAddress . '"></td> </table>'; -echo '<br><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '">'; +echo '<br /><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '">'; echo '</div></form>'; include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/FixedAssetLocations.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -102,7 +102,7 @@ echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?' . SID.'SelectedLocation='.$myrow['locationid'].'">' . _('Edit') . '</td>'; } -echo '</table><br>'; +echo '</table><br />'; echo '<form name="LocationForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><th style="text-align:left">'._('Location ID').'</th>'; @@ -133,7 +133,7 @@ echo '</select>'; echo '</td></tr>'; -echo '</table><br>'; +echo '</table><br />'; //Batman: ParentLocationID checking the location ID Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/FixedAssetRegister.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -76,7 +76,7 @@ echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<div class="centre">' ._('From') . ':' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate'] . '</div>'; - echo '<br><table width=80% cellspacing="1" class=selection><tr>'; + echo '<br /><table width=80% cellspacing="1" class=selection><tr>'; echo '<th>' . _('Asset ID') . '</th>'; echo '<th>' . _('Description') . '</th>'; echo '<th>' . _('Serial Number') . '</th>'; @@ -164,13 +164,13 @@ echo '<tr><td style="vertical-align:top">' . $myrow['assetid'] . '</td>'; echo '<td style="vertical-align:top">' . $myrow['longdescription'] . '</td>'; echo '<td style="vertical-align:top">' . $myrow['serialno'] . '</td>'; - echo '<td>' . $myrow['locationdescription'] . '<br>'; + echo '<td>' . $myrow['locationdescription'] . '<br />'; /* Not reworked yet * for ($i = 1;$i < sizeOf($Ancestors) - 1;$i++) { for ($j = 0;$j < $i;$j++) { echo ' '; } - echo '|_' . $Ancestors[$i] . '<br>'; + echo '|_' . $Ancestors[$i] . '<br />'; } */ echo '</td><td style="vertical-align:top">' . ConvertSQLDate($myrow['datepurchased']) . '</td>'; @@ -230,7 +230,7 @@ echo '<th style="text-align:right">' . number_format($TotalNBV, 2) . '</th>'; echo '<th style="text-align:right">' . number_format($TotalDisposals, 2) . '</th></tr>'; echo '</table>'; - echo '<br><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; + echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name="csv" value="' . _('Print as CSV') . '"></div></form>'; } } else { @@ -289,7 +289,7 @@ echo '<tr><th>' . _('To Date ') . "</th><td><input type='text' class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='ToDate' maxlength=10 size=11 value='" . $_POST['ToDate'] . "'></td>"; echo '</tr>'; - echo '</table><br>'; + echo '</table><br />'; echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"> '; echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/FixedAssetTransfer.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -67,9 +67,9 @@ echo '<input type="text" name="AssetID" size=15 maxlength=18>'; } - echo '</td></tr></table><br>'; + echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit name="Search" value="'. _('Search Now') . '"></div></form><br>'; + echo '<div class="centre"><input type=submit name="Search" value="'. _('Search Now') . '"></div></form><br />'; } if (isset($_POST['Search'])) { Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/FormDesigner.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -154,7 +154,7 @@ $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Form Design') . '" alt="">' . ' ' . _('Form Design').'<br />'. $FormDesign['name'] . ''; -echo '<div class="page_help_text">' . _('Enter the changes that you want in the form layout below.') .'<br /> '. _('All measurements are in millimetres') . '.</div><br>'; +echo '<div class="page_help_text">' . _('Enter the changes that you want in the form layout below.') .'<br /> '. _('All measurements are in millimetres') . '.</div><br />'; $Papers=array('A4_Landscape', 'A4_Portrait', 'A5_Landscape', 'A5_Portrait', 'A3_Landscape', 'A3_Portrait', 'letter_Portrait', 'letter_Landscape', 'legal_Portrait', 'legal_Landscape'); // Possible paper sizes/orientations echo '<form method="post" id="Form" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLAccountCSV.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -16,7 +16,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="" />' . ' ' . _('General Ledger Account Report') . '</p>'; -echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br>'; +echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br />'; echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -258,7 +258,7 @@ } /*end for each SelectedAccount */ fclose($fp); - echo '<p><a href="' . $FileName . '">' . _('click here') . '</a> ' . _('to view the file') . '<br>'; + echo '<p><a href="' . $FileName . '">' . _('click here') . '</a> ' . _('to view the file') . '<br />'; } /* end of if CreateCSV button hit */ include('includes/footer.inc'); Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLAccountInquiry.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -23,7 +23,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="" />' . ' ' . _('General Ledger Account Inquiry') . '</p>'; -echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br>'; +echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br />'; echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -145,7 +145,7 @@ $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; $TransResult = DB_query($sql,$db,$ErrMsg); - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><th colspan=8><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; $TableHeader = '<tr> @@ -233,7 +233,7 @@ <td colspan=2></td> </tr>'; } - $IntegrityReport .= '<br>' . _('Period') . ': ' . $PeriodNo . _('Account movement per transaction') . ': ' . number_format($PeriodTotal,2) . ' ' . _('Movement per ChartDetails record') . ': ' . number_format($ChartDetailRow['actual'],2) . ' ' . _('Period difference') . ': ' . number_format($PeriodTotal -$ChartDetailRow['actual'],3); + $IntegrityReport .= '<br />' . _('Period') . ': ' . $PeriodNo . _('Account movement per transaction') . ': ' . number_format($PeriodTotal,2) . ' ' . _('Movement per ChartDetails record') . ': ' . number_format($ChartDetailRow['actual'],2) . ' ' . _('Period difference') . ': ' . number_format($PeriodTotal -$ChartDetailRow['actual'],3); if (ABS($PeriodTotal -$ChartDetailRow['actual'])>0.01){ $ShowIntegrityReport = True; Modified: trunk/GLAccountReport.php =================================================================== --- trunk/GLAccountReport.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLAccountReport.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -226,7 +226,7 @@ $title = _('Print GL Accounts Report Error'); include('includes/header.inc'); prnMsg (_('There were no accounts to print out'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { @@ -251,7 +251,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="" />' . ' ' . _('General Ledger Account Report') . '</p>'; - echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br>'; + echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br />'; echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLAccounts.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -77,7 +77,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this account because chart details have been created using this account and at least one period has postings to it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('chart details that require this account code'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('chart details that require this account code'); } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'GLTrans' @@ -91,7 +91,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this account because transactions have been created using this account'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions that require this account code'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions that require this account code'); } else { //PREVENT DELETES IF Company default accounts set up to this account @@ -255,7 +255,7 @@ echo '</select></td></tr></table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" value="'. _('Enter Information') . '"></div>'; + echo '<br /><div class="centre"><input type="Submit" name="submit" value="'. _('Enter Information') . '"></div>'; echo '</form>'; @@ -281,7 +281,7 @@ $result = DB_query($sql,$db,$ErrMsg); - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr> <th>' . _('Account Code') . '</th> <th>' . _('Account Name') . '</th> Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLBalanceSheet.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -20,8 +20,8 @@ echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Balance Sheet') . '</p></div>'; echo '<div class="page_help_text">' - . _('Balance Sheet (or statement of financial position) is a summary of balances. Assets, liabilities and ownership equity are listed as of a specific date, such as the end of its financial year. Of the four basic financial statements, the balance sheet is the only statement which applies to a single point in time.') . '<br>' - . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<br>' + . _('Balance Sheet (or statement of financial position) is a summary of balances. Assets, liabilities and ownership equity are listed as of a specific date, such as the end of its financial year. Of the four basic financial statements, the balance sheet is the only statement which applies to a single point in time.') . '<br />' + . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<br />' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; @@ -54,8 +54,8 @@ echo '</table>'; - 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>'; + 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 */ include ('includes/GLPostings.inc'); @@ -90,9 +90,9 @@ $title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The accumulated profits brought forward could not be calculated by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -128,9 +128,9 @@ $title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -291,7 +291,7 @@ $title = _('Print Balance Sheet Error'); include('includes/header.inc'); prnMsg( _('There were no entries to print out for the selections specified') ); - echo '<br><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } else { @@ -658,7 +658,7 @@ </tr>'; echo '</table>'; - echo '<br><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; + echo '<br /><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; } echo '</form>'; Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLTagProfit_Loss.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -104,10 +104,10 @@ echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; - echo '</table><br>'; + echo '</table><br />'; - 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>"; + 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 */ @@ -172,9 +172,9 @@ $title = _('Income and Expenditure') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug == 1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -184,7 +184,7 @@ include('includes/header.inc'); echo '<p>'; prnMsg( _('There were no entries to print out for the selections specified'),'info'); - echo '<br><a href="'. $rootpath.'/index.php">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="'. $rootpath.'/index.php">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GLTrialBalance.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -92,7 +92,7 @@ echo '<option value ="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } - echo '</select></td></tr></table><br>'; + echo '</select></td></tr></table><br />'; echo '<div class="centre"><input type=submit Name="ShowTB" Value="' . _('Show Trial Balance') .'">'; echo '<input type=submit Name="PrintPDF" Value="'._('PrintPDF').'"></div>'; @@ -151,9 +151,9 @@ $title = _('Trial Balance') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -163,7 +163,7 @@ include('includes/header.inc'); echo '<p>'; prnMsg( _('There were no entries to print out for the selections specified') ); - echo '<br><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -710,7 +710,7 @@ number_format($CheckPeriodActual,2), number_format($CheckPeriodBudget,2)); - echo '</table><br>'; + echo '</table><br />'; echo '<div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="' . _('Select A Different Period') . '"></div>'; } echo '</form>'; Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GeocodeSetup.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -137,7 +137,7 @@ '<a href="http://code.google.com/apis/maps/signup.html" target="_blank"> http://code.google.com/apis/maps/signup.html</a></b>'; echo '<div class="centre"><p>'. _('Find the lat/long for your map center point at ') . '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; - echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br>'; + echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br />'; echo '<table border=1>'; echo '<tr> @@ -189,7 +189,7 @@ } //end of ifs and buts! if (isset($SelectedParam)) { - echo '<div class="centre"><br><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show Defined Geocode Param Codes') . '</a><br></div>'; + echo '<div class="centre"><br /><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show Defined Geocode Param Codes') . '</a><br /></div>'; } if (!isset($_GET['delete'])) { @@ -243,7 +243,7 @@ if (!isset($_POST['geocode_key'])) { $_POST['geocode_key'] = ''; } - echo '<br><tr> + echo '<br /><tr> <td>'. _('Geocode Key') .':</td> <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> @@ -264,13 +264,13 @@ <tr><td>'. _('Geocode Host') . '</td> <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> </table> - <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br><br> + <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br /><br /> </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; -echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br>'; +echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br />'; -echo '<div class="centre"><a href="' . $rootpath . '/geocode.php">' . _('Run GeoCode process (may take a long time)') . '</a></p><br>'; -echo '<a href="' . $rootpath . '/geo_displaymap_customers.php">' . _('Display Map of Customer Branches') . '</a><br>'; +echo '<div class="centre"><a href="' . $rootpath . '/geocode.php">' . _('Run GeoCode process (may take a long time)') . '</a></p><br />'; +echo '<a href="' . $rootpath . '/geo_displaymap_customers.php">' . _('Display Map of Customer Branches') . '</a><br />'; echo '<a href="' . $rootpath . '/geo_displaymap_suppliers.php">' . _('Display Map of Suppliers') . '</a></div>'; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GetStockImage.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -151,7 +151,7 @@ $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); prnMsg( _('The Image could not be retrieved because it does not exist'), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -160,9 +160,9 @@ $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); echo 'The image ' . $filename . ' using functype ' . $functype - . '<br> The tmpfilename = ' . $tmpfilename . '<br> The temppath = ' . $filepath . '<br>The stockid = ' . $stockid . '<br> filepath . stockid .jpg = ' . $filepath . $stockid .'.jpg<br> The result of file_exists($filepath . $stockid .jpg) =' . file_exists($filepath . $stockid .'.jpg') - . '<br>filepath = ' . $filepath - . '<br>rootpath = ' . $rootpath; + . '<br /> The tmpfilename = ' . $tmpfilename . '<br /> The temppath = ' . $filepath . '<br />The stockid = ' . $stockid . '<br /> filepath . stockid .jpg = ' . $filepath . $stockid .'.jpg<br /> The result of file_exists($filepath . $stockid .jpg) =' . file_exists($filepath . $stockid .'.jpg') + . '<br />filepath = ' . $filepath + . '<br />rootpath = ' . $rootpath; include('includes/footer.inc'); exit; */ Modified: trunk/GoodsReceivedControlled.php =================================================================== --- trunk/GoodsReceivedControlled.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/GoodsReceivedControlled.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -24,7 +24,7 @@ if (!isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for receiving*/ echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. - _('Select a purchase order to receive'). '</a></div><br>'; + _('Select a purchase order to receive'). '</a></div><br />'; prnMsg( _('This page can only be opened if a purchase order and line item has been selected') . '. ' . _('Please do that first'),'error'); include('includes/footer.inc'); exit; @@ -59,9 +59,9 @@ ********************************************/ echo '<div class="centre">'; -echo '<br><a href="'.$rootpath.'/GoodsReceived.php?identifier=' .$identifier . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO'.$identifier]->OrderNo . '</a>'; +echo '<br /><a href="'.$rootpath.'/GoodsReceived.php?identifier=' .$identifier . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO'.$identifier]->OrderNo . '</a>'; -echo '<br><font size=2><b>'. _('Receive controlled item'). ' '. $LineItem->StockID . ' - ' . $LineItem->ItemDescription . +echo '<br /><font size=2><b>'. _('Receive controlled item'). ' '. $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' ' . _('on order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ @@ -72,7 +72,7 @@ $ShowExisting = false; include ('includes/InputSerialItems.php'); -//echo '<br><input type=submit name=\'AddBatches\' VALUE=\'Enter\'><br>'; +//echo '<br /><input type=submit name=\'AddBatches\' VALUE=\'Enter\'><br />'; /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ Modified: trunk/InventoryPlanningPrefSupplier.php =================================================================== --- trunk/InventoryPlanningPrefSupplier.php 2011-07-02 22:51:40 UTC (rev 4617) +++ trunk/InventoryPlanningPrefSupplier.php 2011-07-02 23:04:59 UTC (rev 4618) @@ -208,9 +208,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg(_('The inventory quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo "<br /><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo "<br />$SQL"; } include('includes/footer.inc'); exit; @@ -276,9 +276,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo "<br /><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo "<br />$SQL"; } include('includes/footer.... [truncated message content] |
From: <dai...@us...> - 2011-07-03 03:01:47
|
Revision: 4619 http://web-erp.svn.sourceforge.net/web-erp/?rev=4619&view=rev Author: daintree Date: 2011-07-03 03:01:39 +0000 (Sun, 03 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CustWhereAlloc.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EDIProcessOrders.php trunk/PDFDeliveryDifferences.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFStockCheckComparison.php trunk/PrintCheque.php trunk/PrintCustStatements.php trunk/WorkOrderCosting.php trunk/doc/Change.log Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/CustWhereAlloc.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -12,7 +12,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Customer Where Allocated'). '" alt="" />' . $title . '</p>'; -echo '<table class=selection cellpadding=2><tr>'; +echo '<table class="selection" cellpadding=2> + <tr>'; echo '<td>' . _('Type') . ':</td> <td><select tabindex=1 name="TransType"> '; @@ -36,7 +37,9 @@ echo '<td>'._('Transaction Number').':</td> <td><input tabindex=2 type="text" name="TransNo" maxlength=10 size=10 value="'. $_POST['TransNo'] . '"></td>'; -echo '</tr></table><br /> +echo '</tr> + </table> + <br /> <div class="centre"><input tabindex=3 type="submit" name="ShowResults" value="' . _('Show How Allocated') . '"></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ @@ -49,9 +52,9 @@ /*First off get the DebtorTransID of the transaction (invoice normally) selected */ $sql = "SELECT id, - ovamount+ovgst AS totamt - FROM debtortrans - WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; + ovamount+ovgst AS totamt + FROM debtortrans + WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; $result = DB_query($sql , $db); @@ -60,25 +63,26 @@ $AllocToID = $myrow['id']; $sql = "SELECT type, - transno, - trandate, - debtortrans.debtorno, - reference, - rate, - ovamount+ovgst+ovfreight+ovdiscount as totalamt, - custallocns.amt - FROM debtortrans - INNER JOIN custallocns ON debtortrans.id=custallocns.transid_allocfrom - WHERE custallocns.transid_allocto='". $AllocToID."'"; + transno, + trandate, + debtortrans.debtorno, + reference, + rate, + ovamount+ovgst+ovfreight+ovdiscount as totalamt, + custallocns.amt + FROM debtortrans + INNER JOIN custallocns + ON debtortrans.id=custallocns.transid_allocfrom + WHERE custallocns.transid_allocto='". $AllocToID."'"; $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); - $TransResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<br /><table cellpadding=2 class=selection>'; + echo '<br /> + <table cellpadding=2 class="selection">'; echo '<tr> <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> @@ -91,7 +95,7 @@ <th>' . _('Ex Rate') . '</th> <th>' . _('Amount') . '</th> <th>' . _('Alloc') . '</th> - </tr>'; + </tr>'; echo $tableheader; $RowCounter = 1; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DailyBankTransactions.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -30,7 +30,8 @@ <td><select name="BankAccount">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr></table>'; prnMsg( _('Bank Accounts have not yet been defined. You must first') . ' <a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a> ' . _('and general ledger accounts to be affected'),'warn'); include('includes/footer.inc'); exit; @@ -41,9 +42,9 @@ $_POST['BankAccount']=$myrow['accountcode']; } if ($_POST['BankAccount']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } } echo '</select></td></tr>'; @@ -95,9 +96,9 @@ } else { $BankDetailRow = DB_fetch_array($BankResult); echo '<table class=selection> - <tr> - <th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> - </tr>'; + <tr> + <th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + </tr>'; echo '<tr> <th>' . ('Date') . '</th> <th>'._('Transaction type').'</th> Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DailySalesInquiry.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -52,7 +52,10 @@ } echo '</select></td>'; -echo '</tr></table><br /><div class="centre"><input tabindex=4 type=submit name="ShowResults" VALUE="' . _('Show Daily Sales For The Selected Month') . '">'; +echo '</tr> + </table> + <br /> + <div class="centre"><input tabindex=4 type=submit name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '">'; echo '</form></div>'; echo '<br />'; /*Now get and display the sales data returned */ @@ -92,13 +95,14 @@ echo '<table cellpadding=2 class=selection>'; echo'<tr> - <th>' . _('Sunday') . '</th> - <th>' . _('Monday') . '</th> - <th>' . _('Tuesday') . '</th> - <th>' . _('Wednesday') . '</th> - <th>' . _('Thursday') . '</th> - <th>' . _('Friday') . '</th> - <th>' . _('Saturday') . '</th></tr>'; + <th>' . _('Sunday') . '</th> + <th>' . _('Monday') . '</th> + <th>' . _('Tuesday') . '</th> + <th>' . _('Wednesday') . '</th> + <th>' . _('Thursday') . '</th> + <th>' . _('Friday') . '</th> + <th>' . _('Saturday') . '</th> + </tr>'; $CumulativeTotalSales = 0; $CumulativeTotalCost = 0; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DebtorsAtPeriodEnd.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -27,28 +27,29 @@ /*Now figure out the aged analysis for the customer range under review */ $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - SUM((debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)/debtortrans.rate) AS balance, - SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) AS fxbalance, - SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN - (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount)/debtortrans.rate ELSE 0 END) AS afterdatetrans, - SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' - AND (debtortrans.type=11 OR debtortrans.type=12) THEN - debtortrans.diffonexch ELSE 0 END) AS afterdatediffonexch, - SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN - debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount ELSE 0 END - ) AS fxafterdatetrans - FROM debtorsmaster, - currencies, - debtortrans - WHERE debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.debtorno = debtortrans.debtorno - AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' + debtorsmaster.name, + currencies.currency, + currencies.decimalplaces, + SUM((debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)/debtortrans.rate) AS balance, + SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) AS fxbalance, + SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount)/debtortrans.rate ELSE 0 END) AS afterdatetrans, + SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' + AND (debtortrans.type=11 OR debtortrans.type=12) THEN + debtortrans.diffonexch ELSE 0 END) AS afterdatediffonexch, + SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN + debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount ELSE 0 END + ) AS fxafterdatetrans + FROM debtorsmaster INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' GROUP BY debtorsmaster.debtorno, debtorsmaster.name, - currencies.currency"; + currencies.currency, + currencies.decimalplaces"; $CustomerResult = DB_query($SQL,$db,'','',false,false); @@ -84,8 +85,8 @@ if (abs($Balance)>0.009 OR ABS($FXBalance)>0.009) { - $DisplayBalance = number_format($DebtorBalances['balance'] - $DebtorBalances['afterdatetrans'],2); - $DisplayFXBalance = number_format($DebtorBalances['fxbalance'] - $DebtorBalances['fxafterdatetrans'],2); + $DisplayBalance = number_format($DebtorBalances['balance'] - $DebtorBalances['afterdatetrans'],$DebtorBalances['decimalplaces']); + $DisplayFXBalance = number_format($DebtorBalances['fxbalance'] - $DebtorBalances['fxafterdatetrans'],$DebtorBalances['decimalplaces']); $TotBal += $Balance; @@ -109,7 +110,7 @@ include('includes/PDFDebtorBalsPageHeader.inc'); } - $DisplayTotBalance = number_format($TotBal,2); + $DisplayTotBalance = number_format($TotBal,$_SESSION['CompanyRecord']['decimalplaces']); $LeftOvers = $pdf->addTextWrap(50,$YPos,160,$FontSize,_('Total balances'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DeliveryDetails.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -40,7 +40,7 @@ if (isset($_POST['ProcessOrder']) OR isset($_POST['MakeRecurringOrder'])) { /*need to check for input errors in any case before order processed */ - $_POST['Update']='Yes rerun the validation checks'; + $_POST['Update']='Yes rerun the validation checks'; //no need for gettext! /*store the old freight cost before it is recalculated to ensure that there has been no change - test for change after freight recalculated and get user to re-confirm if changed */ @@ -126,22 +126,22 @@ } } $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.phoneno, + custbranch.email, + custbranch.defaultlocation, + custbranch.defaultshipvia, + custbranch.deliverblind, + custbranch.specialinstructions, + custbranch.estdeliverydays + 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]->CustomerName . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; @@ -256,7 +256,7 @@ if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors){ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; - prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/RecurringOrders.php?identifier='.$identifier . "&NewRecurringOrder=Yes'>". _('click here') .'</a> '. _('to continue'),'info'); + prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $rootpath . '/RecurringOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'. _('click here') .'</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; } @@ -569,7 +569,7 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br /><table class=selection> + echo '<br /><table class="selection"> <tr> <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td> @@ -591,13 +591,13 @@ echo '<br /><table class=selection> <tr> <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> - <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> </tr> </table>'; echo '<br /><table class=selection> <tr> <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> - <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> </tr> </table>'; } @@ -639,7 +639,7 @@ $ErrMsg = _('Could not update the contract status'); $DbgMsg = _('The SQL that failed to update the contract status was'); $UpdContractResult=DB_query("UPDATE contracts SET status=2, - wo='" . $WONo . "' + wo='" . $WONo . "' WHERE orderno='" .$_SESSION['ExistingOrder'] . "'", $db,$ErrMsg,$DbgMsg,true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, @@ -653,7 +653,7 @@ workcentreadded, '" . $_SESSION['Items'.$identifier]->Location ."', '" . Date('Y-m-d') . "', - '2037-12-31' + '2099-12-31' FROM contractbom WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); @@ -707,31 +707,30 @@ } //end test to see if the order was a contract quotation being changed to an order - $HeaderSQL = "UPDATE salesorders - SET debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - branchcode = '" . $_SESSION['Items'.$identifier]->Branch . "', - customerref = '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', - comments = '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', - ordertype = '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - shipvia = '" . $_POST['ShipVia'] . "', - deliverydate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->DeliveryDate)) . "', - quotedate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->QuoteDate)) . "', - confirmeddate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->ConfirmedDate)) . "', - deliverto = '" . DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', - deladd1 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', - deladd2 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', - deladd3 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', - deladd4 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', - deladd5 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', - deladd6 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', - contactphone = '" . $_SESSION['Items'.$identifier]->PhoneNo . "', - contactemail = '" . $_SESSION['Items'.$identifier]->Email . "', - freightcost = '" . $_SESSION['Items'.$identifier]->FreightCost ."', - fromstkloc = '" . $_SESSION['Items'.$identifier]->Location ."', - printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', - quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', - deliverblind = '" . $_SESSION['Items'.$identifier]->DeliverBlind . "' - WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] ."'"; + $HeaderSQL = "UPDATE salesorders SET debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + branchcode = '" . $_SESSION['Items'.$identifier]->Branch . "', + customerref = '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', + comments = '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', + ordertype = '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', + shipvia = '" . $_POST['ShipVia'] . "', + deliverydate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->DeliveryDate)) . "', + quotedate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->QuoteDate)) . "', + confirmeddate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->ConfirmedDate)) . "', + deliverto = '" . DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', + deladd1 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', + deladd2 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', + deladd3 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', + deladd4 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', + deladd5 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', + deladd6 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', + contactphone = '" . $_SESSION['Items'.$identifier]->PhoneNo . "', + contactemail = '" . $_SESSION['Items'.$identifier]->Email . "', + freightcost = '" . $_SESSION['Items'.$identifier]->FreightCost ."', + fromstkloc = '" . $_SESSION['Items'.$identifier]->Location ."', + printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', + quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', + deliverblind = '" . $_SESSION['Items'.$identifier]->DeliverBlind . "' + WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] ."'"; $DbgMsg = _('The SQL that was used to update the order and failed was'); $ErrMsg = _('The order cannot be updated because'); Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DiscountCategories.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -28,10 +28,10 @@ //first off validate inputs sensible $result = DB_query("SELECT stockid - FROM stockmaster - WHERE mbflag <>'K' - AND mbflag<>'D' - AND stockid='" . strtoupper($_POST['StockID']) . "'",$db); + FROM stockmaster + WHERE mbflag <>'K' + AND mbflag<>'D' + AND stockid='" . strtoupper($_POST['StockID']) . "'",$db); if (DB_num_rows($result)==0){ $InputError = 1; prnMsg(_('The stock item entered must be set up as either a manufactured or purchased or assembly item'),'warn'); @@ -59,8 +59,8 @@ echo '<br />'; } elseif (isset($_POST['SubmitCategory'])) { $sql="UPDATE stockmaster - SET discountcategory='".$_POST['DiscountCategory']."' - WHERE categoryid='".$_POST['stockcategory']."'"; + SET discountcategory='".$_POST['DiscountCategory']."' + WHERE categoryid='".$_POST['stockcategory']."'"; $result=DB_query($sql, $db); } @@ -85,7 +85,10 @@ } echo '</select></td>'; - echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br />'; + echo '<td><input type="submit" name="select" value="'._('Select').'"></td> + </tr> + </table> + <br />'; } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; @@ -125,7 +128,8 @@ <td><input type="text" name="PartID" size=10 maxlength=10 value="' . $_POST['PartID'] . '"></td> <td>' . _('Partial description') . ':</td> <td><input type="text" name="PartDesc" size=10 value="' . $_POST['PartDesc'] .'" maxlength=10></td> - <td><input type="submit" name="search" value="' . _('Search') .'"></td></tr>'; + <td><input type="submit" name="search" value="' . _('Search') .'"></td> + </tr>'; echo '</table>'; @@ -212,7 +216,7 @@ printf('<td>%s</td> <td>%s - %s</td> - <td><a href="%s">'. _('Delete') .'</td> + <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount category?') . '\');">'. _('Delete') .'</td> </tr>', $myrow['discountcategory'], $myrow['stockid'], Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DiscountMatrix.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -136,23 +136,25 @@ echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; $sql = "SELECT sales_type, - salestype, - discountcategory, - quantitybreak, - discountrate - FROM discountmatrix INNER JOIN salestypes - ON discountmatrix.salestype=salestypes.typeabbrev - ORDER BY salestype, - discountcategory, - quantitybreak"; + salestype, + discountcategory, + quantitybreak, + discountrate + FROM discountmatrix INNER JOIN salestypes + ON discountmatrix.salestype=salestypes.typeabbrev + ORDER BY salestype, + discountcategory, + quantitybreak"; $result = DB_query($sql,$db); echo '<table class=selection>'; -echo '<tr><th>' . _('Sales Type') . '</th> +echo '<tr> + <th>' . _('Sales Type') . '</th> <th>' . _('Discount Category') . '</th> <th>' . _('Quantity Break') . '</th> - <th>' . _('Discount Rate') . ' %' . '</th></tr>'; + <th>' . _('Discount Rate') . ' %' . '</th> + </tr>'; $k=0; //row colour counter @@ -170,7 +172,7 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><a href="%s">' . _('Delete') . '</td> + <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</td> </tr>', $myrow['sales_type'], $myrow['discountcategory'], Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/EDIMessageFormat.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -31,13 +31,13 @@ sequenceno, section, linetext) - SELECT '".$PartnerCode."', - 'INVOIC', - sequenceno, - section, - linetext - FROM edimessageformat - WHERE partnercode='DEFAULT' + SELECT '".$PartnerCode."', + 'INVOIC', + sequenceno, + section, + linetext + FROM edimessageformat + WHERE partnercode='DEFAULT' AND messagetype='INVOIC'"; $ErrMsg = _('There was an error inserting the default template invoice message records for') . ' ' . $PartnerCode . ' ' . _('because'); @@ -113,23 +113,23 @@ or deletion of the records*/ $sql = "SELECT id, - section, - sequenceno, - linetext - FROM edimessageformat - WHERE partnercode='" . $PartnerCode . "' - AND messagetype='" . $MessageType . "' - ORDER BY sequenceno"; + section, + sequenceno, + linetext + FROM edimessageformat + WHERE partnercode='" . $PartnerCode . "' + AND messagetype='" . $MessageType . "' + ORDER BY sequenceno"; $result = DB_query($sql,$db); echo '<table class=selection>'; echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; $TableHeader = '<tr> - <th>' . _('Section') . '</th> - <th>' . _('Sequence') . '</th> - <th>' . _('Format String') . '</th> - </tr>'; + <th>' . _('Section') . '</th> + <th>' . _('Sequence') . '</th> + <th>' . _('Format String') . '</th> + </tr>'; echo $TableHeader; $k=0; //row colour counter @@ -145,18 +145,18 @@ printf('<td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> - <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> - </tr>', - $myrow[1], - $myrow[2], - $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0]); + <td class=number>%s</td> + <td>%s</td> + <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> + <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> + </tr>', + $myrow[1], + $myrow[2], + $myrow[3], + $_SERVER['PHP_SELF'] . '?' . SID, + $myrow[0], + $_SERVER['PHP_SELF'] . '?' . SID, + $myrow[0]); } //END WHILE LIST LOOP echo '</table><p>'; Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/EDIProcessOrders.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.20 $ */ /* $Id$*/ -//$PageSecurity =11; - include ('includes/session.inc'); $title = _('Process EDI Orders'); @@ -40,7 +37,7 @@ /*Read in the EANCOM Order Segments for the current seg group from the segments table */ -$sql = 'SELECT id, segtag, maxoccur, seggroup FROM edi_orders_segs'; +$sql = "SELECT id, segtag, maxoccur, seggroup FROM edi_orders_segs"; $OrderSeg = DB_query($sql,$db); $i=0; $Seg = array(); @@ -58,7 +55,7 @@ while (false !== ($OrderFile=readdir($dirhandle))){ /*there are files in the incoming orders dir */ $TryNextFile = False; - echo "<br />$OrderFile"; + echo '<br />' . $OrderFile; /*Counter that keeps track of the array pointer for the 1st seg in the current seg group */ $FirstSegInGrp =0; @@ -541,7 +538,7 @@ } else { $mail->setSubject(_('EDI Order Message') . ' ' . $Order->CustRef); - $EDICustServPerson ="'phil' <phil@localhost>"; + $EDICustServPerson = $_SESSION['PurchasingManagerEmail']; $Recipients = array($EDICustServPerson); } @@ -556,7 +553,6 @@ - } /*end of the loop around all the incoming order files in the incoming orders directory */ Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFDeliveryDifferences.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.15 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,42 +24,51 @@ echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Delivery Differences Report') . '</p>'; - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . - ":</td><td><input type=text class=date alt='".$_SESSION['DefaultDateFormat']. - "' name='FromDate' maxlength=10 size=10 value='" . - Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ":</td><td><input type=text class=date alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . ':</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ':</td><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="ToDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; $result = DB_query($sql,$db); - echo "<select name='CategoryID'>"; - echo "<option selected value='All'>" . _('Over All Categories'); + echo '<select name="CategoryID">'; + echo '<option selected value="All">' . _('Over All Categories') . '</option>'; - while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription']; - } + while ($myrow=DB_fetch_array($result)){ + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; + } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Inventory Location') . ":</td><td><select name='Location'>"; - echo "<option selected value='All'>" . _('All Locations'); + echo '<tr><td>' . _('Inventory Location') . ':</td> + <td><select name="Location"> + <option selected value="All">' . _('All Locations') . '</option>'; - $result= DB_query('SELECT loccode, locationname FROM locations',$db); - while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - } + $result= DB_query("SELECT loccode, locationname FROM locations",$db); + while ($myrow=DB_fetch_array($result)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>"; - echo "<option selected value='No'>" . _('No'); - echo "<option value='Yes'>" . _('Yes'); - echo "</select></td></tr></table><br /><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Email the report off') . ':</td> + <td><select name="Email"> + <option selected value="No">' . _('No') . '</option> + <option value="Yes">' . _('Yes') . '</option> + </select> + </td> + </tr> + </table> + <br /> + <div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -257,20 +263,8 @@ $YPos-=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,_('DIFOT') . ' ' . number_format((1-($TotalDiffs/$myrow[0])) * 100,2) . '%', 'left'); -/* UldisN -$pdfcode = $pdf->output(); -$len = mb_strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=DeliveryDifferences.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ $ReportFileName = $_SESSION['DatabaseName'] . '_DeliveryDifferences_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN +$pdf->OutputD($ReportFileName); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFQuotation.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -84,8 +84,8 @@ $FontSize=12; $PageNumber = 1; $line_height=15; -// $pdf->selectFont('./fonts/Helvetica.afm'); + /* Now ... Has the order got any line items still outstanding to be invoiced */ $ErrMsg = _('There was a problem retrieving the quotation line details for quotation Number') . ' ' . @@ -224,28 +224,16 @@ } /*end if there are line details to show on the quotation*/ -//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); -//$len = mb_strlen($pdfcode); if ($ListCount == 0){ - $title = _('Print Quotation Error'); - include('includes/header.inc'); - echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). - '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). - '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). + '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); exit; } else { -/* - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Quotation.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); -//echo 'here'; - $pdf->Output('PDFQuotation.pdf', 'I'); -*/ - $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFQuotationPortrait.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,7 +2,6 @@ /* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -59,18 +58,17 @@ //If there are no rows, there's a problem. if (DB_num_rows($result)==0){ - $title = _('Print Quotation Error'); - include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; - include('includes/footer.inc'); - exit; + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<div class="centre"><br /><br /><br />'; + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> + </td></tr></table></div><br /><br /><br />'; + include('includes/footer.inc'); + exit; } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ - - $myrow = DB_fetch_array($result); + $myrow = DB_fetch_array($result); } /*retrieve the order details from the database to print */ @@ -85,7 +83,6 @@ $FontSize=12; $PageNumber = 1; $line_height=24; -// $pdf->selectFont('./fonts/Helvetica.afm'); /* Now ... Has the order got any line items still outstanding to be invoiced */ @@ -137,13 +134,19 @@ $TaxProv = $myrow['taxprovinceid']; $TaxCat = $myrow2['taxcatid']; $Branch = $myrow['branchcode']; - $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $sql3 = " SELECT taxgrouptaxes.taxauthid + FROM taxgrouptaxes INNER JOIN custbranch + ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid + WHERE custbranch.branchcode='" .$Branch ."'"; $result3=DB_query($sql3,$db, $ErrMsg); while ($myrow3=DB_fetch_array($result3)){ $TaxAuth = $myrow3['taxauthid']; } - $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $sql4 = "SELECT * FROM taxauthrates + WHERE dispatchtaxprovince='" .$TaxProv ."' + AND taxcatid='" .$TaxCat ."' + AND taxauthority='" .$TaxAuth ."'"; $result4=DB_query($sql4,$db, $ErrMsg); while ($myrow4=DB_fetch_array($result4)){ $TaxClass = 100 * $myrow4['taxrate']; @@ -162,9 +165,9 @@ $LeftOvers = $pdf->addTextWrap(120,$YPos,295,$FontSize,$myrow2['description']); $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize,$DisplayQty,'right'); $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,$DisplayPrice,'right'); - if ($DisplayDiscount > 0){ - $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); - } + if ($DisplayDiscount > 0){ + $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); + } $LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize,$DisplayTaxClass,'right'); $LeftOvers = $pdf->addTextWrap(410,$YPos,85,$FontSize,$DisplayTaxAmount,'center'); $LeftOvers = $pdf->addTextWrap(460,$YPos,90,$FontSize,$DisplayTotal,'right'); @@ -185,12 +188,11 @@ } //end while there are line items to print out if ((mb_strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) - OR (mb_strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) - OR $YPos-$line_height <= 50){ - /* We reached the end of the page so finsih off the page and start a newy */ - $PageNumber++; - include ('includes/PDFQuotationPageHeader.inc'); - + OR (mb_strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); @@ -225,28 +227,16 @@ } /*end if there are line details to show on the quotation*/ -//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); -//$len = mb_strlen($pdfcode); if ($ListCount == 0){ $title = _('Print Quotation Error'); include('includes/header.inc'); echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). - '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). - '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { -/* - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Quotation.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); -//echo 'here'; - $pdf->Output('PDFQuotation.pdf', 'I'); -*/ - $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } ?> Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFStockCheckComparison.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.18 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); If (isset($_POST['PrintPDF']) AND isset($_POST['ReportOrClose'])){ @@ -254,7 +251,11 @@ $LeftOvers = $pdf->addTextWrap(135,$YPos,180,$FontSize,$CheckItemRow['description'], 'left'); $LeftOvers = $pdf->addTextWrap(315,$YPos,60,$FontSize,$CheckItemRow['qoh'], 'right'); - $SQL = "SELECT qtycounted, reference FROM stockcounts WHERE loccode ='" . $Location . "' AND stockid = '" . $CheckItemRow['stockid'] . "'"; + $SQL = "SELECT qtycounted, + reference + FROM stockcounts + WHERE loccode ='" . $Location . "' + AND stockid = '" . $CheckItemRow['stockid'] . "'"; $Counts = DB_query($SQL,$db,'','',false,false); @@ -306,33 +307,10 @@ } /*end STOCK comparison while loop */ $YPos -= (2*$line_height); -/* - $pdfcode = $pdf->output(); - $len = mb_strlen($pdfcode); - if ($len<=20){ - $title = _('Print Stock check comparison Error'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('There were no Inventory Comparison sheets to print out'), 'error'); - echo '<br /><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=StockComparison.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_StockComparison_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); - $pdf->Output('StockCheckComparison.pdf', 'I'); - - } -*/ - $pdf->OutputD($_SESSION['DatabaseName'] . '_StockComparison_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - if ($_POST['ReportOrClose']=='ReportAndClose'){ //need to print the report first before this but don't risk re-adjusting all the stock!! $sql = "TRUNCATE TABLE stockcheckfreeze"; Modified: trunk/PrintCheque.php =================================================================== --- trunk/PrintCheque.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PrintCheque.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,10 +2,6 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - -//$PageSecurity = 5; - include('includes/DefinePaymentClass.php'); include('includes/session.inc'); include('Numbers/Words.php'); @@ -58,8 +54,6 @@ $LeftOvers = $pdf->addTextWrap(375,$YPos,100,$FontSize, number_format($_SESSION['PaymentDetail']->Amount,2), 'right'); - - // remittance advice 1 $YPos -= 14*$line_height; $LeftOvers = $pdf->addTextWrap(0,$YPos,$Page_Width,$FontSize,_('Remittance Advice'), 'center'); @@ -87,26 +81,7 @@ $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,number_format(round($_SESSION['PaymentDetail']->Amount,2),2), 'left'); -/* UldisN -$pdfcode = $pdf->output(); -$len = mb_strlen($pdfcode); -if ($len<=1){ - $title = _('Print Check Error'); - include('includes/header.inc'); - prnMsg(_('Could not print the cheque'),'warn'); - include('includes/footer.inc'); - exit; -} else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Cheque.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->Output('PrintCheque.pdf', 'I'); -} -*/ -$pdf->OutputD($_SESSION['DatabaseName'] . '_Cheque_' . date('Y-m-d') . '_ChequeNum_' . $_GET['ChequeNum'] . '.pdf');//UldisN -$pdf->__destruct(); //UldisN -?> +$pdf->OutputD($_SESSION['DatabaseName'] . '_Cheque_' . date('Y-m-d') . '_ChequeNum_' . $_GET['ChequeNum'] . '.pdf'); +$pdf->__destruct(); +?> \ No newline at end of file Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PrintCustStatements.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,10 +2,6 @@ /* $Id$*/ -/* $Revision: 1.19 $ */ - -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -15,6 +11,7 @@ if (isset($_POST['PrintPDF'])) { $PaperSize='A4_Landscape'; } + if (isset($_GET['PrintPDF'])) { $FromCust = $_GET['FromCust']; $ToCust = $_GET['ToCust']; @@ -25,18 +22,16 @@ $PaperSize='A4_Landscape'; } - - if (isset($_GET['FromCust'])) { $getFrom = $_GET['FromCust']; $_POST['FromCust'] = $getFrom; } + if (isset($_GET['ToCust'])) { $getTo = $_GET['ToCust']; $_POST['ToCust'] = $getTo; } - If (isset($_POST['PrintPDF']) && isset($_POST['FromCust']) && $_POST['FromCust']!=''){ $_POST['FromCust'] = strtoupper($_POST['FromCust']); @@ -57,30 +52,30 @@ $ErrMsg = _('There was a problem settling the old transactions.'); $DbgMsg = _('The SQL used to settle outstanding transactions was'); $sql = "UPDATE debtortrans SET settled=1 - WHERE ABS(debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc)<0.009"; + WHERE ABS(debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc)<0.009"; $SettleAsNec = DB_query($sql,$db, $ErrMsg, $DbgMsg); /*Figure out who all the customers in this range are */ $ErrMsg= _('There was a problem retrieving the customer information for the statements from the database'); $sql = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.lastpaid, - debtorsmaster.lastpaiddate, - currencies.currency, - paymentterms.terms - FROM debtorsmaster INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - WHERE debtorsmaster.debtorno >='" . $_POST['FromCust'] ."' - AND debtorsmaster.debtorno <='" . $_POST['ToCust'] ."' - ORDER BY debtorsmaster.debtorno"; + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.lastpaid, + debtorsmaster.lastpaiddate, + currencies.currency, + paymentterms.terms + FROM debtorsmaster INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + WHERE debtorsmaster.debtorno >='" . $_POST['FromCust'] ."' + AND debtorsmaster.debtorno <='" . $_POST['ToCust'] ."' + ORDER BY debtorsmaster.debtorno"; $StatementResults=DB_query($sql,$db, $ErrMsg); if (DB_Num_Rows($StatementResults) == 0){ @@ -99,16 +94,16 @@ /*now get all the outstanding transaction ie Settled=0 */ $ErrMsg = _('There was a problem retrieving the outstanding transactions for') . ' ' . $StmtHeader['name'] . ' '. _('from the database') . '.'; $sql = "SELECT systypes.typename, - debtortrans.transno, - debtortrans.trandate, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst as total, - debtortrans.alloc, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc as ostdg - FROM debtortrans INNER JOIN systypes - ON debtortrans.type=systypes.typeid - WHERE debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' - AND debtortrans.settled=0 - ORDER BY debtortrans.id"; + debtortrans.transno, + debtortrans.trandate, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst as total, + debtortrans.alloc, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc as ostdg + FROM debtortrans INNER JOIN systypes + ON debtortrans.type=systypes.typeid + WHERE debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' + AND debtortrans.settled=0 + ORDER BY debtortrans.id"; $OstdgTrans=DB_query($sql,$db, $ErrMsg); @@ -118,22 +113,22 @@ $ErrMsg = _('There was a problem retrieving the transactions that were settled over the course of the last month for'). ' ' . $StmtHeader['name'] . ' ' . _('from the database'); if ($_SESSION['Show_Settled_LastMonth']==1){ $sql = "SELECT DISTINCT debtortrans.id, - systypes.typename, - debtortrans.transno, - debtortrans.trandate, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst AS total, - debtortrans.alloc, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc AS ostdg - FROM debtortrans INNER JOIN systypes - ON debtortrans.type=systypes.typeid - INNER JOIN custallocns - ON (debtortrans.id=custallocns.transid_allocfrom - OR debtortrans.id=custallocns.transid_allocto) - WHERE custallocns.datealloc >='" . - Date('Y-m-d',Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))) . "' - AND debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' - AND debtortrans.settled=1 - ORDER BY debtortrans.id"; + systypes.typename, + debtortrans.transno, + debtortrans.trandate, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst AS total, + debtortrans.alloc, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc AS ostdg + FROM debtortrans INNER JOIN systypes + ON debtortrans.type=systypes.typeid + INNER JOIN custallocns + ON (debtortrans.id=custallocns.transid_allocfrom + OR debtortrans.id=custallocns.transid_allocto) + WHERE custallocns.datealloc >='" . + Date('Y-m-d',Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))) . "' + AND debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' + AND debtortrans.settled=1 + ORDER BY debtortrans.id"; $SetldTrans=DB_query($sql,$db, $ErrMsg); $NumberOfRecordsReturned += DB_num_rows($SetldTrans); @@ -273,72 +268,72 @@ /*Now figure out the aged analysis for the customer under review */ $SQL = "SELECT debtorsmaster.name, - currencies.currency, - paymentterms.terms, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription, - SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc) AS balance, - SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= - paymentterms.daysbeforedue - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1', 'MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= 0 - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END) AS due, - Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= - (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') .")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END) AS overdue1, - Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + - " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . - interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) - >= " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END) AS overdue2 - FROM debtorsmaster INNER JOIN paymentterms - ON debtorsmaster.paymentterms = paymentterms.termsindicator - INNER JOIN currencies - ON debtorsmaster.currcode = currencies.currabrev - INNER JOIN holdreasons - ON debtorsmaster.holdreason = holdreasons.reasoncode - INNER JOIN debtortrans - ON debtorsmaster.debtorno = debtortrans.debtorno - WHERE - debtorsmaster.debtorno = '" . $StmtHeader['debtorno'] . "' - GROUP BY - debtorsmaster.name, - currencies.currency, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription"; + currencies.currency, + paymentterms.terms, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription, + SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc) AS balance, + SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= + paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1', 'MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= 0 + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END) AS due, + Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= + (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') .")) >= " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END) AS overdue1, + Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + + " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . + interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) + >= " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END) AS overdue2 + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE + debtorsmaster.debtorno = '" . $StmtHeader['debtorno'] . "' + GROUP BY + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription"; $ErrMsg = 'The customer detail... [truncated message content] |
From: <dai...@us...> - 2011-07-03 03:01:47
|
Revision: 4619 http://web-erp.svn.sourceforge.net/web-erp/?rev=4619&view=rev Author: daintree Date: 2011-07-03 03:01:39 +0000 (Sun, 03 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CustWhereAlloc.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EDIProcessOrders.php trunk/PDFDeliveryDifferences.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFStockCheckComparison.php trunk/PrintCheque.php trunk/PrintCustStatements.php trunk/WorkOrderCosting.php trunk/doc/Change.log Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/CustWhereAlloc.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -12,7 +12,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Customer Where Allocated'). '" alt="" />' . $title . '</p>'; -echo '<table class=selection cellpadding=2><tr>'; +echo '<table class="selection" cellpadding=2> + <tr>'; echo '<td>' . _('Type') . ':</td> <td><select tabindex=1 name="TransType"> '; @@ -36,7 +37,9 @@ echo '<td>'._('Transaction Number').':</td> <td><input tabindex=2 type="text" name="TransNo" maxlength=10 size=10 value="'. $_POST['TransNo'] . '"></td>'; -echo '</tr></table><br /> +echo '</tr> + </table> + <br /> <div class="centre"><input tabindex=3 type="submit" name="ShowResults" value="' . _('Show How Allocated') . '"></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ @@ -49,9 +52,9 @@ /*First off get the DebtorTransID of the transaction (invoice normally) selected */ $sql = "SELECT id, - ovamount+ovgst AS totamt - FROM debtortrans - WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; + ovamount+ovgst AS totamt + FROM debtortrans + WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; $result = DB_query($sql , $db); @@ -60,25 +63,26 @@ $AllocToID = $myrow['id']; $sql = "SELECT type, - transno, - trandate, - debtortrans.debtorno, - reference, - rate, - ovamount+ovgst+ovfreight+ovdiscount as totalamt, - custallocns.amt - FROM debtortrans - INNER JOIN custallocns ON debtortrans.id=custallocns.transid_allocfrom - WHERE custallocns.transid_allocto='". $AllocToID."'"; + transno, + trandate, + debtortrans.debtorno, + reference, + rate, + ovamount+ovgst+ovfreight+ovdiscount as totalamt, + custallocns.amt + FROM debtortrans + INNER JOIN custallocns + ON debtortrans.id=custallocns.transid_allocfrom + WHERE custallocns.transid_allocto='". $AllocToID."'"; $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); - $TransResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<br /><table cellpadding=2 class=selection>'; + echo '<br /> + <table cellpadding=2 class="selection">'; echo '<tr> <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> @@ -91,7 +95,7 @@ <th>' . _('Ex Rate') . '</th> <th>' . _('Amount') . '</th> <th>' . _('Alloc') . '</th> - </tr>'; + </tr>'; echo $tableheader; $RowCounter = 1; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DailyBankTransactions.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -30,7 +30,8 @@ <td><select name="BankAccount">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr></table>'; prnMsg( _('Bank Accounts have not yet been defined. You must first') . ' <a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a> ' . _('and general ledger accounts to be affected'),'warn'); include('includes/footer.inc'); exit; @@ -41,9 +42,9 @@ $_POST['BankAccount']=$myrow['accountcode']; } if ($_POST['BankAccount']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } } echo '</select></td></tr>'; @@ -95,9 +96,9 @@ } else { $BankDetailRow = DB_fetch_array($BankResult); echo '<table class=selection> - <tr> - <th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> - </tr>'; + <tr> + <th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + </tr>'; echo '<tr> <th>' . ('Date') . '</th> <th>'._('Transaction type').'</th> Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DailySalesInquiry.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -52,7 +52,10 @@ } echo '</select></td>'; -echo '</tr></table><br /><div class="centre"><input tabindex=4 type=submit name="ShowResults" VALUE="' . _('Show Daily Sales For The Selected Month') . '">'; +echo '</tr> + </table> + <br /> + <div class="centre"><input tabindex=4 type=submit name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '">'; echo '</form></div>'; echo '<br />'; /*Now get and display the sales data returned */ @@ -92,13 +95,14 @@ echo '<table cellpadding=2 class=selection>'; echo'<tr> - <th>' . _('Sunday') . '</th> - <th>' . _('Monday') . '</th> - <th>' . _('Tuesday') . '</th> - <th>' . _('Wednesday') . '</th> - <th>' . _('Thursday') . '</th> - <th>' . _('Friday') . '</th> - <th>' . _('Saturday') . '</th></tr>'; + <th>' . _('Sunday') . '</th> + <th>' . _('Monday') . '</th> + <th>' . _('Tuesday') . '</th> + <th>' . _('Wednesday') . '</th> + <th>' . _('Thursday') . '</th> + <th>' . _('Friday') . '</th> + <th>' . _('Saturday') . '</th> + </tr>'; $CumulativeTotalSales = 0; $CumulativeTotalCost = 0; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DebtorsAtPeriodEnd.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -27,28 +27,29 @@ /*Now figure out the aged analysis for the customer range under review */ $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - SUM((debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)/debtortrans.rate) AS balance, - SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) AS fxbalance, - SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN - (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount)/debtortrans.rate ELSE 0 END) AS afterdatetrans, - SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' - AND (debtortrans.type=11 OR debtortrans.type=12) THEN - debtortrans.diffonexch ELSE 0 END) AS afterdatediffonexch, - SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN - debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount ELSE 0 END - ) AS fxafterdatetrans - FROM debtorsmaster, - currencies, - debtortrans - WHERE debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.debtorno = debtortrans.debtorno - AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' + debtorsmaster.name, + currencies.currency, + currencies.decimalplaces, + SUM((debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)/debtortrans.rate) AS balance, + SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) AS fxbalance, + SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount)/debtortrans.rate ELSE 0 END) AS afterdatetrans, + SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' + AND (debtortrans.type=11 OR debtortrans.type=12) THEN + debtortrans.diffonexch ELSE 0 END) AS afterdatediffonexch, + SUM(CASE WHEN debtortrans.prd > '" . $_POST['PeriodEnd'] . "' THEN + debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount ELSE 0 END + ) AS fxafterdatetrans + FROM debtorsmaster INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' GROUP BY debtorsmaster.debtorno, debtorsmaster.name, - currencies.currency"; + currencies.currency, + currencies.decimalplaces"; $CustomerResult = DB_query($SQL,$db,'','',false,false); @@ -84,8 +85,8 @@ if (abs($Balance)>0.009 OR ABS($FXBalance)>0.009) { - $DisplayBalance = number_format($DebtorBalances['balance'] - $DebtorBalances['afterdatetrans'],2); - $DisplayFXBalance = number_format($DebtorBalances['fxbalance'] - $DebtorBalances['fxafterdatetrans'],2); + $DisplayBalance = number_format($DebtorBalances['balance'] - $DebtorBalances['afterdatetrans'],$DebtorBalances['decimalplaces']); + $DisplayFXBalance = number_format($DebtorBalances['fxbalance'] - $DebtorBalances['fxafterdatetrans'],$DebtorBalances['decimalplaces']); $TotBal += $Balance; @@ -109,7 +110,7 @@ include('includes/PDFDebtorBalsPageHeader.inc'); } - $DisplayTotBalance = number_format($TotBal,2); + $DisplayTotBalance = number_format($TotBal,$_SESSION['CompanyRecord']['decimalplaces']); $LeftOvers = $pdf->addTextWrap(50,$YPos,160,$FontSize,_('Total balances'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DeliveryDetails.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -40,7 +40,7 @@ if (isset($_POST['ProcessOrder']) OR isset($_POST['MakeRecurringOrder'])) { /*need to check for input errors in any case before order processed */ - $_POST['Update']='Yes rerun the validation checks'; + $_POST['Update']='Yes rerun the validation checks'; //no need for gettext! /*store the old freight cost before it is recalculated to ensure that there has been no change - test for change after freight recalculated and get user to re-confirm if changed */ @@ -126,22 +126,22 @@ } } $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.phoneno, + custbranch.email, + custbranch.defaultlocation, + custbranch.defaultshipvia, + custbranch.deliverblind, + custbranch.specialinstructions, + custbranch.estdeliverydays + 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]->CustomerName . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; @@ -256,7 +256,7 @@ if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors){ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; - prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/RecurringOrders.php?identifier='.$identifier . "&NewRecurringOrder=Yes'>". _('click here') .'</a> '. _('to continue'),'info'); + prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $rootpath . '/RecurringOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'. _('click here') .'</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; } @@ -569,7 +569,7 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br /><table class=selection> + echo '<br /><table class="selection"> <tr> <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td> @@ -591,13 +591,13 @@ echo '<br /><table class=selection> <tr> <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> - <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> </tr> </table>'; echo '<br /><table class=selection> <tr> <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> - <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> </tr> </table>'; } @@ -639,7 +639,7 @@ $ErrMsg = _('Could not update the contract status'); $DbgMsg = _('The SQL that failed to update the contract status was'); $UpdContractResult=DB_query("UPDATE contracts SET status=2, - wo='" . $WONo . "' + wo='" . $WONo . "' WHERE orderno='" .$_SESSION['ExistingOrder'] . "'", $db,$ErrMsg,$DbgMsg,true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, @@ -653,7 +653,7 @@ workcentreadded, '" . $_SESSION['Items'.$identifier]->Location ."', '" . Date('Y-m-d') . "', - '2037-12-31' + '2099-12-31' FROM contractbom WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); @@ -707,31 +707,30 @@ } //end test to see if the order was a contract quotation being changed to an order - $HeaderSQL = "UPDATE salesorders - SET debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - branchcode = '" . $_SESSION['Items'.$identifier]->Branch . "', - customerref = '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', - comments = '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', - ordertype = '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - shipvia = '" . $_POST['ShipVia'] . "', - deliverydate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->DeliveryDate)) . "', - quotedate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->QuoteDate)) . "', - confirmeddate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->ConfirmedDate)) . "', - deliverto = '" . DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', - deladd1 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', - deladd2 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', - deladd3 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', - deladd4 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', - deladd5 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', - deladd6 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', - contactphone = '" . $_SESSION['Items'.$identifier]->PhoneNo . "', - contactemail = '" . $_SESSION['Items'.$identifier]->Email . "', - freightcost = '" . $_SESSION['Items'.$identifier]->FreightCost ."', - fromstkloc = '" . $_SESSION['Items'.$identifier]->Location ."', - printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', - quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', - deliverblind = '" . $_SESSION['Items'.$identifier]->DeliverBlind . "' - WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] ."'"; + $HeaderSQL = "UPDATE salesorders SET debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + branchcode = '" . $_SESSION['Items'.$identifier]->Branch . "', + customerref = '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', + comments = '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', + ordertype = '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', + shipvia = '" . $_POST['ShipVia'] . "', + deliverydate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->DeliveryDate)) . "', + quotedate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->QuoteDate)) . "', + confirmeddate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->ConfirmedDate)) . "', + deliverto = '" . DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', + deladd1 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', + deladd2 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', + deladd3 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', + deladd4 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', + deladd5 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', + deladd6 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', + contactphone = '" . $_SESSION['Items'.$identifier]->PhoneNo . "', + contactemail = '" . $_SESSION['Items'.$identifier]->Email . "', + freightcost = '" . $_SESSION['Items'.$identifier]->FreightCost ."', + fromstkloc = '" . $_SESSION['Items'.$identifier]->Location ."', + printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', + quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', + deliverblind = '" . $_SESSION['Items'.$identifier]->DeliverBlind . "' + WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] ."'"; $DbgMsg = _('The SQL that was used to update the order and failed was'); $ErrMsg = _('The order cannot be updated because'); Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DiscountCategories.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -28,10 +28,10 @@ //first off validate inputs sensible $result = DB_query("SELECT stockid - FROM stockmaster - WHERE mbflag <>'K' - AND mbflag<>'D' - AND stockid='" . strtoupper($_POST['StockID']) . "'",$db); + FROM stockmaster + WHERE mbflag <>'K' + AND mbflag<>'D' + AND stockid='" . strtoupper($_POST['StockID']) . "'",$db); if (DB_num_rows($result)==0){ $InputError = 1; prnMsg(_('The stock item entered must be set up as either a manufactured or purchased or assembly item'),'warn'); @@ -59,8 +59,8 @@ echo '<br />'; } elseif (isset($_POST['SubmitCategory'])) { $sql="UPDATE stockmaster - SET discountcategory='".$_POST['DiscountCategory']."' - WHERE categoryid='".$_POST['stockcategory']."'"; + SET discountcategory='".$_POST['DiscountCategory']."' + WHERE categoryid='".$_POST['stockcategory']."'"; $result=DB_query($sql, $db); } @@ -85,7 +85,10 @@ } echo '</select></td>'; - echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br />'; + echo '<td><input type="submit" name="select" value="'._('Select').'"></td> + </tr> + </table> + <br />'; } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; @@ -125,7 +128,8 @@ <td><input type="text" name="PartID" size=10 maxlength=10 value="' . $_POST['PartID'] . '"></td> <td>' . _('Partial description') . ':</td> <td><input type="text" name="PartDesc" size=10 value="' . $_POST['PartDesc'] .'" maxlength=10></td> - <td><input type="submit" name="search" value="' . _('Search') .'"></td></tr>'; + <td><input type="submit" name="search" value="' . _('Search') .'"></td> + </tr>'; echo '</table>'; @@ -212,7 +216,7 @@ printf('<td>%s</td> <td>%s - %s</td> - <td><a href="%s">'. _('Delete') .'</td> + <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount category?') . '\');">'. _('Delete') .'</td> </tr>', $myrow['discountcategory'], $myrow['stockid'], Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/DiscountMatrix.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -136,23 +136,25 @@ echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; $sql = "SELECT sales_type, - salestype, - discountcategory, - quantitybreak, - discountrate - FROM discountmatrix INNER JOIN salestypes - ON discountmatrix.salestype=salestypes.typeabbrev - ORDER BY salestype, - discountcategory, - quantitybreak"; + salestype, + discountcategory, + quantitybreak, + discountrate + FROM discountmatrix INNER JOIN salestypes + ON discountmatrix.salestype=salestypes.typeabbrev + ORDER BY salestype, + discountcategory, + quantitybreak"; $result = DB_query($sql,$db); echo '<table class=selection>'; -echo '<tr><th>' . _('Sales Type') . '</th> +echo '<tr> + <th>' . _('Sales Type') . '</th> <th>' . _('Discount Category') . '</th> <th>' . _('Quantity Break') . '</th> - <th>' . _('Discount Rate') . ' %' . '</th></tr>'; + <th>' . _('Discount Rate') . ' %' . '</th> + </tr>'; $k=0; //row colour counter @@ -170,7 +172,7 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><a href="%s">' . _('Delete') . '</td> + <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</td> </tr>', $myrow['sales_type'], $myrow['discountcategory'], Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/EDIMessageFormat.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -31,13 +31,13 @@ sequenceno, section, linetext) - SELECT '".$PartnerCode."', - 'INVOIC', - sequenceno, - section, - linetext - FROM edimessageformat - WHERE partnercode='DEFAULT' + SELECT '".$PartnerCode."', + 'INVOIC', + sequenceno, + section, + linetext + FROM edimessageformat + WHERE partnercode='DEFAULT' AND messagetype='INVOIC'"; $ErrMsg = _('There was an error inserting the default template invoice message records for') . ' ' . $PartnerCode . ' ' . _('because'); @@ -113,23 +113,23 @@ or deletion of the records*/ $sql = "SELECT id, - section, - sequenceno, - linetext - FROM edimessageformat - WHERE partnercode='" . $PartnerCode . "' - AND messagetype='" . $MessageType . "' - ORDER BY sequenceno"; + section, + sequenceno, + linetext + FROM edimessageformat + WHERE partnercode='" . $PartnerCode . "' + AND messagetype='" . $MessageType . "' + ORDER BY sequenceno"; $result = DB_query($sql,$db); echo '<table class=selection>'; echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; $TableHeader = '<tr> - <th>' . _('Section') . '</th> - <th>' . _('Sequence') . '</th> - <th>' . _('Format String') . '</th> - </tr>'; + <th>' . _('Section') . '</th> + <th>' . _('Sequence') . '</th> + <th>' . _('Format String') . '</th> + </tr>'; echo $TableHeader; $k=0; //row colour counter @@ -145,18 +145,18 @@ printf('<td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> - <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> - </tr>', - $myrow[1], - $myrow[2], - $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0]); + <td class=number>%s</td> + <td>%s</td> + <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> + <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> + </tr>', + $myrow[1], + $myrow[2], + $myrow[3], + $_SERVER['PHP_SELF'] . '?' . SID, + $myrow[0], + $_SERVER['PHP_SELF'] . '?' . SID, + $myrow[0]); } //END WHILE LIST LOOP echo '</table><p>'; Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/EDIProcessOrders.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.20 $ */ /* $Id$*/ -//$PageSecurity =11; - include ('includes/session.inc'); $title = _('Process EDI Orders'); @@ -40,7 +37,7 @@ /*Read in the EANCOM Order Segments for the current seg group from the segments table */ -$sql = 'SELECT id, segtag, maxoccur, seggroup FROM edi_orders_segs'; +$sql = "SELECT id, segtag, maxoccur, seggroup FROM edi_orders_segs"; $OrderSeg = DB_query($sql,$db); $i=0; $Seg = array(); @@ -58,7 +55,7 @@ while (false !== ($OrderFile=readdir($dirhandle))){ /*there are files in the incoming orders dir */ $TryNextFile = False; - echo "<br />$OrderFile"; + echo '<br />' . $OrderFile; /*Counter that keeps track of the array pointer for the 1st seg in the current seg group */ $FirstSegInGrp =0; @@ -541,7 +538,7 @@ } else { $mail->setSubject(_('EDI Order Message') . ' ' . $Order->CustRef); - $EDICustServPerson ="'phil' <phil@localhost>"; + $EDICustServPerson = $_SESSION['PurchasingManagerEmail']; $Recipients = array($EDICustServPerson); } @@ -556,7 +553,6 @@ - } /*end of the loop around all the incoming order files in the incoming orders directory */ Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFDeliveryDifferences.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.15 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,42 +24,51 @@ echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Delivery Differences Report') . '</p>'; - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . - ":</td><td><input type=text class=date alt='".$_SESSION['DefaultDateFormat']. - "' name='FromDate' maxlength=10 size=10 value='" . - Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ":</td><td><input type=text class=date alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . ':</td> + <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ':</td><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="ToDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; $result = DB_query($sql,$db); - echo "<select name='CategoryID'>"; - echo "<option selected value='All'>" . _('Over All Categories'); + echo '<select name="CategoryID">'; + echo '<option selected value="All">' . _('Over All Categories') . '</option>'; - while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription']; - } + while ($myrow=DB_fetch_array($result)){ + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; + } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Inventory Location') . ":</td><td><select name='Location'>"; - echo "<option selected value='All'>" . _('All Locations'); + echo '<tr><td>' . _('Inventory Location') . ':</td> + <td><select name="Location"> + <option selected value="All">' . _('All Locations') . '</option>'; - $result= DB_query('SELECT loccode, locationname FROM locations',$db); - while ($myrow=DB_fetch_array($result)){ - echo "<option value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - } + $result= DB_query("SELECT loccode, locationname FROM locations",$db); + while ($myrow=DB_fetch_array($result)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>"; - echo "<option selected value='No'>" . _('No'); - echo "<option value='Yes'>" . _('Yes'); - echo "</select></td></tr></table><br /><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Email the report off') . ':</td> + <td><select name="Email"> + <option selected value="No">' . _('No') . '</option> + <option value="Yes">' . _('Yes') . '</option> + </select> + </td> + </tr> + </table> + <br /> + <div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -257,20 +263,8 @@ $YPos-=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,_('DIFOT') . ' ' . number_format((1-($TotalDiffs/$myrow[0])) * 100,2) . '%', 'left'); -/* UldisN -$pdfcode = $pdf->output(); -$len = mb_strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=DeliveryDifferences.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ $ReportFileName = $_SESSION['DatabaseName'] . '_DeliveryDifferences_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN +$pdf->OutputD($ReportFileName); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFQuotation.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -84,8 +84,8 @@ $FontSize=12; $PageNumber = 1; $line_height=15; -// $pdf->selectFont('./fonts/Helvetica.afm'); + /* Now ... Has the order got any line items still outstanding to be invoiced */ $ErrMsg = _('There was a problem retrieving the quotation line details for quotation Number') . ' ' . @@ -224,28 +224,16 @@ } /*end if there are line details to show on the quotation*/ -//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); -//$len = mb_strlen($pdfcode); if ($ListCount == 0){ - $title = _('Print Quotation Error'); - include('includes/header.inc'); - echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). - '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). - '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). + '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); exit; } else { -/* - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Quotation.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); -//echo 'here'; - $pdf->Output('PDFQuotation.pdf', 'I'); -*/ - $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFQuotationPortrait.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,7 +2,6 @@ /* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -59,18 +58,17 @@ //If there are no rows, there's a problem. if (DB_num_rows($result)==0){ - $title = _('Print Quotation Error'); - include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; - include('includes/footer.inc'); - exit; + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<div class="centre"><br /><br /><br />'; + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> + </td></tr></table></div><br /><br /><br />'; + include('includes/footer.inc'); + exit; } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ - - $myrow = DB_fetch_array($result); + $myrow = DB_fetch_array($result); } /*retrieve the order details from the database to print */ @@ -85,7 +83,6 @@ $FontSize=12; $PageNumber = 1; $line_height=24; -// $pdf->selectFont('./fonts/Helvetica.afm'); /* Now ... Has the order got any line items still outstanding to be invoiced */ @@ -137,13 +134,19 @@ $TaxProv = $myrow['taxprovinceid']; $TaxCat = $myrow2['taxcatid']; $Branch = $myrow['branchcode']; - $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $sql3 = " SELECT taxgrouptaxes.taxauthid + FROM taxgrouptaxes INNER JOIN custbranch + ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid + WHERE custbranch.branchcode='" .$Branch ."'"; $result3=DB_query($sql3,$db, $ErrMsg); while ($myrow3=DB_fetch_array($result3)){ $TaxAuth = $myrow3['taxauthid']; } - $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $sql4 = "SELECT * FROM taxauthrates + WHERE dispatchtaxprovince='" .$TaxProv ."' + AND taxcatid='" .$TaxCat ."' + AND taxauthority='" .$TaxAuth ."'"; $result4=DB_query($sql4,$db, $ErrMsg); while ($myrow4=DB_fetch_array($result4)){ $TaxClass = 100 * $myrow4['taxrate']; @@ -162,9 +165,9 @@ $LeftOvers = $pdf->addTextWrap(120,$YPos,295,$FontSize,$myrow2['description']); $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize,$DisplayQty,'right'); $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,$DisplayPrice,'right'); - if ($DisplayDiscount > 0){ - $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); - } + if ($DisplayDiscount > 0){ + $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); + } $LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize,$DisplayTaxClass,'right'); $LeftOvers = $pdf->addTextWrap(410,$YPos,85,$FontSize,$DisplayTaxAmount,'center'); $LeftOvers = $pdf->addTextWrap(460,$YPos,90,$FontSize,$DisplayTotal,'right'); @@ -185,12 +188,11 @@ } //end while there are line items to print out if ((mb_strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) - OR (mb_strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) - OR $YPos-$line_height <= 50){ - /* We reached the end of the page so finsih off the page and start a newy */ - $PageNumber++; - include ('includes/PDFQuotationPageHeader.inc'); - + OR (mb_strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); @@ -225,28 +227,16 @@ } /*end if there are line details to show on the quotation*/ -//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); -//$len = mb_strlen($pdfcode); if ($ListCount == 0){ $title = _('Print Quotation Error'); include('includes/header.inc'); echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). - '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). - '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { -/* - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Quotation.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); -//echo 'here'; - $pdf->Output('PDFQuotation.pdf', 'I'); -*/ - $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } ?> Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PDFStockCheckComparison.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.18 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); If (isset($_POST['PrintPDF']) AND isset($_POST['ReportOrClose'])){ @@ -254,7 +251,11 @@ $LeftOvers = $pdf->addTextWrap(135,$YPos,180,$FontSize,$CheckItemRow['description'], 'left'); $LeftOvers = $pdf->addTextWrap(315,$YPos,60,$FontSize,$CheckItemRow['qoh'], 'right'); - $SQL = "SELECT qtycounted, reference FROM stockcounts WHERE loccode ='" . $Location . "' AND stockid = '" . $CheckItemRow['stockid'] . "'"; + $SQL = "SELECT qtycounted, + reference + FROM stockcounts + WHERE loccode ='" . $Location . "' + AND stockid = '" . $CheckItemRow['stockid'] . "'"; $Counts = DB_query($SQL,$db,'','',false,false); @@ -306,33 +307,10 @@ } /*end STOCK comparison while loop */ $YPos -= (2*$line_height); -/* - $pdfcode = $pdf->output(); - $len = mb_strlen($pdfcode); - if ($len<=20){ - $title = _('Print Stock check comparison Error'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('There were no Inventory Comparison sheets to print out'), 'error'); - echo '<br /><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=StockComparison.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_StockComparison_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); - $pdf->Output('StockCheckComparison.pdf', 'I'); - - } -*/ - $pdf->OutputD($_SESSION['DatabaseName'] . '_StockComparison_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - if ($_POST['ReportOrClose']=='ReportAndClose'){ //need to print the report first before this but don't risk re-adjusting all the stock!! $sql = "TRUNCATE TABLE stockcheckfreeze"; Modified: trunk/PrintCheque.php =================================================================== --- trunk/PrintCheque.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PrintCheque.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,10 +2,6 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - -//$PageSecurity = 5; - include('includes/DefinePaymentClass.php'); include('includes/session.inc'); include('Numbers/Words.php'); @@ -58,8 +54,6 @@ $LeftOvers = $pdf->addTextWrap(375,$YPos,100,$FontSize, number_format($_SESSION['PaymentDetail']->Amount,2), 'right'); - - // remittance advice 1 $YPos -= 14*$line_height; $LeftOvers = $pdf->addTextWrap(0,$YPos,$Page_Width,$FontSize,_('Remittance Advice'), 'center'); @@ -87,26 +81,7 @@ $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,number_format(round($_SESSION['PaymentDetail']->Amount,2),2), 'left'); -/* UldisN -$pdfcode = $pdf->output(); -$len = mb_strlen($pdfcode); -if ($len<=1){ - $title = _('Print Check Error'); - include('includes/header.inc'); - prnMsg(_('Could not print the cheque'),'warn'); - include('includes/footer.inc'); - exit; -} else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Cheque.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->Output('PrintCheque.pdf', 'I'); -} -*/ -$pdf->OutputD($_SESSION['DatabaseName'] . '_Cheque_' . date('Y-m-d') . '_ChequeNum_' . $_GET['ChequeNum'] . '.pdf');//UldisN -$pdf->__destruct(); //UldisN -?> +$pdf->OutputD($_SESSION['DatabaseName'] . '_Cheque_' . date('Y-m-d') . '_ChequeNum_' . $_GET['ChequeNum'] . '.pdf'); +$pdf->__destruct(); +?> \ No newline at end of file Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-07-02 23:04:59 UTC (rev 4618) +++ trunk/PrintCustStatements.php 2011-07-03 03:01:39 UTC (rev 4619) @@ -2,10 +2,6 @@ /* $Id$*/ -/* $Revision: 1.19 $ */ - -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -15,6 +11,7 @@ if (isset($_POST['PrintPDF'])) { $PaperSize='A4_Landscape'; } + if (isset($_GET['PrintPDF'])) { $FromCust = $_GET['FromCust']; $ToCust = $_GET['ToCust']; @@ -25,18 +22,16 @@ $PaperSize='A4_Landscape'; } - - if (isset($_GET['FromCust'])) { $getFrom = $_GET['FromCust']; $_POST['FromCust'] = $getFrom; } + if (isset($_GET['ToCust'])) { $getTo = $_GET['ToCust']; $_POST['ToCust'] = $getTo; } - If (isset($_POST['PrintPDF']) && isset($_POST['FromCust']) && $_POST['FromCust']!=''){ $_POST['FromCust'] = strtoupper($_POST['FromCust']); @@ -57,30 +52,30 @@ $ErrMsg = _('There was a problem settling the old transactions.'); $DbgMsg = _('The SQL used to settle outstanding transactions was'); $sql = "UPDATE debtortrans SET settled=1 - WHERE ABS(debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc)<0.009"; + WHERE ABS(debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc)<0.009"; $SettleAsNec = DB_query($sql,$db, $ErrMsg, $DbgMsg); /*Figure out who all the customers in this range are */ $ErrMsg= _('There was a problem retrieving the customer information for the statements from the database'); $sql = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.lastpaid, - debtorsmaster.lastpaiddate, - currencies.currency, - paymentterms.terms - FROM debtorsmaster INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - WHERE debtorsmaster.debtorno >='" . $_POST['FromCust'] ."' - AND debtorsmaster.debtorno <='" . $_POST['ToCust'] ."' - ORDER BY debtorsmaster.debtorno"; + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.lastpaid, + debtorsmaster.lastpaiddate, + currencies.currency, + paymentterms.terms + FROM debtorsmaster INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + WHERE debtorsmaster.debtorno >='" . $_POST['FromCust'] ."' + AND debtorsmaster.debtorno <='" . $_POST['ToCust'] ."' + ORDER BY debtorsmaster.debtorno"; $StatementResults=DB_query($sql,$db, $ErrMsg); if (DB_Num_Rows($StatementResults) == 0){ @@ -99,16 +94,16 @@ /*now get all the outstanding transaction ie Settled=0 */ $ErrMsg = _('There was a problem retrieving the outstanding transactions for') . ' ' . $StmtHeader['name'] . ' '. _('from the database') . '.'; $sql = "SELECT systypes.typename, - debtortrans.transno, - debtortrans.trandate, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst as total, - debtortrans.alloc, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc as ostdg - FROM debtortrans INNER JOIN systypes - ON debtortrans.type=systypes.typeid - WHERE debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' - AND debtortrans.settled=0 - ORDER BY debtortrans.id"; + debtortrans.transno, + debtortrans.trandate, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst as total, + debtortrans.alloc, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc as ostdg + FROM debtortrans INNER JOIN systypes + ON debtortrans.type=systypes.typeid + WHERE debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' + AND debtortrans.settled=0 + ORDER BY debtortrans.id"; $OstdgTrans=DB_query($sql,$db, $ErrMsg); @@ -118,22 +113,22 @@ $ErrMsg = _('There was a problem retrieving the transactions that were settled over the course of the last month for'). ' ' . $StmtHeader['name'] . ' ' . _('from the database'); if ($_SESSION['Show_Settled_LastMonth']==1){ $sql = "SELECT DISTINCT debtortrans.id, - systypes.typename, - debtortrans.transno, - debtortrans.trandate, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst AS total, - debtortrans.alloc, - debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc AS ostdg - FROM debtortrans INNER JOIN systypes - ON debtortrans.type=systypes.typeid - INNER JOIN custallocns - ON (debtortrans.id=custallocns.transid_allocfrom - OR debtortrans.id=custallocns.transid_allocto) - WHERE custallocns.datealloc >='" . - Date('Y-m-d',Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))) . "' - AND debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' - AND debtortrans.settled=1 - ORDER BY debtortrans.id"; + systypes.typename, + debtortrans.transno, + debtortrans.trandate, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst AS total, + debtortrans.alloc, + debtortrans.ovamount+debtortrans.ovdiscount+debtortrans.ovfreight+debtortrans.ovgst-debtortrans.alloc AS ostdg + FROM debtortrans INNER JOIN systypes + ON debtortrans.type=systypes.typeid + INNER JOIN custallocns + ON (debtortrans.id=custallocns.transid_allocfrom + OR debtortrans.id=custallocns.transid_allocto) + WHERE custallocns.datealloc >='" . + Date('Y-m-d',Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))) . "' + AND debtortrans.debtorno='" . $StmtHeader['debtorno'] . "' + AND debtortrans.settled=1 + ORDER BY debtortrans.id"; $SetldTrans=DB_query($sql,$db, $ErrMsg); $NumberOfRecordsReturned += DB_num_rows($SetldTrans); @@ -273,72 +268,72 @@ /*Now figure out the aged analysis for the customer under review */ $SQL = "SELECT debtorsmaster.name, - currencies.currency, - paymentterms.terms, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription, - SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc) AS balance, - SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= - paymentterms.daysbeforedue - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1', 'MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= 0 - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END) AS due, - Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= - (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') .")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END) AS overdue1, - Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + - " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . - interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) - >= " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + - debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END) AS overdue2 - FROM debtorsmaster INNER JOIN paymentterms - ON debtorsmaster.paymentterms = paymentterms.termsindicator - INNER JOIN currencies - ON debtorsmaster.currcode = currencies.currabrev - INNER JOIN holdreasons - ON debtorsmaster.holdreason = holdreasons.reasoncode - INNER JOIN debtortrans - ON debtorsmaster.debtorno = debtortrans.debtorno - WHERE - debtorsmaster.debtorno = '" . $StmtHeader['debtorno'] . "' - GROUP BY - debtorsmaster.name, - currencies.currency, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription"; + currencies.currency, + paymentterms.terms, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription, + SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc) AS balance, + SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= + paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1', 'MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= 0 + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END) AS due, + Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= + (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') .")) >= " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END) AS overdue1, + Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + + " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . + interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) + >= " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END) AS overdue2 + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE + debtorsmaster.debtorno = '" . $StmtHeader['debtorno'] . "' + GROUP BY + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription"; $ErrMsg = 'The customer detail... [truncated message content] |
From: <dai...@us...> - 2011-07-03 03:27:58
|
Revision: 4620 http://web-erp.svn.sourceforge.net/web-erp/?rev=4620&view=rev Author: daintree Date: 2011-07-03 03:27:48 +0000 (Sun, 03 Jul 2011) Log Message: ----------- strpos to mb_strpos Modified Paths: -------------- trunk/AccountSections.php trunk/ConfirmDispatch_Invoice.php trunk/Contracts.php trunk/Customers.php trunk/DailySalesInquiry.php trunk/DeliveryDetails.php trunk/MRPCreateDemands.php trunk/Numbers/Words.php trunk/PO_PDFPurchOrder.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectCreditItems.php trunk/Stocks.php trunk/SuppPriceList.php trunk/Tax.php trunk/TaxCategories.php trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poEditLangModule.php trunk/api/api_debtortransactions.php trunk/doc/Change.log trunk/doc/Manual/ManualAPIFunctions.php trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/DateFunctions.inc trunk/includes/EDIVariableSubstitution.inc trunk/includes/EDIconfig.inc trunk/includes/RFC822.php trunk/includes/class.pdf.php trunk/includes/phplot/phplot.php trunk/includes/smtp.php trunk/includes/tcpdf/CHANGELOG.TXT trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/tcpdf.php trunk/install/save.php trunk/reportwriter/WriteReport.inc trunk/reportwriter/admin/RCFunctions.inc trunk/reportwriter/admin/forms/ReportsCritSetup.html trunk/reportwriter/forms/FormsFilter.html trunk/reportwriter/forms/ReportsFilter.html Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/AccountSections.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -86,7 +86,7 @@ $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SectionID']) and strpos($_POST['SectionID'],".")>0) { + if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -800,7 +800,7 @@ /*Test to see if the item being sold is an asset */ if (substr($OrderLine->StockID,0,6)=='ASSET-'){ $IsAsset = true; - $HyphenOccursAt = strpos($OrderLine->StockID,'-',6); + $HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6); if ($HyphenOccursAt == false){ $AssetNumber = intval(substr($OrderLine->StockID,6)); } else { Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Contracts.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -224,7 +224,7 @@ prnMsg(_('The contract reference is expected to be more than 2 characters long. Please alter the contract reference before proceeding.'),'error'); $InputError = true; } - if(ContainsIllegalCharacters($_POST['ContractRef']) OR strpos($_POST['ContractRef'],' ')>0){ + if(ContainsIllegalCharacters($_POST['ContractRef']) OR mb_strpos($_POST['ContractRef'],' ')>0){ prnMsg(_('The contract reference cannot contain any spaces, slashes, or inverted commas. Please alter the contract reference before proceeding.'),'error'); $InputError = true; } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Customers.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -49,7 +49,7 @@ prnMsg( _('The debtor code cannot be empty'),'error'); $Errors[$i] = 'DebtorNo'; $i++; - } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR strpos($_POST['DebtorNo'], ' '))) { + } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR mb_strpos($_POST['DebtorNo'], ' '))) { $InputError = 1; prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'DebtorNo'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/DailySalesInquiry.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -59,11 +59,11 @@ echo '</form></div>'; echo '<br />'; /*Now get and display the sales data returned */ -if (strpos($EndDateSQL,'/')) { +if (mb_strpos($EndDateSQL,'/')) { $Date_Array = explode('/',$EndDateSQL); -} elseif (strpos ($EndDateSQL,'-')) { +} elseif (mb_strpos ($EndDateSQL,'-')) { $Date_Array = explode('-',$EndDateSQL); -} elseif (strpos ($EndDateSQL,'.')) { +} elseif (mb_strpos ($EndDateSQL,'.')) { $Date_Array = explode('.',$EndDateSQL); } Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/DeliveryDetails.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -61,7 +61,7 @@ $InputErrors =1; prnMsg(_('You should enter the street address in the box provided') . '. ' . _('Orders cannot be accepted without a valid street address'),'error'); } -// if (strpos($_POST['BrAdd1'],_('Box'))>0){ +// if (mb_strpos($_POST['BrAdd1'],_('Box'))>0){ // prnMsg(_('You have entered the word') . ' "' . _('Box') . '" ' . _('in the street address') . '. ' . _('Items cannot be delivered to') . ' ' ._('box') . ' ' . _('addresses'),'warn'); // } if (!is_numeric($_POST['FreightCost'])){ Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/MRPCreateDemands.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -83,11 +83,11 @@ // Create array of dates based on DistDate and adding either weeks or months $FormatedDistdate = FormatDateForSQL($_POST['DistDate']); -if (strpos($FormatedDistdate,"/")) { +if (mb_strpos($FormatedDistdate,"/")) { list($yyyy,$mm,$dd) = explode("/",$FormatedDistdate); -} else if (strpos($FormatedDistdate,"-")) { +} else if (mb_strpos($FormatedDistdate,"-")) { list($yyyy,$mm,$dd) = explode("-",$FormatedDistdate); -} else if (strpos($FormatedDistdate,".")) { +} else if (mb_strpos($FormatedDistdate,".")) { list($yyyy,$mm,$dd) = explode(".",$FormatedDistdate); } Modified: trunk/Numbers/Words.php =================================================================== --- trunk/Numbers/Words.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Numbers/Words.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -64,8 +64,8 @@ //Phil mods to ensure correct translation used. if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ //try to drop off the .utf8 suffix then recheck - if (strpos($locale,'.utf8')){ - $locale = substr($locale, 0,strpos($locale,'.utf8')); + if (mb_strpos($locale,'.utf8')){ + $locale = substr($locale, 0,mb_strpos($locale,'.utf8')); } if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ $locale = substr($locale,0,2); @@ -132,7 +132,7 @@ @$obj =& new $classname; - if (strpos($num, '.') === false) + if (mb_strpos($num, '.') === false) { $ret = trim($obj->toCurrencyWords($int_curr, $num)); } else { Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/PO_PDFPurchOrder.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -385,7 +385,7 @@ if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ - if (mb_strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){ + if (mb_strlen($ContactDetails['email'])>2 AND mb_strpos($ContactDetails['email'],'@')>0){ if ($_POST['EmailTo']==$ContactDetails['email']){ echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } else { Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/PcExpensesTypeTab.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -17,7 +17,7 @@ $SelectedType=''; } -if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0)){ +if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR mb_strpos($SelectedType,' ')>0)){ $InputError = 1; prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error'); } Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/PcTypeTabs.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ echo prnMsg(_('The tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; - }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR strpos($_POST['TypeTabCode'],' ')>0){ + }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR mb_strpos($_POST['TypeTabCode'],' ')>0){ $InputError = 1; prnMsg(_('The petty cash tab type code cannot contain any of the illegal characters'),'error'); } elseif (mb_strlen($_POST['TypeTabDescription']) >50) { Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/SelectCreditItems.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -116,8 +116,8 @@ /*will only be true if page called from customer selection form parse the $Select string into customer code and branch code */ - $_SESSION['CreditItems']->Branch = substr($_POST['Select'],strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = substr($_POST['Select'],0,strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->Branch = substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); + $_POST['Select'] = substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); /*Now retrieve customer information - name, salestype, currency, terms etc */ Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Stocks.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -102,7 +102,7 @@ $Errors[$i] = 'StockID'; $i++; } - if (ContainsIllegalCharacters($StockID) OR strpos($StockID,' ')) { + if (ContainsIllegalCharacters($StockID) OR mb_strpos($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); $Errors[$i] = 'StockID'; Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/SuppPriceList.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -138,11 +138,11 @@ // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - if (strpos($myrow[3],'-')) { + if (mb_strpos($myrow[3],'-')) { $DateArray=explode('-', $myrow[3]); - } else if (strpos($myrow[3],'/')) { + } else if (mb_strpos($myrow[3],'/')) { $DateArray=explode('/', $myrow[3]); - } else if (strpos($myrow[3],'.')) { + } else if (mb_strpos($myrow[3],'.')) { $DateArray=explode('.', $myrow[3]); } $dateprice=date($_SESSION['DefaultDateFormat'], mktime(0,0,0,$DateArray[1],$DateArray[2],$DateArray[0])); Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Tax.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -127,9 +127,9 @@ /*Now do the inputs from SuppTrans */ /*Only have dates in SuppTrans no periods so need to get the starting date */ - if (strpos($PeriodEnd,'/')) { + if (mb_strpos($PeriodEnd,'/')) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strpos($PeriodEnd,'.')) { + } elseif (mb_strpos($PeriodEnd,'.')) { $Date_Array = explode('.',$PeriodEnd); } if ($_SESSION['DefaultDateFormat']=='d/m/Y'){ Modified: trunk/TaxCategories.php =================================================================== --- trunk/TaxCategories.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/TaxCategories.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -26,7 +26,7 @@ //first off validate inputs sensible - if (strpos($_POST['TaxCategoryName'],'&')>0 OR strpos($_POST['TaxCategoryName'],"'")>0) { + if (mb_strpos($_POST['TaxCategoryName'],'&')>0 OR mb_strpos($_POST['TaxCategoryName'],"'")>0) { $InputError = 1; prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); } Modified: trunk/TaxProvinces.php =================================================================== --- trunk/TaxProvinces.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/TaxProvinces.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -25,7 +25,7 @@ //first off validate inputs sensible - if (strpos($_POST['TaxProvinceName'],'&')>0 OR strpos($_POST['TaxProvinceName'],"'")>0) { + if (mb_strpos($_POST['TaxProvinceName'],'&')>0 OR mb_strpos($_POST['TaxProvinceName'],"'")>0) { $InputError = 1; prnMsg( _('The tax province name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); } Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/UnitsOfMeasure.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -25,7 +25,7 @@ //first off validate inputs sensible - if (strpos($_POST['MeasureName'],'&')>0 OR strpos($_POST['MeasureName'],"'")>0) { + if (mb_strpos($_POST['MeasureName'],'&')>0 OR mb_strpos($_POST['MeasureName'],"'")>0) { $InputError = 1; prnMsg( _('The unit of measure cannot contain the character') . " '&' " . _('or the character') ." '",'error'); } Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/UpgradeDatabase.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -159,7 +159,7 @@ if (substr($SQLEntries[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){ $sql = substr($sql,0,mb_strlen($sql)-1); $result = DB_query($sql, $db, '','', false, false); echo '<tr><td>' . $sql . '</td>'; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_MakeNewCompany.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -118,7 +118,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -49,7 +49,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -51,7 +51,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $sql = substr($sql,0,mb_strlen($sql)-1); $result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false); switch (DB_error_no($db)) { Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -51,7 +51,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $sql = substr($sql,0,mb_strlen($sql)-1); $result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false); switch (DB_error_no($db)) { Modified: trunk/Z_poEditLangModule.php =================================================================== --- trunk/Z_poEditLangModule.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_poEditLangModule.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -144,7 +144,7 @@ for ($i=1; $i<=$TotalLines; $i++) { - $b = strpos($AlsoIn[$i], $_POST['module']); + $b = mb_strpos($AlsoIn[$i], $_POST['module']); if ($b === False) { /* skip it */ Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/api/api_debtortransactions.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -20,11 +20,11 @@ //for MySQL dates are in the format YYYY-mm-dd - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -53,9 +53,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strpos($TranDate,'/')>0) { + if (mb_strpos($TranDate,'/')>0) { $DateArray = explode('/',$TranDate); - } elseif (strpos($TranDate,'.')>0) { + } elseif (mb_strpos($TranDate,'.')>0) { $DateArray = explode('.',$TranDate); } if ($DateFormat=='d/m/Y') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/doc/Change.log 2011-07-03 03:27:48 UTC (rev 4620) @@ -2666,7 +2666,7 @@ 28/8/04 Steve - Minor changes to theme default.css files 28/8/04 Steve - SelectCustomer.php SelectProduct.php SelectSupplier.php all modified to allow paging where a large result set is returned 25/8/04 SelectCreditItems.php now allows text line entries with each line of the credit note -23/8/04 SelectOrderItems.php SelectCreditItems.php strrpos works differently in PHP 5 changed to use strpos +23/8/04 SelectOrderItems.php SelectCreditItems.php strrpos works differently in PHP 5 changed to use mb_strpos 14/8/04 Changed ConfirmDispatch_Invoice.php to allow entry of consignment reference also changed PrintCustTrans.php and PDFPrintCustTransPageHeader.inc to print out the narrative on sales order lines and the consignment number 14/8/04 Changed SelectOrderItems.php to allow entry of narrative and update narrative entries also show warning when quick entries not processed. 14/8/04 Changed DefineCartClass.inc to have a Narrative variable in LineItems and a Consignment variable in the header Modified: trunk/doc/Manual/ManualAPIFunctions.php =================================================================== --- trunk/doc/Manual/ManualAPIFunctions.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/doc/Manual/ManualAPIFunctions.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -26,7 +26,7 @@ $weberppassword = $myrow[0]; $ServerString = $_SERVER['HTTP_HOST'].$rootpath; -$FirstBitOfURL = substr($ServerString,0,strpos($ServerString,'/doc/Manual')); +$FirstBitOfURL = substr($ServerString,0,mb_strpos($ServerString,'/doc/Manual')); $ServerURL = "http://". $FirstBitOfURL ."/api/api_xml-rpc.php"; Modified: trunk/includes/ConstructSQLForUserDefinedSalesReport.inc =================================================================== --- trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -257,7 +257,7 @@ The first 6 Columns are defined by the group by fields so for eg the first col defined will be col 7 and so on - thats why need to add 6 to the col defined as */ - $length_ColNum = strpos($SQLSelectCls, 'AS col' . ($Cols['colnumerator'] + 8) , 7); + $length_ColNum = mb_strpos($SQLSelectCls, 'AS col' . ($Cols['colnumerator'] + 8) , 7); If ($length_ColNum == 0) { @@ -274,9 +274,9 @@ /*find the comma just before the Select Cls statement for the numerator column */ do { - $strt_ColNum = strpos( $SQLSelectCls, ',', $strt_ColNum + 1) + 1; + $strt_ColNum = mb_strpos( $SQLSelectCls, ',', $strt_ColNum + 1) + 1; - } while (strpos($SQLSelectCls, ',', $strt_ColNum) < $length_ColNum && strpos($SQLSelectCls, ',' , $strt_ColNum)!=0); + } while (mb_strpos($SQLSelectCls, ',', $strt_ColNum) < $length_ColNum && mb_strpos($SQLSelectCls, ',' , $strt_ColNum)!=0); /*The length of the element in the select clause defining the column will be from the comma to the @@ -288,7 +288,7 @@ /*The denominator column is also required if the constant is not used so do the same again for the denominator */ - $length_ColDen = strpos($SQLSelectCls, 'AS col' . (($Cols['coldenominator']) + 8), 7); + $length_ColDen = mb_strpos($SQLSelectCls, 'AS col' . (($Cols['coldenominator']) + 8), 7); If ($length_ColDen == 0){ prnMsg (_('Calculated fields must use columns defined in the report specification') . '. ' . _('The denominator column number entered for this calculation is not defined in the report'),'error',_('Calculation With Undefined Denominator')); Exit; @@ -299,9 +299,9 @@ /*find the comma just before the Select Cls statement for the denominator column */ do { - $strt_ColDen = strpos( $SQLSelectCls, ',', $strt_ColDen +1)+1; + $strt_ColDen = mb_strpos( $SQLSelectCls, ',', $strt_ColDen +1)+1; - } while (strpos($SQLSelectCls, ',', $strt_ColDen) < $length_ColDen && strpos($SQLSelectCls, ',' , $strt_ColDen)!=0); + } while (mb_strpos($SQLSelectCls, ',', $strt_ColDen) < $length_ColDen && mb_strpos($SQLSelectCls, ',' , $strt_ColDen)!=0); $length_ColDen = $length_ColDen - $strt_ColDen - 1; Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/DateFunctions.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -21,11 +21,11 @@ //echo '<BR>The date entered is ' . $DateEntry; - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -83,11 +83,11 @@ function MonthAndYearFromSQLDate($DateEntry) { - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -101,11 +101,11 @@ function DayOfWeekFromSQLDate($DateEntry) { - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -119,11 +119,11 @@ function DayOfMonthFromSQLDate($DateEntry) { - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -154,11 +154,11 @@ //for MySQL dates are in the format YYYY-mm-dd - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } else { prnMsg(_('The date does not appear to be in a valid format. The date being converted from SQL format was:') . ' ' . $DateEntry,'error'); @@ -199,11 +199,11 @@ //for MySQL dates are in the format YYYY-mm-dd //EDI format 102 dates are in the format CCYYMMDD - just need to lose the seperator - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -223,11 +223,11 @@ $DateEntry = trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -332,11 +332,11 @@ $DateEntry =trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -388,11 +388,11 @@ $DateEntry = trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -455,11 +455,11 @@ $DateEntry = trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -581,11 +581,11 @@ $TranDate = trim($TranDate); - if (strpos($TranDate,'/')) { + if (mb_strpos($TranDate,'/')) { $Date_Array = explode('/',$TranDate); - } elseif (strpos ($TranDate,'-')) { + } elseif (mb_strpos ($TranDate,'-')) { $Date_Array = explode('-',$TranDate); - } elseif (strpos ($TranDate,'.')) { + } elseif (mb_strpos ($TranDate,'.')) { $Date_Array = explode('.',$TranDate); } @@ -648,11 +648,11 @@ $DateToAddTo = trim($DateToAddTo); - if (strpos($DateToAddTo,'/')) { + if (mb_strpos($DateToAddTo,'/')) { $Date_Array = explode('/',$DateToAddTo); - } elseif (strpos ($DateToAddTo,'-')) { + } elseif (mb_strpos ($DateToAddTo,'-')) { $Date_Array = explode('-',$DateToAddTo); - } elseif (strpos ($DateToAddTo,'.')) { + } elseif (mb_strpos ($DateToAddTo,'.')) { $Date_Array = explode('.',$DateToAddTo); } @@ -723,18 +723,18 @@ $Date1 = trim($Date1); $Date2 = trim($Date2); - if (strpos($Date1,'/')) { + if (mb_strpos($Date1,'/')) { $Date1_array = explode('/',$Date1); - } elseif (strpos ($Date1,'-')) { + } elseif (mb_strpos ($Date1,'-')) { $Date1_array = explode('-',$Date1); - } elseif (strpos ($Date1,'.')) { + } elseif (mb_strpos ($Date1,'.')) { $Date1_array = explode('.',$Date1); } - if (strpos($Date2,'/')) { + if (mb_strpos($Date2,'/')) { $Date2_array = explode('/',$Date2); - } elseif (strpos ($Date2,'-')) { + } elseif (mb_strpos ($Date2,'-')) { $Date2_array = explode('-',$Date2); - } elseif (strpos ($Date2,'.')) { + } elseif (mb_strpos ($Date2,'.')) { $Date2_array = explode('.',$Date2); } @@ -850,11 +850,11 @@ /* Convert the transaction date into a unix time stamp.*/ - if (strpos($TransDate,'/')) { + if (mb_strpos($TransDate,'/')) { $Date_Array = explode('/',$TransDate); - } elseif (strpos ($TransDate,'-')) { + } elseif (mb_strpos ($TransDate,'-')) { $Date_Array = explode('-',$TransDate); - } elseif (strpos ($TransDate,'.')) { + } elseif (mb_strpos ($TransDate,'.')) { $Date_Array = explode('.',$TransDate); } if (($_SESSION['DefaultDateFormat']=='d/m/Y') or ($_SESSION['DefaultDateFormat']=='d.m.Y')){ Modified: trunk/includes/EDIVariableSubstitution.inc =================================================================== --- trunk/includes/EDIVariableSubstitution.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/EDIVariableSubstitution.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -5,14 +5,14 @@ $PositionPointer = 0; $NewLineText =''; /* now get each occurence of [ in the line */ - while (strpos ($MsgLineText,'[',$PositionPointer)!=False){ + while (mb_strpos ($MsgLineText,'[',$PositionPointer)!=False){ $LastPositionPointer = $PositionPointer; - $PositionPointer = strpos ($MsgLineText,'[',$PositionPointer); + $PositionPointer = mb_strpos ($MsgLineText,'[',$PositionPointer); $NewLineText = $NewLineText . substr($MsgLineText,$LastPositionPointer,$PositionPointer-$LastPositionPointer); $LastPositionPointer = $PositionPointer; - $PositionPointer = strpos ($MsgLineText,']',$PositionPointer); + $PositionPointer = mb_strpos ($MsgLineText,']',$PositionPointer); $VariableName = substr($MsgLineText,$LastPositionPointer+1,$PositionPointer-$LastPositionPointer-1); Modified: trunk/includes/EDIconfig.inc =================================================================== --- trunk/includes/EDIconfig.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/EDIconfig.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -58,14 +58,14 @@ $PoistionPointer = 0; $NewLineText =''; /* now get each occurence of [ in the line */ - while (strpos ($LineDetails['linetext'],'[',$PoistionPointer)!=False){ + while (mb_strpos ($LineDetails['linetext'],'[',$PoistionPointer)!=False){ $LastPositionPointer = $PoistionPointer; - $PositionPointer = strpos ($LineDetails['linetext'],'[',$PoistionPointer); + $PositionPointer = mb_strpos ($LineDetails['linetext'],'[',$PoistionPointer); $NewLineText = $NewLineText . substr($LineDetails['linetext'],$LastPositionPointer,$PoistionPointer-$LastPositionPointer); $LastPositionPointer = $PoistionPointer; - $PositionPointer = strpos ($LineDetails['linetext'],']',$PoistionPointer); + $PositionPointer = mb_strpos ($LineDetails['linetext'],']',$PoistionPointer); $VariableName = substr($LineDetails['linetext'],$LastPositionPointer,$PoistionPointer-$LastPositionPointer); Modified: trunk/includes/RFC822.php =================================================================== --- trunk/includes/RFC822.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/RFC822.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -211,7 +211,7 @@ // brackets/quotes etc then something's fubar. // First check there's a colon at all: - if (strpos($string, ':') === false) { + if (mb_strpos($string, ':') === false) { $this->error = 'Invalid address: ' . $string; return false; } @@ -579,7 +579,7 @@ $comments[] = $comment; // +1 is for the trailing ) - $_mailbox = substr($_mailbox, strpos($_mailbox, $comment)+mb_strlen($comment)+1); + $_mailbox = substr($_mailbox, mb_strpos($_mailbox, $comment)+mb_strlen($comment)+1); } else { break; } @@ -647,7 +647,7 @@ function _validateRouteAddr($route_addr) { // Check for colon. - if (strpos($route_addr, ':') !== false) { + if (mb_strpos($route_addr, ':') !== false) { $parts = explode(':', $route_addr); $route = $this->_splitCheck($parts, ':'); } else { @@ -784,7 +784,7 @@ $addr_spec = trim($addr_spec); // Split on @ sign if there is one. - if (strpos($addr_spec, '@') !== false) { + if (mb_strpos($addr_spec, '@') !== false) { $parts = explode('@', $addr_spec); $local_part = $this->_splitCheck($parts, '@'); $domain = substr($addr_spec, mb_strlen($local_part . '@')); Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/class.pdf.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -282,13 +282,13 @@ $b2='LR'; } else { $b2=''; - if(is_int(strpos($border,'L'))) { + if(is_int(mb_strpos($border,'L'))) { $b2.='L'; } - if(is_int(strpos($border,'R'))) { + if(is_int(mb_strpos($border,'R'))) { $b2.='R'; } - $b=is_int(strpos($border,'T')) ? $b2.'T' : $b2; + $b=is_int(mb_strpos($border,'T')) ? $b2.'T' : $b2; } } $sep=-1; Modified: trunk/includes/phplot/phplot.php =================================================================== --- trunk/includes/phplot/phplot.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/phplot/phplot.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -1850,7 +1850,7 @@ $asked = strtolower(trim($which_opt)); # Look for the supplied value in a comma/space separated list. - if (strpos(", $which_acc,", ", $asked,") !== False) + if (mb_strpos(", $which_acc,", ", $asked,") !== False) return $asked; $this->PrintError("$which_func(): '$which_opt' not in available choices: '$which_acc'."); @@ -1889,7 +1889,7 @@ */ protected function CheckDataType($valid_types) { - if (strpos(", $valid_types,", ", $this->data_type,") !== False) + if (mb_strpos(", $valid_types,", ", $this->data_type,") !== False) return TRUE; $this->PrintError("Data type '$this->data_type' is not valid for '$this->plot_type' plots." Modified: trunk/includes/smtp.php =================================================================== --- trunk/includes/smtp.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/smtp.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -336,7 +336,7 @@ $loops = 0; if(is_resource($this->connection)){ - while((strpos($return, CRLF) === FALSE OR substr($line,3,1) !== ' ') AND $loops < 100){ + while((mb_strpos($return, CRLF) === FALSE OR substr($line,3,1) !== ' ') AND $loops < 100){ $line = fgets($this->connection, 512); $return .= $line; $loops++; Modified: trunk/includes/tcpdf/CHANGELOG.TXT =================================================================== --- trunk/includes/tcpdf/CHANGELOG.TXT 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/tcpdf/CHANGELOG.TXT 2011-07-03 03:27:48 UTC (rev 4620) @@ -798,7 +798,7 @@ - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php. 4.0.024 (2008-09-12) - - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4. + - "stripos" function was replaced with "mb_strpos + strtolower" for backward compatibility with PHP4. - support for Spot Colors were added. Check the new example n. 37 and the following new functions: AddSpotColor() SetDrawSpotColor() Modified: trunk/includes/tcpdf/barcodes.php =================================================================== --- trunk/includes/tcpdf/barcodes.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/tcpdf/barcodes.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -948,7 +948,7 @@ $sum = $startid; $clen = mb_strlen($code); for ($i = 0; $i < $clen; ++$i) { - $sum += (strpos($keys, $code{$i}) * ($i+1)); + $sum += (mb_strpos($keys, $code{$i}) * ($i+1)); } $check = ($sum % 103); // add start, check and stop codes @@ -957,7 +957,7 @@ $k = 0; $len = mb_strlen($code); for ($i = 0; $i < $len; ++$i) { - $ck = strpos($keys, $code{$i}); + $ck = mb_strpos($keys, $code{$i}); if (($i == 0) OR ($i > ($len-4))) { $char_num = ord($code{$i}); $seq = $chr[$char_num]; Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/tcpdf/tcpdf.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -3277,23 +3277,23 @@ $tempstyle = strtoupper($style); $style = ''; // underline - if (strpos($tempstyle, 'U') !== false) { + if (mb_strpos($tempstyle, 'U') !== false) { $this->underline = true; } else { $this->underline = false; } // line through (deleted) - if (strpos($tempstyle, 'D') !== false) { + if (mb_strpos($tempstyle, 'D') !== false) { $this->linethrough = true; } else { $this->linethrough = false; } // bold - if (strpos($tempstyle, 'B') !== false) { + if (mb_strpos($tempstyle, 'B') !== false) { $style .= 'B'; } // oblique - if (strpos($tempstyle, 'I') !== false) { + if (mb_strpos($tempstyle, 'I') !== false) { $style .= 'I'; } $bistyle = $style; @@ -3392,7 +3392,7 @@ $styles = array('' => '', 'B' => ',Bold', 'I' => ',Italic', 'BI' => ',BoldItalic'); $sname = $name.$styles[$bistyle]; // artificial bold - if (strpos($bistyle, 'B') !== false) { + if (mb_strpos($bistyle, 'B') !== false) { if (isset($desc['StemV'])) { $desc['StemV'] *= 2; } else { @@ -3400,7 +3400,7 @@ } } // artificial italic - if (strpos($bistyle, 'I') !== false) { + if (mb_strpos($bistyle, 'I') !== false) { if (isset($desc['ItalicAngle'])) { $desc['ItalicAngle'] -= 11; } else { @@ -4022,7 +4022,7 @@ } if (is_string($border)) { $lm = ($this->LineWidth / 2); - if (strpos($border,'L') !== false) { + if (mb_strpos($border,'L') !== false) { if ($this->rtl) { $xk = ($x - $w) * $k; } else { @@ -4030,7 +4030,7 @@ } $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y + $lm) * $k), $xk, (($this->h - ($y + $h + $lm)) * $k)); } - if (strpos($border,'T') !== false) { + if (mb_strpos($border,'T') !== false) { if ($this->rtl) { $xk = ($x - $w + $lm) * $k; $xwk = ($x - $lm) * $k; @@ -4040,7 +4040,7 @@ } $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y) * $k), $xwk, (($this->h - $y) * $k)); } - if (strpos($border,'R') !== false) { + if (mb_strpos($border,'R') !== false) { if ($this->rtl) { $xk = $x * $k; } else { @@ -4048,7 +4048,7 @@ } $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y + $lm) * $k), $xk, (($this->h - ($y + $h + $lm))* $k)); } - if (strpos($border,'B') !== false) { + if (mb_strpos($border,'B') !== false) { if ($this->rtl) { $xk = ($x - $w + $lm) * $k; $xwk = ($x - $lm) * $k; @@ -4459,16 +4459,16 @@ if ($border == 1) { $cborder = 'LTR'; } else { - if (!(false === strpos($border, 'L'))) { + if (!(false === mb_strpos($border, 'L'))) { $cborder .= 'L'; } - if (!(false === strpos($border, 'T'))) { + if (!(false === mb_strpos($border, 'T'))) { $cborder .= 'T'; } - if (!(false === strpos($border, 'R'))) { + if (!(false === mb_strpos($border, 'R'))) { $cborder .= 'R'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'B')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'B')))) { $cborder .= 'B'; } } @@ -4478,16 +4478,16 @@ if ($border == 1) { $cborder = 'LR'; } else { - if (!(false === strpos($border, 'L'))) { + if (!(false === mb_strpos($border, 'L'))) { $cborder .= 'L'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'T')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'T')))) { $cborder .= 'T'; } - if (!(false === strpos($border, 'R'))) { + if (!(false === mb_strpos($border, 'R'))) { $cborder .= 'R'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'B')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'B')))) { $cborder .= 'B'; } } @@ -4497,16 +4497,16 @@ if ($border == 1) { $cborder = 'LRB'; } else { - if (!(false === strpos($border, 'L'))) { + if (!(false === mb_strpos($border, 'L'))) { $cborder .= 'L'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'T')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'T')))) { $cborder .= 'T'; } - if (!(false === strpos($border, 'R'))) { + if (!(false === mb_strpos($border, 'R'))) { $cborder .= 'R'; } - if (!(false === strpos($border, 'B'))) { + if (!(false === mb_strpos($border, 'B'))) { $cborder .= 'B'; } } @@ -5441,7 +5441,7 @@ } elseif ($ct == 2) { $trns = array(ord(substr($t, 1, 1)), ord(substr($t, 3, 1)), ord(substr($t, 5, 1))); } else { - $pos = strpos($t, chr(0)); + $pos = mb_strpos($t, chr(0)); if ($pos !== false) { $trns = array($pos); } @@ -5743,7 +5743,7 @@ // define the ByteRange $byte_range = array(); $byte_range[0] = 0; - $byte_range[1] = strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10; + $byte_range[1] = mb_strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10; $byte_range[2] = $byte_range[1] + $this->signature_max_length + 2; $byte_range[3] = mb_strlen($pdfdoc) - $byte_range[2]; $pdfdoc = substr($pdfdoc, 0, $byte_range[1]).substr($pdfdoc, $byte_range[2]); @@ -5772,7 +5772,7 @@ $signature = file_get_contents($tempsign, false, null, $pdfdoc_length); unlink($tempsign); // extract signature - $signature = substr($signature, (strpos($signature, "%%EOF\n\n------") + 13)); + $signature = substr($signature, (mb_strpos($signature, "%%EOF\n\n------") + 13)); $tmparr = explode("\n\n", $signature); $signature = $tmparr[1]; unset($tmparr); @@ -8249,7 +8249,7 @@ $returncolor = false; $color = preg_replace('/[\s]*/', '', $color); // remove extra spaces $color = strtolower($color); - if (($dotpos = strpos($color, '.')) !== false) { + if (($dotpos = mb_strpos($color, '.')) !== false) { // remove class parent (i.e.: color.red) $color = substr($color, ($dotpos + 1)); } @@ -9016,7 +9016,7 @@ * @see SetLineStyle() */ public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9114,7 +9114,7 @@ * @since 2.1.000 (2008-01-08) */ public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9171,7 +9171,7 @@ * @since 3.0008 (2008-05-12) */ public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9243,7 +9243,7 @@ return; } if ($rx) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9404,7 +9404,7 @@ } $nc += 4; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9623,7 +9623,7 @@ if ('0000' == $round_corner) { // Not rounded $this->Rect($x, $y, $w, $h, $style, $border_style, $fill_color); } else { // Rounded - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -10495,7 +10495,7 @@ if (empty($this->javascript) AND empty($this->js_objects)) { return; } - if (strpos($this->javascript, 'this.addField') > 0) { + if (mb_strpos($this->javascript, 'this.addField') > 0) { if (!$this->ur) { //$this->setUserRights(); } @@ -12542,7 +12542,7 @@ preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); # find Creator if (count($regs) > 1) { $version_str = trim($regs[1]); # e.g. "Adobe Illustrator(R) 8.0" - if (strpos($version_str, 'Adobe Illustrator') !== false) { + if (mb_strpos($version_str, 'Adobe Illustrator') !== false) { $versexp = explode(' ', $version_str); $version = (float)array_pop($versexp); if ($version >= 9) { @@ -12551,7 +12551,7 @@ } } // strip binary bytes in front of PS-header - $start = strpos($data, '%!PS-Adobe'); + $start = mb_strpos($data, '%!PS-Adobe'); if ($start > 0) { $data = substr($data, $start); } @@ -12562,17 +12562,17 @@ } else { $this->Error('No BoundingBox found in EPS file: '.$file); } - $start = strpos($data, '%%EndSetup'); + $start = mb_strpos($data, '%%EndSetup'); if ($start === false) { - $start = strpos($data, '%%EndProlog'); + $start = mb_strpos($data, '%%EndProlog'); } if ($start === false) { - $start = strpos($data, '%%BoundingBox'); + $start = mb_strpos($data, '%%BoundingBox'); } $data = substr($data, $start); - $end = strpos($data, '%%PageTrailer'); + $end = mb_strpos($data, '%%PageTrailer'); if ($end===false) { - $end = strpos($data, 'showpage'); + $end = mb_strpos($data, 'showpage'); } if ($end) { $data = substr($data, 0, $end); @@ -13350,7 +13350,7 @@ $repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\"); $html = strtr($html, $repTable); $offset = 0; - while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</pre>', $offset)) !== false) { + while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</pre>', $offset)) !== false) { $html_a = substr($html, 0, $offset); $html_b = substr($html, $offset, ($pos - $offset + 6)); while (preg_match("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", $html_b)) { @@ -13361,7 +13361,7 @@ $offset = mb_strlen($html_a.$html_b); } $offset = 0; - while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</textarea>', $offset)) !== false) { + while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</textarea>', $offset)) !== false) { $html_a = substr($html, 0, $offset); $html_b = substr($html, $offset, ($pos - $offset + 11)); while (preg_match("'<textarea([^\>]*)>(.*?)\n(.*?)</textarea>'si", $html_b)) { @@ -13375,7 +13375,7 @@ $html = preg_replace("'([\s]*)<option'si", "<option", $html); $html = preg_replace("'</option>([\s]*)'si", "</option>", $html); $offset = 0; - while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</option>', $offset)) !== false) { + while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</option>', $offset)) !== false) { $html_a = substr($html, 0, $offset); $html_b = substr($html, $offset, ($pos - $offset + 9)); while (preg_match("'<option([^\>]*)>(.*?)</option>'si", $html_b)) { @@ -14300,7 +14300,7 @@ } } elseif (($plalign == 'R') AND (!$this->rtl)) { // right alignment on LTR document - if (intval($this->revstrpos($pmid, ')]')) == (intval($this->revstrpos($pmid, ' )]')) + 1)) { + if (intval($this->revmb_strpos($pmid, ')]')) == (intval($this->revmb_strpos($pmid, ' )]')) + 1)) { // remove last space (if any) $linew -= $one_space_width; $mdiff = abs($tw - $linew); @@ -14308,11 +14308,11 @@ $t_x = $mdiff; } elseif (($plalign == 'L') AND ($this->rtl)) { // left alignment on RTL document - if ((intval($this->revstrpos($pmid, '[( ')) == intval($this->revstrpos($pmid, '[('))) OR (intval($this->revstrpos($pmid, '[('.chr(0).chr(32))) == intval($this->revstrpos($pmid, '[(')))) { + if ((intval($this->revmb_strpos($pmid, '[( ')) == intval($this->revmb_strpos($pmid, '[('))) OR (intval($this->revmb_strpos($pmid, '[('.chr(0).chr(32))) == intval($this->revmb_strpos($pmid, '[(')))) { // remove first space (if any) $linew -= $one_space_width; } - if (intval(strpos($pmid, '[(')) == (intval($this->revstrpos($pmid, '[(')))) { + if (intval(mb_strpos($pmid, '[(')) == (intval($this->revmb_strpos($pmid, '[(')))) { // remove last space (if any) $linew -= $one_space_width; if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { @@ -14378,12 +14378,12 @@ global $spacew; while (preg_match('/([0-9\.\+\-]*)[\s](Td|cm|m|l|c|re)[\s]/x', $pmid, $strpiece, PREG_OFFSET_CAPTURE, $offset) == 1) { // check if we are inside a string section '[( ... )]' - $stroffset = strpos($pmid, '[(', $offset); + $stroffset = mb_strpos($pmid, '[(', $offset); if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) { // set offset to the end of string section - $offset = strpos($pmid, ')]', $stroffset); + $offset = mb_strpos($pmid, ')]', $stroffset); while (($offset !== false) AND ($pmid{($offset - 1)} == '\\')) { - $offset = strpos($pmid, ')]', ($offset + 1)); + $offset = mb_strpos($pmid, ')]', ($offset + 1)); } if ($offset === false) { $this->Error('HTML Justification: malformed PDF code.'); @@ -14396,13 +14396,13 @@ $spacew = ($spacewidth * $ns); } $offset = $strpiece[2][1] + mb_strlen($strpiece[2][0]); - $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset); - $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset) + mb_strlen($this->epsmarker.'Q'); + $epsposbeg = mb_strpos($pmid, 'q'.$this->epsmarker, $offset); + $epsposend = mb_strpos($pmid, $this->epsmarker.'Q', $offset) + mb_strlen($this->epsmarker.'Q'); if ((($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend)) OR (($epsposbeg === false) AND ($epsposend > 0) AND ($offset < $epsposend))) { // shift EPS images $trx = sprintf('1 0 0 1 %.3F 0 cm', $spacew); - $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6)); + $epsposbeg = mb_strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6)); $pmid_b = substr($pmid, 0, $epsposbeg); $pmid_m = substr($pmid, $epsposbeg, ($epsposend - $epsposbeg)); $pmid_e = substr($pmid, $epsposend); @@ -14971,7 +14971,7 @@ } } elseif (($plalign == 'R') AND (!$this->rtl)) { // right alignment on LTR document - if (intval($this->revstrpos($pmid, ')]')) == (intval($this->revstrpos($pmid, ' )]')) + 1)) { + if (intval($this->revmb_strpos($pmid, ')]')) == (intval($this->revmb_strpos($pmid, ' )]')) + 1)) { // remove last space (if any) $linew -= $one_space_width; $mdiff = abs($tw - $linew); @@ -14979,11 +14979,11 @@ $t_x = $mdiff; } elseif (($plalign == 'L') AND ($this->rtl)) { // left alignment on RTL document - if ((intval($this->revstrpos($pmid, '[( ')) == intval($this->revstrpos($pmid, '[('))) OR (intval($this->revstrpos($pmid, '[('.chr(0).chr(32))) == intval($this->revstrpos($pmid, '[(')))) { + if ((intval($this->revmb_strpos($pmid, '[( ')) == intval($this->revmb_strpos($pmid, '[('))) OR (intval($this->revmb_strpos($pmid, '[('.chr(0).chr(32))) == intval($this->revmb_strpos($pmid, '[(')))) { // remove first space (if any) $linew -= $one_space_width; } - if (intval(strpos($pmid, '[(')) == (intval($this->revstrpos($pmid, '[(')))) { + if (intval(mb_strpos($pmid, '[(')) == (intval($this->revmb_strpos($pmid, '[(')))) { // remove last space (if any) $linew -= $one_space_width; if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { @@ -15574,7 +15574,7 @@ $options = explode ("\r", $tag['attribute']['opt']); $values = array(); foreach ($options as $val) { - if (strpos($val, "\t") !== false) { + if (mb_strpos($val, "\t") !== false) { $opts = explode("\t", $val); $values[] = $opts; $w = max($w, $this->GetStringWidth($opts[1])); @@ -17276,10 +17276,10 @@ * @access public * @since 4.8.038 (2010-03-13) */ - public function revstrpos($haystack, $needle, $offset = 0) { + public function revmb_strpos($haystack, $needle, $offset = 0) { $length = mb_strlen($haystack); $offset = ($offset > 0)?($length - $offset):abs($offset); - $pos = strpos(strrev($haystack), strrev($needle), $offset); + $pos = mb_strpos(strrev($haystack), strrev($needle), $offset); return ($pos === false)?false:($length - $pos - mb_strlen($needle)); } Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/install/save.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -361,7 +361,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ // Database created above with correct name. if (strncasecmp($SQL, ' CREATE DATABASE ', 17) AND strncasecmp($SQL, ' USE ', 5)){ Modified: trunk/reportwriter/WriteReport.inc =================================================================== --- trunk/reportwriter/WriteReport.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/reportwriter/WriteReport.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -544,7 +544,7 @@ $CSVOutput = ''; // Write the column headings foreach ($Heading as $mycolumn) { // check for embedded commas and enclose in quotes - if (strpos($mycolumn,',')===false) $CSVOutput .= $mycolumn.','; else $CSVOutput .= '"'.$mycolumn.'",'; + if (mb_strpos($mycolumn,',')===false) $CSVOutput .= $mycolumn.','; else $CSVOutput .= '"'.$mycolumn.'",'; } $CSVOutput = substr($CSVOutput,0,-1).chr(10); // Strip the last comma off and add line feed // Now write each data line and totals @@ -561,7 +561,7 @@ default: $CSVLine = ''; foreach ($myrow as $mycolumn) { // check for embedded commas and enclose in quotes - if (strpos($mycolumn,',')===false) $CSVLine .= $mycolumn.','; else $CSVLine .= '"'.$mycolumn.'",'; + if (mb_strpos($mycolumn,',')===false) $CSVLine .= $mycolumn.','; else $CSVLine .= '"'.$mycolumn.'",'; } $CSVLine = substr($CSVLine,0,-1); // Strip ... [truncated message content] |
From: <dai...@us...> - 2011-07-03 03:27:57
|
Revision: 4620 http://web-erp.svn.sourceforge.net/web-erp/?rev=4620&view=rev Author: daintree Date: 2011-07-03 03:27:48 +0000 (Sun, 03 Jul 2011) Log Message: ----------- strpos to mb_strpos Modified Paths: -------------- trunk/AccountSections.php trunk/ConfirmDispatch_Invoice.php trunk/Contracts.php trunk/Customers.php trunk/DailySalesInquiry.php trunk/DeliveryDetails.php trunk/MRPCreateDemands.php trunk/Numbers/Words.php trunk/PO_PDFPurchOrder.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectCreditItems.php trunk/Stocks.php trunk/SuppPriceList.php trunk/Tax.php trunk/TaxCategories.php trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poEditLangModule.php trunk/api/api_debtortransactions.php trunk/doc/Change.log trunk/doc/Manual/ManualAPIFunctions.php trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/DateFunctions.inc trunk/includes/EDIVariableSubstitution.inc trunk/includes/EDIconfig.inc trunk/includes/RFC822.php trunk/includes/class.pdf.php trunk/includes/phplot/phplot.php trunk/includes/smtp.php trunk/includes/tcpdf/CHANGELOG.TXT trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/tcpdf.php trunk/install/save.php trunk/reportwriter/WriteReport.inc trunk/reportwriter/admin/RCFunctions.inc trunk/reportwriter/admin/forms/ReportsCritSetup.html trunk/reportwriter/forms/FormsFilter.html trunk/reportwriter/forms/ReportsFilter.html Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/AccountSections.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -86,7 +86,7 @@ $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SectionID']) and strpos($_POST['SectionID'],".")>0) { + if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -800,7 +800,7 @@ /*Test to see if the item being sold is an asset */ if (substr($OrderLine->StockID,0,6)=='ASSET-'){ $IsAsset = true; - $HyphenOccursAt = strpos($OrderLine->StockID,'-',6); + $HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6); if ($HyphenOccursAt == false){ $AssetNumber = intval(substr($OrderLine->StockID,6)); } else { Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Contracts.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -224,7 +224,7 @@ prnMsg(_('The contract reference is expected to be more than 2 characters long. Please alter the contract reference before proceeding.'),'error'); $InputError = true; } - if(ContainsIllegalCharacters($_POST['ContractRef']) OR strpos($_POST['ContractRef'],' ')>0){ + if(ContainsIllegalCharacters($_POST['ContractRef']) OR mb_strpos($_POST['ContractRef'],' ')>0){ prnMsg(_('The contract reference cannot contain any spaces, slashes, or inverted commas. Please alter the contract reference before proceeding.'),'error'); $InputError = true; } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Customers.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -49,7 +49,7 @@ prnMsg( _('The debtor code cannot be empty'),'error'); $Errors[$i] = 'DebtorNo'; $i++; - } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR strpos($_POST['DebtorNo'], ' '))) { + } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR mb_strpos($_POST['DebtorNo'], ' '))) { $InputError = 1; prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'DebtorNo'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/DailySalesInquiry.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -59,11 +59,11 @@ echo '</form></div>'; echo '<br />'; /*Now get and display the sales data returned */ -if (strpos($EndDateSQL,'/')) { +if (mb_strpos($EndDateSQL,'/')) { $Date_Array = explode('/',$EndDateSQL); -} elseif (strpos ($EndDateSQL,'-')) { +} elseif (mb_strpos ($EndDateSQL,'-')) { $Date_Array = explode('-',$EndDateSQL); -} elseif (strpos ($EndDateSQL,'.')) { +} elseif (mb_strpos ($EndDateSQL,'.')) { $Date_Array = explode('.',$EndDateSQL); } Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/DeliveryDetails.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -61,7 +61,7 @@ $InputErrors =1; prnMsg(_('You should enter the street address in the box provided') . '. ' . _('Orders cannot be accepted without a valid street address'),'error'); } -// if (strpos($_POST['BrAdd1'],_('Box'))>0){ +// if (mb_strpos($_POST['BrAdd1'],_('Box'))>0){ // prnMsg(_('You have entered the word') . ' "' . _('Box') . '" ' . _('in the street address') . '. ' . _('Items cannot be delivered to') . ' ' ._('box') . ' ' . _('addresses'),'warn'); // } if (!is_numeric($_POST['FreightCost'])){ Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/MRPCreateDemands.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -83,11 +83,11 @@ // Create array of dates based on DistDate and adding either weeks or months $FormatedDistdate = FormatDateForSQL($_POST['DistDate']); -if (strpos($FormatedDistdate,"/")) { +if (mb_strpos($FormatedDistdate,"/")) { list($yyyy,$mm,$dd) = explode("/",$FormatedDistdate); -} else if (strpos($FormatedDistdate,"-")) { +} else if (mb_strpos($FormatedDistdate,"-")) { list($yyyy,$mm,$dd) = explode("-",$FormatedDistdate); -} else if (strpos($FormatedDistdate,".")) { +} else if (mb_strpos($FormatedDistdate,".")) { list($yyyy,$mm,$dd) = explode(".",$FormatedDistdate); } Modified: trunk/Numbers/Words.php =================================================================== --- trunk/Numbers/Words.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Numbers/Words.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -64,8 +64,8 @@ //Phil mods to ensure correct translation used. if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ //try to drop off the .utf8 suffix then recheck - if (strpos($locale,'.utf8')){ - $locale = substr($locale, 0,strpos($locale,'.utf8')); + if (mb_strpos($locale,'.utf8')){ + $locale = substr($locale, 0,mb_strpos($locale,'.utf8')); } if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ $locale = substr($locale,0,2); @@ -132,7 +132,7 @@ @$obj =& new $classname; - if (strpos($num, '.') === false) + if (mb_strpos($num, '.') === false) { $ret = trim($obj->toCurrencyWords($int_curr, $num)); } else { Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/PO_PDFPurchOrder.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -385,7 +385,7 @@ if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ - if (mb_strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){ + if (mb_strlen($ContactDetails['email'])>2 AND mb_strpos($ContactDetails['email'],'@')>0){ if ($_POST['EmailTo']==$ContactDetails['email']){ echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } else { Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/PcExpensesTypeTab.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -17,7 +17,7 @@ $SelectedType=''; } -if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0)){ +if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR mb_strpos($SelectedType,' ')>0)){ $InputError = 1; prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error'); } Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/PcTypeTabs.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ echo prnMsg(_('The tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; - }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR strpos($_POST['TypeTabCode'],' ')>0){ + }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR mb_strpos($_POST['TypeTabCode'],' ')>0){ $InputError = 1; prnMsg(_('The petty cash tab type code cannot contain any of the illegal characters'),'error'); } elseif (mb_strlen($_POST['TypeTabDescription']) >50) { Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/SelectCreditItems.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -116,8 +116,8 @@ /*will only be true if page called from customer selection form parse the $Select string into customer code and branch code */ - $_SESSION['CreditItems']->Branch = substr($_POST['Select'],strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = substr($_POST['Select'],0,strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->Branch = substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); + $_POST['Select'] = substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); /*Now retrieve customer information - name, salestype, currency, terms etc */ Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Stocks.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -102,7 +102,7 @@ $Errors[$i] = 'StockID'; $i++; } - if (ContainsIllegalCharacters($StockID) OR strpos($StockID,' ')) { + if (ContainsIllegalCharacters($StockID) OR mb_strpos($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); $Errors[$i] = 'StockID'; Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/SuppPriceList.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -138,11 +138,11 @@ // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - if (strpos($myrow[3],'-')) { + if (mb_strpos($myrow[3],'-')) { $DateArray=explode('-', $myrow[3]); - } else if (strpos($myrow[3],'/')) { + } else if (mb_strpos($myrow[3],'/')) { $DateArray=explode('/', $myrow[3]); - } else if (strpos($myrow[3],'.')) { + } else if (mb_strpos($myrow[3],'.')) { $DateArray=explode('.', $myrow[3]); } $dateprice=date($_SESSION['DefaultDateFormat'], mktime(0,0,0,$DateArray[1],$DateArray[2],$DateArray[0])); Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Tax.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -127,9 +127,9 @@ /*Now do the inputs from SuppTrans */ /*Only have dates in SuppTrans no periods so need to get the starting date */ - if (strpos($PeriodEnd,'/')) { + if (mb_strpos($PeriodEnd,'/')) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strpos($PeriodEnd,'.')) { + } elseif (mb_strpos($PeriodEnd,'.')) { $Date_Array = explode('.',$PeriodEnd); } if ($_SESSION['DefaultDateFormat']=='d/m/Y'){ Modified: trunk/TaxCategories.php =================================================================== --- trunk/TaxCategories.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/TaxCategories.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -26,7 +26,7 @@ //first off validate inputs sensible - if (strpos($_POST['TaxCategoryName'],'&')>0 OR strpos($_POST['TaxCategoryName'],"'")>0) { + if (mb_strpos($_POST['TaxCategoryName'],'&')>0 OR mb_strpos($_POST['TaxCategoryName'],"'")>0) { $InputError = 1; prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); } Modified: trunk/TaxProvinces.php =================================================================== --- trunk/TaxProvinces.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/TaxProvinces.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -25,7 +25,7 @@ //first off validate inputs sensible - if (strpos($_POST['TaxProvinceName'],'&')>0 OR strpos($_POST['TaxProvinceName'],"'")>0) { + if (mb_strpos($_POST['TaxProvinceName'],'&')>0 OR mb_strpos($_POST['TaxProvinceName'],"'")>0) { $InputError = 1; prnMsg( _('The tax province name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); } Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/UnitsOfMeasure.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -25,7 +25,7 @@ //first off validate inputs sensible - if (strpos($_POST['MeasureName'],'&')>0 OR strpos($_POST['MeasureName'],"'")>0) { + if (mb_strpos($_POST['MeasureName'],'&')>0 OR mb_strpos($_POST['MeasureName'],"'")>0) { $InputError = 1; prnMsg( _('The unit of measure cannot contain the character') . " '&' " . _('or the character') ." '",'error'); } Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/UpgradeDatabase.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -159,7 +159,7 @@ if (substr($SQLEntries[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){ $sql = substr($sql,0,mb_strlen($sql)-1); $result = DB_query($sql, $db, '','', false, false); echo '<tr><td>' . $sql . '</td>'; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_MakeNewCompany.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -118,7 +118,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -49,7 +49,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -41,7 +41,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $SQL = substr($SQL,0,mb_strlen($SQL)-1); $result = DB_query($SQL, $db, $ErrMsg); $SQL=''; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -51,7 +51,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $sql = substr($sql,0,mb_strlen($sql)-1); $result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false); switch (DB_error_no($db)) { Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -51,7 +51,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ $sql = substr($sql,0,mb_strlen($sql)-1); $result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false); switch (DB_error_no($db)) { Modified: trunk/Z_poEditLangModule.php =================================================================== --- trunk/Z_poEditLangModule.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/Z_poEditLangModule.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -144,7 +144,7 @@ for ($i=1; $i<=$TotalLines; $i++) { - $b = strpos($AlsoIn[$i], $_POST['module']); + $b = mb_strpos($AlsoIn[$i], $_POST['module']); if ($b === False) { /* skip it */ Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/api/api_debtortransactions.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -20,11 +20,11 @@ //for MySQL dates are in the format YYYY-mm-dd - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -53,9 +53,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strpos($TranDate,'/')>0) { + if (mb_strpos($TranDate,'/')>0) { $DateArray = explode('/',$TranDate); - } elseif (strpos($TranDate,'.')>0) { + } elseif (mb_strpos($TranDate,'.')>0) { $DateArray = explode('.',$TranDate); } if ($DateFormat=='d/m/Y') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/doc/Change.log 2011-07-03 03:27:48 UTC (rev 4620) @@ -2666,7 +2666,7 @@ 28/8/04 Steve - Minor changes to theme default.css files 28/8/04 Steve - SelectCustomer.php SelectProduct.php SelectSupplier.php all modified to allow paging where a large result set is returned 25/8/04 SelectCreditItems.php now allows text line entries with each line of the credit note -23/8/04 SelectOrderItems.php SelectCreditItems.php strrpos works differently in PHP 5 changed to use strpos +23/8/04 SelectOrderItems.php SelectCreditItems.php strrpos works differently in PHP 5 changed to use mb_strpos 14/8/04 Changed ConfirmDispatch_Invoice.php to allow entry of consignment reference also changed PrintCustTrans.php and PDFPrintCustTransPageHeader.inc to print out the narrative on sales order lines and the consignment number 14/8/04 Changed SelectOrderItems.php to allow entry of narrative and update narrative entries also show warning when quick entries not processed. 14/8/04 Changed DefineCartClass.inc to have a Narrative variable in LineItems and a Consignment variable in the header Modified: trunk/doc/Manual/ManualAPIFunctions.php =================================================================== --- trunk/doc/Manual/ManualAPIFunctions.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/doc/Manual/ManualAPIFunctions.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -26,7 +26,7 @@ $weberppassword = $myrow[0]; $ServerString = $_SERVER['HTTP_HOST'].$rootpath; -$FirstBitOfURL = substr($ServerString,0,strpos($ServerString,'/doc/Manual')); +$FirstBitOfURL = substr($ServerString,0,mb_strpos($ServerString,'/doc/Manual')); $ServerURL = "http://". $FirstBitOfURL ."/api/api_xml-rpc.php"; Modified: trunk/includes/ConstructSQLForUserDefinedSalesReport.inc =================================================================== --- trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -257,7 +257,7 @@ The first 6 Columns are defined by the group by fields so for eg the first col defined will be col 7 and so on - thats why need to add 6 to the col defined as */ - $length_ColNum = strpos($SQLSelectCls, 'AS col' . ($Cols['colnumerator'] + 8) , 7); + $length_ColNum = mb_strpos($SQLSelectCls, 'AS col' . ($Cols['colnumerator'] + 8) , 7); If ($length_ColNum == 0) { @@ -274,9 +274,9 @@ /*find the comma just before the Select Cls statement for the numerator column */ do { - $strt_ColNum = strpos( $SQLSelectCls, ',', $strt_ColNum + 1) + 1; + $strt_ColNum = mb_strpos( $SQLSelectCls, ',', $strt_ColNum + 1) + 1; - } while (strpos($SQLSelectCls, ',', $strt_ColNum) < $length_ColNum && strpos($SQLSelectCls, ',' , $strt_ColNum)!=0); + } while (mb_strpos($SQLSelectCls, ',', $strt_ColNum) < $length_ColNum && mb_strpos($SQLSelectCls, ',' , $strt_ColNum)!=0); /*The length of the element in the select clause defining the column will be from the comma to the @@ -288,7 +288,7 @@ /*The denominator column is also required if the constant is not used so do the same again for the denominator */ - $length_ColDen = strpos($SQLSelectCls, 'AS col' . (($Cols['coldenominator']) + 8), 7); + $length_ColDen = mb_strpos($SQLSelectCls, 'AS col' . (($Cols['coldenominator']) + 8), 7); If ($length_ColDen == 0){ prnMsg (_('Calculated fields must use columns defined in the report specification') . '. ' . _('The denominator column number entered for this calculation is not defined in the report'),'error',_('Calculation With Undefined Denominator')); Exit; @@ -299,9 +299,9 @@ /*find the comma just before the Select Cls statement for the denominator column */ do { - $strt_ColDen = strpos( $SQLSelectCls, ',', $strt_ColDen +1)+1; + $strt_ColDen = mb_strpos( $SQLSelectCls, ',', $strt_ColDen +1)+1; - } while (strpos($SQLSelectCls, ',', $strt_ColDen) < $length_ColDen && strpos($SQLSelectCls, ',' , $strt_ColDen)!=0); + } while (mb_strpos($SQLSelectCls, ',', $strt_ColDen) < $length_ColDen && mb_strpos($SQLSelectCls, ',' , $strt_ColDen)!=0); $length_ColDen = $length_ColDen - $strt_ColDen - 1; Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/DateFunctions.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -21,11 +21,11 @@ //echo '<BR>The date entered is ' . $DateEntry; - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -83,11 +83,11 @@ function MonthAndYearFromSQLDate($DateEntry) { - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -101,11 +101,11 @@ function DayOfWeekFromSQLDate($DateEntry) { - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -119,11 +119,11 @@ function DayOfMonthFromSQLDate($DateEntry) { - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -154,11 +154,11 @@ //for MySQL dates are in the format YYYY-mm-dd - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } else { prnMsg(_('The date does not appear to be in a valid format. The date being converted from SQL format was:') . ' ' . $DateEntry,'error'); @@ -199,11 +199,11 @@ //for MySQL dates are in the format YYYY-mm-dd //EDI format 102 dates are in the format CCYYMMDD - just need to lose the seperator - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } @@ -223,11 +223,11 @@ $DateEntry = trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -332,11 +332,11 @@ $DateEntry =trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -388,11 +388,11 @@ $DateEntry = trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -455,11 +455,11 @@ $DateEntry = trim($DateEntry); - if (strpos($DateEntry,'/')) { + if (mb_strpos($DateEntry,'/')) { $Date_Array = explode('/',$DateEntry); - } elseif (strpos ($DateEntry,'-')) { + } elseif (mb_strpos ($DateEntry,'-')) { $Date_Array = explode('-',$DateEntry); - } elseif (strpos ($DateEntry,'.')) { + } elseif (mb_strpos ($DateEntry,'.')) { $Date_Array = explode('.',$DateEntry); } elseif (mb_strlen($DateEntry)==6) { $Date_Array[0]= substr($DateEntry,0,2); @@ -581,11 +581,11 @@ $TranDate = trim($TranDate); - if (strpos($TranDate,'/')) { + if (mb_strpos($TranDate,'/')) { $Date_Array = explode('/',$TranDate); - } elseif (strpos ($TranDate,'-')) { + } elseif (mb_strpos ($TranDate,'-')) { $Date_Array = explode('-',$TranDate); - } elseif (strpos ($TranDate,'.')) { + } elseif (mb_strpos ($TranDate,'.')) { $Date_Array = explode('.',$TranDate); } @@ -648,11 +648,11 @@ $DateToAddTo = trim($DateToAddTo); - if (strpos($DateToAddTo,'/')) { + if (mb_strpos($DateToAddTo,'/')) { $Date_Array = explode('/',$DateToAddTo); - } elseif (strpos ($DateToAddTo,'-')) { + } elseif (mb_strpos ($DateToAddTo,'-')) { $Date_Array = explode('-',$DateToAddTo); - } elseif (strpos ($DateToAddTo,'.')) { + } elseif (mb_strpos ($DateToAddTo,'.')) { $Date_Array = explode('.',$DateToAddTo); } @@ -723,18 +723,18 @@ $Date1 = trim($Date1); $Date2 = trim($Date2); - if (strpos($Date1,'/')) { + if (mb_strpos($Date1,'/')) { $Date1_array = explode('/',$Date1); - } elseif (strpos ($Date1,'-')) { + } elseif (mb_strpos ($Date1,'-')) { $Date1_array = explode('-',$Date1); - } elseif (strpos ($Date1,'.')) { + } elseif (mb_strpos ($Date1,'.')) { $Date1_array = explode('.',$Date1); } - if (strpos($Date2,'/')) { + if (mb_strpos($Date2,'/')) { $Date2_array = explode('/',$Date2); - } elseif (strpos ($Date2,'-')) { + } elseif (mb_strpos ($Date2,'-')) { $Date2_array = explode('-',$Date2); - } elseif (strpos ($Date2,'.')) { + } elseif (mb_strpos ($Date2,'.')) { $Date2_array = explode('.',$Date2); } @@ -850,11 +850,11 @@ /* Convert the transaction date into a unix time stamp.*/ - if (strpos($TransDate,'/')) { + if (mb_strpos($TransDate,'/')) { $Date_Array = explode('/',$TransDate); - } elseif (strpos ($TransDate,'-')) { + } elseif (mb_strpos ($TransDate,'-')) { $Date_Array = explode('-',$TransDate); - } elseif (strpos ($TransDate,'.')) { + } elseif (mb_strpos ($TransDate,'.')) { $Date_Array = explode('.',$TransDate); } if (($_SESSION['DefaultDateFormat']=='d/m/Y') or ($_SESSION['DefaultDateFormat']=='d.m.Y')){ Modified: trunk/includes/EDIVariableSubstitution.inc =================================================================== --- trunk/includes/EDIVariableSubstitution.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/EDIVariableSubstitution.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -5,14 +5,14 @@ $PositionPointer = 0; $NewLineText =''; /* now get each occurence of [ in the line */ - while (strpos ($MsgLineText,'[',$PositionPointer)!=False){ + while (mb_strpos ($MsgLineText,'[',$PositionPointer)!=False){ $LastPositionPointer = $PositionPointer; - $PositionPointer = strpos ($MsgLineText,'[',$PositionPointer); + $PositionPointer = mb_strpos ($MsgLineText,'[',$PositionPointer); $NewLineText = $NewLineText . substr($MsgLineText,$LastPositionPointer,$PositionPointer-$LastPositionPointer); $LastPositionPointer = $PositionPointer; - $PositionPointer = strpos ($MsgLineText,']',$PositionPointer); + $PositionPointer = mb_strpos ($MsgLineText,']',$PositionPointer); $VariableName = substr($MsgLineText,$LastPositionPointer+1,$PositionPointer-$LastPositionPointer-1); Modified: trunk/includes/EDIconfig.inc =================================================================== --- trunk/includes/EDIconfig.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/EDIconfig.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -58,14 +58,14 @@ $PoistionPointer = 0; $NewLineText =''; /* now get each occurence of [ in the line */ - while (strpos ($LineDetails['linetext'],'[',$PoistionPointer)!=False){ + while (mb_strpos ($LineDetails['linetext'],'[',$PoistionPointer)!=False){ $LastPositionPointer = $PoistionPointer; - $PositionPointer = strpos ($LineDetails['linetext'],'[',$PoistionPointer); + $PositionPointer = mb_strpos ($LineDetails['linetext'],'[',$PoistionPointer); $NewLineText = $NewLineText . substr($LineDetails['linetext'],$LastPositionPointer,$PoistionPointer-$LastPositionPointer); $LastPositionPointer = $PoistionPointer; - $PositionPointer = strpos ($LineDetails['linetext'],']',$PoistionPointer); + $PositionPointer = mb_strpos ($LineDetails['linetext'],']',$PoistionPointer); $VariableName = substr($LineDetails['linetext'],$LastPositionPointer,$PoistionPointer-$LastPositionPointer); Modified: trunk/includes/RFC822.php =================================================================== --- trunk/includes/RFC822.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/RFC822.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -211,7 +211,7 @@ // brackets/quotes etc then something's fubar. // First check there's a colon at all: - if (strpos($string, ':') === false) { + if (mb_strpos($string, ':') === false) { $this->error = 'Invalid address: ' . $string; return false; } @@ -579,7 +579,7 @@ $comments[] = $comment; // +1 is for the trailing ) - $_mailbox = substr($_mailbox, strpos($_mailbox, $comment)+mb_strlen($comment)+1); + $_mailbox = substr($_mailbox, mb_strpos($_mailbox, $comment)+mb_strlen($comment)+1); } else { break; } @@ -647,7 +647,7 @@ function _validateRouteAddr($route_addr) { // Check for colon. - if (strpos($route_addr, ':') !== false) { + if (mb_strpos($route_addr, ':') !== false) { $parts = explode(':', $route_addr); $route = $this->_splitCheck($parts, ':'); } else { @@ -784,7 +784,7 @@ $addr_spec = trim($addr_spec); // Split on @ sign if there is one. - if (strpos($addr_spec, '@') !== false) { + if (mb_strpos($addr_spec, '@') !== false) { $parts = explode('@', $addr_spec); $local_part = $this->_splitCheck($parts, '@'); $domain = substr($addr_spec, mb_strlen($local_part . '@')); Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/class.pdf.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -282,13 +282,13 @@ $b2='LR'; } else { $b2=''; - if(is_int(strpos($border,'L'))) { + if(is_int(mb_strpos($border,'L'))) { $b2.='L'; } - if(is_int(strpos($border,'R'))) { + if(is_int(mb_strpos($border,'R'))) { $b2.='R'; } - $b=is_int(strpos($border,'T')) ? $b2.'T' : $b2; + $b=is_int(mb_strpos($border,'T')) ? $b2.'T' : $b2; } } $sep=-1; Modified: trunk/includes/phplot/phplot.php =================================================================== --- trunk/includes/phplot/phplot.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/phplot/phplot.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -1850,7 +1850,7 @@ $asked = strtolower(trim($which_opt)); # Look for the supplied value in a comma/space separated list. - if (strpos(", $which_acc,", ", $asked,") !== False) + if (mb_strpos(", $which_acc,", ", $asked,") !== False) return $asked; $this->PrintError("$which_func(): '$which_opt' not in available choices: '$which_acc'."); @@ -1889,7 +1889,7 @@ */ protected function CheckDataType($valid_types) { - if (strpos(", $valid_types,", ", $this->data_type,") !== False) + if (mb_strpos(", $valid_types,", ", $this->data_type,") !== False) return TRUE; $this->PrintError("Data type '$this->data_type' is not valid for '$this->plot_type' plots." Modified: trunk/includes/smtp.php =================================================================== --- trunk/includes/smtp.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/smtp.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -336,7 +336,7 @@ $loops = 0; if(is_resource($this->connection)){ - while((strpos($return, CRLF) === FALSE OR substr($line,3,1) !== ' ') AND $loops < 100){ + while((mb_strpos($return, CRLF) === FALSE OR substr($line,3,1) !== ' ') AND $loops < 100){ $line = fgets($this->connection, 512); $return .= $line; $loops++; Modified: trunk/includes/tcpdf/CHANGELOG.TXT =================================================================== --- trunk/includes/tcpdf/CHANGELOG.TXT 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/tcpdf/CHANGELOG.TXT 2011-07-03 03:27:48 UTC (rev 4620) @@ -798,7 +798,7 @@ - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php. 4.0.024 (2008-09-12) - - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4. + - "stripos" function was replaced with "mb_strpos + strtolower" for backward compatibility with PHP4. - support for Spot Colors were added. Check the new example n. 37 and the following new functions: AddSpotColor() SetDrawSpotColor() Modified: trunk/includes/tcpdf/barcodes.php =================================================================== --- trunk/includes/tcpdf/barcodes.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/tcpdf/barcodes.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -948,7 +948,7 @@ $sum = $startid; $clen = mb_strlen($code); for ($i = 0; $i < $clen; ++$i) { - $sum += (strpos($keys, $code{$i}) * ($i+1)); + $sum += (mb_strpos($keys, $code{$i}) * ($i+1)); } $check = ($sum % 103); // add start, check and stop codes @@ -957,7 +957,7 @@ $k = 0; $len = mb_strlen($code); for ($i = 0; $i < $len; ++$i) { - $ck = strpos($keys, $code{$i}); + $ck = mb_strpos($keys, $code{$i}); if (($i == 0) OR ($i > ($len-4))) { $char_num = ord($code{$i}); $seq = $chr[$char_num]; Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/includes/tcpdf/tcpdf.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -3277,23 +3277,23 @@ $tempstyle = strtoupper($style); $style = ''; // underline - if (strpos($tempstyle, 'U') !== false) { + if (mb_strpos($tempstyle, 'U') !== false) { $this->underline = true; } else { $this->underline = false; } // line through (deleted) - if (strpos($tempstyle, 'D') !== false) { + if (mb_strpos($tempstyle, 'D') !== false) { $this->linethrough = true; } else { $this->linethrough = false; } // bold - if (strpos($tempstyle, 'B') !== false) { + if (mb_strpos($tempstyle, 'B') !== false) { $style .= 'B'; } // oblique - if (strpos($tempstyle, 'I') !== false) { + if (mb_strpos($tempstyle, 'I') !== false) { $style .= 'I'; } $bistyle = $style; @@ -3392,7 +3392,7 @@ $styles = array('' => '', 'B' => ',Bold', 'I' => ',Italic', 'BI' => ',BoldItalic'); $sname = $name.$styles[$bistyle]; // artificial bold - if (strpos($bistyle, 'B') !== false) { + if (mb_strpos($bistyle, 'B') !== false) { if (isset($desc['StemV'])) { $desc['StemV'] *= 2; } else { @@ -3400,7 +3400,7 @@ } } // artificial italic - if (strpos($bistyle, 'I') !== false) { + if (mb_strpos($bistyle, 'I') !== false) { if (isset($desc['ItalicAngle'])) { $desc['ItalicAngle'] -= 11; } else { @@ -4022,7 +4022,7 @@ } if (is_string($border)) { $lm = ($this->LineWidth / 2); - if (strpos($border,'L') !== false) { + if (mb_strpos($border,'L') !== false) { if ($this->rtl) { $xk = ($x - $w) * $k; } else { @@ -4030,7 +4030,7 @@ } $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y + $lm) * $k), $xk, (($this->h - ($y + $h + $lm)) * $k)); } - if (strpos($border,'T') !== false) { + if (mb_strpos($border,'T') !== false) { if ($this->rtl) { $xk = ($x - $w + $lm) * $k; $xwk = ($x - $lm) * $k; @@ -4040,7 +4040,7 @@ } $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y) * $k), $xwk, (($this->h - $y) * $k)); } - if (strpos($border,'R') !== false) { + if (mb_strpos($border,'R') !== false) { if ($this->rtl) { $xk = $x * $k; } else { @@ -4048,7 +4048,7 @@ } $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y + $lm) * $k), $xk, (($this->h - ($y + $h + $lm))* $k)); } - if (strpos($border,'B') !== false) { + if (mb_strpos($border,'B') !== false) { if ($this->rtl) { $xk = ($x - $w + $lm) * $k; $xwk = ($x - $lm) * $k; @@ -4459,16 +4459,16 @@ if ($border == 1) { $cborder = 'LTR'; } else { - if (!(false === strpos($border, 'L'))) { + if (!(false === mb_strpos($border, 'L'))) { $cborder .= 'L'; } - if (!(false === strpos($border, 'T'))) { + if (!(false === mb_strpos($border, 'T'))) { $cborder .= 'T'; } - if (!(false === strpos($border, 'R'))) { + if (!(false === mb_strpos($border, 'R'))) { $cborder .= 'R'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'B')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'B')))) { $cborder .= 'B'; } } @@ -4478,16 +4478,16 @@ if ($border == 1) { $cborder = 'LR'; } else { - if (!(false === strpos($border, 'L'))) { + if (!(false === mb_strpos($border, 'L'))) { $cborder .= 'L'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'T')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'T')))) { $cborder .= 'T'; } - if (!(false === strpos($border, 'R'))) { + if (!(false === mb_strpos($border, 'R'))) { $cborder .= 'R'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'B')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'B')))) { $cborder .= 'B'; } } @@ -4497,16 +4497,16 @@ if ($border == 1) { $cborder = 'LRB'; } else { - if (!(false === strpos($border, 'L'))) { + if (!(false === mb_strpos($border, 'L'))) { $cborder .= 'L'; } - if ((!$this->opencell) AND (!(false === strpos($border, 'T')))) { + if ((!$this->opencell) AND (!(false === mb_strpos($border, 'T')))) { $cborder .= 'T'; } - if (!(false === strpos($border, 'R'))) { + if (!(false === mb_strpos($border, 'R'))) { $cborder .= 'R'; } - if (!(false === strpos($border, 'B'))) { + if (!(false === mb_strpos($border, 'B'))) { $cborder .= 'B'; } } @@ -5441,7 +5441,7 @@ } elseif ($ct == 2) { $trns = array(ord(substr($t, 1, 1)), ord(substr($t, 3, 1)), ord(substr($t, 5, 1))); } else { - $pos = strpos($t, chr(0)); + $pos = mb_strpos($t, chr(0)); if ($pos !== false) { $trns = array($pos); } @@ -5743,7 +5743,7 @@ // define the ByteRange $byte_range = array(); $byte_range[0] = 0; - $byte_range[1] = strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10; + $byte_range[1] = mb_strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10; $byte_range[2] = $byte_range[1] + $this->signature_max_length + 2; $byte_range[3] = mb_strlen($pdfdoc) - $byte_range[2]; $pdfdoc = substr($pdfdoc, 0, $byte_range[1]).substr($pdfdoc, $byte_range[2]); @@ -5772,7 +5772,7 @@ $signature = file_get_contents($tempsign, false, null, $pdfdoc_length); unlink($tempsign); // extract signature - $signature = substr($signature, (strpos($signature, "%%EOF\n\n------") + 13)); + $signature = substr($signature, (mb_strpos($signature, "%%EOF\n\n------") + 13)); $tmparr = explode("\n\n", $signature); $signature = $tmparr[1]; unset($tmparr); @@ -8249,7 +8249,7 @@ $returncolor = false; $color = preg_replace('/[\s]*/', '', $color); // remove extra spaces $color = strtolower($color); - if (($dotpos = strpos($color, '.')) !== false) { + if (($dotpos = mb_strpos($color, '.')) !== false) { // remove class parent (i.e.: color.red) $color = substr($color, ($dotpos + 1)); } @@ -9016,7 +9016,7 @@ * @see SetLineStyle() */ public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9114,7 +9114,7 @@ * @since 2.1.000 (2008-01-08) */ public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9171,7 +9171,7 @@ * @since 3.0008 (2008-05-12) */ public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9243,7 +9243,7 @@ return; } if ($rx) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9404,7 +9404,7 @@ } $nc += 4; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -9623,7 +9623,7 @@ if ('0000' == $round_corner) { // Not rounded $this->Rect($x, $y, $w, $h, $style, $border_style, $fill_color); } else { // Rounded - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); } switch ($style) { @@ -10495,7 +10495,7 @@ if (empty($this->javascript) AND empty($this->js_objects)) { return; } - if (strpos($this->javascript, 'this.addField') > 0) { + if (mb_strpos($this->javascript, 'this.addField') > 0) { if (!$this->ur) { //$this->setUserRights(); } @@ -12542,7 +12542,7 @@ preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); # find Creator if (count($regs) > 1) { $version_str = trim($regs[1]); # e.g. "Adobe Illustrator(R) 8.0" - if (strpos($version_str, 'Adobe Illustrator') !== false) { + if (mb_strpos($version_str, 'Adobe Illustrator') !== false) { $versexp = explode(' ', $version_str); $version = (float)array_pop($versexp); if ($version >= 9) { @@ -12551,7 +12551,7 @@ } } // strip binary bytes in front of PS-header - $start = strpos($data, '%!PS-Adobe'); + $start = mb_strpos($data, '%!PS-Adobe'); if ($start > 0) { $data = substr($data, $start); } @@ -12562,17 +12562,17 @@ } else { $this->Error('No BoundingBox found in EPS file: '.$file); } - $start = strpos($data, '%%EndSetup'); + $start = mb_strpos($data, '%%EndSetup'); if ($start === false) { - $start = strpos($data, '%%EndProlog'); + $start = mb_strpos($data, '%%EndProlog'); } if ($start === false) { - $start = strpos($data, '%%BoundingBox'); + $start = mb_strpos($data, '%%BoundingBox'); } $data = substr($data, $start); - $end = strpos($data, '%%PageTrailer'); + $end = mb_strpos($data, '%%PageTrailer'); if ($end===false) { - $end = strpos($data, 'showpage'); + $end = mb_strpos($data, 'showpage'); } if ($end) { $data = substr($data, 0, $end); @@ -13350,7 +13350,7 @@ $repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\"); $html = strtr($html, $repTable); $offset = 0; - while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</pre>', $offset)) !== false) { + while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</pre>', $offset)) !== false) { $html_a = substr($html, 0, $offset); $html_b = substr($html, $offset, ($pos - $offset + 6)); while (preg_match("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", $html_b)) { @@ -13361,7 +13361,7 @@ $offset = mb_strlen($html_a.$html_b); } $offset = 0; - while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</textarea>', $offset)) !== false) { + while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</textarea>', $offset)) !== false) { $html_a = substr($html, 0, $offset); $html_b = substr($html, $offset, ($pos - $offset + 11)); while (preg_match("'<textarea([^\>]*)>(.*?)\n(.*?)</textarea>'si", $html_b)) { @@ -13375,7 +13375,7 @@ $html = preg_replace("'([\s]*)<option'si", "<option", $html); $html = preg_replace("'</option>([\s]*)'si", "</option>", $html); $offset = 0; - while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</option>', $offset)) !== false) { + while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</option>', $offset)) !== false) { $html_a = substr($html, 0, $offset); $html_b = substr($html, $offset, ($pos - $offset + 9)); while (preg_match("'<option([^\>]*)>(.*?)</option>'si", $html_b)) { @@ -14300,7 +14300,7 @@ } } elseif (($plalign == 'R') AND (!$this->rtl)) { // right alignment on LTR document - if (intval($this->revstrpos($pmid, ')]')) == (intval($this->revstrpos($pmid, ' )]')) + 1)) { + if (intval($this->revmb_strpos($pmid, ')]')) == (intval($this->revmb_strpos($pmid, ' )]')) + 1)) { // remove last space (if any) $linew -= $one_space_width; $mdiff = abs($tw - $linew); @@ -14308,11 +14308,11 @@ $t_x = $mdiff; } elseif (($plalign == 'L') AND ($this->rtl)) { // left alignment on RTL document - if ((intval($this->revstrpos($pmid, '[( ')) == intval($this->revstrpos($pmid, '[('))) OR (intval($this->revstrpos($pmid, '[('.chr(0).chr(32))) == intval($this->revstrpos($pmid, '[(')))) { + if ((intval($this->revmb_strpos($pmid, '[( ')) == intval($this->revmb_strpos($pmid, '[('))) OR (intval($this->revmb_strpos($pmid, '[('.chr(0).chr(32))) == intval($this->revmb_strpos($pmid, '[(')))) { // remove first space (if any) $linew -= $one_space_width; } - if (intval(strpos($pmid, '[(')) == (intval($this->revstrpos($pmid, '[(')))) { + if (intval(mb_strpos($pmid, '[(')) == (intval($this->revmb_strpos($pmid, '[(')))) { // remove last space (if any) $linew -= $one_space_width; if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { @@ -14378,12 +14378,12 @@ global $spacew; while (preg_match('/([0-9\.\+\-]*)[\s](Td|cm|m|l|c|re)[\s]/x', $pmid, $strpiece, PREG_OFFSET_CAPTURE, $offset) == 1) { // check if we are inside a string section '[( ... )]' - $stroffset = strpos($pmid, '[(', $offset); + $stroffset = mb_strpos($pmid, '[(', $offset); if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) { // set offset to the end of string section - $offset = strpos($pmid, ')]', $stroffset); + $offset = mb_strpos($pmid, ')]', $stroffset); while (($offset !== false) AND ($pmid{($offset - 1)} == '\\')) { - $offset = strpos($pmid, ')]', ($offset + 1)); + $offset = mb_strpos($pmid, ')]', ($offset + 1)); } if ($offset === false) { $this->Error('HTML Justification: malformed PDF code.'); @@ -14396,13 +14396,13 @@ $spacew = ($spacewidth * $ns); } $offset = $strpiece[2][1] + mb_strlen($strpiece[2][0]); - $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset); - $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset) + mb_strlen($this->epsmarker.'Q'); + $epsposbeg = mb_strpos($pmid, 'q'.$this->epsmarker, $offset); + $epsposend = mb_strpos($pmid, $this->epsmarker.'Q', $offset) + mb_strlen($this->epsmarker.'Q'); if ((($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend)) OR (($epsposbeg === false) AND ($epsposend > 0) AND ($offset < $epsposend))) { // shift EPS images $trx = sprintf('1 0 0 1 %.3F 0 cm', $spacew); - $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6)); + $epsposbeg = mb_strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6)); $pmid_b = substr($pmid, 0, $epsposbeg); $pmid_m = substr($pmid, $epsposbeg, ($epsposend - $epsposbeg)); $pmid_e = substr($pmid, $epsposend); @@ -14971,7 +14971,7 @@ } } elseif (($plalign == 'R') AND (!$this->rtl)) { // right alignment on LTR document - if (intval($this->revstrpos($pmid, ')]')) == (intval($this->revstrpos($pmid, ' )]')) + 1)) { + if (intval($this->revmb_strpos($pmid, ')]')) == (intval($this->revmb_strpos($pmid, ' )]')) + 1)) { // remove last space (if any) $linew -= $one_space_width; $mdiff = abs($tw - $linew); @@ -14979,11 +14979,11 @@ $t_x = $mdiff; } elseif (($plalign == 'L') AND ($this->rtl)) { // left alignment on RTL document - if ((intval($this->revstrpos($pmid, '[( ')) == intval($this->revstrpos($pmid, '[('))) OR (intval($this->revstrpos($pmid, '[('.chr(0).chr(32))) == intval($this->revstrpos($pmid, '[(')))) { + if ((intval($this->revmb_strpos($pmid, '[( ')) == intval($this->revmb_strpos($pmid, '[('))) OR (intval($this->revmb_strpos($pmid, '[('.chr(0).chr(32))) == intval($this->revmb_strpos($pmid, '[(')))) { // remove first space (if any) $linew -= $one_space_width; } - if (intval(strpos($pmid, '[(')) == (intval($this->revstrpos($pmid, '[(')))) { + if (intval(mb_strpos($pmid, '[(')) == (intval($this->revmb_strpos($pmid, '[(')))) { // remove last space (if any) $linew -= $one_space_width; if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { @@ -15574,7 +15574,7 @@ $options = explode ("\r", $tag['attribute']['opt']); $values = array(); foreach ($options as $val) { - if (strpos($val, "\t") !== false) { + if (mb_strpos($val, "\t") !== false) { $opts = explode("\t", $val); $values[] = $opts; $w = max($w, $this->GetStringWidth($opts[1])); @@ -17276,10 +17276,10 @@ * @access public * @since 4.8.038 (2010-03-13) */ - public function revstrpos($haystack, $needle, $offset = 0) { + public function revmb_strpos($haystack, $needle, $offset = 0) { $length = mb_strlen($haystack); $offset = ($offset > 0)?($length - $offset):abs($offset); - $pos = strpos(strrev($haystack), strrev($needle), $offset); + $pos = mb_strpos(strrev($haystack), strrev($needle), $offset); return ($pos === false)?false:($length - $pos - mb_strlen($needle)); } Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/install/save.php 2011-07-03 03:27:48 UTC (rev 4620) @@ -361,7 +361,7 @@ if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){ $InAFunction = false; } - if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ + if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ // Database created above with correct name. if (strncasecmp($SQL, ' CREATE DATABASE ', 17) AND strncasecmp($SQL, ' USE ', 5)){ Modified: trunk/reportwriter/WriteReport.inc =================================================================== --- trunk/reportwriter/WriteReport.inc 2011-07-03 03:01:39 UTC (rev 4619) +++ trunk/reportwriter/WriteReport.inc 2011-07-03 03:27:48 UTC (rev 4620) @@ -544,7 +544,7 @@ $CSVOutput = ''; // Write the column headings foreach ($Heading as $mycolumn) { // check for embedded commas and enclose in quotes - if (strpos($mycolumn,',')===false) $CSVOutput .= $mycolumn.','; else $CSVOutput .= '"'.$mycolumn.'",'; + if (mb_strpos($mycolumn,',')===false) $CSVOutput .= $mycolumn.','; else $CSVOutput .= '"'.$mycolumn.'",'; } $CSVOutput = substr($CSVOutput,0,-1).chr(10); // Strip the last comma off and add line feed // Now write each data line and totals @@ -561,7 +561,7 @@ default: $CSVLine = ''; foreach ($myrow as $mycolumn) { // check for embedded commas and enclose in quotes - if (strpos($mycolumn,',')===false) $CSVLine .= $mycolumn.','; else $CSVLine .= '"'.$mycolumn.'",'; + if (mb_strpos($mycolumn,',')===false) $CSVLine .= $mycolumn.','; else $CSVLine .= '"'.$mycolumn.'",'; } $CSVLine = substr($CSVLine,0,-1); // Strip ... [truncated message content] |
From: <dai...@us...> - 2011-07-03 03:35:59
|
Revision: 4621 http://web-erp.svn.sourceforge.net/web-erp/?rev=4621&view=rev Author: daintree Date: 2011-07-03 03:35:49 +0000 (Sun, 03 Jul 2011) Log Message: ----------- substr to mb_substr Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/Contracts.php trunk/CounterSales.php trunk/CustomerBranches.php trunk/Customers.php trunk/DailySalesInquiry.php trunk/EDIProcessOrders.php trunk/FixedAssetItems.php trunk/FixedAssetTransfer.php trunk/FormDesigner.php trunk/GetStockImage.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.cs.php trunk/Numbers/Words/lang.de.php trunk/Numbers/Words/lang.dk.php trunk/Numbers/Words/lang.en_100.php trunk/Numbers/Words/lang.en_GB.php trunk/Numbers/Words/lang.en_US.php trunk/Numbers/Words/lang.es.php trunk/Numbers/Words/lang.es_AR.php trunk/Numbers/Words/lang.et.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/Numbers/Words/lang.he.php trunk/Numbers/Words/lang.hu_HU.php trunk/Numbers/Words/lang.id.php trunk/Numbers/Words/lang.it_IT.php trunk/Numbers/Words/lang.lt.php trunk/Numbers/Words/lang.nl.php trunk/Numbers/Words/lang.pl.php trunk/Numbers/Words/lang.pt_BR.php trunk/Numbers/Words/lang.ru.php trunk/Numbers/Words/lang.sv.php trunk/Numbers/Words.php trunk/OffersReceived.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PageSecurity.php trunk/SalesCategories.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/SpecialOrder.php trunk/Stocks.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/Suppliers.php trunk/UpgradeDatabase.php trunk/WorkOrderReceive.php trunk/Z_ImportChartOfAccounts.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poAddLanguage.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/api/api_branches.php trunk/api/api_customers.php trunk/api/api_debtortransactions.php trunk/api/api_glaccounts.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_purchdata.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/config.distrib.php trunk/doc/Change.log trunk/doc/Manual/ManualAPIFunctions.php trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/DateFunctions.inc trunk/includes/DefineCartClass.php trunk/includes/EDIVariableSubstitution.inc trunk/includes/EDIconfig.inc trunk/includes/FreightCalculation.inc trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/RFC822.php trunk/includes/class.pdf.php trunk/includes/header.inc trunk/includes/htmlMimeMail.php trunk/includes/mimePart.php trunk/includes/php-gettext/gettext.inc trunk/includes/php-gettext/streams.php trunk/includes/phplot/ChangeLog trunk/includes/phplot/NEWS.txt trunk/includes/phplot/contrib/color_range.test1.php trunk/includes/phplot/contrib/prune_labels.test.php trunk/includes/phplot/phplot.php trunk/includes/smtp.php trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/config/tcpdf_config.php trunk/includes/tcpdf/config/tcpdf_config_alt.php trunk/includes/tcpdf/tcpdf.php trunk/install/index.php trunk/install/save.php trunk/javascripts/MiscFunctions.js trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php trunk/reportwriter/WriteForm.inc trunk/reportwriter/WriteReport.inc trunk/reportwriter/admin/RCFunctions.inc trunk/reportwriter/admin/forms/ReportsCritSetup.html Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -577,7 +577,7 @@ $ErrMsg = _('Could not retrieve the quantity left at the location once this order is invoiced (for the purposes of checking that stock will not go negative because)'); $Result = DB_query($SQL,$db,$ErrMsg); $CheckNegRow = DB_fetch_array($Result); - if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND substr($OrderLine->StockID,0,4)!='ASSET'){ + if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND mb_substr($OrderLine->StockID,0,4)!='ASSET'){ if ($CheckNegRow['quantity'] < $OrderLine->QtyDispatched){ prnMsg( _('Invoicing the selected order would result in negative stock. The system parameters are set to prohibit negative stocks from occurring. This invoice cannot be created until the stock on hand is corrected.'),'error',$OrderLine->StockID . ' ' . $CheckNegRow['description'] . ' - ' . _('Negative Stock Prohibited')); $NegativesFound = true; @@ -798,13 +798,13 @@ foreach ($_SESSION['Items']->LineItems as $OrderLine) { /*Test to see if the item being sold is an asset */ - if (substr($OrderLine->StockID,0,6)=='ASSET-'){ + if (mb_substr($OrderLine->StockID,0,6)=='ASSET-'){ $IsAsset = true; $HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6); if ($HyphenOccursAt == false){ - $AssetNumber = intval(substr($OrderLine->StockID,6)); + $AssetNumber = intval(mb_substr($OrderLine->StockID,6)); } else { - $AssetNumber = intval(substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1)); + $AssetNumber = intval(mb_substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1)); } prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info'); } else { Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/ContractBOM.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -165,8 +165,8 @@ if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */ /* take the form entries and enter the data from the form into the PurchOrder class variable */ foreach ($_POST as $ItemCode => $Quantity) { - if (substr($ItemCode, 0, 3)=='Qty') { - $ItemCode=substr($ItemCode, 3, mb_strlen($ItemCode)-3); + if (mb_substr($ItemCode, 0, 3)=='Qty') { + $ItemCode=mb_substr($ItemCode, 3, mb_strlen($ItemCode)-3); $AlreadyOnThisBOM = 0; if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Contracts.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -107,7 +107,7 @@ $filename = $_SESSION['part_pics_dir'] . '/' . $_SESSION['Contract'.$identifier]->ContractRef . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['Drawing']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/CounterSales.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -36,7 +36,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { if (strstr($key,'itm')) { - $NewItemArray[substr($key,3)] = trim($value); + $NewItemArray[mb_substr($key,3)] = trim($value); } } } Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/CustomerBranches.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -443,7 +443,7 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); echo '<div class="page_help_text">'._('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') .'</div>'; - $_POST['BranchCode'] = substr($DebtorNo,0,10); + $_POST['BranchCode'] = mb_substr($DebtorNo,0,10); $_POST['BrName'] = $myrow[0]; $_POST['BrAddress1'] = $myrow[1]; $_POST['BrAddress2'] = $myrow[2]; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Customers.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -280,7 +280,7 @@ $ErrMsg = _('This customer could not be added because'); $result = DB_query($sql,$db,$ErrMsg); - $BranchCode = substr($_POST['DebtorNo'],0,4); + $BranchCode = mb_substr($_POST['DebtorNo'],0,4); echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath .'/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/DailySalesInquiry.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -68,7 +68,7 @@ } if (mb_strlen($Date_Array[2])>4) { - $Date_Array[2]= substr($Date_Array[2],0,2); + $Date_Array[2]= mb_substr($Date_Array[2],0,2); } $StartDateSQL = date('Y-m-d', mktime(0,0,0, (int)$Date_Array[1],1,(int)$Date_Array[0])); Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/EDIProcessOrders.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -78,9 +78,9 @@ $LineText = StripTrailingComma($LineText); echo "<br />".$LineText; - if ($SegTag != substr($LineText,0,3)){ + if ($SegTag != mb_substr($LineText,0,3)){ $SegCounter=1; - $SegTag = substr($LineText,0,3); + $SegTag = mb_substr($LineText,0,3); } else { $SegCounter++; if ($SegCounter > $Seg[$SegID]['MaxOccur']){ @@ -119,17 +119,17 @@ echo '<br />' . _('The segment tag') . ' ' . $SegTag . ' ' . _('is being processed'); switch ($SegTag){ case 'UNH': - $UNH_elements = explode ('+',substr($LineText,4)); + $UNH_elements = explode ('+',mb_substr($LineText,4)); $Order->Comments .= _('Customer EDI Ref') . ': ' . $UNH_elements[0]; $EmailText .= "\n" . _('EDI Message Ref') . ': ' . $UNH_elements[0]; - if (substr($UNH_elements[1],0,6)!='ORDERS'){ + if (mb_substr($UNH_elements[1],0,6)!='ORDERS'){ $EmailText .= "\n" . _('This message is not an order'); $TryNextFile = True; } break; case 'BGM': - $BGM_elements = explode('+',substr($LineText,4)); + $BGM_elements = explode('+',mb_substr($LineText,4)); $BGM_C002 = explode(':',$BGM_elements[0]); switch ($BGM_C002[0]){ case '220': @@ -239,7 +239,7 @@ break; case 'DTM': /*explode into an arrage all items delimited by the : - only after the + */ - $DTM_C507 = explode(':',substr($LineText,4)); + $DTM_C507 = explode(':',mb_substr($LineText,4)); $LocalFormatDate = ConvertEDIDate($DTM_C507[1],$DTM_C507[2]); switch ($DTM_C507[0]){ @@ -294,7 +294,7 @@ break; case 'PAI': /*explode into an array all items delimited by the : - only after the + */ - $PAI_C534 = explode(':',substr($LineText,4)); + $PAI_C534 = explode(':',mb_substr($LineText,4)); if ($PAI_C534[0]=='1'){ $EmailText .= "\n" . _('Payment will be effected by a direct payment for this order'); } elseif($PAI_C534[0]=='OA'){ @@ -318,7 +318,7 @@ } break; case 'ALI': - $ALI = explode('+',substr($LineText,4)); + $ALI = explode('+',mb_substr($LineText,4)); if (mb_strlen($ALI[0])>1){ $EmailText .= "\n" . _('Goods of origin') . ' ' . $ALI[0]; } @@ -347,7 +347,7 @@ } break; case 'FTX': - $FTX = explode('+',substr($LineText,4)); + $FTX = explode('+',mb_substr($LineText,4)); /*agreed coded text is not catered for ... yet only free form text */ if (mb_strlen($FTX[3])>5){ @@ -357,7 +357,7 @@ } break; case 'RFF': - $RFF = explode(':',substr($LineText,4)); + $RFF = explode(':',mb_substr($LineText,4)); switch ($RFF[0]){ case 'AE': $MsgText = "\n" . _('Authorisation for expense no') . ' ' . $RFF[1]; @@ -404,7 +404,7 @@ $EmailText .= $MsgText; break; case 'NAD': - $NAD = explode('+',substr($LineText,4)); + $NAD = explode('+',mb_substr($LineText,4)); $NAD_C082 = explode(':', $NAD[1]); $NAD_C058 = explode(':', $NAD[2]); /*Not used according to MIG */ $NAD_C080 = explode(':', $NAD[3]); @@ -561,7 +561,7 @@ function StripTrailingComma ($StringToStrip){ if (strrpos($StringToStrip,"'")){ - Return substr($StringToStrip,0,strrpos($StringToStrip,"'")); + Return mb_substr($StringToStrip,0,strrpos($StringToStrip,"'")); } else { Return $StringToStrip; } Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/FixedAssetItems.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -30,7 +30,7 @@ $filename = $_SESSION['part_pics_dir'] . '/ASSET_' . $AssetID . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/FixedAssetTransfer.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -9,8 +9,8 @@ include('includes/header.inc'); foreach ($_POST as $AssetToMove => $Value) { //Value is not used? - if (substr($AssetToMove,0,4)=='Move') { // the form variable is of the format MoveAssetID so need to strip the move bit off - $AssetID=substr($AssetToMove,4); + if (mb_substr($AssetToMove,0,4)=='Move') { // the form variable is of the format MoveAssetID so need to strip the move bit off + $AssetID=mb_substr($AssetToMove,4); $sql="UPDATE fixedassets SET assetlocation='".$_POST['Location'.$AssetID] ."' WHERE assetid='". $AssetID . "'"; Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/FormDesigner.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -78,8 +78,8 @@ /*First create a simple xml object from the main file */ $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']); $FormDesign['name']=$_POST['formname']; - if (substr($_POST['PaperSize'],-8)=='Portrait') { - $_POST['PaperSize']=substr($_POST['PaperSize'],0,mb_strlen($_POST['PaperSize'])-9); + if (mb_substr($_POST['PaperSize'],-8)=='Portrait') { + $_POST['PaperSize']=mb_substr($_POST['PaperSize'],0,mb_strlen($_POST['PaperSize'])-9); } $FormDesign->PaperSize=$_POST['PaperSize']; $FormDesign->LineHeight=$_POST['LineHeight']; @@ -164,8 +164,8 @@ /* Select the paper size/orientation */ echo '<th width=33%>'._('Paper Size').'<select name="PaperSize">'; foreach ($Papers as $Paper) { - if (substr($Paper,-8)=='Portrait') { - $PaperValue=substr($Paper,0,mb_strlen($Paper)-9); + if (mb_substr($Paper,-8)=='Portrait') { + $PaperValue=mb_substr($Paper,0,mb_strlen($Paper)-9); } else { $PaperValue=$Paper; } Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/GetStockImage.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -22,26 +22,26 @@ // Color decode function function DecodeBgColor( $colorstr ) { if ( $colorstr[0] == '#' ) { - $colorstr = substr($colorstr,1,mb_strlen($colorstr)); + $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr)); } $red = 0; if(mb_strlen($colorstr) > 1) { - $red = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $red = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } $green = 0; if(mb_strlen($colorstr) > 1) { - $green = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $green = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } $blue = 0; if(mb_strlen($colorstr) > 1) { - $blue = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $blue = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } if(mb_strlen($colorstr) > 1) { - $alpha = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $alpha = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } if ( isset($alpha) ) return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha ); @@ -120,8 +120,8 @@ if( $i === false ) $type = 'png'; else { - $type = strtolower(substr($stockid,$i+1,mb_strlen($stockid))); - $stockid = substr($stockid,0,$i); + $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid))); + $stockid = mb_substr($stockid,0,$i); if($blanktext && !isset($text)) $text = ''; } Modified: trunk/Numbers/Words/lang.bg.php =================================================================== --- trunk/Numbers/Words/lang.bg.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.bg.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -311,8 +311,8 @@ if (is_string($num)) { $ret = array(); $mb_strlen = mb_strlen($num); - $first = substr($num, 0, $mb_strlen%3); - preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m); + $first = mb_substr($num, 0, $mb_strlen%3); + preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m); $ret =& $m[0]; if ($first) array_unshift($ret, $first); return $ret; @@ -446,9 +446,9 @@ if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret_minus = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity Modified: trunk/Numbers/Words/lang.cs.php =================================================================== --- trunk/Numbers/Words/lang.cs.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.cs.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -169,9 +169,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -185,8 +185,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -198,7 +198,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -210,13 +210,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.de.php =================================================================== --- trunk/Numbers/Words/lang.de.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.de.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -158,9 +158,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -174,8 +174,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -187,7 +187,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -199,13 +199,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.dk.php =================================================================== --- trunk/Numbers/Words/lang.dk.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.dk.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -172,9 +172,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -188,8 +188,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -201,7 +201,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -213,13 +213,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.en_100.php =================================================================== --- trunk/Numbers/Words/lang.en_100.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.en_100.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -146,9 +146,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -162,8 +162,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -176,7 +176,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -188,13 +188,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.en_GB.php =================================================================== --- trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -204,9 +204,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -220,8 +220,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -233,7 +233,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -245,13 +245,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.en_US.php =================================================================== --- trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -296,9 +296,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -312,8 +312,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -325,7 +325,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -337,13 +337,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.es.php =================================================================== --- trunk/Numbers/Words/lang.es.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.es.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -129,10 +129,10 @@ $ret = ''; // add a the word for the minus sign if necessary - if (substr($num, 0, 1) == '-') + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } @@ -147,13 +147,13 @@ { // convert the number above the first 6 digits // with it's corresponding $power. - $snum = substr($num, 0, -6); + $snum = mb_substr($num, 0, -6); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $ret .= $this->toWords($snum, $power + 6); } } - $num = substr($num, -6); + $num = mb_substr($num, -6); if ($num == 0) { return $ret; } Modified: trunk/Numbers/Words/lang.es_AR.php =================================================================== --- trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -189,10 +189,10 @@ $ret = ''; // add a the word for the minus sign if necessary - if (substr($num, 0, 1) == '-') + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } @@ -212,13 +212,13 @@ { // convert the number above the first 6 digits // with it's corresponding $power. - $snum = substr($num, 0, -6); + $snum = mb_substr($num, 0, -6); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $ret .= $this->toWords($snum, $power + 6); } } - $num = substr($num, -6); + $num = mb_substr($num, -6); if ($num == 0) { return $ret; } Modified: trunk/Numbers/Words/lang.et.php =================================================================== --- trunk/Numbers/Words/lang.et.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.et.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -235,9 +235,9 @@ function toWords($num, $power = 0, $powsuffix = '') { $ret = ''; - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } $num = trim($num); @@ -248,7 +248,7 @@ $curp = $maxp; for ($p = $maxp; $p > 0; --$p) { // power if (isset($this->_exponent[$p])) { - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -260,7 +260,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -272,13 +272,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.fr.php =================================================================== --- trunk/Numbers/Words/lang.fr.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.fr.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -264,8 +264,8 @@ if (is_string($num)) { $ret = array(); $mb_strlen = mb_strlen($num); - $first = substr($num, 0, $mb_strlen%3); - preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m); + $first = mb_substr($num, 0, $mb_strlen%3); + preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m); $ret =& $m[0]; if ($first) array_unshift($ret, $first); return $ret; @@ -397,9 +397,9 @@ if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity Modified: trunk/Numbers/Words/lang.fr_BE.php =================================================================== --- trunk/Numbers/Words/lang.fr_BE.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.fr_BE.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -268,8 +268,8 @@ if (is_string($num)) { $ret = array(); $mb_strlen = mb_strlen($num); - $first = substr($num, 0, $mb_strlen%3); - preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m); + $first = mb_substr($num, 0, $mb_strlen%3); + preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m); $ret =& $m[0]; if ($first) array_unshift($ret, $first); return $ret; @@ -375,9 +375,9 @@ if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity Modified: trunk/Numbers/Words/lang.he.php =================================================================== --- trunk/Numbers/Words/lang.he.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.he.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -313,9 +313,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -329,8 +329,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -342,7 +342,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -354,13 +354,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.hu_HU.php =================================================================== --- trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -204,9 +204,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -220,8 +220,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -233,7 +233,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -245,13 +245,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.id.php =================================================================== --- trunk/Numbers/Words/lang.id.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.id.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -131,9 +131,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -147,8 +147,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -160,7 +160,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -172,16 +172,16 @@ switch(mb_strlen($num)) { case 4: - $th = (int)substr($num,-4,1); + $th = (int)mb_substr($num,-4,1); case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.it_IT.php =================================================================== --- trunk/Numbers/Words/lang.it_IT.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.it_IT.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -125,10 +125,10 @@ $ret = ''; // add a the word for the minus sign if necessary - if (substr($num, 0, 1) == '-') + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } @@ -143,13 +143,13 @@ { // convert the number above the first 6 digits // with it's corresponding $power. - $snum = substr($num, 0, -6); + $snum = mb_substr($num, 0, -6); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $ret .= $this->toWords($snum, $power + 6); } } - $num = substr($num, -6); + $num = mb_substr($num, -6); if ($num == 0) { return $ret; } Modified: trunk/Numbers/Words/lang.lt.php =================================================================== --- trunk/Numbers/Words/lang.lt.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.lt.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -136,9 +136,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -152,8 +152,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -165,7 +165,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -177,13 +177,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.nl.php =================================================================== --- trunk/Numbers/Words/lang.nl.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.nl.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -166,9 +166,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -182,8 +182,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -195,7 +195,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -207,13 +207,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.pl.php =================================================================== --- trunk/Numbers/Words/lang.pl.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.pl.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -225,9 +225,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -241,8 +241,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -254,7 +254,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -266,13 +266,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: @@ -476,18 +476,18 @@ * @since Numbers_Words 0.4 */ function _get_numlevel($num) { - $num = (int)substr($num,-3); + $num = (int)mb_substr($num,-3); $h = $t = $d = $lev = 0; switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.pt_BR.php =================================================================== --- trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -219,9 +219,9 @@ $num = trim($num); - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces Modified: trunk/Numbers/Words/lang.ru.php =================================================================== --- trunk/Numbers/Words/lang.ru.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.ru.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -463,9 +463,9 @@ $num = trim($num); $sign = ""; - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $sign = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } while (mb_strlen($num) % 3) $num = '0' . $num; @@ -483,7 +483,7 @@ } else { $groupgender = 1; } - $group = $this->_groupToWords(substr($num,-$power-3,3),$groupgender,$_case); + $group = $this->_groupToWords(mb_substr($num,-$power-3,3),$groupgender,$_case); if (!$power) { $case = $_case; } @@ -547,7 +547,7 @@ $hundreds = (int)$num{0}; if ($hundreds) { $ret = $this->_hundreds[$hundreds]; - if (substr($num,1) != '00') { + if (mb_substr($num,1) != '00') { $ret .= $this->_sep; } $case = 3; Modified: trunk/Numbers/Words/lang.sv.php =================================================================== --- trunk/Numbers/Words/lang.sv.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.sv.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -157,9 +157,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -173,8 +173,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -186,7 +186,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -198,13 +198,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words.php =================================================================== --- trunk/Numbers/Words.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -65,10 +65,10 @@ if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ //try to drop off the .utf8 suffix then recheck if (mb_strpos($locale,'.utf8')){ - $locale = substr($locale, 0,mb_strpos($locale,'.utf8')); + $locale = mb_substr($locale, 0,mb_strpos($locale,'.utf8')); } if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ - $locale = substr($locale,0,2); + $locale = mb_substr($locale,0,2); } if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ $locale = 'en_US'; Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/OffersReceived.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -134,8 +134,8 @@ $rejects=array(); $defers=array(); foreach ($_POST as $key => $value) { - if(substr($key,0,6)=='action') { - $OfferID=substr($key,6); + if(mb_substr($key,0,6)=='action') { + $OfferID=mb_substr($key,6); switch ($value) { case 1: $accepts[]=$OfferID; Modified: trunk/PO_AuthoriseMyOrders.php =================================================================== --- trunk/PO_AuthoriseMyOrders.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/PO_AuthoriseMyOrders.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -17,8 +17,8 @@ if (isset($_POST['UpdateAll'])) { foreach ($_POST as $key => $value) { - if (substr($key,0,6)=='status') { - $OrderNo=substr($key,6); + if (mb_substr($key,0,6)=='status') { + $OrderNo=mb_substr($key,6); $Status=$_POST['status'.$OrderNo]; $Comment=date($_SESSION['DefaultDateFormat']).' - '._('Authorised by').' '.'<a href="mailto:' . $EmailRow['email'].'">'.$_SESSION['UserID'].'</a> <br />' . $_POST['comment']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/PO_Items.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -504,9 +504,9 @@ foreach ($_POST as $FormVariableName => $Quantity) { - if (substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order + if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - $ItemCode = substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); + $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); $AlreadyOnThisOrder = 0; if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/PageSecurity.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -13,7 +13,7 @@ if (isset($_POST['Update'])) { foreach ($_POST as $ScriptName => $PageSecurityValue) { if ($ScriptName!='Update' and $ScriptName!='FormID') { - $ScriptName = substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php'; + $ScriptName = mb_substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php'; $sql="UPDATE scripts SET pagesecurity='".$PageSecurityValue."' WHERE script='".$ScriptName."'"; $UpdateResult=DB_query($sql, $db,_('Could not update the page security value for the script because')); } Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SalesCategories.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -39,7 +39,7 @@ $FileName = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SelectCreditItems.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -116,8 +116,8 @@ /*will only be true if page called from customer selection form parse the $Select string into customer code and branch code */ - $_SESSION['CreditItems']->Branch = substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->Branch = mb_substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); + $_POST['Select'] = mb_substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); /*Now retrieve customer information - name, salestype, currency, terms etc */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SelectOrderItems.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -25,7 +25,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { if (strstr($key,'itm')) { - $NewItem_array[substr($key,3)] = trim($value); + $NewItem_array[mb_substr($key,3)] = trim($value); } } } Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SpecialOrder.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -332,7 +332,7 @@ if ($PartCount[0]!=0){ $PartAlreadyExists =True; if (mb_strlen($PartCode)==20){ - $PartCode = "*" . strtoupper(substr($_SESSION['SPL']->PurchOrderNo,0,13)) . "_" . $SPLLine->LineNo; + $PartCode = "*" . strtoupper(mb_substr($_SESSION['SPL']->PurchOrderNo,0,13)) . "_" . $SPLLine->LineNo; } $PartCode = $PartCode . $Counter; $Counter++; Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Stocks.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -43,7 +43,7 @@ $filename = $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SE... [truncated message content] |
From: <dai...@us...> - 2011-07-03 03:36:00
|
Revision: 4621 http://web-erp.svn.sourceforge.net/web-erp/?rev=4621&view=rev Author: daintree Date: 2011-07-03 03:35:49 +0000 (Sun, 03 Jul 2011) Log Message: ----------- substr to mb_substr Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/Contracts.php trunk/CounterSales.php trunk/CustomerBranches.php trunk/Customers.php trunk/DailySalesInquiry.php trunk/EDIProcessOrders.php trunk/FixedAssetItems.php trunk/FixedAssetTransfer.php trunk/FormDesigner.php trunk/GetStockImage.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.cs.php trunk/Numbers/Words/lang.de.php trunk/Numbers/Words/lang.dk.php trunk/Numbers/Words/lang.en_100.php trunk/Numbers/Words/lang.en_GB.php trunk/Numbers/Words/lang.en_US.php trunk/Numbers/Words/lang.es.php trunk/Numbers/Words/lang.es_AR.php trunk/Numbers/Words/lang.et.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/Numbers/Words/lang.he.php trunk/Numbers/Words/lang.hu_HU.php trunk/Numbers/Words/lang.id.php trunk/Numbers/Words/lang.it_IT.php trunk/Numbers/Words/lang.lt.php trunk/Numbers/Words/lang.nl.php trunk/Numbers/Words/lang.pl.php trunk/Numbers/Words/lang.pt_BR.php trunk/Numbers/Words/lang.ru.php trunk/Numbers/Words/lang.sv.php trunk/Numbers/Words.php trunk/OffersReceived.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PageSecurity.php trunk/SalesCategories.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/SpecialOrder.php trunk/Stocks.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/Suppliers.php trunk/UpgradeDatabase.php trunk/WorkOrderReceive.php trunk/Z_ImportChartOfAccounts.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poAddLanguage.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/api/api_branches.php trunk/api/api_customers.php trunk/api/api_debtortransactions.php trunk/api/api_glaccounts.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_purchdata.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/config.distrib.php trunk/doc/Change.log trunk/doc/Manual/ManualAPIFunctions.php trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/DateFunctions.inc trunk/includes/DefineCartClass.php trunk/includes/EDIVariableSubstitution.inc trunk/includes/EDIconfig.inc trunk/includes/FreightCalculation.inc trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/RFC822.php trunk/includes/class.pdf.php trunk/includes/header.inc trunk/includes/htmlMimeMail.php trunk/includes/mimePart.php trunk/includes/php-gettext/gettext.inc trunk/includes/php-gettext/streams.php trunk/includes/phplot/ChangeLog trunk/includes/phplot/NEWS.txt trunk/includes/phplot/contrib/color_range.test1.php trunk/includes/phplot/contrib/prune_labels.test.php trunk/includes/phplot/phplot.php trunk/includes/smtp.php trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/config/tcpdf_config.php trunk/includes/tcpdf/config/tcpdf_config_alt.php trunk/includes/tcpdf/tcpdf.php trunk/install/index.php trunk/install/save.php trunk/javascripts/MiscFunctions.js trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php trunk/reportwriter/WriteForm.inc trunk/reportwriter/WriteReport.inc trunk/reportwriter/admin/RCFunctions.inc trunk/reportwriter/admin/forms/ReportsCritSetup.html Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -577,7 +577,7 @@ $ErrMsg = _('Could not retrieve the quantity left at the location once this order is invoiced (for the purposes of checking that stock will not go negative because)'); $Result = DB_query($SQL,$db,$ErrMsg); $CheckNegRow = DB_fetch_array($Result); - if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND substr($OrderLine->StockID,0,4)!='ASSET'){ + if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND mb_substr($OrderLine->StockID,0,4)!='ASSET'){ if ($CheckNegRow['quantity'] < $OrderLine->QtyDispatched){ prnMsg( _('Invoicing the selected order would result in negative stock. The system parameters are set to prohibit negative stocks from occurring. This invoice cannot be created until the stock on hand is corrected.'),'error',$OrderLine->StockID . ' ' . $CheckNegRow['description'] . ' - ' . _('Negative Stock Prohibited')); $NegativesFound = true; @@ -798,13 +798,13 @@ foreach ($_SESSION['Items']->LineItems as $OrderLine) { /*Test to see if the item being sold is an asset */ - if (substr($OrderLine->StockID,0,6)=='ASSET-'){ + if (mb_substr($OrderLine->StockID,0,6)=='ASSET-'){ $IsAsset = true; $HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6); if ($HyphenOccursAt == false){ - $AssetNumber = intval(substr($OrderLine->StockID,6)); + $AssetNumber = intval(mb_substr($OrderLine->StockID,6)); } else { - $AssetNumber = intval(substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1)); + $AssetNumber = intval(mb_substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1)); } prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info'); } else { Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/ContractBOM.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -165,8 +165,8 @@ if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */ /* take the form entries and enter the data from the form into the PurchOrder class variable */ foreach ($_POST as $ItemCode => $Quantity) { - if (substr($ItemCode, 0, 3)=='Qty') { - $ItemCode=substr($ItemCode, 3, mb_strlen($ItemCode)-3); + if (mb_substr($ItemCode, 0, 3)=='Qty') { + $ItemCode=mb_substr($ItemCode, 3, mb_strlen($ItemCode)-3); $AlreadyOnThisBOM = 0; if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Contracts.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -107,7 +107,7 @@ $filename = $_SESSION['part_pics_dir'] . '/' . $_SESSION['Contract'.$identifier]->ContractRef . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['Drawing']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/CounterSales.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -36,7 +36,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { if (strstr($key,'itm')) { - $NewItemArray[substr($key,3)] = trim($value); + $NewItemArray[mb_substr($key,3)] = trim($value); } } } Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/CustomerBranches.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -443,7 +443,7 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); echo '<div class="page_help_text">'._('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') .'</div>'; - $_POST['BranchCode'] = substr($DebtorNo,0,10); + $_POST['BranchCode'] = mb_substr($DebtorNo,0,10); $_POST['BrName'] = $myrow[0]; $_POST['BrAddress1'] = $myrow[1]; $_POST['BrAddress2'] = $myrow[2]; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Customers.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -280,7 +280,7 @@ $ErrMsg = _('This customer could not be added because'); $result = DB_query($sql,$db,$ErrMsg); - $BranchCode = substr($_POST['DebtorNo'],0,4); + $BranchCode = mb_substr($_POST['DebtorNo'],0,4); echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath .'/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/DailySalesInquiry.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -68,7 +68,7 @@ } if (mb_strlen($Date_Array[2])>4) { - $Date_Array[2]= substr($Date_Array[2],0,2); + $Date_Array[2]= mb_substr($Date_Array[2],0,2); } $StartDateSQL = date('Y-m-d', mktime(0,0,0, (int)$Date_Array[1],1,(int)$Date_Array[0])); Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/EDIProcessOrders.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -78,9 +78,9 @@ $LineText = StripTrailingComma($LineText); echo "<br />".$LineText; - if ($SegTag != substr($LineText,0,3)){ + if ($SegTag != mb_substr($LineText,0,3)){ $SegCounter=1; - $SegTag = substr($LineText,0,3); + $SegTag = mb_substr($LineText,0,3); } else { $SegCounter++; if ($SegCounter > $Seg[$SegID]['MaxOccur']){ @@ -119,17 +119,17 @@ echo '<br />' . _('The segment tag') . ' ' . $SegTag . ' ' . _('is being processed'); switch ($SegTag){ case 'UNH': - $UNH_elements = explode ('+',substr($LineText,4)); + $UNH_elements = explode ('+',mb_substr($LineText,4)); $Order->Comments .= _('Customer EDI Ref') . ': ' . $UNH_elements[0]; $EmailText .= "\n" . _('EDI Message Ref') . ': ' . $UNH_elements[0]; - if (substr($UNH_elements[1],0,6)!='ORDERS'){ + if (mb_substr($UNH_elements[1],0,6)!='ORDERS'){ $EmailText .= "\n" . _('This message is not an order'); $TryNextFile = True; } break; case 'BGM': - $BGM_elements = explode('+',substr($LineText,4)); + $BGM_elements = explode('+',mb_substr($LineText,4)); $BGM_C002 = explode(':',$BGM_elements[0]); switch ($BGM_C002[0]){ case '220': @@ -239,7 +239,7 @@ break; case 'DTM': /*explode into an arrage all items delimited by the : - only after the + */ - $DTM_C507 = explode(':',substr($LineText,4)); + $DTM_C507 = explode(':',mb_substr($LineText,4)); $LocalFormatDate = ConvertEDIDate($DTM_C507[1],$DTM_C507[2]); switch ($DTM_C507[0]){ @@ -294,7 +294,7 @@ break; case 'PAI': /*explode into an array all items delimited by the : - only after the + */ - $PAI_C534 = explode(':',substr($LineText,4)); + $PAI_C534 = explode(':',mb_substr($LineText,4)); if ($PAI_C534[0]=='1'){ $EmailText .= "\n" . _('Payment will be effected by a direct payment for this order'); } elseif($PAI_C534[0]=='OA'){ @@ -318,7 +318,7 @@ } break; case 'ALI': - $ALI = explode('+',substr($LineText,4)); + $ALI = explode('+',mb_substr($LineText,4)); if (mb_strlen($ALI[0])>1){ $EmailText .= "\n" . _('Goods of origin') . ' ' . $ALI[0]; } @@ -347,7 +347,7 @@ } break; case 'FTX': - $FTX = explode('+',substr($LineText,4)); + $FTX = explode('+',mb_substr($LineText,4)); /*agreed coded text is not catered for ... yet only free form text */ if (mb_strlen($FTX[3])>5){ @@ -357,7 +357,7 @@ } break; case 'RFF': - $RFF = explode(':',substr($LineText,4)); + $RFF = explode(':',mb_substr($LineText,4)); switch ($RFF[0]){ case 'AE': $MsgText = "\n" . _('Authorisation for expense no') . ' ' . $RFF[1]; @@ -404,7 +404,7 @@ $EmailText .= $MsgText; break; case 'NAD': - $NAD = explode('+',substr($LineText,4)); + $NAD = explode('+',mb_substr($LineText,4)); $NAD_C082 = explode(':', $NAD[1]); $NAD_C058 = explode(':', $NAD[2]); /*Not used according to MIG */ $NAD_C080 = explode(':', $NAD[3]); @@ -561,7 +561,7 @@ function StripTrailingComma ($StringToStrip){ if (strrpos($StringToStrip,"'")){ - Return substr($StringToStrip,0,strrpos($StringToStrip,"'")); + Return mb_substr($StringToStrip,0,strrpos($StringToStrip,"'")); } else { Return $StringToStrip; } Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/FixedAssetItems.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -30,7 +30,7 @@ $filename = $_SESSION['part_pics_dir'] . '/ASSET_' . $AssetID . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/FixedAssetTransfer.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -9,8 +9,8 @@ include('includes/header.inc'); foreach ($_POST as $AssetToMove => $Value) { //Value is not used? - if (substr($AssetToMove,0,4)=='Move') { // the form variable is of the format MoveAssetID so need to strip the move bit off - $AssetID=substr($AssetToMove,4); + if (mb_substr($AssetToMove,0,4)=='Move') { // the form variable is of the format MoveAssetID so need to strip the move bit off + $AssetID=mb_substr($AssetToMove,4); $sql="UPDATE fixedassets SET assetlocation='".$_POST['Location'.$AssetID] ."' WHERE assetid='". $AssetID . "'"; Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/FormDesigner.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -78,8 +78,8 @@ /*First create a simple xml object from the main file */ $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']); $FormDesign['name']=$_POST['formname']; - if (substr($_POST['PaperSize'],-8)=='Portrait') { - $_POST['PaperSize']=substr($_POST['PaperSize'],0,mb_strlen($_POST['PaperSize'])-9); + if (mb_substr($_POST['PaperSize'],-8)=='Portrait') { + $_POST['PaperSize']=mb_substr($_POST['PaperSize'],0,mb_strlen($_POST['PaperSize'])-9); } $FormDesign->PaperSize=$_POST['PaperSize']; $FormDesign->LineHeight=$_POST['LineHeight']; @@ -164,8 +164,8 @@ /* Select the paper size/orientation */ echo '<th width=33%>'._('Paper Size').'<select name="PaperSize">'; foreach ($Papers as $Paper) { - if (substr($Paper,-8)=='Portrait') { - $PaperValue=substr($Paper,0,mb_strlen($Paper)-9); + if (mb_substr($Paper,-8)=='Portrait') { + $PaperValue=mb_substr($Paper,0,mb_strlen($Paper)-9); } else { $PaperValue=$Paper; } Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/GetStockImage.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -22,26 +22,26 @@ // Color decode function function DecodeBgColor( $colorstr ) { if ( $colorstr[0] == '#' ) { - $colorstr = substr($colorstr,1,mb_strlen($colorstr)); + $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr)); } $red = 0; if(mb_strlen($colorstr) > 1) { - $red = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $red = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } $green = 0; if(mb_strlen($colorstr) > 1) { - $green = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $green = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } $blue = 0; if(mb_strlen($colorstr) > 1) { - $blue = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $blue = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } if(mb_strlen($colorstr) > 1) { - $alpha = hexdec(substr($colorstr,0,2)); - $colorstr = substr($colorstr,2,mb_strlen($colorstr)); + $alpha = hexdec(mb_substr($colorstr,0,2)); + $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); } if ( isset($alpha) ) return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha ); @@ -120,8 +120,8 @@ if( $i === false ) $type = 'png'; else { - $type = strtolower(substr($stockid,$i+1,mb_strlen($stockid))); - $stockid = substr($stockid,0,$i); + $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid))); + $stockid = mb_substr($stockid,0,$i); if($blanktext && !isset($text)) $text = ''; } Modified: trunk/Numbers/Words/lang.bg.php =================================================================== --- trunk/Numbers/Words/lang.bg.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.bg.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -311,8 +311,8 @@ if (is_string($num)) { $ret = array(); $mb_strlen = mb_strlen($num); - $first = substr($num, 0, $mb_strlen%3); - preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m); + $first = mb_substr($num, 0, $mb_strlen%3); + preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m); $ret =& $m[0]; if ($first) array_unshift($ret, $first); return $ret; @@ -446,9 +446,9 @@ if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret_minus = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity Modified: trunk/Numbers/Words/lang.cs.php =================================================================== --- trunk/Numbers/Words/lang.cs.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.cs.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -169,9 +169,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -185,8 +185,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -198,7 +198,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -210,13 +210,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.de.php =================================================================== --- trunk/Numbers/Words/lang.de.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.de.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -158,9 +158,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -174,8 +174,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -187,7 +187,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -199,13 +199,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.dk.php =================================================================== --- trunk/Numbers/Words/lang.dk.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.dk.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -172,9 +172,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -188,8 +188,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -201,7 +201,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -213,13 +213,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.en_100.php =================================================================== --- trunk/Numbers/Words/lang.en_100.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.en_100.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -146,9 +146,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -162,8 +162,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -176,7 +176,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -188,13 +188,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.en_GB.php =================================================================== --- trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -204,9 +204,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -220,8 +220,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -233,7 +233,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -245,13 +245,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.en_US.php =================================================================== --- trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -296,9 +296,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -312,8 +312,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -325,7 +325,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -337,13 +337,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.es.php =================================================================== --- trunk/Numbers/Words/lang.es.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.es.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -129,10 +129,10 @@ $ret = ''; // add a the word for the minus sign if necessary - if (substr($num, 0, 1) == '-') + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } @@ -147,13 +147,13 @@ { // convert the number above the first 6 digits // with it's corresponding $power. - $snum = substr($num, 0, -6); + $snum = mb_substr($num, 0, -6); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $ret .= $this->toWords($snum, $power + 6); } } - $num = substr($num, -6); + $num = mb_substr($num, -6); if ($num == 0) { return $ret; } Modified: trunk/Numbers/Words/lang.es_AR.php =================================================================== --- trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -189,10 +189,10 @@ $ret = ''; // add a the word for the minus sign if necessary - if (substr($num, 0, 1) == '-') + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } @@ -212,13 +212,13 @@ { // convert the number above the first 6 digits // with it's corresponding $power. - $snum = substr($num, 0, -6); + $snum = mb_substr($num, 0, -6); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $ret .= $this->toWords($snum, $power + 6); } } - $num = substr($num, -6); + $num = mb_substr($num, -6); if ($num == 0) { return $ret; } Modified: trunk/Numbers/Words/lang.et.php =================================================================== --- trunk/Numbers/Words/lang.et.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.et.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -235,9 +235,9 @@ function toWords($num, $power = 0, $powsuffix = '') { $ret = ''; - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } $num = trim($num); @@ -248,7 +248,7 @@ $curp = $maxp; for ($p = $maxp; $p > 0; --$p) { // power if (isset($this->_exponent[$p])) { - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -260,7 +260,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -272,13 +272,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.fr.php =================================================================== --- trunk/Numbers/Words/lang.fr.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.fr.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -264,8 +264,8 @@ if (is_string($num)) { $ret = array(); $mb_strlen = mb_strlen($num); - $first = substr($num, 0, $mb_strlen%3); - preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m); + $first = mb_substr($num, 0, $mb_strlen%3); + preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m); $ret =& $m[0]; if ($first) array_unshift($ret, $first); return $ret; @@ -397,9 +397,9 @@ if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity Modified: trunk/Numbers/Words/lang.fr_BE.php =================================================================== --- trunk/Numbers/Words/lang.fr_BE.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.fr_BE.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -268,8 +268,8 @@ if (is_string($num)) { $ret = array(); $mb_strlen = mb_strlen($num); - $first = substr($num, 0, $mb_strlen%3); - preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m); + $first = mb_substr($num, 0, $mb_strlen%3); + preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m); $ret =& $m[0]; if ($first) array_unshift($ret, $first); return $ret; @@ -375,9 +375,9 @@ if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity Modified: trunk/Numbers/Words/lang.he.php =================================================================== --- trunk/Numbers/Words/lang.he.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.he.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -313,9 +313,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -329,8 +329,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -342,7 +342,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -354,13 +354,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.hu_HU.php =================================================================== --- trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -204,9 +204,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -220,8 +220,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -233,7 +233,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -245,13 +245,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.id.php =================================================================== --- trunk/Numbers/Words/lang.id.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.id.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -131,9 +131,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -147,8 +147,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -160,7 +160,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -172,16 +172,16 @@ switch(mb_strlen($num)) { case 4: - $th = (int)substr($num,-4,1); + $th = (int)mb_substr($num,-4,1); case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.it_IT.php =================================================================== --- trunk/Numbers/Words/lang.it_IT.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.it_IT.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -125,10 +125,10 @@ $ret = ''; // add a the word for the minus sign if necessary - if (substr($num, 0, 1) == '-') + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } @@ -143,13 +143,13 @@ { // convert the number above the first 6 digits // with it's corresponding $power. - $snum = substr($num, 0, -6); + $snum = mb_substr($num, 0, -6); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $ret .= $this->toWords($snum, $power + 6); } } - $num = substr($num, -6); + $num = mb_substr($num, -6); if ($num == 0) { return $ret; } Modified: trunk/Numbers/Words/lang.lt.php =================================================================== --- trunk/Numbers/Words/lang.lt.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.lt.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -136,9 +136,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -152,8 +152,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -165,7 +165,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -177,13 +177,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.nl.php =================================================================== --- trunk/Numbers/Words/lang.nl.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.nl.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -166,9 +166,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -182,8 +182,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -195,7 +195,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -207,13 +207,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.pl.php =================================================================== --- trunk/Numbers/Words/lang.pl.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.pl.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -225,9 +225,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -241,8 +241,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -254,7 +254,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -266,13 +266,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: @@ -476,18 +476,18 @@ * @since Numbers_Words 0.4 */ function _get_numlevel($num) { - $num = (int)substr($num,-3); + $num = (int)mb_substr($num,-3); $h = $t = $d = $lev = 0; switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words/lang.pt_BR.php =================================================================== --- trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -219,9 +219,9 @@ $num = trim($num); - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces Modified: trunk/Numbers/Words/lang.ru.php =================================================================== --- trunk/Numbers/Words/lang.ru.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.ru.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -463,9 +463,9 @@ $num = trim($num); $sign = ""; - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $sign = $this->_minus . $this->_sep; - $num = substr($num, 1); + $num = mb_substr($num, 1); } while (mb_strlen($num) % 3) $num = '0' . $num; @@ -483,7 +483,7 @@ } else { $groupgender = 1; } - $group = $this->_groupToWords(substr($num,-$power-3,3),$groupgender,$_case); + $group = $this->_groupToWords(mb_substr($num,-$power-3,3),$groupgender,$_case); if (!$power) { $case = $_case; } @@ -547,7 +547,7 @@ $hundreds = (int)$num{0}; if ($hundreds) { $ret = $this->_hundreds[$hundreds]; - if (substr($num,1) != '00') { + if (mb_substr($num,1) != '00') { $ret .= $this->_sep; } $case = 3; Modified: trunk/Numbers/Words/lang.sv.php =================================================================== --- trunk/Numbers/Words/lang.sv.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words/lang.sv.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -157,9 +157,9 @@ $ret = ''; // add a minus sign - if (substr($num, 0, 1) == '-') { + if (mb_substr($num, 0, 1) == '-') { $ret = $this->_sep . $this->_minus; - $num = substr($num, 1); + $num = mb_substr($num, 1); } // strip excessive zero signs and spaces @@ -173,8 +173,8 @@ // check for highest power if (isset($this->_exponent[$p])) { - // send substr from $curp to $p - $snum = substr($num, $maxp - $curp, $curp - $p + 1); + // send mb_substr from $curp to $p + $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1); $snum = preg_replace('/^0+/','',$snum); if ($snum !== '') { $cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1]; @@ -186,7 +186,7 @@ continue; } } - $num = substr($num, $maxp - $curp, $curp - $p + 1); + $num = mb_substr($num, $maxp - $curp, $curp - $p + 1); if ($num == 0) { return $ret; } @@ -198,13 +198,13 @@ switch(mb_strlen($num)) { case 3: - $h = (int)substr($num,-3,1); + $h = (int)mb_substr($num,-3,1); case 2: - $t = (int)substr($num,-2,1); + $t = (int)mb_substr($num,-2,1); case 1: - $d = (int)substr($num,-1,1); + $d = (int)mb_substr($num,-1,1); break; case 0: Modified: trunk/Numbers/Words.php =================================================================== --- trunk/Numbers/Words.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Numbers/Words.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -65,10 +65,10 @@ if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ //try to drop off the .utf8 suffix then recheck if (mb_strpos($locale,'.utf8')){ - $locale = substr($locale, 0,mb_strpos($locale,'.utf8')); + $locale = mb_substr($locale, 0,mb_strpos($locale,'.utf8')); } if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ - $locale = substr($locale,0,2); + $locale = mb_substr($locale,0,2); } if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){ $locale = 'en_US'; Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/OffersReceived.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -134,8 +134,8 @@ $rejects=array(); $defers=array(); foreach ($_POST as $key => $value) { - if(substr($key,0,6)=='action') { - $OfferID=substr($key,6); + if(mb_substr($key,0,6)=='action') { + $OfferID=mb_substr($key,6); switch ($value) { case 1: $accepts[]=$OfferID; Modified: trunk/PO_AuthoriseMyOrders.php =================================================================== --- trunk/PO_AuthoriseMyOrders.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/PO_AuthoriseMyOrders.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -17,8 +17,8 @@ if (isset($_POST['UpdateAll'])) { foreach ($_POST as $key => $value) { - if (substr($key,0,6)=='status') { - $OrderNo=substr($key,6); + if (mb_substr($key,0,6)=='status') { + $OrderNo=mb_substr($key,6); $Status=$_POST['status'.$OrderNo]; $Comment=date($_SESSION['DefaultDateFormat']).' - '._('Authorised by').' '.'<a href="mailto:' . $EmailRow['email'].'">'.$_SESSION['UserID'].'</a> <br />' . $_POST['comment']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/PO_Items.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -504,9 +504,9 @@ foreach ($_POST as $FormVariableName => $Quantity) { - if (substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order + if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - $ItemCode = substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); + $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); $AlreadyOnThisOrder = 0; if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/PageSecurity.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -13,7 +13,7 @@ if (isset($_POST['Update'])) { foreach ($_POST as $ScriptName => $PageSecurityValue) { if ($ScriptName!='Update' and $ScriptName!='FormID') { - $ScriptName = substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php'; + $ScriptName = mb_substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php'; $sql="UPDATE scripts SET pagesecurity='".$PageSecurityValue."' WHERE script='".$ScriptName."'"; $UpdateResult=DB_query($sql, $db,_('Could not update the page security value for the script because')); } Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SalesCategories.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -39,7 +39,7 @@ $FileName = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SelectCreditItems.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -116,8 +116,8 @@ /*will only be true if page called from customer selection form parse the $Select string into customer code and branch code */ - $_SESSION['CreditItems']->Branch = substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->Branch = mb_substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); + $_POST['Select'] = mb_substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); /*Now retrieve customer information - name, salestype, currency, terms etc */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SelectOrderItems.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -25,7 +25,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { if (strstr($key,'itm')) { - $NewItem_array[substr($key,3)] = trim($value); + $NewItem_array[mb_substr($key,3)] = trim($value); } } } Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/SpecialOrder.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -332,7 +332,7 @@ if ($PartCount[0]!=0){ $PartAlreadyExists =True; if (mb_strlen($PartCode)==20){ - $PartCode = "*" . strtoupper(substr($_SESSION['SPL']->PurchOrderNo,0,13)) . "_" . $SPLLine->LineNo; + $PartCode = "*" . strtoupper(mb_substr($_SESSION['SPL']->PurchOrderNo,0,13)) . "_" . $SPLLine->LineNo; } $PartCode = $PartCode . $Counter; $Counter++; Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-03 03:27:48 UTC (rev 4620) +++ trunk/Stocks.php 2011-07-03 03:35:49 UTC (rev 4621) @@ -43,7 +43,7 @@ $filename = $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg'; //But check for the worst - if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SE... [truncated message content] |
From: <dai...@us...> - 2011-07-03 04:33:28
|
Revision: 4622 http://web-erp.svn.sourceforge.net/web-erp/?rev=4622&view=rev Author: daintree Date: 2011-07-03 04:33:19 +0000 (Sun, 03 Jul 2011) Log Message: ----------- strtoupper to mb_strtoupper Modified Paths: -------------- trunk/AccountGroups.php trunk/Areas.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/Contracts.php trunk/CounterSales.php trunk/Currencies.php trunk/CustomerBranches.php trunk/CustomerTypes.php trunk/Customers.php trunk/DiscountCategories.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/GetStockImage.php trunk/Locations.php trunk/MRPCalendar.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPReport.php trunk/Numbers/Words/lang.dk.php trunk/Numbers/Words/lang.en_GB.php trunk/Numbers/Words/lang.en_US.php trunk/Numbers/Words/lang.es_AR.php trunk/Numbers/Words/lang.he.php trunk/Numbers/Words/lang.hu_HU.php trunk/Numbers/Words/lang.pl.php trunk/Numbers/Words/lang.pt_BR.php trunk/Numbers/Words/lang.ru.php trunk/POReport.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PrintCustStatements.php trunk/PurchData.php trunk/SalesCategories.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTypes.php trunk/SelectAsset.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCostUpdate.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/Stocks.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/WhereUsedInquiry.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_poAddLanguage.php trunk/doc/Change.log trunk/includes/DefineCartClass.php trunk/includes/MiscFunctions.php trunk/includes/htmlMimeMail.php trunk/includes/mimePart.php trunk/includes/tcpdf/2dbarcodes.php trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc trunk/reportwriter/admin/RCFunctions.inc Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/AccountGroups.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -262,7 +262,7 @@ <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Areas.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,9 +10,9 @@ if (isset($_GET['SelectedArea'])){ - $SelectedArea = strtoupper($_GET['SelectedArea']); + $SelectedArea = mb_strtoupper($_GET['SelectedArea']); } elseif (isset($_POST['SelectedArea'])){ - $SelectedArea = strtoupper($_POST['SelectedArea']); + $SelectedArea = mb_strtoupper($_POST['SelectedArea']); } if (isset($Errors)) { @@ -30,7 +30,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - $_POST['AreaCode'] = strtoupper($_POST['AreaCode']); + $_POST['AreaCode'] = mb_strtoupper($_POST['AreaCode']); $sql = "SELECT count(areacode) from areas WHERE areacode='".$_POST['AreaCode']."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMExtendedQty.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -303,7 +303,7 @@ $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('Extended Quantity BOM Listing For ') - . strtoupper($_POST['Part'])); + . mb_strtoupper($_POST['Part'])); $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -=$line_height; Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMIndented.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -315,7 +315,7 @@ $YPos =$YPos - (2*$line_height); $pdf->addTextWrap($Left_Margin+1,$YPos,40,$FontSize,_('Assembly:'),'',0); - $pdf->addTextWrap(85,$YPos,100,$FontSize,strtoupper($_POST['Part']),'',0); + $pdf->addTextWrap(85,$YPos,100,$FontSize,mb_strtoupper($_POST['Part']),'',0); $pdf->addTextWrap(185,$YPos,150,$FontSize,$assemblydesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMIndentedReverse.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -291,7 +291,7 @@ $YPos =$YPos - $line_height; $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,_('Component:'),'',0); - $pdf->addTextWrap(100,$YPos,100,$FontSize,strtoupper($_POST['Part']),'',0); + $pdf->addTextWrap(100,$YPos,100,$FontSize,mb_strtoupper($_POST['Part']),'',0); $pdf->addTextWrap(200,$YPos,150,$FontSize,$assemblydesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMInquiry.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/header.inc'); if (isset($_GET['StockID'])){ - $StockID =trim(strtoupper($_GET['StockID'])); + $StockID =trim(mb_strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])){ - $StockID =trim(strtoupper($_POST['StockID'])); + $StockID =trim(mb_strtoupper($_POST['StockID'])); } if (!isset($_POST['StockID'])) { Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Contracts.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -107,7 +107,7 @@ $filename = $_SESSION['part_pics_dir'] . '/' . $_SESSION['Contract'.$identifier]->ContractRef . '.jpg'; //But check for the worst - if (strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ + if (mb_strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['Drawing']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check @@ -611,7 +611,7 @@ } else { if (mb_strlen($_POST['CustKeywords'])>0) { //insert wildcard characters in spaces - $_POST['CustKeywords'] = strtoupper(trim($_POST['CustKeywords'])); + $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = '%' . str_replace(' ', '%', $_POST['CustKeywords']) . '%'; $SQL = "SELECT custbranch.brname, @@ -630,7 +630,7 @@ } elseif (mb_strlen($_POST['CustCode'])>0){ - $_POST['CustCode'] = strtoupper(trim($_POST['CustCode'])); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $SQL = "SELECT custbranch.brname, custbranch.contactname, Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/CounterSales.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -223,7 +223,7 @@ } if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ @@ -256,7 +256,7 @@ } else if (mb_strlen($_POST['StockCode'])>0){ - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; if ($_POST['StockCat']=='All'){ @@ -382,7 +382,7 @@ $i++; if (isset($_POST[$QuickEntryCode])) { - $NewItem = strtoupper($_POST[$QuickEntryCode]); + $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); } if (isset($_POST[$QuickEntryQty])) { $NewItemQty = $_POST[$QuickEntryQty]; Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Currencies.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -237,7 +237,7 @@ $k++; } // Lets show the country flag - $ImageFile = 'flags/' . strtoupper($myrow[1]) . '.gif'; + $ImageFile = 'flags/' . mb_strtoupper($myrow[1]) . '.gif'; if(!file_exists($ImageFile)){ $ImageFile = 'flags/blank.gif'; Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/CustomerBranches.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/header.inc'); if (isset($_GET['DebtorNo'])) { - $DebtorNo = strtoupper($_GET['DebtorNo']); + $DebtorNo = mb_strtoupper($_GET['DebtorNo']); } else if (isset($_POST['DebtorNo'])){ - $DebtorNo = strtoupper($_POST['DebtorNo']); + $DebtorNo = mb_strtoupper($_POST['DebtorNo']); } if (!isset($DebtorNo)) { @@ -22,9 +22,9 @@ if (isset($_GET['SelectedBranch'])){ - $SelectedBranch = strtoupper($_GET['SelectedBranch']); + $SelectedBranch = mb_strtoupper($_GET['SelectedBranch']); } else if (isset($_POST['SelectedBranch'])){ - $SelectedBranch = strtoupper($_POST['SelectedBranch']); + $SelectedBranch = mb_strtoupper($_POST['SelectedBranch']); } if (isset($Errors)) { @@ -44,7 +44,7 @@ //first off validate inputs sensible - $_POST['BranchCode'] = strtoupper($_POST['BranchCode']); + $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { $InputError = 1; Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/CustomerTypes.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/header.inc'); if (isset($_POST['SelectedType'])){ - $SelectedType = strtoupper($_POST['SelectedType']); + $SelectedType = mb_strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ - $SelectedType = strtoupper($_GET['SelectedType']); + $SelectedType = mb_strtoupper($_GET['SelectedType']); } if (isset($Errors)) { Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Customers.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -29,7 +29,7 @@ //first off validate inputs sensible - $_POST['DebtorNo'] = strtoupper($_POST['DebtorNo']); + $_POST['DebtorNo'] = mb_strtoupper($_POST['DebtorNo']); $sql="SELECT COUNT(debtorno) FROM debtorsmaster WHERE debtorno='".$_POST['DebtorNo']."'"; $result=DB_query($sql,$db); Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/DiscountCategories.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -31,7 +31,7 @@ FROM stockmaster WHERE mbflag <>'K' AND mbflag<>'D' - AND stockid='" . strtoupper($_POST['StockID']) . "'",$db); + AND stockid='" . mb_strtoupper($_POST['StockID']) . "'",$db); if (DB_num_rows($result)==0){ $InputError = 1; prnMsg(_('The stock item entered must be set up as either a manufactured or purchased or assembly item'),'warn'); @@ -40,9 +40,9 @@ if ($InputError !=1) { $sql = "UPDATE stockmaster SET discountcategory='" . $_POST['DiscountCategory'] . "' - WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; + WHERE stockid='" . mb_strtoupper($_POST['StockID']) . "'"; - $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); + $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . mb_strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); prnMsg(_('The stock master has been updated with this discount category'),'success'); unset($_POST['DiscountCategory']); @@ -53,7 +53,7 @@ } elseif (isset($_GET['Delete']) and $_GET['Delete']=='yes') { /*the link to delete a selected record was clicked instead of the submit button */ - $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(strtoupper($_GET['StockID'])) ."'"; + $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(mb_strtoupper($_GET['StockID'])) ."'"; $result = DB_query($sql,$db); prnMsg( _('The stock master record has been updated to no discount category'),'success'); echo '<br />'; Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Factors.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,10 +9,10 @@ include('includes/header.inc'); if (isset($_GET['FactorID'])){ - $FactorID = strtoupper($_GET['FactorID']); + $FactorID = mb_strtoupper($_GET['FactorID']); $_POST['Amend']=True; } elseif (isset($_POST['FactorID'])){ - $FactorID = strtoupper($_POST['FactorID']); + $FactorID = mb_strtoupper($_POST['FactorID']); } else { unset($FactorID); } Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/FixedAssetCategories.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -12,9 +12,9 @@ _('Fixed Asset Categories') . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_GET['SelectedCategory'])){ - $SelectedCategory = strtoupper($_GET['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_GET['SelectedCategory']); } else if (isset($_POST['SelectedCategory'])){ - $SelectedCategory = strtoupper($_POST['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_POST['SelectedCategory']); } if (isset($_POST['submit'])) { @@ -27,7 +27,7 @@ //first off validate inputs sensible - $_POST['CategoryID'] = strtoupper($_POST['CategoryID']); + $_POST['CategoryID'] = mb_strtoupper($_POST['CategoryID']); if (mb_strlen($_POST['CategoryID']) > 6) { $InputError = 1; @@ -96,13 +96,12 @@ depnact, disposalact, accumdepnact) - VALUES ( - '" . $_POST['CategoryID'] . "', - '" . $_POST['CategoryDescription'] . "', - '" . $_POST['CostAct'] . "', - '" . $_POST['DepnAct'] . "', - '" . $_POST['DisposalAct'] . "', - '" . $_POST['AccumDepnAct'] . "')"; + VALUES ('" . $_POST['CategoryID'] . "', + '" . $_POST['CategoryDescription'] . "', + '" . $_POST['CostAct'] . "', + '" . $_POST['DepnAct'] . "', + '" . $_POST['DisposalAct'] . "', + '" . $_POST['AccumDepnAct'] . "')"; $ErrMsg = _('Could not insert the new fixed asset category') . $_POST['CategoryDescription'] . _('because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('A new fixed asset category record has been added for') . ' ' . $_POST['CategoryDescription'],'success'); @@ -144,22 +143,25 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT categoryid, + $sql = "SELECT categoryid, categorydescription, costact, depnact, disposalact, accumdepnact - FROM fixedassetcategories'; + FROM fixedassetcategories"; $result = DB_query($sql,$db); - echo '<br /><table class=selection>'; - echo '<tr><th>' . _('Cat Code') . '</th> + echo '<br /> + <table class="selection">'; + echo '<tr> + <th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> <th>' . _('P & L Depn GL') . '</th> <th>' . _('Disposal GL') . '</th> - <th>' . _('Accum Depn GL') . '</th></tr>'; + <th>' . _('Accum Depn GL') . '</th> + </tr>'; $k=0; //row colour counter @@ -178,7 +180,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> - <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> + <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '\');">' . _('Delete') . '</td> </tr>', $myrow['categoryid'], $myrow['categorydescription'], @@ -186,9 +188,9 @@ $myrow['depnact'], $myrow['disposalact'], $myrow['accumdepnact'], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['categoryid'], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['categoryid']); } //END WHILE LIST LOOP @@ -201,7 +203,7 @@ echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' ._('Show All Fixed Asset Categories') . '</a></div>'; } -echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCategory) and !isset($_POST['submit'])) { @@ -238,23 +240,21 @@ } //SQL to poulate account selection boxes -$sql = 'SELECT accountcode, +$sql = "SELECT accountcode, accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl=0 - ORDER BY accountcode'; + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY accountcode"; $BSAccountsResult = DB_query($sql,$db); -$sql = 'SELECT accountcode, +$sql = "SELECT accountcode, accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl!=0 - ORDER BY accountcode'; + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl!=0 + ORDER BY accountcode"; $PnLAccountsResult = DB_query($sql,$db); Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/FixedAssetDepreciation.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,13 +9,13 @@ /*Get the last period depreciation (depn is transtype =44) was posted for */ -$result = DB_query('SELECT periods.lastdate_in_period, +$result = DB_query("SELECT periods.lastdate_in_period, max(fixedassettrans.periodno) FROM fixedassettrans INNER JOIN periods ON fixedassettrans.periodno=periods.periodno WHERE transtype=44 GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC',$db); + ORDER BY periods.lastdate_in_period DESC",$db); $LastDepnRun = DB_fetch_row($result); @@ -65,7 +65,7 @@ fixedassetcategories.accumdepnact, fixedassetcategories.depnact, fixedassetcategories.categorydescription -ORDER BY assetcategoryid, assetid"; + ORDER BY assetcategoryid, assetid"; $AssetsResult=DB_query($sql, $db); $InputError = false; //always hope for the best @@ -104,11 +104,11 @@ if ($AssetCategoryDescription != $AssetRow['categorydescription'] OR $AssetCategoryDescription =='0'){ if ($AssetCategoryDescription !='0'){ //then print totals echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . number_format($TotalCategoryCost,2) . '</th> - <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> + <th class="number">' . number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th colspan=2></th> - <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> + <th class="number">' . number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; } echo '<tr><th colspan=9 align="left">' . $AssetRow['categorydescription'] . '</th></tr>'; @@ -147,12 +147,12 @@ echo '<td>' . $AssetRow['assetid'] . '</td> <td>' . $AssetRow['description'] . '</td> <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> - <td class="number">' . number_format($AssetRow['costtotal'],2) . '</td> - <td class="number">' . number_format($AssetRow['depnbfwd'],2) . '</td> - <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],2) . '</td> + <td class="number">' . number_format($AssetRow['costtotal'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($AssetRow['depnbfwd'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td align="center">' . $DepreciationType . '</td> <td class="number">' . $AssetRow['depnrate'] . '</td> - <td class="number">' . number_format($NewDepreciation ,2) . '</td> + <td class="number">' . number_format($NewDepreciation ,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $TotalCategoryCost +=$AssetRow['costtotal']; $TotalCategoryAccumDepn +=$AssetRow['depnbfwd']; @@ -227,18 +227,18 @@ } //end if Committing the depreciation to DB } //end loop around the assets to calculate depreciation for echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . number_format($TotalCategoryCost,2) . '</th> - <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> + <th class="number">' . number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th colspan=2></th> - <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> + <th class="number">' . number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; echo '<tr><th colspan=3 align="right">' . _('GRAND Total') . ' </th> - <th class="number">' . number_format($TotalCost,2) . '</th> - <th class="number">' . number_format($TotalAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCost-$TotalAccumDepn),2) . '</th> + <th class="number">' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format($TotalAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($TotalCost-$TotalAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th colspan=2></th> - <th class="number">' . number_format($TotalDepn,2) . '</th> + <th class="number">' . number_format($TotalDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; echo '</table><hr><p></p>'; @@ -247,11 +247,11 @@ $result = DB_Txn_Commit($db); prnMsg(_('Depreciation') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); unset($_POST['ProcessDate']); - echo '<br /><a href="index.php' . '?' . SID . '">' ._('Return to main menu').'</a>'; + echo '<br /><a href="index.php">' ._('Return to main menu').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); } else { - echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="form">'; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method=post name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p></p>'; echo '<table class=selection width=30%><tr></tr><tr>'; Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/FixedAssetItems.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -30,7 +30,7 @@ $filename = $_SESSION['part_pics_dir'] . '/ASSET_' . $AssetID . '.jpg'; //But check for the worst - if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (mb_strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/GetStockImage.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -68,7 +68,7 @@ } $filepath = $_SESSION['part_pics_dir'] . $pathsep; -$stockid = trim(strtoupper($_GET['StockID'])); +$stockid = trim(mb_strtoupper($_GET['StockID'])); if( isset($_GET['bgcolor']) ) $bgcolor = $_GET['bgcolor']; if( isset($_GET['textcolor']) ) Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Locations.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -22,7 +22,7 @@ /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ - $_POST['LocCode']=strtoupper($_POST['LocCode']); + $_POST['LocCode']=mb_strtoupper($_POST['LocCode']); if( trim($_POST['LocCode']) == '' ) { $InputError = 1; prnMsg( _('The location code may not be empty'), 'error'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPCalendar.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -11,9 +11,9 @@ if (isset($_POST['ChangeDate'])){ - $ChangeDate =trim(strtoupper($_POST['ChangeDate'])); + $ChangeDate =trim(mb_strtoupper($_POST['ChangeDate'])); } elseif (isset($_GET['ChangeDate'])){ - $ChangeDate =trim(strtoupper($_GET['ChangeDate'])); + $ChangeDate =trim(mb_strtoupper($_GET['ChangeDate'])); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPDemandTypes.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,9 +8,9 @@ //SelectedDT is the Selected MRPDemandType if (isset($_POST['SelectedDT'])){ - $SelectedDT = trim(strtoupper($_POST['SelectedDT'])); + $SelectedDT = trim(mb_strtoupper($_POST['SelectedDT'])); } elseif (isset($_GET['SelectedDT'])){ - $SelectedDT = trim(strtoupper($_GET['SelectedDT'])); + $SelectedDT = trim(mb_strtoupper($_GET['SelectedDT'])); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . @@ -26,8 +26,8 @@ //first off validate inputs sensible - if (trim(strtoupper($_POST['MRPDemandType']) == 'WO') or - trim(strtoupper($_POST['MRPDemandType']) == 'SO')) { + if (trim(mb_strtoupper($_POST['MRPDemandType']) == 'WO') or + trim(mb_strtoupper($_POST['MRPDemandType']) == 'SO')) { $InputError = 1; prnMsg(_('The Demand Type is reserved for the system'),'error'); } @@ -57,7 +57,7 @@ $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) - VALUES ('" . trim(strtoupper($_POST['MRPDemandType'])) . "', + VALUES ('" . trim(mb_strtoupper($_POST['MRPDemandType'])) . "', '" . $_POST['Description'] . "' )"; $msg = _('The new demand type has been added to the database'); Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPDemands.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -18,9 +18,9 @@ } if (isset($_POST['StockID'])){ - $StockID =trim(strtoupper($_POST['StockID'])); + $StockID =trim(mb_strtoupper($_POST['StockID'])); } elseif (isset($_GET['StockID'])){ - $StockID =trim(strtoupper($_GET['StockID'])); + $StockID =trim(mb_strtoupper($_GET['StockID'])); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . @@ -191,7 +191,7 @@ if ($myrow[0]>0) { //If $myrow[0] > 0, it means this is an edit, so do an update $sql = "UPDATE mrpdemands SET quantity = '" . $_POST['Quantity'] . "', - mrpdemandtype = '" . trim(strtoupper($_POST['MRPDemandtype'])) . "', + mrpdemandtype = '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', duedate = '" . $FormatedDuedate . "' WHERE demandid = '" . $DemandID . "'"; $msg = _("The MRP demand record has been updated for").' '.$StockID; @@ -203,7 +203,7 @@ quantity, duedate) VALUES ('" . $StockID . "', - '" . trim(strtoupper($_POST['MRPDemandtype'])) . "', + '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', '" . $_POST['Quantity'] . "', '" . $FormatedDuedate . "' )"; Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPReport.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -569,7 +569,7 @@ } if ($_POST['Keywords']) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, @@ -608,7 +608,7 @@ ORDER BY stockmaster.stockid"; } } elseif (isset($_POST['StockCode'])) { - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, stockmaster.description, Modified: trunk/Numbers/Words/lang.dk.php =================================================================== --- trunk/Numbers/Words/lang.dk.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.dk.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -368,7 +368,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.en_GB.php =================================================================== --- trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.en_GB.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -380,7 +380,7 @@ * @since Numbers_Words 0.13.1 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.en_US.php =================================================================== --- trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.en_US.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -472,7 +472,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.es_AR.php =================================================================== --- trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.es_AR.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -430,7 +430,7 @@ * @author Martin Marrese */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.he.php =================================================================== --- trunk/Numbers/Words/lang.he.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.he.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -462,7 +462,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.hu_HU.php =================================================================== --- trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -359,7 +359,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.pl.php =================================================================== --- trunk/Numbers/Words/lang.pl.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.pl.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -439,7 +439,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.pt_BR.php =================================================================== --- trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -279,7 +279,7 @@ * @since Numbers_Words 0.10.1 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_name[$int_curr])){ $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.ru.php =================================================================== --- trunk/Numbers/Words/lang.ru.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.ru.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -599,7 +599,7 @@ */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/POReport.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -21,18 +21,18 @@ if (isset($_POST['submit']) or isset($_POST['submitcsv'])) { if (isset($_POST['PartNumber'])){ - $PartNumber = trim(strtoupper($_POST['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_POST['PartNumber'])); } elseif (isset($_GET['PartNumber'])){ - $PartNumber = trim(strtoupper($_GET['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_GET['PartNumber'])); } # Part Number operator - either LIKE or = $PartNumberOp = $_POST['PartNumberOp']; if (isset($_POST['SupplierId'])){ - $SupplierId = trim(strtoupper($_POST['SupplierId'])); + $SupplierId = trim(mb_strtoupper($_POST['SupplierId'])); } elseif (isset($_GET['SupplierId'])){ - $SupplierId = trim(strtoupper($_GET['SupplierId'])); + $SupplierId = trim(mb_strtoupper($_GET['SupplierId'])); } $SupplierIdOp = $_POST['SupplierIdOp']; @@ -45,9 +45,9 @@ } if (isset($_POST['SupplierName'])){ - $SupplierName = trim(strtoupper($_POST['SupplierName'])); + $SupplierName = trim(mb_strtoupper($_POST['SupplierName'])); } elseif (isset($_GET['SupplierName'])){ - $SupplierName = trim(strtoupper($_GET['SupplierName'])); + $SupplierName = trim(mb_strtoupper($_GET['SupplierName'])); } // Had to add supplierid to SummaryType when do summary by name because there could be several accounts Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcAssignCashToTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -6,9 +6,9 @@ include('includes/header.inc'); if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if (isset($_POST['SelectedIndex'])){ Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcAuthorizeExpenses.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/SQL_CommonFunctions.inc'); if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if (isset($_POST['SelectedIndex'])){ Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcClaimExpensesFromTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,9 +8,9 @@ if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if (isset($_POST['SelectedIndex'])){ Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcExpenses.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,9 +10,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedExpense'])){ - $SelectedExpense = strtoupper($_POST['SelectedExpense']); + $SelectedExpense = mb_strtoupper($_POST['SelectedExpense']); } elseif (isset($_GET['SelectedExpense'])){ - $SelectedExpense = strtoupper($_GET['SelectedExpense']); + $SelectedExpense = mb_strtoupper($_GET['SelectedExpense']); } if (isset($_POST['Cancel'])) { Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcExpensesTypeTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,9 +10,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedType'])){ - $SelectedType = strtoupper($_POST['SelectedType']); + $SelectedType = mb_strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ - $SelectedType = strtoupper($_GET['SelectedType']); + $SelectedType = mb_strtoupper($_GET['SelectedType']); } else { $SelectedType=''; } @@ -23,9 +23,9 @@ } if (isset($_POST['SelectedTab'])){ - $SelectedTab = strtoupper($_POST['SelectedTab']); + $SelectedTab = mb_strtoupper($_POST['SelectedTab']); } elseif (isset($_GET['SelectedTab'])){ - $SelectedTab = strtoupper($_GET['SelectedTab']); + $SelectedTab = mb_strtoupper($_GET['SelectedTab']); } if (isset($_POST['Cancel'])) { Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcReportTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,9 +8,9 @@ $title = _('Petty Cash Management Report'); if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if ((! isset($_POST['FromDate']) AND ! isset($_POST['ToDate'])) OR isset($_POST['SelectDifferentDate'])){ Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcTabs.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,9 +9,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedTab'])){ - $SelectedTab = strtoupper($_POST['SelectedTab']); + $SelectedTab = mb_strtoupper($_POST['SelectedTab']); } elseif (isset($_GET['SelectedTab'])){ - $SelectedTab = strtoupper($_GET['SelectedTab']); + $SelectedTab = mb_strtoupper($_GET['SelectedTab']); } if (isset($_POST['Cancel'])) { Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcTypeTabs.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,9 +9,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedTab'])){ - $SelectedTab = strtoupper($_POST['SelectedTab']); + $SelectedTab = mb_strtoupper($_POST['SelectedTab']); } elseif (isset($_GET['SelectedTab'])){ - $SelectedTab = strtoupper($_GET['SelectedTab']); + $SelectedTab = mb_strtoupper($_GET['SelectedTab']); } if (isset($Errors)) { Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Prices.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -14,9 +14,9 @@ if (isset($_GET['Item'])){ - $Item = trim(strtoupper($_GET['Item'])); + $Item = trim(mb_strtoupper($_GET['Item'])); }elseif (isset($_POST['Item'])){ - $Item = trim(strtoupper($_POST['Item'])); + $Item = trim(mb_strtoupper($_POST['Item'])); } if (!isset($_POST['TypeAbbrev']) OR $_POST['TypeAbbrev']==''){ Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PrintCustStatements.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -33,12 +33,12 @@ } If (isset($_POST['PrintPDF']) && isset($_POST['FromCust']) && $_POST['FromCust']!=''){ - $_POST['FromCust'] = strtoupper($_POST['FromCust']); + $_POST['FromCust'] = mb_strtoupper($_POST['FromCust']); If (!isset($_POST['ToCust'])){ $_POST['ToCust'] = $_POST['FromCust']; } else { - $_POST['ToCust'] = strtoupper($_POST['ToCust']); + $_POST['ToCust'] = mb_strtoupper($_POST['ToCust']); } include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Customer Statements') ); Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PurchData.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,15 +8,15 @@ include ('includes/header.inc'); if (isset($_GET['SupplierID'])) { - $SupplierID = trim(strtoupper($_GET['SupplierID'])); + $SupplierID = trim(mb_strtoupper($_GET['SupplierID'])); } elseif (isset($_POST['SupplierID'])) { - $SupplierID = trim(strtoupper($_POST['SupplierID'])); + $SupplierID = trim(mb_strtoupper($_POST['SupplierID'])); } if (isset($_GET['StockID'])) { - $StockID = trim(strtoupper($_GET['StockID'])); + $StockID = trim(mb_strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])) { - $StockID = trim(strtoupper($_POST['StockID'])); + $StockID = trim(mb_strtoupper($_POST['StockID'])); } if (isset($_POST['StockUOM'])) { Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesCategories.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -11,24 +11,24 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_GET['SelectedCategory'])){ - $SelectedCategory = strtoupper($_GET['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_GET['SelectedCategory']); } else if (isset($_POST['SelectedCategory'])){ - $SelectedCategory = strtoupper($_POST['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_POST['SelectedCategory']); } if (isset($_GET['ParentCategory'])){ - $ParentCategory = strtoupper($_GET['ParentCategory']); + $ParentCategory = mb_strtoupper($_GET['ParentCategory']); } else if (isset($_POST['ParentCategory'])){ - $ParentCategory = strtoupper($_POST['ParentCategory']); + $ParentCategory = mb_strtoupper($_POST['ParentCategory']); } if( isset($ParentCategory) AND $ParentCategory == 0 ) { unset($ParentCategory); } if (isset($_GET['EditName'])){ - $EditName = strtoupper($_GET['EditName']); + $EditName = mb_strtoupper($_GET['EditName']); } else if (isset($_POST['EditName'])){ - $EditName = strtoupper($_POST['EditName']); + $EditName = mb_strtoupper($_POST['EditName']); } if (isset($SelectedCategory) AND isset($_FILES['ItemPicture']) AND $_FILES['ItemPicture']['name'] !='') { @@ -39,7 +39,7 @@ $FileName = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg'; //But check for the worst - if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (mb_strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesInquiry.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -20,26 +20,26 @@ } if (isset($_POST['PartNumber'])){ - $PartNumber = trim(strtoupper($_POST['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_POST['PartNumber'])); } elseif (isset($_GET['PartNumber'])){ - $PartNumber = trim(strtoupper($_GET['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_GET['PartNumber'])); } # Part Number operator - either LIKE or = $PartNumberOp = $_POST['PartNumberOp']; if (isset($_POST['DebtorNo'])){ - $DebtorNo = trim(strtoupper($_POST['DebtorNo'])); + $DebtorNo = trim(mb_strtoupper($_POST['DebtorNo'])); } elseif (isset($_GET['DebtorNo'])){ - $DebtorNo = trim(strtoupper($_GET['DebtorNo'])); + $DebtorNo = trim(mb_strtoupper($_GET['DebtorNo'])); } $DebtorNoOp = $_POST['DebtorNoOp']; if (isset($_POST['DebtorName'])){ - $DebtorName = trim(strtoupper($_POST['DebtorName'])); + $DebtorName = trim(mb_strtoupper($_POST['DebtorName'])); } elseif (isset($_GET['DebtorName'])){ - $DebtorName = trim(strtoupper($_GET['DebtorName'])); + $DebtorName = trim(mb_strtoupper($_GET['DebtorName'])); } $DebtorNameOp = $_POST['DebtorNameOp']; Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesPeople.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -6,9 +6,9 @@ include('includes/header.inc'); if (isset($_GET['SelectedSaleperson'])){ - $SelectedSaleperson =strtoupper($_GET['SelectedSaleperson']); + $SelectedSaleperson =mb_strtoupper($_GET['SelectedSaleperson']); } elseif(isset($_POST['SelectedSaleperson'])){ - $SelectedSaleperson =strtoupper($_POST['SelectedSaleperson']); + $SelectedSaleperson =mb_strtoupper($_POST['SelectedSaleperson']); } if (isset($Errors)) { Modified: trunk/SalesTypes.php =================================================================== --- trunk/SalesTypes.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesTypes.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -6,9 +6,9 @@ include('includes/header.inc'); if (isset($_POST['SelectedType'])){ - $SelectedType = strtoupper($_POST['SelectedType']); + $SelectedType = mb_strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ - $SelectedType = strtoupper($_GET['SelectedType']); + $SelectedType = mb_strtoupper($_GET['SelectedType']); } if (isset($Errors)) { Modified: trunk/SelectAsset.php =================================================================== --- trunk/SelectAsset.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectAsset.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -25,7 +25,7 @@ } } if (isset($_POST['AssetCode'])) { - $_POST['AssetCode'] = trim(strtoupper($_POST['AssetCode'])); + $_POST['AssetCode'] = trim(mb_strtoupper($_POST['AssetCode'])); } // Always show the search facilities $SQL = 'SELECT categoryid, @@ -123,7 +123,7 @@ if ($_POST['Keywords']) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['AssetCategory'] == 'ALL') { if ($_POST['AssetLocation']=='ALL'){ Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectCustomer.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -91,7 +91,7 @@ } if (mb_strlen($_POST['Keywords'])>0) { $msg = _('Search Result: Customer Name has been used in search') . '<br />'; - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); } elseif (mb_strlen($_POST['CustCode'])>0) { $msg = _('Search Result: Customer Code has been used in search') . '<br />'; } elseif (mb_strlen($_POST['CustPhone'])>0) { @@ -124,7 +124,7 @@ } else { if (mb_strlen($_POST['Keywords']) > 0) { //using the customer name - $_POST['Keywords'] = strtoupper(trim($_POST['Keywords'])); + $_POST['Keywords'] = mb_strtoupper(trim($_POST['Keywords'])); //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT debtorsmaster.debtorno, @@ -144,7 +144,7 @@ WHERE debtorsmaster.name " . LIKE . " '" . $SearchString . "' AND debtorsmaster.typeid = debtortype.typeid"; } elseif (mb_strlen($_POST['CustCode']) > 0) { - $_POST['CustCode'] = strtoupper(trim($_POST['CustCode'])); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, debtorsmaster.address1, Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectOrderItems.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -305,7 +305,7 @@ } else { if (mb_strlen($_POST['CustKeywords'])>0) { //insert wildcard characters in spaces - $_POST['CustKeywords'] = strtoupper(trim($_POST['CustKeywords'])); + $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = '%' . str_replace(' ', '%', $_POST['CustKeywords']) . '%'; $SQL = "SELECT custbranch.brname, @@ -328,7 +328,7 @@ } elseif (mb_strlen($_POST['CustCode'])>0){ - $_POST['CustCode'] = strtoupper(trim($_POST['CustCode'])); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $SQL = "SELECT custbranch.brname, custbranch.contactname, @@ -766,7 +766,7 @@ } if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ @@ -797,7 +797,7 @@ } elseif (mb_strlen($_POST['StockCode'])>0){ - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; if ($_POST['StockCat']=='All'){ @@ -918,7 +918,7 @@ $i++; if (isset($_POST[$QuickEntryCode])) { - $NewItem = strtoupper($_POST[$QuickEntryCode]); + $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); } if (isset($_POST[$QuickEntryQty])) { $NewItemQty = $_POST[$QuickEntryQty]; Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectProduct.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,8 +10,8 @@ if (isset($_GET['StockID'])) { //The page is called with a StockID - $_GET['StockID'] = trim(strtoupper($_GET['StockID'])); - $_POST['Select'] = trim(strtoupper($_GET['StockID'])); + $_GET['StockID'] = trim(mb_strtoupper($_GET['StockID'])); + $_POST['Select'] = trim(mb_strtoupper($_GET['StockID'])); } echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory Items') . '" alt="" />' . ' ' . _('Inventory Items') . '</p>'; if (isset($_GET['NewSearch']) or isset($_POST['Next']) or isset($_POST['Previous']) or isset($_POST['Go'])) { @@ -27,7 +27,7 @@ } } if (isset($_POST['StockCode'])) { - $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); + $_POST['StockCode'] = trim(mb_strtoupper($_POST['StockCode'])); } // Always show the search facilities $SQL = "SELECT categoryid, @@ -534,7 +534,7 @@ } if ($_POST['Keywords']) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, @@ -575,7 +575,7 @@ ORDER BY stockmaster.stockid"; } } elseif (isset($_POST['StockCode'])) { - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, stockmaster.description, Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectSalesOrder.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -398,9 +398,9 @@ } if (isset($_POST['StockID'])){ - $StockID = trim(strtoupper($_POST['StockID'])); + $StockID = trim(mb_strtoupper($_POST['StockID'])); } elseif (isset($_GET['StockID'])){ - $StockID = trim(strtoupper($_GET['StockID'])); + $StockID = trim(mb_strtoupper($_GET['StockID'])); } if (!isset($StockID)) { Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectSupplier.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -88,7 +88,7 @@ ORDER BY suppname"; } else { if (mb_strlen($_POST['Keywords']) > 0) { - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT supplierid, @@ -102,7 +102,7 @@ WHERE suppname " . LIKE . " '" . $SearchString . "' ORDER BY suppname"; } elseif (mb_strlen($_POST['SupplierCode']) > 0) { - $_POST['SupplierCode'] = strtoupper($_POST['SupplierCode']); + $_POST['SupplierCode'] = mb_strtoupper($_POST['SupplierCode']); $SQL = "SELECT supplierid, suppname, currcode, Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectWorkOrder.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -89,9 +89,9 @@ } if (isset($_POST['StockID'])){ - $StockID = trim(strtoupper($_POST['StockID'])); + $StockID = trim(mb_strtoupper($_POST['Stoc... [truncated message content] |
From: <dai...@us...> - 2011-07-03 04:33:29
|
Revision: 4622 http://web-erp.svn.sourceforge.net/web-erp/?rev=4622&view=rev Author: daintree Date: 2011-07-03 04:33:19 +0000 (Sun, 03 Jul 2011) Log Message: ----------- strtoupper to mb_strtoupper Modified Paths: -------------- trunk/AccountGroups.php trunk/Areas.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/Contracts.php trunk/CounterSales.php trunk/Currencies.php trunk/CustomerBranches.php trunk/CustomerTypes.php trunk/Customers.php trunk/DiscountCategories.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/GetStockImage.php trunk/Locations.php trunk/MRPCalendar.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPReport.php trunk/Numbers/Words/lang.dk.php trunk/Numbers/Words/lang.en_GB.php trunk/Numbers/Words/lang.en_US.php trunk/Numbers/Words/lang.es_AR.php trunk/Numbers/Words/lang.he.php trunk/Numbers/Words/lang.hu_HU.php trunk/Numbers/Words/lang.pl.php trunk/Numbers/Words/lang.pt_BR.php trunk/Numbers/Words/lang.ru.php trunk/POReport.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PrintCustStatements.php trunk/PurchData.php trunk/SalesCategories.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTypes.php trunk/SelectAsset.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCostUpdate.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/Stocks.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/WhereUsedInquiry.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_poAddLanguage.php trunk/doc/Change.log trunk/includes/DefineCartClass.php trunk/includes/MiscFunctions.php trunk/includes/htmlMimeMail.php trunk/includes/mimePart.php trunk/includes/tcpdf/2dbarcodes.php trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc trunk/reportwriter/admin/RCFunctions.inc Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/AccountGroups.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -262,7 +262,7 @@ <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Areas.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,9 +10,9 @@ if (isset($_GET['SelectedArea'])){ - $SelectedArea = strtoupper($_GET['SelectedArea']); + $SelectedArea = mb_strtoupper($_GET['SelectedArea']); } elseif (isset($_POST['SelectedArea'])){ - $SelectedArea = strtoupper($_POST['SelectedArea']); + $SelectedArea = mb_strtoupper($_POST['SelectedArea']); } if (isset($Errors)) { @@ -30,7 +30,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - $_POST['AreaCode'] = strtoupper($_POST['AreaCode']); + $_POST['AreaCode'] = mb_strtoupper($_POST['AreaCode']); $sql = "SELECT count(areacode) from areas WHERE areacode='".$_POST['AreaCode']."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMExtendedQty.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -303,7 +303,7 @@ $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('Extended Quantity BOM Listing For ') - . strtoupper($_POST['Part'])); + . mb_strtoupper($_POST['Part'])); $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -=$line_height; Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMIndented.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -315,7 +315,7 @@ $YPos =$YPos - (2*$line_height); $pdf->addTextWrap($Left_Margin+1,$YPos,40,$FontSize,_('Assembly:'),'',0); - $pdf->addTextWrap(85,$YPos,100,$FontSize,strtoupper($_POST['Part']),'',0); + $pdf->addTextWrap(85,$YPos,100,$FontSize,mb_strtoupper($_POST['Part']),'',0); $pdf->addTextWrap(185,$YPos,150,$FontSize,$assemblydesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMIndentedReverse.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -291,7 +291,7 @@ $YPos =$YPos - $line_height; $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,_('Component:'),'',0); - $pdf->addTextWrap(100,$YPos,100,$FontSize,strtoupper($_POST['Part']),'',0); + $pdf->addTextWrap(100,$YPos,100,$FontSize,mb_strtoupper($_POST['Part']),'',0); $pdf->addTextWrap(200,$YPos,150,$FontSize,$assemblydesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/BOMInquiry.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/header.inc'); if (isset($_GET['StockID'])){ - $StockID =trim(strtoupper($_GET['StockID'])); + $StockID =trim(mb_strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])){ - $StockID =trim(strtoupper($_POST['StockID'])); + $StockID =trim(mb_strtoupper($_POST['StockID'])); } if (!isset($_POST['StockID'])) { Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Contracts.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -107,7 +107,7 @@ $filename = $_SESSION['part_pics_dir'] . '/' . $_SESSION['Contract'.$identifier]->ContractRef . '.jpg'; //But check for the worst - if (strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ + if (mb_strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['Drawing']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check @@ -611,7 +611,7 @@ } else { if (mb_strlen($_POST['CustKeywords'])>0) { //insert wildcard characters in spaces - $_POST['CustKeywords'] = strtoupper(trim($_POST['CustKeywords'])); + $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = '%' . str_replace(' ', '%', $_POST['CustKeywords']) . '%'; $SQL = "SELECT custbranch.brname, @@ -630,7 +630,7 @@ } elseif (mb_strlen($_POST['CustCode'])>0){ - $_POST['CustCode'] = strtoupper(trim($_POST['CustCode'])); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $SQL = "SELECT custbranch.brname, custbranch.contactname, Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/CounterSales.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -223,7 +223,7 @@ } if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ @@ -256,7 +256,7 @@ } else if (mb_strlen($_POST['StockCode'])>0){ - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; if ($_POST['StockCat']=='All'){ @@ -382,7 +382,7 @@ $i++; if (isset($_POST[$QuickEntryCode])) { - $NewItem = strtoupper($_POST[$QuickEntryCode]); + $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); } if (isset($_POST[$QuickEntryQty])) { $NewItemQty = $_POST[$QuickEntryQty]; Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Currencies.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -237,7 +237,7 @@ $k++; } // Lets show the country flag - $ImageFile = 'flags/' . strtoupper($myrow[1]) . '.gif'; + $ImageFile = 'flags/' . mb_strtoupper($myrow[1]) . '.gif'; if(!file_exists($ImageFile)){ $ImageFile = 'flags/blank.gif'; Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/CustomerBranches.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/header.inc'); if (isset($_GET['DebtorNo'])) { - $DebtorNo = strtoupper($_GET['DebtorNo']); + $DebtorNo = mb_strtoupper($_GET['DebtorNo']); } else if (isset($_POST['DebtorNo'])){ - $DebtorNo = strtoupper($_POST['DebtorNo']); + $DebtorNo = mb_strtoupper($_POST['DebtorNo']); } if (!isset($DebtorNo)) { @@ -22,9 +22,9 @@ if (isset($_GET['SelectedBranch'])){ - $SelectedBranch = strtoupper($_GET['SelectedBranch']); + $SelectedBranch = mb_strtoupper($_GET['SelectedBranch']); } else if (isset($_POST['SelectedBranch'])){ - $SelectedBranch = strtoupper($_POST['SelectedBranch']); + $SelectedBranch = mb_strtoupper($_POST['SelectedBranch']); } if (isset($Errors)) { @@ -44,7 +44,7 @@ //first off validate inputs sensible - $_POST['BranchCode'] = strtoupper($_POST['BranchCode']); + $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { $InputError = 1; Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/CustomerTypes.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/header.inc'); if (isset($_POST['SelectedType'])){ - $SelectedType = strtoupper($_POST['SelectedType']); + $SelectedType = mb_strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ - $SelectedType = strtoupper($_GET['SelectedType']); + $SelectedType = mb_strtoupper($_GET['SelectedType']); } if (isset($Errors)) { Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Customers.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -29,7 +29,7 @@ //first off validate inputs sensible - $_POST['DebtorNo'] = strtoupper($_POST['DebtorNo']); + $_POST['DebtorNo'] = mb_strtoupper($_POST['DebtorNo']); $sql="SELECT COUNT(debtorno) FROM debtorsmaster WHERE debtorno='".$_POST['DebtorNo']."'"; $result=DB_query($sql,$db); Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/DiscountCategories.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -31,7 +31,7 @@ FROM stockmaster WHERE mbflag <>'K' AND mbflag<>'D' - AND stockid='" . strtoupper($_POST['StockID']) . "'",$db); + AND stockid='" . mb_strtoupper($_POST['StockID']) . "'",$db); if (DB_num_rows($result)==0){ $InputError = 1; prnMsg(_('The stock item entered must be set up as either a manufactured or purchased or assembly item'),'warn'); @@ -40,9 +40,9 @@ if ($InputError !=1) { $sql = "UPDATE stockmaster SET discountcategory='" . $_POST['DiscountCategory'] . "' - WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; + WHERE stockid='" . mb_strtoupper($_POST['StockID']) . "'"; - $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); + $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . mb_strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); prnMsg(_('The stock master has been updated with this discount category'),'success'); unset($_POST['DiscountCategory']); @@ -53,7 +53,7 @@ } elseif (isset($_GET['Delete']) and $_GET['Delete']=='yes') { /*the link to delete a selected record was clicked instead of the submit button */ - $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(strtoupper($_GET['StockID'])) ."'"; + $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(mb_strtoupper($_GET['StockID'])) ."'"; $result = DB_query($sql,$db); prnMsg( _('The stock master record has been updated to no discount category'),'success'); echo '<br />'; Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Factors.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,10 +9,10 @@ include('includes/header.inc'); if (isset($_GET['FactorID'])){ - $FactorID = strtoupper($_GET['FactorID']); + $FactorID = mb_strtoupper($_GET['FactorID']); $_POST['Amend']=True; } elseif (isset($_POST['FactorID'])){ - $FactorID = strtoupper($_POST['FactorID']); + $FactorID = mb_strtoupper($_POST['FactorID']); } else { unset($FactorID); } Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/FixedAssetCategories.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -12,9 +12,9 @@ _('Fixed Asset Categories') . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_GET['SelectedCategory'])){ - $SelectedCategory = strtoupper($_GET['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_GET['SelectedCategory']); } else if (isset($_POST['SelectedCategory'])){ - $SelectedCategory = strtoupper($_POST['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_POST['SelectedCategory']); } if (isset($_POST['submit'])) { @@ -27,7 +27,7 @@ //first off validate inputs sensible - $_POST['CategoryID'] = strtoupper($_POST['CategoryID']); + $_POST['CategoryID'] = mb_strtoupper($_POST['CategoryID']); if (mb_strlen($_POST['CategoryID']) > 6) { $InputError = 1; @@ -96,13 +96,12 @@ depnact, disposalact, accumdepnact) - VALUES ( - '" . $_POST['CategoryID'] . "', - '" . $_POST['CategoryDescription'] . "', - '" . $_POST['CostAct'] . "', - '" . $_POST['DepnAct'] . "', - '" . $_POST['DisposalAct'] . "', - '" . $_POST['AccumDepnAct'] . "')"; + VALUES ('" . $_POST['CategoryID'] . "', + '" . $_POST['CategoryDescription'] . "', + '" . $_POST['CostAct'] . "', + '" . $_POST['DepnAct'] . "', + '" . $_POST['DisposalAct'] . "', + '" . $_POST['AccumDepnAct'] . "')"; $ErrMsg = _('Could not insert the new fixed asset category') . $_POST['CategoryDescription'] . _('because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('A new fixed asset category record has been added for') . ' ' . $_POST['CategoryDescription'],'success'); @@ -144,22 +143,25 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT categoryid, + $sql = "SELECT categoryid, categorydescription, costact, depnact, disposalact, accumdepnact - FROM fixedassetcategories'; + FROM fixedassetcategories"; $result = DB_query($sql,$db); - echo '<br /><table class=selection>'; - echo '<tr><th>' . _('Cat Code') . '</th> + echo '<br /> + <table class="selection">'; + echo '<tr> + <th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> <th>' . _('P & L Depn GL') . '</th> <th>' . _('Disposal GL') . '</th> - <th>' . _('Accum Depn GL') . '</th></tr>'; + <th>' . _('Accum Depn GL') . '</th> + </tr>'; $k=0; //row colour counter @@ -178,7 +180,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> - <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> + <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '\');">' . _('Delete') . '</td> </tr>', $myrow['categoryid'], $myrow['categorydescription'], @@ -186,9 +188,9 @@ $myrow['depnact'], $myrow['disposalact'], $myrow['accumdepnact'], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['categoryid'], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['categoryid']); } //END WHILE LIST LOOP @@ -201,7 +203,7 @@ echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' ._('Show All Fixed Asset Categories') . '</a></div>'; } -echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCategory) and !isset($_POST['submit'])) { @@ -238,23 +240,21 @@ } //SQL to poulate account selection boxes -$sql = 'SELECT accountcode, +$sql = "SELECT accountcode, accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl=0 - ORDER BY accountcode'; + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY accountcode"; $BSAccountsResult = DB_query($sql,$db); -$sql = 'SELECT accountcode, +$sql = "SELECT accountcode, accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl!=0 - ORDER BY accountcode'; + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl!=0 + ORDER BY accountcode"; $PnLAccountsResult = DB_query($sql,$db); Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/FixedAssetDepreciation.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,13 +9,13 @@ /*Get the last period depreciation (depn is transtype =44) was posted for */ -$result = DB_query('SELECT periods.lastdate_in_period, +$result = DB_query("SELECT periods.lastdate_in_period, max(fixedassettrans.periodno) FROM fixedassettrans INNER JOIN periods ON fixedassettrans.periodno=periods.periodno WHERE transtype=44 GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC',$db); + ORDER BY periods.lastdate_in_period DESC",$db); $LastDepnRun = DB_fetch_row($result); @@ -65,7 +65,7 @@ fixedassetcategories.accumdepnact, fixedassetcategories.depnact, fixedassetcategories.categorydescription -ORDER BY assetcategoryid, assetid"; + ORDER BY assetcategoryid, assetid"; $AssetsResult=DB_query($sql, $db); $InputError = false; //always hope for the best @@ -104,11 +104,11 @@ if ($AssetCategoryDescription != $AssetRow['categorydescription'] OR $AssetCategoryDescription =='0'){ if ($AssetCategoryDescription !='0'){ //then print totals echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . number_format($TotalCategoryCost,2) . '</th> - <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> + <th class="number">' . number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th colspan=2></th> - <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> + <th class="number">' . number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; } echo '<tr><th colspan=9 align="left">' . $AssetRow['categorydescription'] . '</th></tr>'; @@ -147,12 +147,12 @@ echo '<td>' . $AssetRow['assetid'] . '</td> <td>' . $AssetRow['description'] . '</td> <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> - <td class="number">' . number_format($AssetRow['costtotal'],2) . '</td> - <td class="number">' . number_format($AssetRow['depnbfwd'],2) . '</td> - <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],2) . '</td> + <td class="number">' . number_format($AssetRow['costtotal'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($AssetRow['depnbfwd'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td align="center">' . $DepreciationType . '</td> <td class="number">' . $AssetRow['depnrate'] . '</td> - <td class="number">' . number_format($NewDepreciation ,2) . '</td> + <td class="number">' . number_format($NewDepreciation ,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $TotalCategoryCost +=$AssetRow['costtotal']; $TotalCategoryAccumDepn +=$AssetRow['depnbfwd']; @@ -227,18 +227,18 @@ } //end if Committing the depreciation to DB } //end loop around the assets to calculate depreciation for echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . number_format($TotalCategoryCost,2) . '</th> - <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> + <th class="number">' . number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th colspan=2></th> - <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> + <th class="number">' . number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; echo '<tr><th colspan=3 align="right">' . _('GRAND Total') . ' </th> - <th class="number">' . number_format($TotalCost,2) . '</th> - <th class="number">' . number_format($TotalAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCost-$TotalAccumDepn),2) . '</th> + <th class="number">' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format($TotalAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($TotalCost-$TotalAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th colspan=2></th> - <th class="number">' . number_format($TotalDepn,2) . '</th> + <th class="number">' . number_format($TotalDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; echo '</table><hr><p></p>'; @@ -247,11 +247,11 @@ $result = DB_Txn_Commit($db); prnMsg(_('Depreciation') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); unset($_POST['ProcessDate']); - echo '<br /><a href="index.php' . '?' . SID . '">' ._('Return to main menu').'</a>'; + echo '<br /><a href="index.php">' ._('Return to main menu').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); } else { - echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="form">'; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method=post name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p></p>'; echo '<table class=selection width=30%><tr></tr><tr>'; Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/FixedAssetItems.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -30,7 +30,7 @@ $filename = $_SESSION['part_pics_dir'] . '/ASSET_' . $AssetID . '.jpg'; //But check for the worst - if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (mb_strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/GetStockImage.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -68,7 +68,7 @@ } $filepath = $_SESSION['part_pics_dir'] . $pathsep; -$stockid = trim(strtoupper($_GET['StockID'])); +$stockid = trim(mb_strtoupper($_GET['StockID'])); if( isset($_GET['bgcolor']) ) $bgcolor = $_GET['bgcolor']; if( isset($_GET['textcolor']) ) Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Locations.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -22,7 +22,7 @@ /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ - $_POST['LocCode']=strtoupper($_POST['LocCode']); + $_POST['LocCode']=mb_strtoupper($_POST['LocCode']); if( trim($_POST['LocCode']) == '' ) { $InputError = 1; prnMsg( _('The location code may not be empty'), 'error'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPCalendar.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -11,9 +11,9 @@ if (isset($_POST['ChangeDate'])){ - $ChangeDate =trim(strtoupper($_POST['ChangeDate'])); + $ChangeDate =trim(mb_strtoupper($_POST['ChangeDate'])); } elseif (isset($_GET['ChangeDate'])){ - $ChangeDate =trim(strtoupper($_GET['ChangeDate'])); + $ChangeDate =trim(mb_strtoupper($_GET['ChangeDate'])); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPDemandTypes.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,9 +8,9 @@ //SelectedDT is the Selected MRPDemandType if (isset($_POST['SelectedDT'])){ - $SelectedDT = trim(strtoupper($_POST['SelectedDT'])); + $SelectedDT = trim(mb_strtoupper($_POST['SelectedDT'])); } elseif (isset($_GET['SelectedDT'])){ - $SelectedDT = trim(strtoupper($_GET['SelectedDT'])); + $SelectedDT = trim(mb_strtoupper($_GET['SelectedDT'])); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . @@ -26,8 +26,8 @@ //first off validate inputs sensible - if (trim(strtoupper($_POST['MRPDemandType']) == 'WO') or - trim(strtoupper($_POST['MRPDemandType']) == 'SO')) { + if (trim(mb_strtoupper($_POST['MRPDemandType']) == 'WO') or + trim(mb_strtoupper($_POST['MRPDemandType']) == 'SO')) { $InputError = 1; prnMsg(_('The Demand Type is reserved for the system'),'error'); } @@ -57,7 +57,7 @@ $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) - VALUES ('" . trim(strtoupper($_POST['MRPDemandType'])) . "', + VALUES ('" . trim(mb_strtoupper($_POST['MRPDemandType'])) . "', '" . $_POST['Description'] . "' )"; $msg = _('The new demand type has been added to the database'); Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPDemands.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -18,9 +18,9 @@ } if (isset($_POST['StockID'])){ - $StockID =trim(strtoupper($_POST['StockID'])); + $StockID =trim(mb_strtoupper($_POST['StockID'])); } elseif (isset($_GET['StockID'])){ - $StockID =trim(strtoupper($_GET['StockID'])); + $StockID =trim(mb_strtoupper($_GET['StockID'])); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . @@ -191,7 +191,7 @@ if ($myrow[0]>0) { //If $myrow[0] > 0, it means this is an edit, so do an update $sql = "UPDATE mrpdemands SET quantity = '" . $_POST['Quantity'] . "', - mrpdemandtype = '" . trim(strtoupper($_POST['MRPDemandtype'])) . "', + mrpdemandtype = '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', duedate = '" . $FormatedDuedate . "' WHERE demandid = '" . $DemandID . "'"; $msg = _("The MRP demand record has been updated for").' '.$StockID; @@ -203,7 +203,7 @@ quantity, duedate) VALUES ('" . $StockID . "', - '" . trim(strtoupper($_POST['MRPDemandtype'])) . "', + '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', '" . $_POST['Quantity'] . "', '" . $FormatedDuedate . "' )"; Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/MRPReport.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -569,7 +569,7 @@ } if ($_POST['Keywords']) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, @@ -608,7 +608,7 @@ ORDER BY stockmaster.stockid"; } } elseif (isset($_POST['StockCode'])) { - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, stockmaster.description, Modified: trunk/Numbers/Words/lang.dk.php =================================================================== --- trunk/Numbers/Words/lang.dk.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.dk.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -368,7 +368,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.en_GB.php =================================================================== --- trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.en_GB.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -380,7 +380,7 @@ * @since Numbers_Words 0.13.1 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.en_US.php =================================================================== --- trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.en_US.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -472,7 +472,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.es_AR.php =================================================================== --- trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.es_AR.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -430,7 +430,7 @@ * @author Martin Marrese */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.he.php =================================================================== --- trunk/Numbers/Words/lang.he.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.he.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -462,7 +462,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.hu_HU.php =================================================================== --- trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -359,7 +359,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.pl.php =================================================================== --- trunk/Numbers/Words/lang.pl.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.pl.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -439,7 +439,7 @@ * @since Numbers_Words 0.4 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.pt_BR.php =================================================================== --- trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -279,7 +279,7 @@ * @since Numbers_Words 0.10.1 */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_name[$int_curr])){ $int_curr = $this->def_currency; } Modified: trunk/Numbers/Words/lang.ru.php =================================================================== --- trunk/Numbers/Words/lang.ru.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Numbers/Words/lang.ru.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -599,7 +599,7 @@ */ function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true) { - $int_curr = strtoupper($int_curr); + $int_curr = mb_strtoupper($int_curr); if (!isset($this->_currency_names[$int_curr])) { $int_curr = $this->def_currency; } Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/POReport.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -21,18 +21,18 @@ if (isset($_POST['submit']) or isset($_POST['submitcsv'])) { if (isset($_POST['PartNumber'])){ - $PartNumber = trim(strtoupper($_POST['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_POST['PartNumber'])); } elseif (isset($_GET['PartNumber'])){ - $PartNumber = trim(strtoupper($_GET['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_GET['PartNumber'])); } # Part Number operator - either LIKE or = $PartNumberOp = $_POST['PartNumberOp']; if (isset($_POST['SupplierId'])){ - $SupplierId = trim(strtoupper($_POST['SupplierId'])); + $SupplierId = trim(mb_strtoupper($_POST['SupplierId'])); } elseif (isset($_GET['SupplierId'])){ - $SupplierId = trim(strtoupper($_GET['SupplierId'])); + $SupplierId = trim(mb_strtoupper($_GET['SupplierId'])); } $SupplierIdOp = $_POST['SupplierIdOp']; @@ -45,9 +45,9 @@ } if (isset($_POST['SupplierName'])){ - $SupplierName = trim(strtoupper($_POST['SupplierName'])); + $SupplierName = trim(mb_strtoupper($_POST['SupplierName'])); } elseif (isset($_GET['SupplierName'])){ - $SupplierName = trim(strtoupper($_GET['SupplierName'])); + $SupplierName = trim(mb_strtoupper($_GET['SupplierName'])); } // Had to add supplierid to SummaryType when do summary by name because there could be several accounts Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcAssignCashToTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -6,9 +6,9 @@ include('includes/header.inc'); if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if (isset($_POST['SelectedIndex'])){ Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcAuthorizeExpenses.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -7,9 +7,9 @@ include('includes/SQL_CommonFunctions.inc'); if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if (isset($_POST['SelectedIndex'])){ Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcClaimExpensesFromTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,9 +8,9 @@ if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if (isset($_POST['SelectedIndex'])){ Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcExpenses.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,9 +10,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedExpense'])){ - $SelectedExpense = strtoupper($_POST['SelectedExpense']); + $SelectedExpense = mb_strtoupper($_POST['SelectedExpense']); } elseif (isset($_GET['SelectedExpense'])){ - $SelectedExpense = strtoupper($_GET['SelectedExpense']); + $SelectedExpense = mb_strtoupper($_GET['SelectedExpense']); } if (isset($_POST['Cancel'])) { Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcExpensesTypeTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,9 +10,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedType'])){ - $SelectedType = strtoupper($_POST['SelectedType']); + $SelectedType = mb_strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ - $SelectedType = strtoupper($_GET['SelectedType']); + $SelectedType = mb_strtoupper($_GET['SelectedType']); } else { $SelectedType=''; } @@ -23,9 +23,9 @@ } if (isset($_POST['SelectedTab'])){ - $SelectedTab = strtoupper($_POST['SelectedTab']); + $SelectedTab = mb_strtoupper($_POST['SelectedTab']); } elseif (isset($_GET['SelectedTab'])){ - $SelectedTab = strtoupper($_GET['SelectedTab']); + $SelectedTab = mb_strtoupper($_GET['SelectedTab']); } if (isset($_POST['Cancel'])) { Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcReportTab.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,9 +8,9 @@ $title = _('Petty Cash Management Report'); if (isset($_POST['SelectedTabs'])){ - $SelectedTabs = strtoupper($_POST['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ - $SelectedTabs = strtoupper($_GET['SelectedTabs']); + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); } if ((! isset($_POST['FromDate']) AND ! isset($_POST['ToDate'])) OR isset($_POST['SelectDifferentDate'])){ Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcTabs.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,9 +9,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedTab'])){ - $SelectedTab = strtoupper($_POST['SelectedTab']); + $SelectedTab = mb_strtoupper($_POST['SelectedTab']); } elseif (isset($_GET['SelectedTab'])){ - $SelectedTab = strtoupper($_GET['SelectedTab']); + $SelectedTab = mb_strtoupper($_GET['SelectedTab']); } if (isset($_POST['Cancel'])) { Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PcTypeTabs.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -9,9 +9,9 @@ . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedTab'])){ - $SelectedTab = strtoupper($_POST['SelectedTab']); + $SelectedTab = mb_strtoupper($_POST['SelectedTab']); } elseif (isset($_GET['SelectedTab'])){ - $SelectedTab = strtoupper($_GET['SelectedTab']); + $SelectedTab = mb_strtoupper($_GET['SelectedTab']); } if (isset($Errors)) { Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/Prices.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -14,9 +14,9 @@ if (isset($_GET['Item'])){ - $Item = trim(strtoupper($_GET['Item'])); + $Item = trim(mb_strtoupper($_GET['Item'])); }elseif (isset($_POST['Item'])){ - $Item = trim(strtoupper($_POST['Item'])); + $Item = trim(mb_strtoupper($_POST['Item'])); } if (!isset($_POST['TypeAbbrev']) OR $_POST['TypeAbbrev']==''){ Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PrintCustStatements.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -33,12 +33,12 @@ } If (isset($_POST['PrintPDF']) && isset($_POST['FromCust']) && $_POST['FromCust']!=''){ - $_POST['FromCust'] = strtoupper($_POST['FromCust']); + $_POST['FromCust'] = mb_strtoupper($_POST['FromCust']); If (!isset($_POST['ToCust'])){ $_POST['ToCust'] = $_POST['FromCust']; } else { - $_POST['ToCust'] = strtoupper($_POST['ToCust']); + $_POST['ToCust'] = mb_strtoupper($_POST['ToCust']); } include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Customer Statements') ); Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/PurchData.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -8,15 +8,15 @@ include ('includes/header.inc'); if (isset($_GET['SupplierID'])) { - $SupplierID = trim(strtoupper($_GET['SupplierID'])); + $SupplierID = trim(mb_strtoupper($_GET['SupplierID'])); } elseif (isset($_POST['SupplierID'])) { - $SupplierID = trim(strtoupper($_POST['SupplierID'])); + $SupplierID = trim(mb_strtoupper($_POST['SupplierID'])); } if (isset($_GET['StockID'])) { - $StockID = trim(strtoupper($_GET['StockID'])); + $StockID = trim(mb_strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])) { - $StockID = trim(strtoupper($_POST['StockID'])); + $StockID = trim(mb_strtoupper($_POST['StockID'])); } if (isset($_POST['StockUOM'])) { Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesCategories.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -11,24 +11,24 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_GET['SelectedCategory'])){ - $SelectedCategory = strtoupper($_GET['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_GET['SelectedCategory']); } else if (isset($_POST['SelectedCategory'])){ - $SelectedCategory = strtoupper($_POST['SelectedCategory']); + $SelectedCategory = mb_strtoupper($_POST['SelectedCategory']); } if (isset($_GET['ParentCategory'])){ - $ParentCategory = strtoupper($_GET['ParentCategory']); + $ParentCategory = mb_strtoupper($_GET['ParentCategory']); } else if (isset($_POST['ParentCategory'])){ - $ParentCategory = strtoupper($_POST['ParentCategory']); + $ParentCategory = mb_strtoupper($_POST['ParentCategory']); } if( isset($ParentCategory) AND $ParentCategory == 0 ) { unset($ParentCategory); } if (isset($_GET['EditName'])){ - $EditName = strtoupper($_GET['EditName']); + $EditName = mb_strtoupper($_GET['EditName']); } else if (isset($_POST['EditName'])){ - $EditName = strtoupper($_POST['EditName']); + $EditName = mb_strtoupper($_POST['EditName']); } if (isset($SelectedCategory) AND isset($_FILES['ItemPicture']) AND $_FILES['ItemPicture']['name'] !='') { @@ -39,7 +39,7 @@ $FileName = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg'; //But check for the worst - if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ + if (mb_strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesInquiry.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -20,26 +20,26 @@ } if (isset($_POST['PartNumber'])){ - $PartNumber = trim(strtoupper($_POST['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_POST['PartNumber'])); } elseif (isset($_GET['PartNumber'])){ - $PartNumber = trim(strtoupper($_GET['PartNumber'])); + $PartNumber = trim(mb_strtoupper($_GET['PartNumber'])); } # Part Number operator - either LIKE or = $PartNumberOp = $_POST['PartNumberOp']; if (isset($_POST['DebtorNo'])){ - $DebtorNo = trim(strtoupper($_POST['DebtorNo'])); + $DebtorNo = trim(mb_strtoupper($_POST['DebtorNo'])); } elseif (isset($_GET['DebtorNo'])){ - $DebtorNo = trim(strtoupper($_GET['DebtorNo'])); + $DebtorNo = trim(mb_strtoupper($_GET['DebtorNo'])); } $DebtorNoOp = $_POST['DebtorNoOp']; if (isset($_POST['DebtorName'])){ - $DebtorName = trim(strtoupper($_POST['DebtorName'])); + $DebtorName = trim(mb_strtoupper($_POST['DebtorName'])); } elseif (isset($_GET['DebtorName'])){ - $DebtorName = trim(strtoupper($_GET['DebtorName'])); + $DebtorName = trim(mb_strtoupper($_GET['DebtorName'])); } $DebtorNameOp = $_POST['DebtorNameOp']; Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesPeople.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -6,9 +6,9 @@ include('includes/header.inc'); if (isset($_GET['SelectedSaleperson'])){ - $SelectedSaleperson =strtoupper($_GET['SelectedSaleperson']); + $SelectedSaleperson =mb_strtoupper($_GET['SelectedSaleperson']); } elseif(isset($_POST['SelectedSaleperson'])){ - $SelectedSaleperson =strtoupper($_POST['SelectedSaleperson']); + $SelectedSaleperson =mb_strtoupper($_POST['SelectedSaleperson']); } if (isset($Errors)) { Modified: trunk/SalesTypes.php =================================================================== --- trunk/SalesTypes.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SalesTypes.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -6,9 +6,9 @@ include('includes/header.inc'); if (isset($_POST['SelectedType'])){ - $SelectedType = strtoupper($_POST['SelectedType']); + $SelectedType = mb_strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ - $SelectedType = strtoupper($_GET['SelectedType']); + $SelectedType = mb_strtoupper($_GET['SelectedType']); } if (isset($Errors)) { Modified: trunk/SelectAsset.php =================================================================== --- trunk/SelectAsset.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectAsset.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -25,7 +25,7 @@ } } if (isset($_POST['AssetCode'])) { - $_POST['AssetCode'] = trim(strtoupper($_POST['AssetCode'])); + $_POST['AssetCode'] = trim(mb_strtoupper($_POST['AssetCode'])); } // Always show the search facilities $SQL = 'SELECT categoryid, @@ -123,7 +123,7 @@ if ($_POST['Keywords']) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['AssetCategory'] == 'ALL') { if ($_POST['AssetLocation']=='ALL'){ Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectCustomer.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -91,7 +91,7 @@ } if (mb_strlen($_POST['Keywords'])>0) { $msg = _('Search Result: Customer Name has been used in search') . '<br />'; - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); } elseif (mb_strlen($_POST['CustCode'])>0) { $msg = _('Search Result: Customer Code has been used in search') . '<br />'; } elseif (mb_strlen($_POST['CustPhone'])>0) { @@ -124,7 +124,7 @@ } else { if (mb_strlen($_POST['Keywords']) > 0) { //using the customer name - $_POST['Keywords'] = strtoupper(trim($_POST['Keywords'])); + $_POST['Keywords'] = mb_strtoupper(trim($_POST['Keywords'])); //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT debtorsmaster.debtorno, @@ -144,7 +144,7 @@ WHERE debtorsmaster.name " . LIKE . " '" . $SearchString . "' AND debtorsmaster.typeid = debtortype.typeid"; } elseif (mb_strlen($_POST['CustCode']) > 0) { - $_POST['CustCode'] = strtoupper(trim($_POST['CustCode'])); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, debtorsmaster.address1, Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectOrderItems.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -305,7 +305,7 @@ } else { if (mb_strlen($_POST['CustKeywords'])>0) { //insert wildcard characters in spaces - $_POST['CustKeywords'] = strtoupper(trim($_POST['CustKeywords'])); + $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = '%' . str_replace(' ', '%', $_POST['CustKeywords']) . '%'; $SQL = "SELECT custbranch.brname, @@ -328,7 +328,7 @@ } elseif (mb_strlen($_POST['CustCode'])>0){ - $_POST['CustCode'] = strtoupper(trim($_POST['CustCode'])); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); $SQL = "SELECT custbranch.brname, custbranch.contactname, @@ -766,7 +766,7 @@ } if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ @@ -797,7 +797,7 @@ } elseif (mb_strlen($_POST['StockCode'])>0){ - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; if ($_POST['StockCat']=='All'){ @@ -918,7 +918,7 @@ $i++; if (isset($_POST[$QuickEntryCode])) { - $NewItem = strtoupper($_POST[$QuickEntryCode]); + $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); } if (isset($_POST[$QuickEntryQty])) { $NewItemQty = $_POST[$QuickEntryQty]; Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectProduct.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -10,8 +10,8 @@ if (isset($_GET['StockID'])) { //The page is called with a StockID - $_GET['StockID'] = trim(strtoupper($_GET['StockID'])); - $_POST['Select'] = trim(strtoupper($_GET['StockID'])); + $_GET['StockID'] = trim(mb_strtoupper($_GET['StockID'])); + $_POST['Select'] = trim(mb_strtoupper($_GET['StockID'])); } echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory Items') . '" alt="" />' . ' ' . _('Inventory Items') . '</p>'; if (isset($_GET['NewSearch']) or isset($_POST['Next']) or isset($_POST['Previous']) or isset($_POST['Go'])) { @@ -27,7 +27,7 @@ } } if (isset($_POST['StockCode'])) { - $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); + $_POST['StockCode'] = trim(mb_strtoupper($_POST['StockCode'])); } // Always show the search facilities $SQL = "SELECT categoryid, @@ -534,7 +534,7 @@ } if ($_POST['Keywords']) { //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, @@ -575,7 +575,7 @@ ORDER BY stockmaster.stockid"; } } elseif (isset($_POST['StockCode'])) { - $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, stockmaster.description, Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectSalesOrder.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -398,9 +398,9 @@ } if (isset($_POST['StockID'])){ - $StockID = trim(strtoupper($_POST['StockID'])); + $StockID = trim(mb_strtoupper($_POST['StockID'])); } elseif (isset($_GET['StockID'])){ - $StockID = trim(strtoupper($_GET['StockID'])); + $StockID = trim(mb_strtoupper($_GET['StockID'])); } if (!isset($StockID)) { Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectSupplier.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -88,7 +88,7 @@ ORDER BY suppname"; } else { if (mb_strlen($_POST['Keywords']) > 0) { - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT supplierid, @@ -102,7 +102,7 @@ WHERE suppname " . LIKE . " '" . $SearchString . "' ORDER BY suppname"; } elseif (mb_strlen($_POST['SupplierCode']) > 0) { - $_POST['SupplierCode'] = strtoupper($_POST['SupplierCode']); + $_POST['SupplierCode'] = mb_strtoupper($_POST['SupplierCode']); $SQL = "SELECT supplierid, suppname, currcode, Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-07-03 03:35:49 UTC (rev 4621) +++ trunk/SelectWorkOrder.php 2011-07-03 04:33:19 UTC (rev 4622) @@ -89,9 +89,9 @@ } if (isset($_POST['StockID'])){ - $StockID = trim(strtoupper($_POST['StockID'])); + $StockID = trim(mb_strtoupper($_POST['Stoc... [truncated message content] |
From: <dai...@us...> - 2011-07-05 10:27:34
|
Revision: 4623 http://web-erp.svn.sourceforge.net/web-erp/?rev=4623&view=rev Author: daintree Date: 2011-07-05 10:27:25 +0000 (Tue, 05 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/EDIProcessOrders.php trunk/EDISendInvoices.php trunk/EmailConfirmation.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/Factors.php trunk/FixedAssetRegister.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/ShipmentCosting.php trunk/TaxAuthorityRates.php trunk/includes/LanguagesArray.php trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PDFQuotationPortraitPageHeader.inc trunk/includes/RFC822.php trunk/includes/tcpdf/tcpdf.php trunk/sql/mysql/upgrade4.04.4-4.04.5.sql Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EDIProcessOrders.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -76,7 +76,7 @@ while ($LineText = fgets($fp) AND $TryNextFile != True){ /* get each line of the order file */ $LineText = StripTrailingComma($LineText); - echo "<br />".$LineText; + echo '<br />' . $LineText; if ($SegTag != mb_substr($LineText,0,3)){ $SegCounter=1; @@ -140,7 +140,7 @@ $Order->Comments .= "\n" . _('blanket order'); break; case '224': - $EmailText .= "\n\n" . _('This order is URGENT') . "</font>"; + $EmailText .= "\n\n" . _('This order is URGENT') . '</font>'; $Order->Comments .= "\n" . _('URGENT ORDER'); break; case '226': @@ -184,7 +184,7 @@ $EmailText .= "\n" . _('Customers order ref') . ': ' . $BGM_C106[0]; } if (isset($BGM_elements[2])){ - echo "<br />echo BGM_elements[2] " .$BGM_elements[2]; + echo '<br />echo BGM_elements[2] ' .$BGM_elements[2]; $BGM_1225 = explode(':',$BGM_elements[2]); $MsgFunction = $BGM_1225[0]; @@ -457,22 +457,23 @@ case 'SN': /*Store Number - get the branch details from the store number - snag here too cos need to ensure got the Customer detail first before try looking up its branches */ $BranchResult = DB_query("SELECT branchcode, - brname, - braddress1, - braddress2, - braddress3, - braddress4, - braddress5, - braddress6, - contactname, - defaultlocation, - phoneno, - email - FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1",$db); + brname, + braddress1, + braddress2, + braddress3, + braddress4, + braddress5, + braddress6, + contactname, + defaultlocation, + phoneno, + email + FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1",$db); if (DB_num_rows($BranchResult)!=1){ $EmailText .= "\n" . _('The Store number was specified as') . ' ' . $NAD_C082[0] . ' ' . _('Unfortunately there are either no branches of customer code') . ' ' . $Order->DebtorNo . ' ' ._('or several that match this store number') . '. ' . _('This order could not be processed further'); $TryNextFile = True; /* Look for other EDI msgs */ - $CreateOrder = False; /*Dont create order in system */ } else { + $CreateOrder = False; /*Dont create order in system */ + } else { $BranchRow = DB_fetch_array($BranchResult); $Order->BranchCode = $BranchRow['branchcode']; $Order->DeliverTo = $BranchRow['brname']; Modified: trunk/EDISendInvoices.php =================================================================== --- trunk/EDISendInvoices.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EDISendInvoices.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -8,16 +8,16 @@ include('includes/htmlMimeMail.php'); // need for sending email attachments /*Get the Customers who are enabled for EDI invoicing */ -$sql = 'SELECT debtorno, - edireference, - editransport, - ediaddress, - ediserveruser, - ediserverpwd, - daysbeforedue, - dayinfollowingmonth - FROM debtorsmaster INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - WHERE ediinvoices=1'; +$sql = "SELECT debtorno, + edireference, + editransport, + ediaddress, + ediserveruser, + ediserverpwd, + daysbeforedue, + dayinfollowingmonth + FROM debtorsmaster INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator + WHERE ediinvoices=1"; $EDIInvCusts = DB_query($sql,$db); @@ -30,29 +30,29 @@ /*Figure out if there are any unset invoices or credits for the customer */ $sql = "SELECT debtortrans.id, - transno, - type, - order_, - trandate, - ovgst, - ovamount, - ovfreight, - ovdiscount, - debtortrans.branchcode, - custbranchcode, - invtext, - shipvia, - rate, - brname, - braddress1, - braddress2, - braddress3, - braddress4 - FROM debtortrans INNER JOIN custbranch ON custbranch.debtorno = debtortrans.debtorno - AND custbranch.branchcode = debtortrans.branchcode - WHERE (type=10 or type=11) - AND edisent=0 - AND debtortrans.debtorno='" . $CustDetails['debtorno'] . "'"; + transno, + type, + order_, + trandate, + ovgst, + ovamount, + ovfreight, + ovdiscount, + debtortrans.branchcode, + custbranchcode, + invtext, + shipvia, + rate, + brname, + braddress1, + braddress2, + braddress3, + braddress4 + FROM debtortrans INNER JOIN custbranch ON custbranch.debtorno = debtortrans.debtorno + AND custbranch.branchcode = debtortrans.branchcode + WHERE (type=10 or type=11) + AND edisent=0 + AND debtortrans.debtorno='" . $CustDetails['debtorno'] . "'"; $ErrMsg = _('There was a problem retrieving the customer transactions because'); $TransHeaders = DB_query($sql,$db,$ErrMsg); @@ -135,34 +135,34 @@ if ($TransDetail['type']==10){ /*its an invoice */ $sql = "SELECT stockmoves.stockid, - stockmaster.description, - -stockmoves.qty as quantity, - stockmoves.discountpercent, - ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmoves.taxrate, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 - AND stockmoves.transno='" . $TransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + -stockmoves.qty as quantity, + stockmoves.discountpercent, + ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.taxrate, + stockmaster.units + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=10 + AND stockmoves.transno='" . $TransNo . "' + AND stockmoves.show_on_inv_crds=1"; } else { /* credit note */ $sql = "SELECT stockmoves.stockid, - stockmaster.description, - stockmoves.qty as quantity, - stockmoves.discountpercent, - ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) as fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmoves.taxrate, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 and stockmoves.transno='" . $TransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + stockmoves.qty as quantity, + stockmoves.discountpercent, + ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) as fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.taxrate, + stockmaster.units + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=11 and stockmoves.transno='" . $TransNo . "' + AND stockmoves.show_on_inv_crds=1"; } $TransLinesResult = DB_query($sql,$db); @@ -174,9 +174,9 @@ $StockID = $TransLines['StockID']; $sql = "SELECT partnerstockid FROM ediitemmapping - WHERE supporcust='CUST' - AND partnercode ='" . $CustDetails['debtorno'] . "' - AND stockid='" . $TransLines['stockid'] . "'"; + WHERE supporcust='CUST' + AND partnercode ='" . $CustDetails['debtorno'] . "' + AND stockid='" . $TransLines['stockid'] . "'"; $CustStkResult = DB_query($sql,$db); if (DB_num_rows($CustStkResult)==1){ Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EmailConfirmation.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,108 +1,144 @@ <?php /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); //Get Out if we have no order number to work with If (!isset($_GET['TransNo']) OR $_GET['TransNo']==""){ - $title = _('Select Order To Print'); - include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; - include('includes/footer.inc'); - exit(); + $title = _('Select Order To Print'); + include('includes/header.inc'); + echo '<div class="centre"> + <br /> + <br /> + <br />'; + prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; + include('includes/footer.inc'); + exit(); } -$MailTo = $_GET['EMail']; -$headers = 'From: Bethany Manufacturing <sa...@be...>' . '\n'; -$headers .= 'MIME-Version: 1.0\n' . 'Content-Type: text/html; charset="utf-8"\n'; +$MailTo = $_GET['EMail']; +$headers = 'From: Bethany Manufacturing <sa...@be...>' . '\n'; +$headers .= 'MIME-Version: 1.0\n' . 'Content-Type: text/html; charset="utf-8"\n'; /*retrieve the order details from the database to print */ $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . $_GET['TransNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.debtorno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname, - salesorders.deliverydate - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno=" . $_GET['TransNo']; + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname, + salesorders.deliverydate + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); //If there are no rows, there's a problem. if (DB_num_rows($result)==0){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; - include('includes/footer.inc'); - exit(); + $title = _('Print Packing Slip Error'); + include('includes/header.inc'); + echo '<div class="centre"> + <br /> + <br /> + <br />'; + prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; + include('includes/footer.inc'); + exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ - $myrow = DB_fetch_array($result); - /* Place the deliver blind variable into a hold variable to used when - producing the packlist */ - $DeliverBlind = $myrow['deliverblind']; - $DeliveryDate = $myrow['salesorders.deliverydate']; - if ($myrow['printedpackingslip']==1 AND ($_GET['Reprint']!='OK' OR !isset($_GET['Reprint']))){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . - _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); - echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' - . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . - '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; + $myrow = DB_fetch_array($result); + /* Place the deliver blind variable into a hold variable to used when + producing the packlist */ + $DeliverBlind = $myrow['deliverblind']; + $DeliveryDate = $myrow['salesorders.deliverydate']; + if ($myrow['printedpackingslip']==1 AND ($_GET['Reprint']!='OK' OR !isset($_GET['Reprint']))){ + $title = _('Print Packing Slip Error'); + include('includes/header.inc'); + prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . _('has previously been printed') . ' ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' + . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a></p><p><a href="' . $rootpath. '/PrintCustOrder_generic.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a></p>'; - echo '<br /><br /><br />'; - echo _('Or select another Order Number to Print'); - echo '<table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br />'; + echo _('Or select another Order Number to Print'); + echo '<table class="table_index"><tr><td class="menu_group_item"> + <ul> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; - include('includes/footer.inc'); - exit; - }//packing slip has been printed. - $MailSubject = "Order Confirmation-Sales Order " . $_GET['TransNo'] . " - Your PO " . - $myrow['customerref'] ; + include('includes/footer.inc'); + exit; + }//packing slip has been printed. + $MailSubject = _('Order Confirmation-Sales Order') . ' ' . $_GET['TransNo'] . ' - '. _('Your PO') . ' ' . $myrow['customerref'] ; } /*retrieve the order details from the database to print */ @@ -111,49 +147,52 @@ ) LETS GO */ -$MailMessage = "<html><head><title>Email Confirmation</title></head><body>" . - "<Table cellpadding='2' cellspacing='2'><tr>" . - "<td align='center' colspan='4'><H1>" . $_SESSION['CompanyRecord']['coyname'] . "</H1>" ; -$MailMessage = $MailMessage . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['regoffice1'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['regoffice4'] . ","; -$MailMessage = $MailMessage . "<b>" . - $_SESSION['CompanyRecord']['regoffice5'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . - $_SESSION['CompanyRecord']['fax'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['email'] . "<br /><br /><br /></td></tr>"; -$MailMessage = $MailMessage . "<Table><tr><td align='center' colspan='4'> - <h2> Order Acknowledgement</h2></td></tr>"; -$MailMessage = $MailMessage . "<tr><td align='center' colspan='4'> <b>Order Number " . - $_GET['TransNo'] . "</b><br /><br /><br /></td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>Delivered To:</b></td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $myrow['deliverto'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $myrow['deladd1'] . "</td></tr>"; -If(mb_strlen(trim($myrow['deladd2']))) -{ - $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd2'] . "</td></tr>"; - $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd3'] . - ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']. "<br /><br /><br /></td></tr>"; +$MailMessage = '<html><head><title>' . _('Email Confirmation') . '</title></head> + <body> + <table cellpadding="2" cellspacing="2"> + <tr> + <td align="center" colspan="4"><h1>' . $_SESSION['CompanyRecord']['coyname'] . '</h1></td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['regoffice1'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['regoffice4'] . ',<b>' . $_SESSION['CompanyRecord']['regoffice5'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['email'] . '<br /><br /><br /></td> + </tr> + </table> + <table> + <tr><td align="center" colspan="4"> + <h2>' . _('Order Acknowledgement') . '</h2></td> + </tr> + <tr><td align="center" colspan="4"> <b>' . _('Order Number') . ' ' . $_GET['TransNo'] . '</b><br /><br /><br /></td> + </tr> + <tr><td colspan="4"> <b>' . _('Delivered To') . ':</b></td> + </tr> + <tr><td colspan="4"> <b>' . $myrow['deliverto'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $myrow['deladd1'] . '</td> + </tr>'; + +if(mb_strlen(trim($myrow['deladd2']))) { + $MailMessage .= '<tr><td> <b>' . $myrow['deladd2'] . '</td></tr> + <tr><td> <b>' . $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']. '<br /><br /><br /></td> + </tr>'; +} else { + $MailMessage .= '<tr><td> <b>' . $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5'] . '<br /><br /><br /></td> + </tr>'; } -else -{ - $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd3'] . ' ' . - $myrow['deladd4'] . ' ' . $myrow['deladd5'] . "<br /><br /><br /></td></tr>"; -} -$MailMessage = $MailMessage . "</table><table border='1' width='50%'><tr>"; +$MailMessage .= '</table> + <table border="1" width="50%"><tr>'; if($_REQUEST['POLine'] == 1){ - $MailMessage = $MailMessage . " <td>PO Line</td>"; + $MailMessage .= '<td>' . _('PO Line') . '</td>'; } - $MailMessage = $MailMessage . "<td>Stock Code</td> - <td>Description</td> - <td>Quantity Ordered</td> - <td>Due Date</td></tr>"; + $MailMessage .= '<td>' . _('Stock Code') . '</td> + <td>' . _('Description') . '</td> + <td>' . _('Quantity Ordered') . '</td> + <td>' . _('Due Date') . '</td> + </tr>'; $sql = "SELECT salesorderdetails.stkcode, @@ -181,33 +220,31 @@ $DscCode[$i] = $myrow2['description']; $QtyCode[$i] = $DisplayQty ; $POLine[$i] = $myrow2['poline']; - If($myrow2['itemdue'] =='') - { + if($myrow2['itemdue'] =='') { $ItemDue[$i] = date('M d, Y',strtotime($DeliveryDate)); - } - else - { + } else { $ItemDue[$i] = date('M d, Y',strtotime($myrow2['itemdue'])); } - $MailMessage = $MailMessage . "<tr>"; + $MailMessage .= '<tr>'; if($_REQUEST['POLine'] == 1){ - $MailMessage = $MailMessage . "<td align='right'>" . $POLine[$i] . "</td>"; + $MailMessage .= '<td align="right">' . $POLine[$i] . '</td>'; } - $MailMessage = $MailMessage . "<td>" . $myrow2['stkcode'] . - "</td><td>" . - $myrow2['description'] . "</td><td align='right'>" . - $DisplayQty . "</td><td align='center'>" . $ItemDue[$i] . - "</td></tr>"; + $MailMessage .= '<td>' . $myrow2['stkcode'] . '</td><td>' . $myrow2['description'] . '</td> + <td align="right">' . $DisplayQty . '</td> + <td align="center">' . $ItemDue[$i] . '</td> + </tr>'; $i = $i + 1; } //end while there are line items to print out } /*end if there are order details to show on the order*/ -$MailMessage = $MailMessage . "</Table></body></html>"; +$MailMessage .= '</table> + </body> + </html>'; // echo $MailMessage . "=mailMessage<br />"; IF(mail( $MailTo, $MailSubject, $MailMessage, $headers )){ - echo " The following E-Mail was sent to $MailTo:"; + echo ' ' ._('The following E-Mail was sent to') . ' ' . $MailTo . ' :'; } ?> <html> Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EmailCustTrans.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -47,8 +47,8 @@ FROM custbranch INNER JOIN debtortrans ON custbranch.debtorno= debtortrans.debtorno AND custbranch.branchcode=debtortrans.branchcode - WHERE debtortrans.type='" . $TypeCode . "' - AND debtortrans.transno='" .$_GET['FromTransNo'] . "'"; + WHERE debtortrans.type='" . $TypeCode . "' + AND debtortrans.transno='" .$_GET['FromTransNo'] . "'"; $ErrMsg = _('There was a problem retrieving the contact details for the customer'); $ContactResult=DB_query($SQL,$db,$ErrMsg); Modified: trunk/ExchangeRateTrend.php =================================================================== --- trunk/ExchangeRateTrend.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/ExchangeRateTrend.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.3 $ */ + /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('View Currency Trends'); @@ -29,33 +27,30 @@ _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '</p>'; echo '<table>'; // First column - $SQL = 'SELECT * FROM currencies'; + $SQL = "SELECT * FROM currencies"; $result=DB_query($SQL,$db); // CurrencyToShow Currency Picker echo '<tr><td><select name="CurrencyToShow" onChange="ReloadForm(update.submit)">'; - DB_data_seek($result,0); - while ($myrow=DB_fetch_array($result)) { - if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ - if ( $CurrencyToShow==$myrow['currabrev'] ) { - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; - } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; - } + DB_data_seek($result,0); + while ($myrow=DB_fetch_array($result)) { + if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ + if ( $CurrencyToShow==$myrow['currabrev'] ) { + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; + } else { + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } } - echo '</select></td></tr>'; + } + echo '</select></td></tr>'; echo '</table>'; /*close off the table in the third column */ - - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"></div>'; echo '</form>'; - - // ************** // SHOW OUR GRAPH // ************** @@ -66,7 +61,7 @@ echo '<p></div><table class=selection>'; echo '<tr><th><div class="centre"><font size=4 color=BLUE><b><U>' . $FunctionalCurrency . ' / ' . $CurrencyToShow . '</b></U></font></th></tr>'; - echo '<tr><td><img src=' . $image . ' alt="Trend Currently Unavailable"></td></tr>'; + echo '<tr><td><img src=' . $image . ' alt="' ._('Trend Currently Unavailable') . '"></td></tr>'; echo '</table>'; Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/Factors.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -151,19 +151,19 @@ if (isset($FactorID) and isset($_POST['Amend'])) { $sql = "SELECT id, - coyname, - address1, - address2, - address3, - address4, - address5, - address6, - contact, - telephone, - fax, - email - FROM factorcompanies - WHERE id = '".$FactorID."'"; + coyname, + address1, + address2, + address3, + address4, + address5, + address6, + contact, + telephone, + fax, + email + FROM factorcompanies + WHERE id = '".$FactorID."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -208,7 +208,6 @@ <td><input tabindex=2 type="text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] .'"></td></tr>'; echo '<tr><td>' . _('Address Line 2') . ':</td> <td><input tabindex=3 type="text" name="Address2" size=42 maxlength=40 value="' . $_POST['Address2'] .'"></td></tr>'; - echo '<tr><td>' . _('Address Line 3') . ':</td> <td><input tabindex=4 type="text" name="Address3" size=42 maxlength=40 value="' .$_POST['Address3'] .'"></td></tr>'; echo '<tr><td>' . _('Address Line 4') . ':</td> @@ -248,32 +247,34 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="No">'; - echo '<table class=selection><tr> - <th>' . _('ID') . '</th> - <th>' . _('Company Name').'</th> - <th>' . _('Address 1').'</th> - <th>' . _('Address 2').'</th> - <th>' . _('Address 3').'</th> - <th>' . _('Address 4').'</th> - <th>' . _('Address 5').'</th> - <th>' . _('Address 6').'</th> - <th>' . _('Contact').'</th> - <th>' . _('Telephone').'</th> - <th>' . _('Fax Number').'</th> - <th>' . _('Email').'</th></tr>'; + echo '<table class=selection> + <tr> + <th>' . _('ID') . '</th> + <th>' . _('Company Name').'</th> + <th>' . _('Address 1').'</th> + <th>' . _('Address 2').'</th> + <th>' . _('Address 3').'</th> + <th>' . _('Address 4').'</th> + <th>' . _('Address 5').'</th> + <th>' . _('Address 6').'</th> + <th>' . _('Contact').'</th> + <th>' . _('Telephone').'</th> + <th>' . _('Fax Number').'</th> + <th>' . _('Email').'</th> + </tr>'; $sql = "SELECT id, - coyname, - address1, - address2, - address3, - address4, - address5, - address6, - contact, - telephone, - fax, - email - FROM factorcompanies"; + coyname, + address1, + address2, + address3, + address4, + address5, + address6, + contact, + telephone, + fax, + email + FROM factorcompanies"; $result=DB_query($sql, $db); $j=1; while ($myrow = DB_fetch_array($result)) { @@ -307,6 +308,5 @@ } - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/FixedAssetRegister.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,5 +1,5 @@ <?php -//$PageSecurity = 11; + include ('includes/session.inc'); $title = _('Fixed Asset Register'); $csv_output = ''; @@ -15,36 +15,36 @@ $DateFrom = FormatDateForSQL($_POST['FromDate']); $DateTo = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT fixedassets.assetid, - fixedassets.description, - fixedassets.longdescription, - fixedassets.assetcategoryid, - fixedassets.serialno, - fixedassetlocations.locationdescription, - fixedassets.datepurchased, - fixedassetlocations.parentlocationid, - fixedassets.assetlocation, - fixedassets.disposaldate, - SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS costbfwd, - SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='depn') THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd, - SUM(CASE WHEN (fixedassettrans.transdate >='" . $DateFrom ."' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS periodadditions, - SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS perioddepn, - SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='disposal' THEN fixedassettrans.amount ELSE 0 END) AS perioddisposal - FROM fixedassets - INNER JOIN fixedassetcategories ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - INNER JOIN fixedassetlocations ON fixedassets.assetlocation=fixedassetlocations.locationid - INNER JOIN fixedassettrans ON fixedassets.assetid=fixedassettrans.assetid - WHERE fixedassets.assetcategoryid " . LIKE . "'" . $_POST['AssetCategory'] . "' - AND fixedassets.assetid " . LIKE . "'" . $_POST['AssetID'] . "' - AND fixedassets.assetlocation " . LIKE . "'" . $_POST['AssetLocation'] . "' - GROUP BY fixedassets.assetid, - fixedassets.description, - fixedassets.longdescription, - fixedassets.assetcategoryid, - fixedassets.serialno, - fixedassetlocations.locationdescription, - fixedassets.datepurchased, - fixedassetlocations.parentlocationid, - fixedassets.assetlocation"; + fixedassets.description, + fixedassets.longdescription, + fixedassets.assetcategoryid, + fixedassets.serialno, + fixedassetlocations.locationdescription, + fixedassets.datepurchased, + fixedassetlocations.parentlocationid, + fixedassets.assetlocation, + fixedassets.disposaldate, + SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS costbfwd, + SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='depn') THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd, + SUM(CASE WHEN (fixedassettrans.transdate >='" . $DateFrom ."' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS periodadditions, + SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS perioddepn, + SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='disposal' THEN fixedassettrans.amount ELSE 0 END) AS perioddisposal + FROM fixedassets + INNER JOIN fixedassetcategories ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + INNER JOIN fixedassetlocations ON fixedassets.assetlocation=fixedassetlocations.locationid + INNER JOIN fixedassettrans ON fixedassets.assetid=fixedassettrans.assetid + WHERE fixedassets.assetcategoryid " . LIKE . "'" . $_POST['AssetCategory'] . "' + AND fixedassets.assetid " . LIKE . "'" . $_POST['AssetID'] . "' + AND fixedassets.assetlocation " . LIKE . "'" . $_POST['AssetLocation'] . "' + GROUP BY fixedassets.assetid, + fixedassets.description, + fixedassets.longdescription, + fixedassets.assetcategoryid, + fixedassets.serialno, + fixedassetlocations.locationdescription, + fixedassets.datepurchased, + fixedassetlocations.parentlocationid, + fixedassets.assetlocation"; $result = DB_query($sql, $db); if (isset($_POST['pdf'])) { $FontSize = 10; @@ -116,8 +116,7 @@ $Ancestors[$i] = $ParentRow['locationdescription']; } */ - if (Date1GreaterThanDate2(ConvertSQLDate($myrow['disposaldate']),$_POST['FromDate']) - OR $myrow['disposaldate']='0000-00-00'){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['disposaldate']),$_POST['FromDate']) OR $myrow['disposaldate']='0000-00-00') { if ($myrow['disposaldate']!='0000-00-00' AND Date1GreaterThanDate2($_POST['ToDate'], ConvertSQLDate($myrow['disposaldate']))){ /*The asset was disposed during the period */ @@ -221,14 +220,14 @@ echo '<input type=hidden name=AssetLocation value=' . $_POST['AssetLocation'] . '>'; //Total Values echo '<tr><th style="vertical-align:top" colspan="5">' . _('TOTAL') . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalCostBfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDepnBfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalAdditions, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDepn, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalCostCfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDepnCfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalNBV, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDisposals, 2) . '</th></tr>'; + echo '<th style="text-align:right">' . number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDepnBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalAdditions, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDepn, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalCostCfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDepnCfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalNBV, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDisposals, $_SESSION['CompanyRecord']['decimalplaces']) . '</th></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name="csv" value="' . _('Print as CSV') . '"></div></form>'; @@ -238,7 +237,7 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; $result = DB_query('SELECT categoryid,categorydescription FROM fixedassetcategories', $db); - echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class="selection">'; + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><th>' . _('Asset Category') . '</th>'; echo '<td><select name=AssetCategory>'; @@ -251,7 +250,7 @@ } } echo '</select></td></tr>'; - $sql = 'SELECT locationid, locationdescription FROM fixedassetlocations'; + $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; $result = DB_query($sql, $db); echo '<tr><th>' . _('Asset Location') . '</th>'; echo '<td><select name=AssetLocation>'; @@ -264,7 +263,7 @@ } } echo '</select></td></tr>'; - $sql = 'SELECT assetid, description FROM fixedassets'; + $sql = "SELECT assetid, description FROM fixedassets"; $result = DB_query($sql, $db); echo '<tr><th>' . _('Asset') . '</th>'; echo '<td><select name="AssetID">'; @@ -278,18 +277,19 @@ } echo '</select></td></tr>'; if (empty($_POST['FromDate'])) { - $_POST['FromDate'] = date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, date("m"), date("d"), date("Y") - 1)); + $_POST['FromDate'] = date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)); } if (empty($_POST['ToDate'])) { $_POST['ToDate'] = date($_SESSION['DefaultDateFormat']); } - echo '<tr><th>' . _(' From Date') . "</th><td><input type='text' class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='FromDate' maxlength=10 size=11 value='" . $_POST['FromDate'] . "'></td>"; + echo '<tr><th>' . _(' From Date') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=11 value="' . $_POST['FromDate'] . '"></td>'; echo '</tr>'; - echo '<tr><th>' . _('To Date ') . "</th><td><input type='text' class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='ToDate' maxlength=10 size=11 value='" . $_POST['ToDate'] . "'></td>"; - echo '</tr>'; - - echo '</table><br />'; + echo '<tr><th>' . _('To Date ') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '"></td> + </tr> + </table> + <br />'; + echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"> '; echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/PDFQuotation.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -22,37 +22,37 @@ $ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.branchcode, - locations.taxprovinceid, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.quotation=1 - AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.currcode, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders INNER JOIN debtorsmaster + ON salesorders.debtorno=debtorsmaster.debtorno + INNER JOIN shippers + ON salesorders.shipvia=shippers.shipper_id + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + WHERE salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; $result=DB_query($sql,$db, $ErrMsg); @@ -62,9 +62,20 @@ include('includes/header.inc'); echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul><li><a href="'. $rootpath . '/SelectSalesOrder.php?Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li></ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ @@ -105,7 +116,7 @@ $result=DB_query($sql,$db, $ErrMsg); -$ListCount = 0; // UldisN +$ListCount = 0; if (DB_num_rows($result)>0){ /*Yes there are line items to start the ball rolling with a page header */ @@ -136,13 +147,19 @@ $TaxProv = $myrow['taxprovinceid']; $TaxCat = $myrow2['taxcatid']; $Branch = $myrow['branchcode']; - $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $sql3 = "SELECT taxgrouptaxes.taxauthid + FROM taxgrouptaxes INNER JOIN custbranch + ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid + WHERE custbranch.branchcode='" .$Branch ."'"; $result3=DB_query($sql3,$db, $ErrMsg); while ($myrow3=DB_fetch_array($result3)){ $TaxAuth = $myrow3['taxauthid']; } - $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $sql4 = "SELECT * FROM taxauthrates + WHERE dispatchtaxprovince='" .$TaxProv ."' + AND taxcatid='" .$TaxCat ."' + AND taxauthority='" .$TaxAuth ."'"; $result4=DB_query($sql4,$db, $ErrMsg); while ($myrow4=DB_fetch_array($result4)){ $TaxClass = 100 * $myrow4['taxrate']; @@ -227,9 +244,9 @@ if ($ListCount == 0){ $title = _('Print Quotation Error'); include('includes/header.inc'); - echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). - '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). - '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + prnMsg(_('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'),'info'); + echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?Quotation=Quotes_only">'. _('Print Another Quotation'). '</a> + <br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/PDFQuotationPortrait.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -9,11 +9,26 @@ If (!isset($_GET['QuotationNo']) || $_GET['QuotationNo']==""){ $title = _('Select Quotation To Print'); include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; + echo '<div class="centre"> + <br /> + <br /> + <br />'; prnMsg( _('Select a Quotation to Print before calling this page') , 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul><li><a href="'. $rootpath . '/SelectSalesOrder.php?Quotations=Quotes_Only">' . _('Quotations') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit(); } @@ -22,37 +37,37 @@ $ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.branchcode, - locations.taxprovinceid, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.quotation=1 - AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.currcode, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders INNER JOIN debtorsmaster + ON salesorders.debtorno=debtorsmaster.debtorno + INNER JOIN shippers + ON salesorders.shipvia=shippers.shipper_id + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + WHERE salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; $result=DB_query($sql,$db, $ErrMsg); @@ -60,11 +75,25 @@ if (DB_num_rows($result)==0){ $title = _('Print Quotation Error'); include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; + echo '<div class="centre"> + <br /> + <br /> + <br />'; prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul><li><a href="'. $rootpath . '/SelectSalesOrder.php?Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li></ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/ShipmentCosting.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -624,8 +624,8 @@ if ($_SESSION['WeightedAverageCosting']==0){ /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected VALUE="Yes">'. _('Yes') . '</option> - <option VALUE="No">'. _('No') . '</option> + <option selected value="Yes">'. _('Yes') . '</option> + <option value="No">'. _('No') . '</option> </select>'; } echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/TaxAuthorityRates.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; // only allow accountant access - if (isset($_POST['TaxAuthority'])){ $TaxAuthority = $_POST['TaxAuthority']; } @@ -17,10 +15,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" alt="" />' . $title. '</p>'; -/* <-- $Revision: 1.16 $ --> */ if (!isset($TaxAuthority)){ - prnMsg(_('This page can only be called after selecting the tax authority to edit the rates for') . '. ' . _('Please select the Rates link from the tax authority page') . ".<br /><a href='$rootpath/TaxAuthorities.php'>" . _('click here') . '</a> ' . _('to go to the Tax Authority page'),'error'); + prnMsg(_('This page can only be called after selecting the tax authority to edit the rates for') . '. ' . _('Please select the Rates link from the tax authority page') . '<br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('click here') . '</a> ' . _('to go to the Tax Authority page'),'error'); include ('includes/footer.inc'); exit; } @@ -29,11 +26,11 @@ if (isset($_POST['UpdateRates'])){ $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, - taxauthrates.taxrate, - taxauthrates.dispatchtaxprovince - FROM taxauthrates - WHERE taxauthrates.taxauthority='" . $TaxAuthority . "'", - $db); + taxauthrates.taxrate, + taxauthrates.dispatchtaxprovince + FROM taxauthrates + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "'", + $db); while ($myrow=DB_fetch_array($TaxRatesResult)){ @@ -55,34 +52,35 @@ $TaxAuthDetail = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); $myrow = DB_fetch_row($TaxAuthDetail); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type=hidden name="TaxAuthority" VALUE=' . $TaxAuthority . '>'; +echo '<input type=hidden name="TaxAuthority" value="' . $TaxAuthority . '">'; $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, - taxcategories.taxcatname, - taxauthrates.taxrate, - taxauthrates.dispatchtaxprovince, - taxprovinces.taxprovincename - FROM taxauthrates INNER JOIN taxauthorities - ON taxauthrates.taxauthority=taxauthorities.taxid - INNER JOIN taxprovinces - ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid - INNER JOIN taxcategories - ON taxauthrates.taxcatid=taxcategories.taxcatid - WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' - ORDER BY taxauthrates.dispatchtaxprovince, - taxauthrates.taxcatid", - $db); + taxcategories.taxcatname, + taxauthrates.taxrate, + taxauthrates.dispatchtaxprovince, + taxprovinces.taxprovincename + FROM taxauthrates INNER JOIN taxauthorities + ON taxauthrates.taxauthority=taxauthorities.taxid + INNER JOIN taxprovinces + ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid + INNER JOIN taxcategories + ON taxauthrates.taxcatid=taxcategories.taxcatid + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' + ORDER BY taxauthrates.dispatchtaxprovince, + taxauthrates.taxcatid", + $db); if (DB_num_rows($TaxRatesResult)>0){ - echo '<table cellpadding=2 class=selection>'; + echo '<table cellpadding=2 class="selection">'; echo '<tr><th colspan=3><font size=3 color=navy>' . _('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>'; + <th>' . _('Tax Rate') . ' %</th> + </tr>'; echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -104,7 +102,7 @@ printf('<td>%s</td> <td>%s</td> - <td><input type=text class="number" name=%s maxlength=5 size=5 value=%s></td> + <td><input type="text" class="number" name=%s maxlength=5 size=5 value=%s></td> </tr>', $myrow['taxprovincename'], $myrow['taxcatname'], @@ -116,7 +114,9 @@ } //end of while loop echo '</table>'; -echo "<br /><div class='centre'><input type=submit name='UpdateRates' VALUE='" . _('Update Rates') . "'>"; +echo '<br /> + <div class="centre"> + <input type=submit name="UpdateRates" VALUE="' . _('Update Rates') . '">'; } //end if tax taxcatid/rates to show else { prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'),'warn'); @@ -124,10 +124,10 @@ echo '</form>'; -echo '<br /><br /><a href="' . $rootpath . '/TaxAuthorities.php?' . SID . '">' . _('Tax Authorities') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxGroups.php?' . SID . '">' . _('Tax Groupings') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxCategories.php?' . SID . '">' . _('Tax Categories') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxProvinces.php?' . SID . '">' . _('Dispatch Tax Provinces') . '</a>'; +echo '<br /><br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Groupings') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxCategories.php">' . _('Tax Categories') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a>'; echo '</div>'; include( 'includes/footer.inc' ); Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/includes/LanguagesArray.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,32 +1,32 @@ -<?php -$LanguagesArray = array(); -$LanguagesArray['en_US.utf8'] = _('English US'); -$LanguagesArray['en_GB.utf8'] = _('English British'); -$LanguagesArray['cz_CZ.utf8'] = _('Czechoslovakian'); -$LanguagesArray['de_DE.utf8'] = _('German'); -$LanguagesArray['el_GR.utf8'] = _('Greek'); -$LanguagesArray['es_ES.utf8'] = _('Spanish'); -$LanguagesArray['et_EE.utf8'] = _('Estonian'); -$LanguagesArray['fa_IR.utf8'] = _('Arabic'); -$LanguagesArray['fr_FR.utf8'] = _('French'); -$LanguagesArray['hi_IN.utf8'] = _('Hindi'); -$LanguagesArray['hr_HR.utf8'] = _('H... [truncated message content] |
From: <dai...@us...> - 2011-07-05 10:27:34
|
Revision: 4623 http://web-erp.svn.sourceforge.net/web-erp/?rev=4623&view=rev Author: daintree Date: 2011-07-05 10:27:25 +0000 (Tue, 05 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/EDIProcessOrders.php trunk/EDISendInvoices.php trunk/EmailConfirmation.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/Factors.php trunk/FixedAssetRegister.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/ShipmentCosting.php trunk/TaxAuthorityRates.php trunk/includes/LanguagesArray.php trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PDFQuotationPortraitPageHeader.inc trunk/includes/RFC822.php trunk/includes/tcpdf/tcpdf.php trunk/sql/mysql/upgrade4.04.4-4.04.5.sql Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EDIProcessOrders.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -76,7 +76,7 @@ while ($LineText = fgets($fp) AND $TryNextFile != True){ /* get each line of the order file */ $LineText = StripTrailingComma($LineText); - echo "<br />".$LineText; + echo '<br />' . $LineText; if ($SegTag != mb_substr($LineText,0,3)){ $SegCounter=1; @@ -140,7 +140,7 @@ $Order->Comments .= "\n" . _('blanket order'); break; case '224': - $EmailText .= "\n\n" . _('This order is URGENT') . "</font>"; + $EmailText .= "\n\n" . _('This order is URGENT') . '</font>'; $Order->Comments .= "\n" . _('URGENT ORDER'); break; case '226': @@ -184,7 +184,7 @@ $EmailText .= "\n" . _('Customers order ref') . ': ' . $BGM_C106[0]; } if (isset($BGM_elements[2])){ - echo "<br />echo BGM_elements[2] " .$BGM_elements[2]; + echo '<br />echo BGM_elements[2] ' .$BGM_elements[2]; $BGM_1225 = explode(':',$BGM_elements[2]); $MsgFunction = $BGM_1225[0]; @@ -457,22 +457,23 @@ case 'SN': /*Store Number - get the branch details from the store number - snag here too cos need to ensure got the Customer detail first before try looking up its branches */ $BranchResult = DB_query("SELECT branchcode, - brname, - braddress1, - braddress2, - braddress3, - braddress4, - braddress5, - braddress6, - contactname, - defaultlocation, - phoneno, - email - FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1",$db); + brname, + braddress1, + braddress2, + braddress3, + braddress4, + braddress5, + braddress6, + contactname, + defaultlocation, + phoneno, + email + FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno = custbranch.debtorno WHERE custbranchcode='" . $NAD_C082[0] . "' AND custbranch.debtorno='" . $Order->DebtorNo . "' AND debtorsmaster.ediorders=1",$db); if (DB_num_rows($BranchResult)!=1){ $EmailText .= "\n" . _('The Store number was specified as') . ' ' . $NAD_C082[0] . ' ' . _('Unfortunately there are either no branches of customer code') . ' ' . $Order->DebtorNo . ' ' ._('or several that match this store number') . '. ' . _('This order could not be processed further'); $TryNextFile = True; /* Look for other EDI msgs */ - $CreateOrder = False; /*Dont create order in system */ } else { + $CreateOrder = False; /*Dont create order in system */ + } else { $BranchRow = DB_fetch_array($BranchResult); $Order->BranchCode = $BranchRow['branchcode']; $Order->DeliverTo = $BranchRow['brname']; Modified: trunk/EDISendInvoices.php =================================================================== --- trunk/EDISendInvoices.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EDISendInvoices.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -8,16 +8,16 @@ include('includes/htmlMimeMail.php'); // need for sending email attachments /*Get the Customers who are enabled for EDI invoicing */ -$sql = 'SELECT debtorno, - edireference, - editransport, - ediaddress, - ediserveruser, - ediserverpwd, - daysbeforedue, - dayinfollowingmonth - FROM debtorsmaster INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - WHERE ediinvoices=1'; +$sql = "SELECT debtorno, + edireference, + editransport, + ediaddress, + ediserveruser, + ediserverpwd, + daysbeforedue, + dayinfollowingmonth + FROM debtorsmaster INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator + WHERE ediinvoices=1"; $EDIInvCusts = DB_query($sql,$db); @@ -30,29 +30,29 @@ /*Figure out if there are any unset invoices or credits for the customer */ $sql = "SELECT debtortrans.id, - transno, - type, - order_, - trandate, - ovgst, - ovamount, - ovfreight, - ovdiscount, - debtortrans.branchcode, - custbranchcode, - invtext, - shipvia, - rate, - brname, - braddress1, - braddress2, - braddress3, - braddress4 - FROM debtortrans INNER JOIN custbranch ON custbranch.debtorno = debtortrans.debtorno - AND custbranch.branchcode = debtortrans.branchcode - WHERE (type=10 or type=11) - AND edisent=0 - AND debtortrans.debtorno='" . $CustDetails['debtorno'] . "'"; + transno, + type, + order_, + trandate, + ovgst, + ovamount, + ovfreight, + ovdiscount, + debtortrans.branchcode, + custbranchcode, + invtext, + shipvia, + rate, + brname, + braddress1, + braddress2, + braddress3, + braddress4 + FROM debtortrans INNER JOIN custbranch ON custbranch.debtorno = debtortrans.debtorno + AND custbranch.branchcode = debtortrans.branchcode + WHERE (type=10 or type=11) + AND edisent=0 + AND debtortrans.debtorno='" . $CustDetails['debtorno'] . "'"; $ErrMsg = _('There was a problem retrieving the customer transactions because'); $TransHeaders = DB_query($sql,$db,$ErrMsg); @@ -135,34 +135,34 @@ if ($TransDetail['type']==10){ /*its an invoice */ $sql = "SELECT stockmoves.stockid, - stockmaster.description, - -stockmoves.qty as quantity, - stockmoves.discountpercent, - ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmoves.taxrate, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 - AND stockmoves.transno='" . $TransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + -stockmoves.qty as quantity, + stockmoves.discountpercent, + ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.taxrate, + stockmaster.units + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=10 + AND stockmoves.transno='" . $TransNo . "' + AND stockmoves.show_on_inv_crds=1"; } else { /* credit note */ $sql = "SELECT stockmoves.stockid, - stockmaster.description, - stockmoves.qty as quantity, - stockmoves.discountpercent, - ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) as fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmoves.taxrate, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 and stockmoves.transno='" . $TransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + stockmoves.qty as quantity, + stockmoves.discountpercent, + ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) as fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.taxrate, + stockmaster.units + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=11 and stockmoves.transno='" . $TransNo . "' + AND stockmoves.show_on_inv_crds=1"; } $TransLinesResult = DB_query($sql,$db); @@ -174,9 +174,9 @@ $StockID = $TransLines['StockID']; $sql = "SELECT partnerstockid FROM ediitemmapping - WHERE supporcust='CUST' - AND partnercode ='" . $CustDetails['debtorno'] . "' - AND stockid='" . $TransLines['stockid'] . "'"; + WHERE supporcust='CUST' + AND partnercode ='" . $CustDetails['debtorno'] . "' + AND stockid='" . $TransLines['stockid'] . "'"; $CustStkResult = DB_query($sql,$db); if (DB_num_rows($CustStkResult)==1){ Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EmailConfirmation.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,108 +1,144 @@ <?php /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); //Get Out if we have no order number to work with If (!isset($_GET['TransNo']) OR $_GET['TransNo']==""){ - $title = _('Select Order To Print'); - include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; - include('includes/footer.inc'); - exit(); + $title = _('Select Order To Print'); + include('includes/header.inc'); + echo '<div class="centre"> + <br /> + <br /> + <br />'; + prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; + include('includes/footer.inc'); + exit(); } -$MailTo = $_GET['EMail']; -$headers = 'From: Bethany Manufacturing <sa...@be...>' . '\n'; -$headers .= 'MIME-Version: 1.0\n' . 'Content-Type: text/html; charset="utf-8"\n'; +$MailTo = $_GET['EMail']; +$headers = 'From: Bethany Manufacturing <sa...@be...>' . '\n'; +$headers .= 'MIME-Version: 1.0\n' . 'Content-Type: text/html; charset="utf-8"\n'; /*retrieve the order details from the database to print */ $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . $_GET['TransNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.debtorno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname, - salesorders.deliverydate - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno=" . $_GET['TransNo']; + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname, + salesorders.deliverydate + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); //If there are no rows, there's a problem. if (DB_num_rows($result)==0){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; - include('includes/footer.inc'); - exit(); + $title = _('Print Packing Slip Error'); + include('includes/header.inc'); + echo '<div class="centre"> + <br /> + <br /> + <br />'; + prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; + include('includes/footer.inc'); + exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ - $myrow = DB_fetch_array($result); - /* Place the deliver blind variable into a hold variable to used when - producing the packlist */ - $DeliverBlind = $myrow['deliverblind']; - $DeliveryDate = $myrow['salesorders.deliverydate']; - if ($myrow['printedpackingslip']==1 AND ($_GET['Reprint']!='OK' OR !isset($_GET['Reprint']))){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . - _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); - echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' - . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . - '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; + $myrow = DB_fetch_array($result); + /* Place the deliver blind variable into a hold variable to used when + producing the packlist */ + $DeliverBlind = $myrow['deliverblind']; + $DeliveryDate = $myrow['salesorders.deliverydate']; + if ($myrow['printedpackingslip']==1 AND ($_GET['Reprint']!='OK' OR !isset($_GET['Reprint']))){ + $title = _('Print Packing Slip Error'); + include('includes/header.inc'); + prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . _('has previously been printed') . ' ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' + . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a></p><p><a href="' . $rootpath. '/PrintCustOrder_generic.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a></p>'; - echo '<br /><br /><br />'; - echo _('Or select another Order Number to Print'); - echo '<table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br />'; + echo _('Or select another Order Number to Print'); + echo '<table class="table_index"><tr><td class="menu_group_item"> + <ul> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; - include('includes/footer.inc'); - exit; - }//packing slip has been printed. - $MailSubject = "Order Confirmation-Sales Order " . $_GET['TransNo'] . " - Your PO " . - $myrow['customerref'] ; + include('includes/footer.inc'); + exit; + }//packing slip has been printed. + $MailSubject = _('Order Confirmation-Sales Order') . ' ' . $_GET['TransNo'] . ' - '. _('Your PO') . ' ' . $myrow['customerref'] ; } /*retrieve the order details from the database to print */ @@ -111,49 +147,52 @@ ) LETS GO */ -$MailMessage = "<html><head><title>Email Confirmation</title></head><body>" . - "<Table cellpadding='2' cellspacing='2'><tr>" . - "<td align='center' colspan='4'><H1>" . $_SESSION['CompanyRecord']['coyname'] . "</H1>" ; -$MailMessage = $MailMessage . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['regoffice1'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['regoffice4'] . ","; -$MailMessage = $MailMessage . "<b>" . - $_SESSION['CompanyRecord']['regoffice5'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . - $_SESSION['CompanyRecord']['fax'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $_SESSION['CompanyRecord']['email'] . "<br /><br /><br /></td></tr>"; -$MailMessage = $MailMessage . "<Table><tr><td align='center' colspan='4'> - <h2> Order Acknowledgement</h2></td></tr>"; -$MailMessage = $MailMessage . "<tr><td align='center' colspan='4'> <b>Order Number " . - $_GET['TransNo'] . "</b><br /><br /><br /></td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>Delivered To:</b></td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $myrow['deliverto'] . "</td></tr>"; -$MailMessage = $MailMessage . "<tr><td colspan='4'> <b>" . - $myrow['deladd1'] . "</td></tr>"; -If(mb_strlen(trim($myrow['deladd2']))) -{ - $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd2'] . "</td></tr>"; - $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd3'] . - ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']. "<br /><br /><br /></td></tr>"; +$MailMessage = '<html><head><title>' . _('Email Confirmation') . '</title></head> + <body> + <table cellpadding="2" cellspacing="2"> + <tr> + <td align="center" colspan="4"><h1>' . $_SESSION['CompanyRecord']['coyname'] . '</h1></td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['regoffice1'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['regoffice4'] . ',<b>' . $_SESSION['CompanyRecord']['regoffice5'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $_SESSION['CompanyRecord']['email'] . '<br /><br /><br /></td> + </tr> + </table> + <table> + <tr><td align="center" colspan="4"> + <h2>' . _('Order Acknowledgement') . '</h2></td> + </tr> + <tr><td align="center" colspan="4"> <b>' . _('Order Number') . ' ' . $_GET['TransNo'] . '</b><br /><br /><br /></td> + </tr> + <tr><td colspan="4"> <b>' . _('Delivered To') . ':</b></td> + </tr> + <tr><td colspan="4"> <b>' . $myrow['deliverto'] . '</td> + </tr> + <tr><td colspan="4"> <b>' . $myrow['deladd1'] . '</td> + </tr>'; + +if(mb_strlen(trim($myrow['deladd2']))) { + $MailMessage .= '<tr><td> <b>' . $myrow['deladd2'] . '</td></tr> + <tr><td> <b>' . $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']. '<br /><br /><br /></td> + </tr>'; +} else { + $MailMessage .= '<tr><td> <b>' . $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5'] . '<br /><br /><br /></td> + </tr>'; } -else -{ - $MailMessage = $MailMessage . "<tr><td> <b>" . $myrow['deladd3'] . ' ' . - $myrow['deladd4'] . ' ' . $myrow['deladd5'] . "<br /><br /><br /></td></tr>"; -} -$MailMessage = $MailMessage . "</table><table border='1' width='50%'><tr>"; +$MailMessage .= '</table> + <table border="1" width="50%"><tr>'; if($_REQUEST['POLine'] == 1){ - $MailMessage = $MailMessage . " <td>PO Line</td>"; + $MailMessage .= '<td>' . _('PO Line') . '</td>'; } - $MailMessage = $MailMessage . "<td>Stock Code</td> - <td>Description</td> - <td>Quantity Ordered</td> - <td>Due Date</td></tr>"; + $MailMessage .= '<td>' . _('Stock Code') . '</td> + <td>' . _('Description') . '</td> + <td>' . _('Quantity Ordered') . '</td> + <td>' . _('Due Date') . '</td> + </tr>'; $sql = "SELECT salesorderdetails.stkcode, @@ -181,33 +220,31 @@ $DscCode[$i] = $myrow2['description']; $QtyCode[$i] = $DisplayQty ; $POLine[$i] = $myrow2['poline']; - If($myrow2['itemdue'] =='') - { + if($myrow2['itemdue'] =='') { $ItemDue[$i] = date('M d, Y',strtotime($DeliveryDate)); - } - else - { + } else { $ItemDue[$i] = date('M d, Y',strtotime($myrow2['itemdue'])); } - $MailMessage = $MailMessage . "<tr>"; + $MailMessage .= '<tr>'; if($_REQUEST['POLine'] == 1){ - $MailMessage = $MailMessage . "<td align='right'>" . $POLine[$i] . "</td>"; + $MailMessage .= '<td align="right">' . $POLine[$i] . '</td>'; } - $MailMessage = $MailMessage . "<td>" . $myrow2['stkcode'] . - "</td><td>" . - $myrow2['description'] . "</td><td align='right'>" . - $DisplayQty . "</td><td align='center'>" . $ItemDue[$i] . - "</td></tr>"; + $MailMessage .= '<td>' . $myrow2['stkcode'] . '</td><td>' . $myrow2['description'] . '</td> + <td align="right">' . $DisplayQty . '</td> + <td align="center">' . $ItemDue[$i] . '</td> + </tr>'; $i = $i + 1; } //end while there are line items to print out } /*end if there are order details to show on the order*/ -$MailMessage = $MailMessage . "</Table></body></html>"; +$MailMessage .= '</table> + </body> + </html>'; // echo $MailMessage . "=mailMessage<br />"; IF(mail( $MailTo, $MailSubject, $MailMessage, $headers )){ - echo " The following E-Mail was sent to $MailTo:"; + echo ' ' ._('The following E-Mail was sent to') . ' ' . $MailTo . ' :'; } ?> <html> Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/EmailCustTrans.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -47,8 +47,8 @@ FROM custbranch INNER JOIN debtortrans ON custbranch.debtorno= debtortrans.debtorno AND custbranch.branchcode=debtortrans.branchcode - WHERE debtortrans.type='" . $TypeCode . "' - AND debtortrans.transno='" .$_GET['FromTransNo'] . "'"; + WHERE debtortrans.type='" . $TypeCode . "' + AND debtortrans.transno='" .$_GET['FromTransNo'] . "'"; $ErrMsg = _('There was a problem retrieving the contact details for the customer'); $ContactResult=DB_query($SQL,$db,$ErrMsg); Modified: trunk/ExchangeRateTrend.php =================================================================== --- trunk/ExchangeRateTrend.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/ExchangeRateTrend.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.3 $ */ + /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('View Currency Trends'); @@ -29,33 +27,30 @@ _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '</p>'; echo '<table>'; // First column - $SQL = 'SELECT * FROM currencies'; + $SQL = "SELECT * FROM currencies"; $result=DB_query($SQL,$db); // CurrencyToShow Currency Picker echo '<tr><td><select name="CurrencyToShow" onChange="ReloadForm(update.submit)">'; - DB_data_seek($result,0); - while ($myrow=DB_fetch_array($result)) { - if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ - if ( $CurrencyToShow==$myrow['currabrev'] ) { - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; - } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; - } + DB_data_seek($result,0); + while ($myrow=DB_fetch_array($result)) { + if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ + if ( $CurrencyToShow==$myrow['currabrev'] ) { + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; + } else { + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } } - echo '</select></td></tr>'; + } + echo '</select></td></tr>'; echo '</table>'; /*close off the table in the third column */ - - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"></div>'; echo '</form>'; - - // ************** // SHOW OUR GRAPH // ************** @@ -66,7 +61,7 @@ echo '<p></div><table class=selection>'; echo '<tr><th><div class="centre"><font size=4 color=BLUE><b><U>' . $FunctionalCurrency . ' / ' . $CurrencyToShow . '</b></U></font></th></tr>'; - echo '<tr><td><img src=' . $image . ' alt="Trend Currently Unavailable"></td></tr>'; + echo '<tr><td><img src=' . $image . ' alt="' ._('Trend Currently Unavailable') . '"></td></tr>'; echo '</table>'; Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/Factors.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -151,19 +151,19 @@ if (isset($FactorID) and isset($_POST['Amend'])) { $sql = "SELECT id, - coyname, - address1, - address2, - address3, - address4, - address5, - address6, - contact, - telephone, - fax, - email - FROM factorcompanies - WHERE id = '".$FactorID."'"; + coyname, + address1, + address2, + address3, + address4, + address5, + address6, + contact, + telephone, + fax, + email + FROM factorcompanies + WHERE id = '".$FactorID."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -208,7 +208,6 @@ <td><input tabindex=2 type="text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] .'"></td></tr>'; echo '<tr><td>' . _('Address Line 2') . ':</td> <td><input tabindex=3 type="text" name="Address2" size=42 maxlength=40 value="' . $_POST['Address2'] .'"></td></tr>'; - echo '<tr><td>' . _('Address Line 3') . ':</td> <td><input tabindex=4 type="text" name="Address3" size=42 maxlength=40 value="' .$_POST['Address3'] .'"></td></tr>'; echo '<tr><td>' . _('Address Line 4') . ':</td> @@ -248,32 +247,34 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="No">'; - echo '<table class=selection><tr> - <th>' . _('ID') . '</th> - <th>' . _('Company Name').'</th> - <th>' . _('Address 1').'</th> - <th>' . _('Address 2').'</th> - <th>' . _('Address 3').'</th> - <th>' . _('Address 4').'</th> - <th>' . _('Address 5').'</th> - <th>' . _('Address 6').'</th> - <th>' . _('Contact').'</th> - <th>' . _('Telephone').'</th> - <th>' . _('Fax Number').'</th> - <th>' . _('Email').'</th></tr>'; + echo '<table class=selection> + <tr> + <th>' . _('ID') . '</th> + <th>' . _('Company Name').'</th> + <th>' . _('Address 1').'</th> + <th>' . _('Address 2').'</th> + <th>' . _('Address 3').'</th> + <th>' . _('Address 4').'</th> + <th>' . _('Address 5').'</th> + <th>' . _('Address 6').'</th> + <th>' . _('Contact').'</th> + <th>' . _('Telephone').'</th> + <th>' . _('Fax Number').'</th> + <th>' . _('Email').'</th> + </tr>'; $sql = "SELECT id, - coyname, - address1, - address2, - address3, - address4, - address5, - address6, - contact, - telephone, - fax, - email - FROM factorcompanies"; + coyname, + address1, + address2, + address3, + address4, + address5, + address6, + contact, + telephone, + fax, + email + FROM factorcompanies"; $result=DB_query($sql, $db); $j=1; while ($myrow = DB_fetch_array($result)) { @@ -307,6 +308,5 @@ } - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/FixedAssetRegister.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,5 +1,5 @@ <?php -//$PageSecurity = 11; + include ('includes/session.inc'); $title = _('Fixed Asset Register'); $csv_output = ''; @@ -15,36 +15,36 @@ $DateFrom = FormatDateForSQL($_POST['FromDate']); $DateTo = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT fixedassets.assetid, - fixedassets.description, - fixedassets.longdescription, - fixedassets.assetcategoryid, - fixedassets.serialno, - fixedassetlocations.locationdescription, - fixedassets.datepurchased, - fixedassetlocations.parentlocationid, - fixedassets.assetlocation, - fixedassets.disposaldate, - SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS costbfwd, - SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='depn') THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd, - SUM(CASE WHEN (fixedassettrans.transdate >='" . $DateFrom ."' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS periodadditions, - SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS perioddepn, - SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='disposal' THEN fixedassettrans.amount ELSE 0 END) AS perioddisposal - FROM fixedassets - INNER JOIN fixedassetcategories ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - INNER JOIN fixedassetlocations ON fixedassets.assetlocation=fixedassetlocations.locationid - INNER JOIN fixedassettrans ON fixedassets.assetid=fixedassettrans.assetid - WHERE fixedassets.assetcategoryid " . LIKE . "'" . $_POST['AssetCategory'] . "' - AND fixedassets.assetid " . LIKE . "'" . $_POST['AssetID'] . "' - AND fixedassets.assetlocation " . LIKE . "'" . $_POST['AssetLocation'] . "' - GROUP BY fixedassets.assetid, - fixedassets.description, - fixedassets.longdescription, - fixedassets.assetcategoryid, - fixedassets.serialno, - fixedassetlocations.locationdescription, - fixedassets.datepurchased, - fixedassetlocations.parentlocationid, - fixedassets.assetlocation"; + fixedassets.description, + fixedassets.longdescription, + fixedassets.assetcategoryid, + fixedassets.serialno, + fixedassetlocations.locationdescription, + fixedassets.datepurchased, + fixedassetlocations.parentlocationid, + fixedassets.assetlocation, + fixedassets.disposaldate, + SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS costbfwd, + SUM(CASE WHEN (fixedassettrans.transdate <'" . $DateFrom . "' AND fixedassettrans.fixedassettranstype='depn') THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd, + SUM(CASE WHEN (fixedassettrans.transdate >='" . $DateFrom ."' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='cost') THEN fixedassettrans.amount ELSE 0 END) AS periodadditions, + SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS perioddepn, + SUM(CASE WHEN fixedassettrans.transdate >='" . $DateFrom . "' AND fixedassettrans.transdate <='" . $DateTo . "' AND fixedassettrans.fixedassettranstype='disposal' THEN fixedassettrans.amount ELSE 0 END) AS perioddisposal + FROM fixedassets + INNER JOIN fixedassetcategories ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + INNER JOIN fixedassetlocations ON fixedassets.assetlocation=fixedassetlocations.locationid + INNER JOIN fixedassettrans ON fixedassets.assetid=fixedassettrans.assetid + WHERE fixedassets.assetcategoryid " . LIKE . "'" . $_POST['AssetCategory'] . "' + AND fixedassets.assetid " . LIKE . "'" . $_POST['AssetID'] . "' + AND fixedassets.assetlocation " . LIKE . "'" . $_POST['AssetLocation'] . "' + GROUP BY fixedassets.assetid, + fixedassets.description, + fixedassets.longdescription, + fixedassets.assetcategoryid, + fixedassets.serialno, + fixedassetlocations.locationdescription, + fixedassets.datepurchased, + fixedassetlocations.parentlocationid, + fixedassets.assetlocation"; $result = DB_query($sql, $db); if (isset($_POST['pdf'])) { $FontSize = 10; @@ -116,8 +116,7 @@ $Ancestors[$i] = $ParentRow['locationdescription']; } */ - if (Date1GreaterThanDate2(ConvertSQLDate($myrow['disposaldate']),$_POST['FromDate']) - OR $myrow['disposaldate']='0000-00-00'){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['disposaldate']),$_POST['FromDate']) OR $myrow['disposaldate']='0000-00-00') { if ($myrow['disposaldate']!='0000-00-00' AND Date1GreaterThanDate2($_POST['ToDate'], ConvertSQLDate($myrow['disposaldate']))){ /*The asset was disposed during the period */ @@ -221,14 +220,14 @@ echo '<input type=hidden name=AssetLocation value=' . $_POST['AssetLocation'] . '>'; //Total Values echo '<tr><th style="vertical-align:top" colspan="5">' . _('TOTAL') . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalCostBfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDepnBfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalAdditions, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDepn, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalCostCfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDepnCfwd, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalNBV, 2) . '</th>'; - echo '<th style="text-align:right">' . number_format($TotalDisposals, 2) . '</th></tr>'; + echo '<th style="text-align:right">' . number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDepnBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalAdditions, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDepn, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalCostCfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDepnCfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalNBV, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; + echo '<th style="text-align:right">' . number_format($TotalDisposals, $_SESSION['CompanyRecord']['decimalplaces']) . '</th></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name="csv" value="' . _('Print as CSV') . '"></div></form>'; @@ -238,7 +237,7 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; $result = DB_query('SELECT categoryid,categorydescription FROM fixedassetcategories', $db); - echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class="selection">'; + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><th>' . _('Asset Category') . '</th>'; echo '<td><select name=AssetCategory>'; @@ -251,7 +250,7 @@ } } echo '</select></td></tr>'; - $sql = 'SELECT locationid, locationdescription FROM fixedassetlocations'; + $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; $result = DB_query($sql, $db); echo '<tr><th>' . _('Asset Location') . '</th>'; echo '<td><select name=AssetLocation>'; @@ -264,7 +263,7 @@ } } echo '</select></td></tr>'; - $sql = 'SELECT assetid, description FROM fixedassets'; + $sql = "SELECT assetid, description FROM fixedassets"; $result = DB_query($sql, $db); echo '<tr><th>' . _('Asset') . '</th>'; echo '<td><select name="AssetID">'; @@ -278,18 +277,19 @@ } echo '</select></td></tr>'; if (empty($_POST['FromDate'])) { - $_POST['FromDate'] = date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, date("m"), date("d"), date("Y") - 1)); + $_POST['FromDate'] = date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)); } if (empty($_POST['ToDate'])) { $_POST['ToDate'] = date($_SESSION['DefaultDateFormat']); } - echo '<tr><th>' . _(' From Date') . "</th><td><input type='text' class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='FromDate' maxlength=10 size=11 value='" . $_POST['FromDate'] . "'></td>"; + echo '<tr><th>' . _(' From Date') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=11 value="' . $_POST['FromDate'] . '"></td>'; echo '</tr>'; - echo '<tr><th>' . _('To Date ') . "</th><td><input type='text' class='date' alt='" . $_SESSION['DefaultDateFormat'] . "' name='ToDate' maxlength=10 size=11 value='" . $_POST['ToDate'] . "'></td>"; - echo '</tr>'; - - echo '</table><br />'; + echo '<tr><th>' . _('To Date ') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '"></td> + </tr> + </table> + <br />'; + echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"> '; echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/PDFQuotation.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -22,37 +22,37 @@ $ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.branchcode, - locations.taxprovinceid, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.quotation=1 - AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.currcode, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders INNER JOIN debtorsmaster + ON salesorders.debtorno=debtorsmaster.debtorno + INNER JOIN shippers + ON salesorders.shipvia=shippers.shipper_id + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + WHERE salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; $result=DB_query($sql,$db, $ErrMsg); @@ -62,9 +62,20 @@ include('includes/header.inc'); echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul><li><a href="'. $rootpath . '/SelectSalesOrder.php?Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li></ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ @@ -105,7 +116,7 @@ $result=DB_query($sql,$db, $ErrMsg); -$ListCount = 0; // UldisN +$ListCount = 0; if (DB_num_rows($result)>0){ /*Yes there are line items to start the ball rolling with a page header */ @@ -136,13 +147,19 @@ $TaxProv = $myrow['taxprovinceid']; $TaxCat = $myrow2['taxcatid']; $Branch = $myrow['branchcode']; - $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $sql3 = "SELECT taxgrouptaxes.taxauthid + FROM taxgrouptaxes INNER JOIN custbranch + ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid + WHERE custbranch.branchcode='" .$Branch ."'"; $result3=DB_query($sql3,$db, $ErrMsg); while ($myrow3=DB_fetch_array($result3)){ $TaxAuth = $myrow3['taxauthid']; } - $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $sql4 = "SELECT * FROM taxauthrates + WHERE dispatchtaxprovince='" .$TaxProv ."' + AND taxcatid='" .$TaxCat ."' + AND taxauthority='" .$TaxAuth ."'"; $result4=DB_query($sql4,$db, $ErrMsg); while ($myrow4=DB_fetch_array($result4)){ $TaxClass = 100 * $myrow4['taxrate']; @@ -227,9 +244,9 @@ if ($ListCount == 0){ $title = _('Print Quotation Error'); include('includes/header.inc'); - echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). - '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). - '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + prnMsg(_('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'),'info'); + echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?Quotation=Quotes_only">'. _('Print Another Quotation'). '</a> + <br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/PDFQuotationPortrait.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -9,11 +9,26 @@ If (!isset($_GET['QuotationNo']) || $_GET['QuotationNo']==""){ $title = _('Select Quotation To Print'); include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; + echo '<div class="centre"> + <br /> + <br /> + <br />'; prnMsg( _('Select a Quotation to Print before calling this page') , 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul><li><a href="'. $rootpath . '/SelectSalesOrder.php?Quotations=Quotes_Only">' . _('Quotations') . '</a></li> + </ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit(); } @@ -22,37 +37,37 @@ $ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.branchcode, - locations.taxprovinceid, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.quotation=1 - AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.currcode, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders INNER JOIN debtorsmaster + ON salesorders.debtorno=debtorsmaster.debtorno + INNER JOIN shippers + ON salesorders.shipvia=shippers.shipper_id + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + WHERE salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; $result=DB_query($sql,$db, $ErrMsg); @@ -60,11 +75,25 @@ if (DB_num_rows($result)==0){ $title = _('Print Quotation Error'); include('includes/header.inc'); - echo '<div class="centre"><br /><br /><br />'; + echo '<div class="centre"> + <br /> + <br /> + <br />'; prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr> + <td class="menu_group_item"> + <ul><li><a href="'. $rootpath . '/SelectSalesOrder.php?Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li></ul> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/ShipmentCosting.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -624,8 +624,8 @@ if ($_SESSION['WeightedAverageCosting']==0){ /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected VALUE="Yes">'. _('Yes') . '</option> - <option VALUE="No">'. _('No') . '</option> + <option selected value="Yes">'. _('Yes') . '</option> + <option value="No">'. _('No') . '</option> </select>'; } echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/TaxAuthorityRates.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; // only allow accountant access - if (isset($_POST['TaxAuthority'])){ $TaxAuthority = $_POST['TaxAuthority']; } @@ -17,10 +15,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" alt="" />' . $title. '</p>'; -/* <-- $Revision: 1.16 $ --> */ if (!isset($TaxAuthority)){ - prnMsg(_('This page can only be called after selecting the tax authority to edit the rates for') . '. ' . _('Please select the Rates link from the tax authority page') . ".<br /><a href='$rootpath/TaxAuthorities.php'>" . _('click here') . '</a> ' . _('to go to the Tax Authority page'),'error'); + prnMsg(_('This page can only be called after selecting the tax authority to edit the rates for') . '. ' . _('Please select the Rates link from the tax authority page') . '<br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('click here') . '</a> ' . _('to go to the Tax Authority page'),'error'); include ('includes/footer.inc'); exit; } @@ -29,11 +26,11 @@ if (isset($_POST['UpdateRates'])){ $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, - taxauthrates.taxrate, - taxauthrates.dispatchtaxprovince - FROM taxauthrates - WHERE taxauthrates.taxauthority='" . $TaxAuthority . "'", - $db); + taxauthrates.taxrate, + taxauthrates.dispatchtaxprovince + FROM taxauthrates + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "'", + $db); while ($myrow=DB_fetch_array($TaxRatesResult)){ @@ -55,34 +52,35 @@ $TaxAuthDetail = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); $myrow = DB_fetch_row($TaxAuthDetail); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type=hidden name="TaxAuthority" VALUE=' . $TaxAuthority . '>'; +echo '<input type=hidden name="TaxAuthority" value="' . $TaxAuthority . '">'; $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, - taxcategories.taxcatname, - taxauthrates.taxrate, - taxauthrates.dispatchtaxprovince, - taxprovinces.taxprovincename - FROM taxauthrates INNER JOIN taxauthorities - ON taxauthrates.taxauthority=taxauthorities.taxid - INNER JOIN taxprovinces - ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid - INNER JOIN taxcategories - ON taxauthrates.taxcatid=taxcategories.taxcatid - WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' - ORDER BY taxauthrates.dispatchtaxprovince, - taxauthrates.taxcatid", - $db); + taxcategories.taxcatname, + taxauthrates.taxrate, + taxauthrates.dispatchtaxprovince, + taxprovinces.taxprovincename + FROM taxauthrates INNER JOIN taxauthorities + ON taxauthrates.taxauthority=taxauthorities.taxid + INNER JOIN taxprovinces + ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid + INNER JOIN taxcategories + ON taxauthrates.taxcatid=taxcategories.taxcatid + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' + ORDER BY taxauthrates.dispatchtaxprovince, + taxauthrates.taxcatid", + $db); if (DB_num_rows($TaxRatesResult)>0){ - echo '<table cellpadding=2 class=selection>'; + echo '<table cellpadding=2 class="selection">'; echo '<tr><th colspan=3><font size=3 color=navy>' . _('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>'; + <th>' . _('Tax Rate') . ' %</th> + </tr>'; echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -104,7 +102,7 @@ printf('<td>%s</td> <td>%s</td> - <td><input type=text class="number" name=%s maxlength=5 size=5 value=%s></td> + <td><input type="text" class="number" name=%s maxlength=5 size=5 value=%s></td> </tr>', $myrow['taxprovincename'], $myrow['taxcatname'], @@ -116,7 +114,9 @@ } //end of while loop echo '</table>'; -echo "<br /><div class='centre'><input type=submit name='UpdateRates' VALUE='" . _('Update Rates') . "'>"; +echo '<br /> + <div class="centre"> + <input type=submit name="UpdateRates" VALUE="' . _('Update Rates') . '">'; } //end if tax taxcatid/rates to show else { prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'),'warn'); @@ -124,10 +124,10 @@ echo '</form>'; -echo '<br /><br /><a href="' . $rootpath . '/TaxAuthorities.php?' . SID . '">' . _('Tax Authorities') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxGroups.php?' . SID . '">' . _('Tax Groupings') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxCategories.php?' . SID . '">' . _('Tax Categories') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxProvinces.php?' . SID . '">' . _('Dispatch Tax Provinces') . '</a>'; +echo '<br /><br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Groupings') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxCategories.php">' . _('Tax Categories') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a>'; echo '</div>'; include( 'includes/footer.inc' ); Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-07-03 04:33:19 UTC (rev 4622) +++ trunk/includes/LanguagesArray.php 2011-07-05 10:27:25 UTC (rev 4623) @@ -1,32 +1,32 @@ -<?php -$LanguagesArray = array(); -$LanguagesArray['en_US.utf8'] = _('English US'); -$LanguagesArray['en_GB.utf8'] = _('English British'); -$LanguagesArray['cz_CZ.utf8'] = _('Czechoslovakian'); -$LanguagesArray['de_DE.utf8'] = _('German'); -$LanguagesArray['el_GR.utf8'] = _('Greek'); -$LanguagesArray['es_ES.utf8'] = _('Spanish'); -$LanguagesArray['et_EE.utf8'] = _('Estonian'); -$LanguagesArray['fa_IR.utf8'] = _('Arabic'); -$LanguagesArray['fr_FR.utf8'] = _('French'); -$LanguagesArray['hi_IN.utf8'] = _('Hindi'); -$LanguagesArray['hr_HR.utf8'] = _('H... [truncated message content] |
From: <dai...@us...> - 2011-07-05 10:36:20
|
Revision: 4624 http://web-erp.svn.sourceforge.net/web-erp/?rev=4624&view=rev Author: daintree Date: 2011-07-05 10:36:13 +0000 (Tue, 05 Jul 2011) Log Message: ----------- </br> changed to <br /> Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/GLBudgets.php trunk/InventoryQuantities.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPPlannedWorkOrders.php trunk/MRPReschedules.php trunk/PricesByCost.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/StockTransfers.php trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/BOMExtendedQty.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -82,7 +82,7 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - //echo "</br>sql is $sql</br>"; + //echo "<br />sql is $sql<br />"; // This while routine finds the other levels as long as $ComponentCounter - the // component counter finds there are more components that are used as // assemblies at lower levels @@ -258,7 +258,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ':</td> <td><input type ="text" name="Part" size="20">'; @@ -276,8 +276,8 @@ <option value="no">' . _('Plain Print') . '</option> </select></td></tr>'; echo '</table> - </br> - </br> + <br /> + <br /> <div class="centre"> <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"> </div>'; Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/BOMIndented.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -79,7 +79,7 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - //echo "</br>sql is $sql</br>"; + //echo "<br />sql is $sql<br />"; // This while routine finds the other levels as long as $ComponentCounter - the // component counter - finds there are more components that are used as // assemblies at lower levels @@ -245,8 +245,8 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br> - </br> + echo '<br /> + <br /> <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/BOMIndentedReverse.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -234,8 +234,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br> - </br> + echo '<br /> + <br /> <form action=' . $_SERVER['PHP_SELF'] . ' method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/GLBudgets.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -30,7 +30,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; -echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' +echo '<br /><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; $SQL = "SELECT accountcode, @@ -68,7 +68,7 @@ echo '<br /><table><tr><td><input type="submit" name="Previous" value="' . _('Prev Account') . '"></td>'; echo '<td><input type="submit" name="Select" value="' . _('Select Account') . '"></td>'; echo '<td><input type="submit" name="Next" value="' . _('Next Account') . '"></td></tr>'; -echo '</table></br>'; +echo '</table><br />'; echo '</form>'; // End of account selection @@ -213,7 +213,7 @@ echo '<input type="hidden" name="SelectedAccount" value='.$SelectedAccount.'>'; echo '<script>defaultControl(document.form.1next);</script>'; - echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; + echo '<br /><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/InventoryQuantities.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -146,7 +146,7 @@ echo '<div class="page_help_text">' . _('Use this report to display the quantity of Inventory items in different categories.') . '</div><br />'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"><tr><td>'; echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRP.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -13,8 +13,8 @@ } // MRP - Create levels table based on bom - echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; - echo '</br>' . _('Initialising tables .....') . '</br>'; + echo '<br />' ._('Start time') . ': ' . date('h:i:s') . '<br />'; + echo '<br />' . _('Initialising tables .....') . '<br />'; flush(); $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); $result = DB_query("DROP TABLE IF EXISTS passbom",$db); @@ -59,7 +59,7 @@ FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); - //echo "</br>sql is $sql</br>"; + //echo "<br />sql is $sql<br />"; // This while routine finds the other levels as long as $compctr - the // component counter - finds there are more components that are used as // assemblies at lower levels @@ -584,7 +584,7 @@ echo '<td><input type="checkbox" name="pansizeflag" value="y" checked></td></tr>'; echo '<tr><td>' ._('Use Shrinkage?') . ':</td>'; echo '<td><input type="checkbox" name="shrinkageflag" value="y" checked></td></tr>'; - echo '</table></td></tr></table><div class="centre"></br></br><input type="submit" name="submit" value="' . _('Run MRP') . '"></div>'; + echo '</table></td></tr></table><div class="centre"><br /><br /><input type="submit" name="submit" value="' . _('Run MRP') . '"></div>'; echo '</form>'; } // End of Main program logic ------------------------------------------------------- @@ -594,7 +594,7 @@ // Create an array of mrprequirements and an array of mrpsupplies, then read through // them seeing if all requirements are covered by supplies. Create a planned order // for any unmet requirements. Change dates if necessary for the supplies. - //echo '</br>Part is ' . "$part" . '</br>'; + //echo '<br />Part is ' . "$part" . '<br />'; // Get decimal places from stockmaster for rounding of shrinkage factor $sql = "SELECT decimalplaces FROM stockmaster WHERE stockid = '" . $part . "'"; Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPCalendar.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -210,7 +210,7 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo '</br><table class="selection"> + echo '<br /><table class="selection"> <tr bgcolor ="#800000"> <th>' . _('Date') . '</th> <th>' . _('Manufacturing Date') . '</th> @@ -231,7 +231,7 @@ } //END WHILE LIST LOOP echo '</table>'; - echo '</br></br>'; + echo '<br /><br />'; unset ($ChangeDate); display($db,$ChangeDate); Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPCreateDemands.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -61,7 +61,7 @@ " . $WhereLocation . " " . $WhereCategory . " GROUP BY salesorderdetails.stkcode"; -//echo "</br>$sql</br>"; +//echo "<br />$sql<br />"; $result = DB_query($sql,$db); // To get the quantity per period, get the whole number amount of the total quantity divided // by the number of periods and also get the remainder from that calculation. Put the whole Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPPlannedWorkOrders.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -315,7 +315,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class="selection">'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Consolidation') . ':</td><td><select name="Consolidation">'; Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPReschedules.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -124,7 +124,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/PricesByCost.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -227,7 +227,7 @@ } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br />'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $SQL = "SELECT categoryid, categorydescription @@ -280,7 +280,7 @@ DB_data_seek($result, 0); echo '</select></td></tr>'; echo '</table> - </br><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; + <br /><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; } /*end of else not submit */ include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/ReorderLevel.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -161,7 +161,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . _('Inventory Reorder Level Report') . '</p>'; echo '<div class="page_help_text">' . _('Use this report to display the reorder levels for Inventory items in different categories.') . '</div><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; + echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, locationname Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/ReorderLevelLocation.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -162,7 +162,7 @@ echo '<div class="page_help_text">' . _('Use this report to display the reorder levels for Inventory items in different categories.') . '</div><br />'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, locationname @@ -203,7 +203,7 @@ echo '<option value="2">'. _('Code') . '</option>'; echo '</select></td></tr>'; - echo '</table></br><p><div class="centre"><input type=submit name="submit" value="' . _('Submit') . '"></div></p>'; + echo '</table><br /><p><div class="centre"><input type=submit name="submit" value="' . _('Submit') . '"></div></p>'; } /*end of else not submit */ include('includes/footer.inc'); Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/StockTransfers.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -424,7 +424,7 @@ $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'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; + echo '<br /><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2011-07-05 10:36:13 UTC (rev 4624) @@ -35232,7 +35232,7 @@ #: includes/DefineLabelClass.php:40 msgid "Max text<br />length" -msgstr "Maximale</br>Textlänge" +msgstr "Maximale<br />Textlänge" #: includes/DefineLabelClass.php:41 msgid "Font size" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-05 10:36:20
|
Revision: 4624 http://web-erp.svn.sourceforge.net/web-erp/?rev=4624&view=rev Author: daintree Date: 2011-07-05 10:36:13 +0000 (Tue, 05 Jul 2011) Log Message: ----------- </br> changed to <br /> Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/GLBudgets.php trunk/InventoryQuantities.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPPlannedWorkOrders.php trunk/MRPReschedules.php trunk/PricesByCost.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/StockTransfers.php trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/BOMExtendedQty.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -82,7 +82,7 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - //echo "</br>sql is $sql</br>"; + //echo "<br />sql is $sql<br />"; // This while routine finds the other levels as long as $ComponentCounter - the // component counter finds there are more components that are used as // assemblies at lower levels @@ -258,7 +258,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ':</td> <td><input type ="text" name="Part" size="20">'; @@ -276,8 +276,8 @@ <option value="no">' . _('Plain Print') . '</option> </select></td></tr>'; echo '</table> - </br> - </br> + <br /> + <br /> <div class="centre"> <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"> </div>'; Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/BOMIndented.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -79,7 +79,7 @@ AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - //echo "</br>sql is $sql</br>"; + //echo "<br />sql is $sql<br />"; // This while routine finds the other levels as long as $ComponentCounter - the // component counter - finds there are more components that are used as // assemblies at lower levels @@ -245,8 +245,8 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br> - </br> + echo '<br /> + <br /> <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/BOMIndentedReverse.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -234,8 +234,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br> - </br> + echo '<br /> + <br /> <form action=' . $_SERVER['PHP_SELF'] . ' method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/GLBudgets.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -30,7 +30,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; -echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' +echo '<br /><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; $SQL = "SELECT accountcode, @@ -68,7 +68,7 @@ echo '<br /><table><tr><td><input type="submit" name="Previous" value="' . _('Prev Account') . '"></td>'; echo '<td><input type="submit" name="Select" value="' . _('Select Account') . '"></td>'; echo '<td><input type="submit" name="Next" value="' . _('Next Account') . '"></td></tr>'; -echo '</table></br>'; +echo '</table><br />'; echo '</form>'; // End of account selection @@ -213,7 +213,7 @@ echo '<input type="hidden" name="SelectedAccount" value='.$SelectedAccount.'>'; echo '<script>defaultControl(document.form.1next);</script>'; - echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; + echo '<br /><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/InventoryQuantities.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -146,7 +146,7 @@ echo '<div class="page_help_text">' . _('Use this report to display the quantity of Inventory items in different categories.') . '</div><br />'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"><tr><td>'; echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRP.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -13,8 +13,8 @@ } // MRP - Create levels table based on bom - echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; - echo '</br>' . _('Initialising tables .....') . '</br>'; + echo '<br />' ._('Start time') . ': ' . date('h:i:s') . '<br />'; + echo '<br />' . _('Initialising tables .....') . '<br />'; flush(); $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); $result = DB_query("DROP TABLE IF EXISTS passbom",$db); @@ -59,7 +59,7 @@ FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); - //echo "</br>sql is $sql</br>"; + //echo "<br />sql is $sql<br />"; // This while routine finds the other levels as long as $compctr - the // component counter - finds there are more components that are used as // assemblies at lower levels @@ -584,7 +584,7 @@ echo '<td><input type="checkbox" name="pansizeflag" value="y" checked></td></tr>'; echo '<tr><td>' ._('Use Shrinkage?') . ':</td>'; echo '<td><input type="checkbox" name="shrinkageflag" value="y" checked></td></tr>'; - echo '</table></td></tr></table><div class="centre"></br></br><input type="submit" name="submit" value="' . _('Run MRP') . '"></div>'; + echo '</table></td></tr></table><div class="centre"><br /><br /><input type="submit" name="submit" value="' . _('Run MRP') . '"></div>'; echo '</form>'; } // End of Main program logic ------------------------------------------------------- @@ -594,7 +594,7 @@ // Create an array of mrprequirements and an array of mrpsupplies, then read through // them seeing if all requirements are covered by supplies. Create a planned order // for any unmet requirements. Change dates if necessary for the supplies. - //echo '</br>Part is ' . "$part" . '</br>'; + //echo '<br />Part is ' . "$part" . '<br />'; // Get decimal places from stockmaster for rounding of shrinkage factor $sql = "SELECT decimalplaces FROM stockmaster WHERE stockid = '" . $part . "'"; Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPCalendar.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -210,7 +210,7 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo '</br><table class="selection"> + echo '<br /><table class="selection"> <tr bgcolor ="#800000"> <th>' . _('Date') . '</th> <th>' . _('Manufacturing Date') . '</th> @@ -231,7 +231,7 @@ } //END WHILE LIST LOOP echo '</table>'; - echo '</br></br>'; + echo '<br /><br />'; unset ($ChangeDate); display($db,$ChangeDate); Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPCreateDemands.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -61,7 +61,7 @@ " . $WhereLocation . " " . $WhereCategory . " GROUP BY salesorderdetails.stkcode"; -//echo "</br>$sql</br>"; +//echo "<br />$sql<br />"; $result = DB_query($sql,$db); // To get the quantity per period, get the whole number amount of the total quantity divided // by the number of periods and also get the remainder from that calculation. Put the whole Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPPlannedWorkOrders.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -315,7 +315,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class="selection">'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Consolidation') . ':</td><td><select name="Consolidation">'; Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/MRPReschedules.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -124,7 +124,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/PricesByCost.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -227,7 +227,7 @@ } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br />'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $SQL = "SELECT categoryid, categorydescription @@ -280,7 +280,7 @@ DB_data_seek($result, 0); echo '</select></td></tr>'; echo '</table> - </br><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; + <br /><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; } /*end of else not submit */ include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/ReorderLevel.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -161,7 +161,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . _('Inventory Reorder Level Report') . '</p>'; echo '<div class="page_help_text">' . _('Use this report to display the reorder levels for Inventory items in different categories.') . '</div><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; + echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, locationname Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/ReorderLevelLocation.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -162,7 +162,7 @@ echo '<div class="page_help_text">' . _('Use this report to display the reorder levels for Inventory items in different categories.') . '</div><br />'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; + echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, locationname @@ -203,7 +203,7 @@ echo '<option value="2">'. _('Code') . '</option>'; echo '</select></td></tr>'; - echo '</table></br><p><div class="centre"><input type=submit name="submit" value="' . _('Submit') . '"></div></p>'; + echo '</table><br /><p><div class="centre"><input type=submit name="submit" value="' . _('Submit') . '"></div></p>'; } /*end of else not submit */ include('includes/footer.inc'); Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/StockTransfers.php 2011-07-05 10:36:13 UTC (rev 4624) @@ -424,7 +424,7 @@ $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'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; + echo '<br /><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2011-07-05 10:27:25 UTC (rev 4623) +++ trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po 2011-07-05 10:36:13 UTC (rev 4624) @@ -35232,7 +35232,7 @@ #: includes/DefineLabelClass.php:40 msgid "Max text<br />length" -msgstr "Maximale</br>Textlänge" +msgstr "Maximale<br />Textlänge" #: includes/DefineLabelClass.php:41 msgid "Font size" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-06 09:30:53
|
Revision: 4625 http://web-erp.svn.sourceforge.net/web-erp/?rev=4625&view=rev Author: daintree Date: 2011-07-06 09:30:42 +0000 (Wed, 06 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/GeocodeSetup.php trunk/GetStockImage.php trunk/MRPShortages.php trunk/PDFStockTransfer.php trunk/ShipmentCosting.php trunk/Z_CheckDebtorsControl.php trunk/api/api_session.inc trunk/api/api_xml-rpc.php trunk/doc/Change.log trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/session.inc trunk/index.php trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GeocodeSetup.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -29,14 +29,14 @@ //first off validate inputs are sensible $sql="SELECT count(geocodeid) - FROM geocode_param WHERE geocodeid='".$_POST['geocodeid']."'"; + FROM geocode_param WHERE geocodeid='".$_POST['GeoCodeID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]!=0 and !isset($SelectedParam)) { $InputError = 1; prnMsg( _('That geocode ID already exists in the database'),'error'); - $Errors[$i] = 'geocodeid'; + $Errors[$i] = 'GeoCodeID'; $i++; } @@ -46,14 +46,14 @@ /*SelectedParam could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - if (isset($_POST['geocode_key']) and isset($_POST['geocode_key']) ){ + if (isset($_POST['GeoCode_Key']) and isset($_POST['GeoCode_Key']) ){ $sql = "UPDATE geocode_param SET - geocode_key='" . $_POST['geocode_key'] . "', - center_long='" . $_POST['center_long'] . "', - center_lat='" . $_POST['center_lat'] . "', - map_height='" . $_POST['map_height'] . "', - map_width='" . $_POST['map_width'] . "', - map_host='" . $_POST['map_host'] . "' + geocode_key='" . $_POST['GeoCode_Key'] . "', + center_long='" . $_POST['Center_Long'] . "', + center_lat='" . $_POST['Center_Lat'] . "', + map_height='" . $_POST['Map_Height'] . "', + map_width='" . $_POST['Map_Width'] . "', + map_host='" . $_POST['Map_Host'] . "' WHERE geocodeid = '" . $SelectedParam . "'"; } $msg = _('The geocode status record has been updated'); @@ -62,48 +62,42 @@ /*Selected Param is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new status code form */ - if (isset($_POST['geocode_key']) and $_POST['geocode_key']>0){ + if (isset($_POST['GeoCode_Key']) and $_POST['GeoCode_Key']>0){ - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES (" . " - '', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . "' - )"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } else { - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES ( - '" . $_POST['geocodeid'] . "', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . " - ')"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('" . $_POST['GeoCodeID'] . "', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } $msg = _('A new geocode status record has been inserted'); unset ($SelectedParam); - unset ($_POST['geocode_key']); + unset ($_POST['GeoCode_Key']); } //run the SQL from either of the above possibilites $result = DB_query($sql,$db); @@ -128,7 +122,14 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = "SELECT geocodeid, geocode_key, center_long, center_lat, map_height, map_width, map_host FROM geocode_param"; + $sql = "SELECT geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param"; $result = DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="" />'. @@ -137,17 +138,19 @@ '<a href="http://code.google.com/apis/maps/signup.html" target="_blank"> http://code.google.com/apis/maps/signup.html</a></b>'; echo '<div class="centre"><p>'. _('Find the lat/long for your map center point at ') . '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; - echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br />'; + prnMsg(_('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)'),'info'); + echo '</div><br />'; echo '<table border=1>'; echo '<tr> - <th>'. _('Geocode ID') .'</th> - <th>'. _('Geocode Key') .'</th> - <th>'. _('Center Longitude') .'</th> - <th>'. _('Center Latitude') .'</th> - <th>'. _('Map height (px)') .'</th> - <th>'. _('Map width (px)') .'</th> - <th>'. _('Map host') .'</th>'; + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') . '</th> + <th>'. _('Center Latitude') . '</th> + <th>'. _('Map height (px)') . '</th> + <th>'. _('Map width (px)') . '</th> + <th>'. _('Map host') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -161,27 +164,27 @@ } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> - <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> - </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], - $_SERVER['PHP_SELF'], - $myrow[0], - $_SERVER['PHP_SELF'], - $myrow[0], - $myrow[0]); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $myrow[3], + $myrow[4], + $myrow[5], + $myrow[6], + $_SERVER['PHP_SELF'], + $myrow[0], + $_SERVER['PHP_SELF'], + $myrow[0], + $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -201,70 +204,72 @@ //editing an existing status code $sql = "SELECT geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host - FROM geocode_param - WHERE geocodeid='" . $SelectedParam . "'"; + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param + WHERE geocodeid='" . $SelectedParam . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['geocodeid'] = $myrow['geocodeid']; - $_POST['geocode_key'] = $myrow['geocode_key']; - $_POST['center_long'] = $myrow['center_long']; - $_POST['center_lat'] = $myrow['center_lat']; - $_POST['map_height'] = $myrow['map_height']; - $_POST['map_width'] = $myrow['map_width']; - $_POST['map_host'] = $myrow['map_host']; + $_POST['GeoCodeID'] = $myrow['geocodeid']; + $_POST['GeoCode_Key'] = $myrow['geocode_key']; + $_POST['Center_Long'] = $myrow['center_long']; + $_POST['Center_Lat'] = $myrow['center_lat']; + $_POST['Map_Height'] = $myrow['map_height']; + $_POST['Map_Width'] = $myrow['map_width']; + $_POST['Map_Host'] = $myrow['map_host']; echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; - echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; + echo '<input type="hidden" name="GeoCodeID" value="' . $_POST['GeoCodeID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; echo '<table> <tr><td>'. _('Geocode Code') .':</td> - <td>' . $_POST['geocodeid'] . '</td></tr>'; + <td>' . $_POST['GeoCodeID'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered - if (!isset($_POST['geocodeid'])) { - $_POST['geocodeid'] = ''; + if (!isset($_POST['GeoCodeID'])) { + $_POST['GeoCodeID'] = ''; } echo '<table>'; // <tr> // <td>'. _('Geocode Code') .":</td> -// <td><input " . (in_array('geocodeid',$Errors) ? 'class="inputerror"' : '' ) . -// " tabindex=1 type='Text' name='geocodeid' VALUE='". $_POST['geocodeid'] ."' size=3 maxlength=2></td> +// <td><input " . (in_array('GeoCodeID',$Errors) ? 'class="inputerror"' : '' ) . +// " tabindex=1 type='Text' name='GeoCodeID' VALUE='". $_POST['GeoCodeID'] ."' size=3 maxlength=2></td> // </tr>"; } - if (!isset($_POST['geocode_key'])) { - $_POST['geocode_key'] = ''; + if (!isset($_POST['GeoCode_Key'])) { + $_POST['GeoCode_Key'] = ''; } echo '<br /><tr> <td>'. _('Geocode Key') .':</td> - <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + <td><input ' . (in_array('GeoCode_Key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="GeoCode_Key" value="'. $_POST['GeoCode_Key'] .'" size=28 maxlength=300> </td></tr> <tr><td>'. _('Geocode Center Long') . '</td> - <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=3 type="text" name="Center_Long" value="'. $_POST['Center_Long'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Center Lat') . '</td> - <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=4 type="text" name="Center_Lat" value="'. $_POST['Center_Lat'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Height') . '</td> - <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=5 type="text" name="Map_Height" value="'. $_POST['Map_Height'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Width') . '</td> - <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=6 type="text" name="Map_Width" value="'. $_POST['Map_Width'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Host') . '</td> - <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + <td><input tabindex=7 type="text" name="Map_Host" value="'. $_POST['Map_Host'] .'" size=20 maxlength=300></td></tr> </table> - <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br /><br /> + <div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"</div> + <br /> + <br /> </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br />'; Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GetStockImage.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -20,33 +20,33 @@ */ // Color decode function -function DecodeBgColor( $colorstr ) { - if ( $colorstr[0] == '#' ) { - $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr)); +function DecodeBgColor( $ColourStr ) { + if ( $ColourStr[0] == '#' ) { + $ColourStr = mb_substr($ColourStr,1,mb_strlen($ColourStr)); } - $red = 0; - if(mb_strlen($colorstr) > 1) { - $red = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Red = 0; + if(mb_strlen($ColourStr) > 1) { + $Red = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $green = 0; - if(mb_strlen($colorstr) > 1) { - $green = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Green = 0; + if(mb_strlen($ColourStr) > 1) { + $Green = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $blue = 0; - if(mb_strlen($colorstr) > 1) { - $blue = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Blue = 0; + if(mb_strlen($ColourStr) > 1) { + $Blue = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if(mb_strlen($colorstr) > 1) { - $alpha = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + if(mb_strlen($ColourStr) > 1) { + $Alpha = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if ( isset($alpha) ) - return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha ); + if ( isset($Alpha) ) + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue, 'alpha' => $Alpha ); else - return array('red' => $red, 'green' => $green, 'blue' => $blue ); + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue ); } if (!function_exists('imagecreatefrompng')){ @@ -56,7 +56,7 @@ include('includes/footer.inc'); exit; } -$defaultimage = 'webERPsmall.png'; +$DefaultImage = 'webERPsmall.png'; // FOR APACHE if ( $_SERVER['PATH_TRANSLATED'][0] == '/' OR $_SERVER['PATH_TRANSLATED'][0]=='') { @@ -66,13 +66,13 @@ //Windows $pathsep = "\\"; } -$filepath = $_SESSION['part_pics_dir'] . $pathsep; +$FilePath = $_SESSION['part_pics_dir'] . $pathsep; -$stockid = trim(mb_strtoupper($_GET['StockID'])); +$StockID = trim(mb_strtoupper($_GET['StockID'])); if( isset($_GET['bgcolor']) ) - $bgcolor = $_GET['bgcolor']; + $BackgroundColour = $_GET['bgcolor']; if( isset($_GET['textcolor']) ) - $textcolor = $_GET['textcolor']; + $TextColour = $_GET['textcolor']; if( isset($_GET['width']) ) $width = $_GET['width']; if( isset($_GET['height']) ) @@ -89,7 +89,7 @@ } if( isset($_GET['transcolor'])) { $doTrans = true; - $transcolor = $_GET['transcolor']; + $TranspColour = $_GET['transcolor']; } if( isset($_GET['bevel']) ) { $bevel = $_GET['bevel']; @@ -111,17 +111,17 @@ // Extension requirements and Stock ID Isolation -if($stockid == '') { - $stockid = $defaultimage; +if($StockID == '') { + $StockID = $DefaultImage; $blanktext = true; } -$i = strrpos($stockid,'.'); +$i = strrpos($StockID,'.'); if( $i === false ) $type = 'png'; else { - $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid))); - $stockid = mb_substr($stockid,0,$i); + $type = strtolower(mb_substr($StockID,$i+1,mb_strlen($StockID))); + $StockID = mb_substr($StockID,0,$i); if($blanktext && !isset($text)) $text = ''; } @@ -132,22 +132,22 @@ $functype = 'jpeg'; } -$tmpfilename = $filepath.$stockid; +$tmpFileName = $FilePath.$StockID; // First check for an image this is not the type requested -if ( file_exists($tmpfilename.'.jpg') ) { - $filename = $stockid.'.jpg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.jpeg')) { - $filename = $stockid.'.jpeg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.png')) { - $filename = $stockid.'.png'; - $isjpeg = false; +if ( file_exists($tmpFileName.'.jpg') ) { + $FileName = $StockID.'.jpg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.jpeg')) { + $FileName = $StockID.'.jpeg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.png')) { + $FileName = $StockID.'.png'; + $IsJpeg = false; } else { - $filename = $defaultimage; - $isjpeg = $defaultisjpeg; + $FileName = $DefaultImage; + $IsJpeg = $DefaultIsJpeg; } -if( !$automake && !isset($filename) ) { +if( !$automake && !isset($FileName) ) { $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); prnMsg( _('The Image could not be retrieved because it does not exist'), 'error'); @@ -159,9 +159,9 @@ /* $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); - echo 'The image ' . $filename . ' using functype ' . $functype - . '<br /> The tmpfilename = ' . $tmpfilename . '<br /> The temppath = ' . $filepath . '<br />The stockid = ' . $stockid . '<br /> filepath . stockid .jpg = ' . $filepath . $stockid .'.jpg<br /> The result of file_exists($filepath . $stockid .jpg) =' . file_exists($filepath . $stockid .'.jpg') - . '<br />filepath = ' . $filepath + echo 'The image ' . $FileName . ' using functype ' . $functype + . '<br /> The tmpFileName = ' . $tmpFileName . '<br /> The temppath = ' . $FilePath . '<br />The stockid = ' . $StockID . '<br /> filepath . stockid .jpg = ' . $FilePath . $StockID .'.jpg<br /> The result of file_exists($FilePath . $StockID .jpg) =' . file_exists($FilePath . $StockID .'.jpg') + . '<br />filepath = ' . $FilePath . '<br />rootpath = ' . $rootpath; include('includes/footer.inc'); exit; @@ -170,7 +170,7 @@ // See if we need to automake this image -if( $automake && !isset($filename) || $useblank ) { +if( $automake && !isset($FileName) || $useblank ) { // Have we got height and width specs if( !isset($width) ) $width = 64; @@ -178,39 +178,39 @@ $height = 64; // Have we got a background color $im = imagecreate($width, $height); - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -223,7 +223,7 @@ } if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -237,35 +237,35 @@ } } else { - $tmpfilename = $filepath.$filename; - if( $isjpeg ) { - $im = imagecreatefromjpeg($tmpfilename); + $tmpFileName = $FilePath.$FileName; + if( $IsJpeg ) { + $im = imagecreatefromjpeg($tmpFileName); } else { - $im = imagecreatefrompng($tmpfilename); + $im = imagecreatefrompng($tmpFileName); } // Have we got a background color - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } $sw = imagesx($im); $sh = imagesy($im); @@ -281,32 +281,32 @@ $im = $tmpim; unset($tmpim); - if( !isset($bgcolor['alpha']) ) { + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } - if( !isset($textcolor['alpha']) ) { + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } //imagealphablending ( $im, false); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -322,7 +322,7 @@ // $ixtextbgcolor = imagecolorallocatealpha($im, // 0,0,0,0); if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -348,7 +348,7 @@ imageline($im, imagesx($im)-1,0,imagesx($im)-1, imagesy($im)-1, $silver); // right } // Set up headers -header('Content-Disposition: filename='.$stockid.'.'.$type); +header('Content-Disposition: filename='.$StockID.'.'.$type); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-type: image/'.$style); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/MRPShortages.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -260,15 +260,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - 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'] . '" />'; echo '<table class=selection>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Category') . ':</td><td><select name="CategoryID">'; - echo '<option selected value="All">' . _('All Stock Categories'); + echo '<option selected value="All">' . _('All Stock Categories') .'</option>'; $sql = 'SELECT categoryid, - categorydescription - FROM stockcategory'; + categorydescription + FROM stockcategory"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/PDFStockTransfer.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -2,6 +2,8 @@ /* $Id$*/ +/* This script is superseded by the PDFStockLocTransfer.php which produces a multiple item stock transfer listing - this was for the old individual stock transfers where there is just single items being transferred */ + include('includes/session.inc'); if (!isset($_GET['TransferNo'])){ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/ShipmentCosting.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -25,15 +25,15 @@ } $ShipmentHeaderSQL = "SELECT shipments.supplierid, - suppliers.suppname, - shipments.eta, - suppliers.currcode, - shipments.vessel, - shipments.voyageref, - shipments.closed - FROM shipments INNER JOIN suppliers - ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; + suppliers.suppname, + shipments.eta, + suppliers.currcode, + shipments.vessel, + shipments.voyageref, + shipments.closed + FROM shipments INNER JOIN suppliers + ON shipments.supplierid = suppliers.supplierid + WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); @@ -46,7 +46,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; -echo '<table class=selection>'; +echo '<table class="selection">'; echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> @@ -140,15 +140,17 @@ 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>'; - $TableHeader = '<tr> <th>'. _('Item'). '</th> - <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> - <th>'. _('Quantity'). '<br />'. _('Received'). '</th> - <th>'. _('Invoiced'). '<br />'. _('Charges'). '</th> - <th>'. _('Shipment'). '<br />'. _('Charges'). '</th> - <th>'. _('Shipment'). '<br />'. _('Cost'). '</th> - <th>'. _('Standard'). '<br />'. _('Cost'). '</th> - <th>'. _('Variance'). '</th> - <th>%</th></tr>'; + $TableHeader = '<tr> + <th>'. _('Item'). '</th> + <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> + <th>'. _('Quantity'). '<br />'. _('Received'). '</th> + <th>'. _('Invoiced'). '<br />'. _('Charges'). '</th> + <th>'. _('Shipment'). '<br />'. _('Charges'). '</th> + <th>'. _('Shipment'). '<br />'. _('Cost'). '</th> + <th>'. _('Standard'). '<br />'. _('Cost'). '</th> + <th>'. _('Variance'). '</th> + <th>%</th> + </tr>'; echo $TableHeader; /*show the line items on the shipment with the value invoiced and shipt cost */ @@ -618,17 +620,18 @@ if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c - echo '<div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + echo '<div class="centre"> + <form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($_SESSION['WeightedAverageCosting']==0){ /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected value="Yes">'. _('Yes') . '</option> - <option value="No">'. _('No') . '</option> + <option selected value="Yes">'. _('Yes') . '</option> + <option value="No">'. _('No') . '</option> </select>'; } - echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; + echo '<br /><br /><input type=submit name="Close" value="'. _('Confirm OK to Close'). '">'; echo '</form></div>'; } Modified: trunk/Z_CheckDebtorsControl.php =================================================================== --- trunk/Z_CheckDebtorsControl.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/Z_CheckDebtorsControl.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -88,13 +88,12 @@ $GLOpening = $invTotal = $RecTotal = $GLClosing = $CalcTotal = $DiffTotal = 0; $j=0; - while ( $CurPeriod <= $_POST['ToPeriod'] ) - { + while ( $CurPeriod <= $_POST['ToPeriod'] ) { $SQL = "SELECT bfwd, - actual - FROM chartdetails - WHERE period = " . $CurPeriod . " - AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; + actual + FROM chartdetails + WHERE period = " . $CurPeriod . " + AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; $dtResult = DB_query($SQL,$db); $dtRow = DB_fetch_array($dtResult); DB_free_result($dtResult); @@ -165,7 +164,6 @@ echo '</table></form>'; } -echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -40,7 +40,7 @@ $_SESSION['AttemptsCounter'] = 0; } -if ($_SESSION['HTTPS_Only']==1){ +if (isset($_SESSION['HTTPS_Only']) AND $_SESSION['HTTPS_Only']==1){ if ($_SERVER['HTTPS']!='on'){ prnMsg(_('webERP is configured to allow only secure socket connections. Pages must be called with https://') . ' .....','error'); exit; @@ -51,8 +51,7 @@ // value must be set in the script before header.inc is included. $SecurityGroups is an array of // arrays defining access for each group of users. These definitions can be modified by a system admin under setup - -if (!is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { +if (isset($_SESSION['AllowedPageSecurityTokens']) AND !is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { /* NO HTML output - but may need an XMLRPC style error message here. Lindsay: 12Jan10 $title = _('Account Error Report'); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_xml-rpc.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1043,7 +1043,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); $Description = _('This function is used to insert a new Sales Credit to the webERP database.'); $Parameter[0]['name'] = _('Credit Details'); $Parameter[0]['description'] = _('An array of index/value items describing the credit. All values must be negative.'); @@ -1212,7 +1212,8 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); $Parameter[0]['name'] = _('Account Details'); $Parameter[0]['description'] = _('An array of index/value items describing the GL Account and fields to set.'); $Parameter[1]['name'] = _('User name'); @@ -1242,6 +1243,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Section Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account section to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1271,6 +1275,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Group Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account group to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1299,7 +1306,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $Description = _('This function returns a list of stock location ids.'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); @@ -1507,6 +1514,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Sales Area Details'); $Parameter[0]['description'] = _('An array of index/value items describing the sales area to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1626,6 +1636,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Salesman Details'); $Parameter[0]['description'] = _('An array of index/value items describing the salesman to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1773,6 +1786,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1802,6 +1818,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to modify.'); $Parameter[1]['name'] = _('User name'); @@ -1889,6 +1908,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Field Name'); $Parameter[0]['description'] = _('The field name to search on.'); $Parameter[1]['name'] = _('Match Criteria'); @@ -1922,6 +1944,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Label Name'); $Parameter[0]['description'] = _('The category label to search on.'); $Parameter[1]['name'] = _('Match Criteria'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,6 @@ webERP Change Log +5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper 3/7/11 Phil: changed all substr to mb_substr Modified: trunk/geo_displaymap_customers.php =================================================================== --- trunk/geo_displaymap_customers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_customers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Customer Branches Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_customers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/geo_displaymap_suppliers.php =================================================================== --- trunk/geo_displaymap_suppliers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_suppliers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Supplier Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_suppliers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/includes/session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -291,7 +291,8 @@ echo '</td> </tr> </table> - </td>'; + </td> + </tr>'; include($PathPrefix . 'includes/footer.inc'); exit; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/index.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -714,7 +714,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockLocTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,4 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2005 Logic Works Ltd # This file is distributed under the GPL # FIRST AUTHOR <xlyz> .2004/2005 # @@ -7,9 +6,9 @@ msgstr "" "Project-Id-Version: Weberp\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-02 20:11+1200\n" -"PO-Revision-Date: 2011-03-04 18:03+0000\n" -"Last-Translator: Martino Barbon <Unknown>\n" +"POT-Creation-Date: 2011-05-30 20:51+1200\n" +"PO-Revision-Date: 2011-07-05 12:26+0100\n" +"Last-Translator: Gioacchino Cipriano <gio...@gm...>\n" "Language-Team: italian <none>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,31 +17,25 @@ "X-Generator: Launchpad (build 12696)\n" "Language: \n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 +#: index.php:1296 msgid "Account Groups" msgstr "Gestione dei conti" #: AccountGroups.php:17 -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "" -"È verificato un errore durante il recupero dei gruppi conto del gruppo di " -"conto genitore durante il controllo per la ricorsione" +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "È verificato un errore durante il recupero dei gruppi conto del gruppo di conto genitore durante il controllo per la ricorsione" #: AccountGroups.php:18 -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "" -"Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di " -"account principale e che ha fallito nel processo è stato" +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di account principale e che ha fallito nel processo è stato" -#: AccountGroups.php:55 AccountGroups.php:92 AccountGroups.php:176 -#: AccountGroups.php:186 +#: AccountGroups.php:55 +#: AccountGroups.php:92 +#: AccountGroups.php:175 +#: AccountGroups.php:185 msgid "The SQL that was used to retrieve the information was" -msgstr "" -"Il SQL che è stato utilizzato per recuperare le informazioni sono state" +msgstr "Il SQL che è stato utilizzato per recuperare le informazioni sono state" #: AccountGroups.php:56 msgid "Could not check whether the group exists because" @@ -54,415 +47,774 @@ #: AccountGroups.php:69 msgid "The account group name cannot contain the character" -msgstr "Il nome del conto non può contenere il carattere" +msgstr "Il nome del conto non può contenere il carattere" -#: AccountGroups.php:69 TaxCategories.php:31 TaxProvinces.php:30 +#: AccountGroups.php:69 +#: TaxCategories.php:31 +#: TaxProvinces.php:30 #: UnitsOfMeasure.php:30 msgid "or the character" msgstr "o il carattere" #: AccountGroups.php:75 msgid "The account group name must be at least one character long" -msgstr "Il nome del gruppo account deve essere almeno un carattere a lungo" +msgstr "Il nome del gruppo account deve essere lungo almeno un carattere" #: AccountGroups.php:82 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" -"Il gruppo di account principale selezionato sembra comportare una struttura " -"ricorsiva conto - selezionare un'alternativa gruppo di account " -"principale o fanno di questo gruppo un gruppo di alto livello di account" +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "Il gruppo di account principale selezionato sembra comportare una struttura ricorsiva conto - selezionare un'alternativa gruppo di account principale o fanno di questo gruppo un gruppo di alto livello di account" #: AccountGroups.php:93 msgid "Could not check whether the group is recursive because" msgstr "Impossibile verificare se il gruppo è ricorsivo perché" -#: AccountGroups.php:101 -msgid "" -"Since this account group is a child group, the sequence in the trial " -"balance, the section in the accounts and whether or not the account group " -"appears in the balance sheet or profit and loss account are all properties " -"inherited from the parent account group. Any changes made to these fields " -"will have no effect." -msgstr "" - -#: AccountGroups.php:106 +#: AccountGroups.php:105 msgid "The section in accounts must be an integer" msgstr "Il codice del gruppo di conti deve essere un numero intero" -#: AccountGroups.php:112 +#: AccountGroups.php:111 msgid "The sequence in the trial balance must be an integer" -msgstr "" -"Il numero che indica la posizione nel bilancio deve essere un numero intero" +msgstr "Il numero che indica la posizione nel bilancio deve essere un numero intero" -#: AccountGroups.php:118 +#: AccountGroups.php:117 msgid "The sequence in the TB must be numeric and less than" msgstr "La sequenza della TB deve essere numerico e meno" -#: AccountGroups.php:135 +#: AccountGroups.php:134 msgid "An error occurred in updating the account group" -msgstr "È verificato un errore nell'aggiornamento del gruppo di account" +msgstr "Si è verificato un errore nell'aggiornamento del gruppo di account" -#: AccountGroups.php:136 +#: AccountGroups.php:135 msgid "The SQL that was used to update the account group was" -msgstr "" -"Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" +msgstr "Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" -#: AccountGroups.php:138 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:137 +#: AccountSections.php:104 +#: PaymentMethods.php:82 msgid "Record Updated" msgstr "Record aggiornato" -#: AccountGroups.php:156 +#: AccountGroups.php:155 msgid "An error occurred in inserting the account group" msgstr "È verificato un errore nel mettere il gruppo di account" -#: AccountGroups.php:157 +#: AccountGroups.php:156 msgid "The SQL that was used to insert the account group was" -msgstr "" -"L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" -#: AccountGroups.php:158 AccountSections.php:116 PaymentMethods.php:106 +#: AccountGroups.php:157 +#: AccountSections.php:116 +#: PaymentMethods.php:106 msgid "Record inserted" msgstr "Record inserito" -#: AccountGroups.php:175 +#: AccountGroups.php:174 msgid "An error occurred in retrieving the group information from chartmaster" -msgstr "" -"È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +msgstr "È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +#: AccountGroups.php:179 +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "Impossibile eliminare questo gruppo di conti, perché ci sono conti di contabilità generale che sono stati creati utilizzando questo gruppo" + #: AccountGroups.php:180 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "" -"Non ĂŠ possibile cancellare questo conto perchĂŠ ci sono dei sottoconti che " -"vi fanno riferimento" - -#: AccountGroups.php:181 AccountGroups.php:191 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 -#: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 -#: CustomerBranches.php:316 Customers.php:312 Customers.php:321 -#: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:130 -#: GLAccounts.php:80 GLAccounts.php:94 Locations.php:244 Locations.php:252 -#: Locations.php:261 Locations.php:269 Locations.php:277 Locations.php:285 -#: Locations.php:293 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:140 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:152 SalesCategories.php:125 SalesCategories.php:133 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:475 Stocks.php:484 Stocks.php:492 Stocks.php:500 Stocks.php:508 -#: Stocks.php:516 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 -#: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 +#: AccountGroups.php:190 +#: AccountSections.php:137 +#: Areas.php:116 +#: Areas.php:125 +#: BankAccounts.php:157 +#: CreditStatus.php:125 +#: Currencies.php:143 +#: Currencies.php:151 +#: Currencies.php:158 +#: CustomerBranches.php:286 +#: CustomerBranches.php:296 +#: CustomerBranches.php:306 +#: CustomerBranches.php:316 +#: Customers.php:311 +#: Customers.php:320 +#: Customers.php:328 +#: Customers.php:336 +#: CustomerTypes.php:147 +#: CustomerTypes.php:157 +#: Factors.php:134 +#: FixedAssetCategories.php:130 +#: GLAccounts.php:80 +#: GLAccounts.php:94 +#: Locations.php:244 +#: Locations.php:252 +#: Locations.php:261 +#: Locations.php:269 +#: Locations.php:277 +#: Locations.php:285 +#: Locations.php:293 +#: Locations.php:301 +#: MRPDemandTypes.php:87 +#: PaymentMethods.php:140 +#: PaymentTerms.php:147 +#: PaymentTerms.php:154 +#: PcExpenses.php:152 +#: SalesCategories.php:125 +#: SalesCategories.php:133 +#: SalesPeople.php:144 +#: SalesPeople.php:151 +#: SalesTypes.php:145 +#: SalesTypes.php:155 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:179 +#: Stocks.php:475 +#: Stocks.php:484 +#: Stocks.php:492 +#: Stocks.php:500 +#: Stocks.php:508 +#: Stocks.php:516 +#: Suppliers.php:609 +#: Suppliers.php:618 +#: Suppliers.php:626 +#: SupplierTypes.php:145 +#: TaxCategories.php:131 +#: TaxGroups.php:127 +#: TaxGroups.php:134 +#: TaxProvinces.php:125 +#: UnitsOfMeasure.php:138 +#: WorkCentres.php:89 +#: WorkCentres.php:95 +#: WWW_Access.php:83 msgid "There are" msgstr "Ci sono" -#: AccountGroups.php:181 +#: AccountGroups.php:180 msgid "general ledger accounts that refer to this account group" msgstr "sottoconti fanno riferimento a questo conto" -#: AccountGroups.php:185 +#: AccountGroups.php:184 msgid "An error occurred in retrieving the parent group information" -msgstr "" -"È verificato un errore di estrarre le informazioni del gruppo di genitore" +msgstr "È verificato un errore di estrarre le informazioni del gruppo di genitore" +#: AccountGroups.php:189 +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "Impossibile eliminare questo gruppo considerazione perché si tratta di un gruppo di account principale del gruppo di altri account" + #: AccountGroups.php:190 -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "" -"Impossibile eliminare questo gruppo considerazione perché si tratta di un " -"gruppo di account principale del gruppo di altri account (s)" - -#: AccountGroups.php:191 msgid "account groups that have this group as its/there parent account group" -msgstr "" -"gruppi di account che hanno questo gruppo come il suo / gruppo di " -"appartenenza ci conto" +msgstr "gruppi di account che hanno questo gruppo come il suo / gruppo di appartenenza ci conto" -#: AccountGroups.php:194 +#: AccountGroups.php:193 msgid "An error occurred in deleting the account group" -msgstr "" -"È verificato un errore durante l'eliminazione del gruppo di account" +msgstr "Si è verificato un errore durante l'eliminazione del gruppo di account" -#: AccountGroups.php:195 +#: AccountGroups.php:194 msgid "The SQL that was used to delete the account group was" -msgstr "" -"L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" -#: AccountGroups.php:197 +#: AccountGroups.php:196 msgid "group has been deleted" msgstr "e' stato cancellato" -#: AccountGroups.php:222 +#: AccountGroups.php:221 msgid "The sql that was used to retrieve the account group information was " -msgstr "" -"L'SQL che è stato utilizzato per recuperare le informazioni di account " -"di gruppo è stato " +msgstr "L'SQL che è stato utilizzato per recuperare le informazioni di account di gruppo è stato " -#: AccountGroups.php:223 +#: AccountGroups.php:222 msgid "Could not get account groups because" -msgstr "Non ĂŠ possibile estrarre il piano dei conti perchè" +msgstr "Non àŠ possibile estrarre il piano dei conti perchè" -#: AccountGroups.php:225 AccountSections.php:175 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:101 -#: AddCustomerTypeNotes.php:95 AgedDebtors.php:454 AgedSuppliers.php:268 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 -#: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 -#: BOMInquiry.php:171 BOMListing.php:112 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:1983 -#: CounterSales.php:2107 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:124 DiscountCategories.php:10 -#: DiscountCategories.php:128 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:238 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:374 InventoryPlanningPrefSupplier.php:474 -#: Labels.php:117 Labels.php:273 MRPReport.php:515 OutstandingGRNs.php:150 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:131 PDFStockLocTransfer.php:21 -#: PO_AuthorisationLevels.php:10 POReport.php:60 POReport.php:64 -#: POReport.php:68 PO_SelectOSPurchOrder.php:133 PricesBasedOnMarkUp.php:11 -#: Prices_Customer.php:39 Prices.php:30 PurchData.php:138 PurchData.php:249 -#: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 -#: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 -#: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 -#: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1463 -#: SelectOrderItems.php:1583 SelectProduct.php:485 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 -#: StockLocMovements.php:13 StockLocStatus.php:26 Suppliers.php:302 -#: SupplierTenders.php:260 SupplierTenders.php:317 SupplierTransInquiry.php:11 -#: TaxGroups.php:15 TaxProvinces.php:10 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:110 WorkCentres.php:157 -#: WorkOrderCosting.php:12 WorkOrderEntry.php:10 WorkOrderIssue.php:20 -#: WorkOrderReceive.php:13 WorkOrderStatus.php:41 WWW_Access.php:11 -#: WWW_Users.php:32 Z_BottomUpCosts.php:51 +#: AccountGroups.php:224 +#: AccountSections.php:175 +#: AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 +#: AddCustomerNotes.php:97 +#: AddCustomerTypeNotes.php:94 +#: AgedDebtors.php:454 +#: AgedSuppliers.php:277 +#: Areas.php:144 +#: AuditTrail.php:11 +#: BankReconciliation.php:13 +#: BOMExtendedQty.php:272 +#: BOMIndented.ph... [truncated message content] |
From: <dai...@us...> - 2011-07-06 09:30:55
|
Revision: 4625 http://web-erp.svn.sourceforge.net/web-erp/?rev=4625&view=rev Author: daintree Date: 2011-07-06 09:30:42 +0000 (Wed, 06 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/GeocodeSetup.php trunk/GetStockImage.php trunk/MRPShortages.php trunk/PDFStockTransfer.php trunk/ShipmentCosting.php trunk/Z_CheckDebtorsControl.php trunk/api/api_session.inc trunk/api/api_xml-rpc.php trunk/doc/Change.log trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/session.inc trunk/index.php trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GeocodeSetup.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -29,14 +29,14 @@ //first off validate inputs are sensible $sql="SELECT count(geocodeid) - FROM geocode_param WHERE geocodeid='".$_POST['geocodeid']."'"; + FROM geocode_param WHERE geocodeid='".$_POST['GeoCodeID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]!=0 and !isset($SelectedParam)) { $InputError = 1; prnMsg( _('That geocode ID already exists in the database'),'error'); - $Errors[$i] = 'geocodeid'; + $Errors[$i] = 'GeoCodeID'; $i++; } @@ -46,14 +46,14 @@ /*SelectedParam could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - if (isset($_POST['geocode_key']) and isset($_POST['geocode_key']) ){ + if (isset($_POST['GeoCode_Key']) and isset($_POST['GeoCode_Key']) ){ $sql = "UPDATE geocode_param SET - geocode_key='" . $_POST['geocode_key'] . "', - center_long='" . $_POST['center_long'] . "', - center_lat='" . $_POST['center_lat'] . "', - map_height='" . $_POST['map_height'] . "', - map_width='" . $_POST['map_width'] . "', - map_host='" . $_POST['map_host'] . "' + geocode_key='" . $_POST['GeoCode_Key'] . "', + center_long='" . $_POST['Center_Long'] . "', + center_lat='" . $_POST['Center_Lat'] . "', + map_height='" . $_POST['Map_Height'] . "', + map_width='" . $_POST['Map_Width'] . "', + map_host='" . $_POST['Map_Host'] . "' WHERE geocodeid = '" . $SelectedParam . "'"; } $msg = _('The geocode status record has been updated'); @@ -62,48 +62,42 @@ /*Selected Param is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new status code form */ - if (isset($_POST['geocode_key']) and $_POST['geocode_key']>0){ + if (isset($_POST['GeoCode_Key']) and $_POST['GeoCode_Key']>0){ - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES (" . " - '', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . "' - )"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } else { - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES ( - '" . $_POST['geocodeid'] . "', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . " - ')"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('" . $_POST['GeoCodeID'] . "', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } $msg = _('A new geocode status record has been inserted'); unset ($SelectedParam); - unset ($_POST['geocode_key']); + unset ($_POST['GeoCode_Key']); } //run the SQL from either of the above possibilites $result = DB_query($sql,$db); @@ -128,7 +122,14 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = "SELECT geocodeid, geocode_key, center_long, center_lat, map_height, map_width, map_host FROM geocode_param"; + $sql = "SELECT geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param"; $result = DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="" />'. @@ -137,17 +138,19 @@ '<a href="http://code.google.com/apis/maps/signup.html" target="_blank"> http://code.google.com/apis/maps/signup.html</a></b>'; echo '<div class="centre"><p>'. _('Find the lat/long for your map center point at ') . '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; - echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br />'; + prnMsg(_('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)'),'info'); + echo '</div><br />'; echo '<table border=1>'; echo '<tr> - <th>'. _('Geocode ID') .'</th> - <th>'. _('Geocode Key') .'</th> - <th>'. _('Center Longitude') .'</th> - <th>'. _('Center Latitude') .'</th> - <th>'. _('Map height (px)') .'</th> - <th>'. _('Map width (px)') .'</th> - <th>'. _('Map host') .'</th>'; + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') . '</th> + <th>'. _('Center Latitude') . '</th> + <th>'. _('Map height (px)') . '</th> + <th>'. _('Map width (px)') . '</th> + <th>'. _('Map host') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -161,27 +164,27 @@ } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> - <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> - </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], - $_SERVER['PHP_SELF'], - $myrow[0], - $_SERVER['PHP_SELF'], - $myrow[0], - $myrow[0]); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $myrow[3], + $myrow[4], + $myrow[5], + $myrow[6], + $_SERVER['PHP_SELF'], + $myrow[0], + $_SERVER['PHP_SELF'], + $myrow[0], + $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -201,70 +204,72 @@ //editing an existing status code $sql = "SELECT geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host - FROM geocode_param - WHERE geocodeid='" . $SelectedParam . "'"; + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param + WHERE geocodeid='" . $SelectedParam . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['geocodeid'] = $myrow['geocodeid']; - $_POST['geocode_key'] = $myrow['geocode_key']; - $_POST['center_long'] = $myrow['center_long']; - $_POST['center_lat'] = $myrow['center_lat']; - $_POST['map_height'] = $myrow['map_height']; - $_POST['map_width'] = $myrow['map_width']; - $_POST['map_host'] = $myrow['map_host']; + $_POST['GeoCodeID'] = $myrow['geocodeid']; + $_POST['GeoCode_Key'] = $myrow['geocode_key']; + $_POST['Center_Long'] = $myrow['center_long']; + $_POST['Center_Lat'] = $myrow['center_lat']; + $_POST['Map_Height'] = $myrow['map_height']; + $_POST['Map_Width'] = $myrow['map_width']; + $_POST['Map_Host'] = $myrow['map_host']; echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; - echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; + echo '<input type="hidden" name="GeoCodeID" value="' . $_POST['GeoCodeID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; echo '<table> <tr><td>'. _('Geocode Code') .':</td> - <td>' . $_POST['geocodeid'] . '</td></tr>'; + <td>' . $_POST['GeoCodeID'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered - if (!isset($_POST['geocodeid'])) { - $_POST['geocodeid'] = ''; + if (!isset($_POST['GeoCodeID'])) { + $_POST['GeoCodeID'] = ''; } echo '<table>'; // <tr> // <td>'. _('Geocode Code') .":</td> -// <td><input " . (in_array('geocodeid',$Errors) ? 'class="inputerror"' : '' ) . -// " tabindex=1 type='Text' name='geocodeid' VALUE='". $_POST['geocodeid'] ."' size=3 maxlength=2></td> +// <td><input " . (in_array('GeoCodeID',$Errors) ? 'class="inputerror"' : '' ) . +// " tabindex=1 type='Text' name='GeoCodeID' VALUE='". $_POST['GeoCodeID'] ."' size=3 maxlength=2></td> // </tr>"; } - if (!isset($_POST['geocode_key'])) { - $_POST['geocode_key'] = ''; + if (!isset($_POST['GeoCode_Key'])) { + $_POST['GeoCode_Key'] = ''; } echo '<br /><tr> <td>'. _('Geocode Key') .':</td> - <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + <td><input ' . (in_array('GeoCode_Key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="GeoCode_Key" value="'. $_POST['GeoCode_Key'] .'" size=28 maxlength=300> </td></tr> <tr><td>'. _('Geocode Center Long') . '</td> - <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=3 type="text" name="Center_Long" value="'. $_POST['Center_Long'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Center Lat') . '</td> - <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=4 type="text" name="Center_Lat" value="'. $_POST['Center_Lat'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Height') . '</td> - <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=5 type="text" name="Map_Height" value="'. $_POST['Map_Height'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Width') . '</td> - <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=6 type="text" name="Map_Width" value="'. $_POST['Map_Width'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Host') . '</td> - <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + <td><input tabindex=7 type="text" name="Map_Host" value="'. $_POST['Map_Host'] .'" size=20 maxlength=300></td></tr> </table> - <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br /><br /> + <div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"</div> + <br /> + <br /> </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br />'; Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GetStockImage.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -20,33 +20,33 @@ */ // Color decode function -function DecodeBgColor( $colorstr ) { - if ( $colorstr[0] == '#' ) { - $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr)); +function DecodeBgColor( $ColourStr ) { + if ( $ColourStr[0] == '#' ) { + $ColourStr = mb_substr($ColourStr,1,mb_strlen($ColourStr)); } - $red = 0; - if(mb_strlen($colorstr) > 1) { - $red = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Red = 0; + if(mb_strlen($ColourStr) > 1) { + $Red = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $green = 0; - if(mb_strlen($colorstr) > 1) { - $green = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Green = 0; + if(mb_strlen($ColourStr) > 1) { + $Green = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $blue = 0; - if(mb_strlen($colorstr) > 1) { - $blue = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Blue = 0; + if(mb_strlen($ColourStr) > 1) { + $Blue = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if(mb_strlen($colorstr) > 1) { - $alpha = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + if(mb_strlen($ColourStr) > 1) { + $Alpha = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if ( isset($alpha) ) - return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha ); + if ( isset($Alpha) ) + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue, 'alpha' => $Alpha ); else - return array('red' => $red, 'green' => $green, 'blue' => $blue ); + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue ); } if (!function_exists('imagecreatefrompng')){ @@ -56,7 +56,7 @@ include('includes/footer.inc'); exit; } -$defaultimage = 'webERPsmall.png'; +$DefaultImage = 'webERPsmall.png'; // FOR APACHE if ( $_SERVER['PATH_TRANSLATED'][0] == '/' OR $_SERVER['PATH_TRANSLATED'][0]=='') { @@ -66,13 +66,13 @@ //Windows $pathsep = "\\"; } -$filepath = $_SESSION['part_pics_dir'] . $pathsep; +$FilePath = $_SESSION['part_pics_dir'] . $pathsep; -$stockid = trim(mb_strtoupper($_GET['StockID'])); +$StockID = trim(mb_strtoupper($_GET['StockID'])); if( isset($_GET['bgcolor']) ) - $bgcolor = $_GET['bgcolor']; + $BackgroundColour = $_GET['bgcolor']; if( isset($_GET['textcolor']) ) - $textcolor = $_GET['textcolor']; + $TextColour = $_GET['textcolor']; if( isset($_GET['width']) ) $width = $_GET['width']; if( isset($_GET['height']) ) @@ -89,7 +89,7 @@ } if( isset($_GET['transcolor'])) { $doTrans = true; - $transcolor = $_GET['transcolor']; + $TranspColour = $_GET['transcolor']; } if( isset($_GET['bevel']) ) { $bevel = $_GET['bevel']; @@ -111,17 +111,17 @@ // Extension requirements and Stock ID Isolation -if($stockid == '') { - $stockid = $defaultimage; +if($StockID == '') { + $StockID = $DefaultImage; $blanktext = true; } -$i = strrpos($stockid,'.'); +$i = strrpos($StockID,'.'); if( $i === false ) $type = 'png'; else { - $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid))); - $stockid = mb_substr($stockid,0,$i); + $type = strtolower(mb_substr($StockID,$i+1,mb_strlen($StockID))); + $StockID = mb_substr($StockID,0,$i); if($blanktext && !isset($text)) $text = ''; } @@ -132,22 +132,22 @@ $functype = 'jpeg'; } -$tmpfilename = $filepath.$stockid; +$tmpFileName = $FilePath.$StockID; // First check for an image this is not the type requested -if ( file_exists($tmpfilename.'.jpg') ) { - $filename = $stockid.'.jpg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.jpeg')) { - $filename = $stockid.'.jpeg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.png')) { - $filename = $stockid.'.png'; - $isjpeg = false; +if ( file_exists($tmpFileName.'.jpg') ) { + $FileName = $StockID.'.jpg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.jpeg')) { + $FileName = $StockID.'.jpeg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.png')) { + $FileName = $StockID.'.png'; + $IsJpeg = false; } else { - $filename = $defaultimage; - $isjpeg = $defaultisjpeg; + $FileName = $DefaultImage; + $IsJpeg = $DefaultIsJpeg; } -if( !$automake && !isset($filename) ) { +if( !$automake && !isset($FileName) ) { $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); prnMsg( _('The Image could not be retrieved because it does not exist'), 'error'); @@ -159,9 +159,9 @@ /* $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); - echo 'The image ' . $filename . ' using functype ' . $functype - . '<br /> The tmpfilename = ' . $tmpfilename . '<br /> The temppath = ' . $filepath . '<br />The stockid = ' . $stockid . '<br /> filepath . stockid .jpg = ' . $filepath . $stockid .'.jpg<br /> The result of file_exists($filepath . $stockid .jpg) =' . file_exists($filepath . $stockid .'.jpg') - . '<br />filepath = ' . $filepath + echo 'The image ' . $FileName . ' using functype ' . $functype + . '<br /> The tmpFileName = ' . $tmpFileName . '<br /> The temppath = ' . $FilePath . '<br />The stockid = ' . $StockID . '<br /> filepath . stockid .jpg = ' . $FilePath . $StockID .'.jpg<br /> The result of file_exists($FilePath . $StockID .jpg) =' . file_exists($FilePath . $StockID .'.jpg') + . '<br />filepath = ' . $FilePath . '<br />rootpath = ' . $rootpath; include('includes/footer.inc'); exit; @@ -170,7 +170,7 @@ // See if we need to automake this image -if( $automake && !isset($filename) || $useblank ) { +if( $automake && !isset($FileName) || $useblank ) { // Have we got height and width specs if( !isset($width) ) $width = 64; @@ -178,39 +178,39 @@ $height = 64; // Have we got a background color $im = imagecreate($width, $height); - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -223,7 +223,7 @@ } if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -237,35 +237,35 @@ } } else { - $tmpfilename = $filepath.$filename; - if( $isjpeg ) { - $im = imagecreatefromjpeg($tmpfilename); + $tmpFileName = $FilePath.$FileName; + if( $IsJpeg ) { + $im = imagecreatefromjpeg($tmpFileName); } else { - $im = imagecreatefrompng($tmpfilename); + $im = imagecreatefrompng($tmpFileName); } // Have we got a background color - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } $sw = imagesx($im); $sh = imagesy($im); @@ -281,32 +281,32 @@ $im = $tmpim; unset($tmpim); - if( !isset($bgcolor['alpha']) ) { + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } - if( !isset($textcolor['alpha']) ) { + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } //imagealphablending ( $im, false); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -322,7 +322,7 @@ // $ixtextbgcolor = imagecolorallocatealpha($im, // 0,0,0,0); if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -348,7 +348,7 @@ imageline($im, imagesx($im)-1,0,imagesx($im)-1, imagesy($im)-1, $silver); // right } // Set up headers -header('Content-Disposition: filename='.$stockid.'.'.$type); +header('Content-Disposition: filename='.$StockID.'.'.$type); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-type: image/'.$style); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/MRPShortages.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -260,15 +260,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - 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'] . '" />'; echo '<table class=selection>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Category') . ':</td><td><select name="CategoryID">'; - echo '<option selected value="All">' . _('All Stock Categories'); + echo '<option selected value="All">' . _('All Stock Categories') .'</option>'; $sql = 'SELECT categoryid, - categorydescription - FROM stockcategory'; + categorydescription + FROM stockcategory"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/PDFStockTransfer.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -2,6 +2,8 @@ /* $Id$*/ +/* This script is superseded by the PDFStockLocTransfer.php which produces a multiple item stock transfer listing - this was for the old individual stock transfers where there is just single items being transferred */ + include('includes/session.inc'); if (!isset($_GET['TransferNo'])){ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/ShipmentCosting.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -25,15 +25,15 @@ } $ShipmentHeaderSQL = "SELECT shipments.supplierid, - suppliers.suppname, - shipments.eta, - suppliers.currcode, - shipments.vessel, - shipments.voyageref, - shipments.closed - FROM shipments INNER JOIN suppliers - ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; + suppliers.suppname, + shipments.eta, + suppliers.currcode, + shipments.vessel, + shipments.voyageref, + shipments.closed + FROM shipments INNER JOIN suppliers + ON shipments.supplierid = suppliers.supplierid + WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); @@ -46,7 +46,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; -echo '<table class=selection>'; +echo '<table class="selection">'; echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> @@ -140,15 +140,17 @@ 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>'; - $TableHeader = '<tr> <th>'. _('Item'). '</th> - <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> - <th>'. _('Quantity'). '<br />'. _('Received'). '</th> - <th>'. _('Invoiced'). '<br />'. _('Charges'). '</th> - <th>'. _('Shipment'). '<br />'. _('Charges'). '</th> - <th>'. _('Shipment'). '<br />'. _('Cost'). '</th> - <th>'. _('Standard'). '<br />'. _('Cost'). '</th> - <th>'. _('Variance'). '</th> - <th>%</th></tr>'; + $TableHeader = '<tr> + <th>'. _('Item'). '</th> + <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> + <th>'. _('Quantity'). '<br />'. _('Received'). '</th> + <th>'. _('Invoiced'). '<br />'. _('Charges'). '</th> + <th>'. _('Shipment'). '<br />'. _('Charges'). '</th> + <th>'. _('Shipment'). '<br />'. _('Cost'). '</th> + <th>'. _('Standard'). '<br />'. _('Cost'). '</th> + <th>'. _('Variance'). '</th> + <th>%</th> + </tr>'; echo $TableHeader; /*show the line items on the shipment with the value invoiced and shipt cost */ @@ -618,17 +620,18 @@ if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c - echo '<div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + echo '<div class="centre"> + <form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($_SESSION['WeightedAverageCosting']==0){ /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected value="Yes">'. _('Yes') . '</option> - <option value="No">'. _('No') . '</option> + <option selected value="Yes">'. _('Yes') . '</option> + <option value="No">'. _('No') . '</option> </select>'; } - echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; + echo '<br /><br /><input type=submit name="Close" value="'. _('Confirm OK to Close'). '">'; echo '</form></div>'; } Modified: trunk/Z_CheckDebtorsControl.php =================================================================== --- trunk/Z_CheckDebtorsControl.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/Z_CheckDebtorsControl.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -88,13 +88,12 @@ $GLOpening = $invTotal = $RecTotal = $GLClosing = $CalcTotal = $DiffTotal = 0; $j=0; - while ( $CurPeriod <= $_POST['ToPeriod'] ) - { + while ( $CurPeriod <= $_POST['ToPeriod'] ) { $SQL = "SELECT bfwd, - actual - FROM chartdetails - WHERE period = " . $CurPeriod . " - AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; + actual + FROM chartdetails + WHERE period = " . $CurPeriod . " + AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; $dtResult = DB_query($SQL,$db); $dtRow = DB_fetch_array($dtResult); DB_free_result($dtResult); @@ -165,7 +164,6 @@ echo '</table></form>'; } -echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -40,7 +40,7 @@ $_SESSION['AttemptsCounter'] = 0; } -if ($_SESSION['HTTPS_Only']==1){ +if (isset($_SESSION['HTTPS_Only']) AND $_SESSION['HTTPS_Only']==1){ if ($_SERVER['HTTPS']!='on'){ prnMsg(_('webERP is configured to allow only secure socket connections. Pages must be called with https://') . ' .....','error'); exit; @@ -51,8 +51,7 @@ // value must be set in the script before header.inc is included. $SecurityGroups is an array of // arrays defining access for each group of users. These definitions can be modified by a system admin under setup - -if (!is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { +if (isset($_SESSION['AllowedPageSecurityTokens']) AND !is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { /* NO HTML output - but may need an XMLRPC style error message here. Lindsay: 12Jan10 $title = _('Account Error Report'); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_xml-rpc.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1043,7 +1043,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); $Description = _('This function is used to insert a new Sales Credit to the webERP database.'); $Parameter[0]['name'] = _('Credit Details'); $Parameter[0]['description'] = _('An array of index/value items describing the credit. All values must be negative.'); @@ -1212,7 +1212,8 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); $Parameter[0]['name'] = _('Account Details'); $Parameter[0]['description'] = _('An array of index/value items describing the GL Account and fields to set.'); $Parameter[1]['name'] = _('User name'); @@ -1242,6 +1243,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Section Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account section to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1271,6 +1275,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Group Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account group to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1299,7 +1306,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $Description = _('This function returns a list of stock location ids.'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); @@ -1507,6 +1514,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Sales Area Details'); $Parameter[0]['description'] = _('An array of index/value items describing the sales area to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1626,6 +1636,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Salesman Details'); $Parameter[0]['description'] = _('An array of index/value items describing the salesman to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1773,6 +1786,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1802,6 +1818,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to modify.'); $Parameter[1]['name'] = _('User name'); @@ -1889,6 +1908,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Field Name'); $Parameter[0]['description'] = _('The field name to search on.'); $Parameter[1]['name'] = _('Match Criteria'); @@ -1922,6 +1944,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Label Name'); $Parameter[0]['description'] = _('The category label to search on.'); $Parameter[1]['name'] = _('Match Criteria'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,6 @@ webERP Change Log +5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper 3/7/11 Phil: changed all substr to mb_substr Modified: trunk/geo_displaymap_customers.php =================================================================== --- trunk/geo_displaymap_customers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_customers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Customer Branches Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_customers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/geo_displaymap_suppliers.php =================================================================== --- trunk/geo_displaymap_suppliers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_suppliers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Supplier Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_suppliers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/includes/session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -291,7 +291,8 @@ echo '</td> </tr> </table> - </td>'; + </td> + </tr>'; include($PathPrefix . 'includes/footer.inc'); exit; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/index.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -714,7 +714,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockLocTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,4 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2005 Logic Works Ltd # This file is distributed under the GPL # FIRST AUTHOR <xlyz> .2004/2005 # @@ -7,9 +6,9 @@ msgstr "" "Project-Id-Version: Weberp\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-02 20:11+1200\n" -"PO-Revision-Date: 2011-03-04 18:03+0000\n" -"Last-Translator: Martino Barbon <Unknown>\n" +"POT-Creation-Date: 2011-05-30 20:51+1200\n" +"PO-Revision-Date: 2011-07-05 12:26+0100\n" +"Last-Translator: Gioacchino Cipriano <gio...@gm...>\n" "Language-Team: italian <none>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,31 +17,25 @@ "X-Generator: Launchpad (build 12696)\n" "Language: \n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 +#: index.php:1296 msgid "Account Groups" msgstr "Gestione dei conti" #: AccountGroups.php:17 -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "" -"È verificato un errore durante il recupero dei gruppi conto del gruppo di " -"conto genitore durante il controllo per la ricorsione" +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "È verificato un errore durante il recupero dei gruppi conto del gruppo di conto genitore durante il controllo per la ricorsione" #: AccountGroups.php:18 -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "" -"Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di " -"account principale e che ha fallito nel processo è stato" +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di account principale e che ha fallito nel processo è stato" -#: AccountGroups.php:55 AccountGroups.php:92 AccountGroups.php:176 -#: AccountGroups.php:186 +#: AccountGroups.php:55 +#: AccountGroups.php:92 +#: AccountGroups.php:175 +#: AccountGroups.php:185 msgid "The SQL that was used to retrieve the information was" -msgstr "" -"Il SQL che è stato utilizzato per recuperare le informazioni sono state" +msgstr "Il SQL che è stato utilizzato per recuperare le informazioni sono state" #: AccountGroups.php:56 msgid "Could not check whether the group exists because" @@ -54,415 +47,774 @@ #: AccountGroups.php:69 msgid "The account group name cannot contain the character" -msgstr "Il nome del conto non può contenere il carattere" +msgstr "Il nome del conto non può contenere il carattere" -#: AccountGroups.php:69 TaxCategories.php:31 TaxProvinces.php:30 +#: AccountGroups.php:69 +#: TaxCategories.php:31 +#: TaxProvinces.php:30 #: UnitsOfMeasure.php:30 msgid "or the character" msgstr "o il carattere" #: AccountGroups.php:75 msgid "The account group name must be at least one character long" -msgstr "Il nome del gruppo account deve essere almeno un carattere a lungo" +msgstr "Il nome del gruppo account deve essere lungo almeno un carattere" #: AccountGroups.php:82 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" -"Il gruppo di account principale selezionato sembra comportare una struttura " -"ricorsiva conto - selezionare un'alternativa gruppo di account " -"principale o fanno di questo gruppo un gruppo di alto livello di account" +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "Il gruppo di account principale selezionato sembra comportare una struttura ricorsiva conto - selezionare un'alternativa gruppo di account principale o fanno di questo gruppo un gruppo di alto livello di account" #: AccountGroups.php:93 msgid "Could not check whether the group is recursive because" msgstr "Impossibile verificare se il gruppo è ricorsivo perché" -#: AccountGroups.php:101 -msgid "" -"Since this account group is a child group, the sequence in the trial " -"balance, the section in the accounts and whether or not the account group " -"appears in the balance sheet or profit and loss account are all properties " -"inherited from the parent account group. Any changes made to these fields " -"will have no effect." -msgstr "" - -#: AccountGroups.php:106 +#: AccountGroups.php:105 msgid "The section in accounts must be an integer" msgstr "Il codice del gruppo di conti deve essere un numero intero" -#: AccountGroups.php:112 +#: AccountGroups.php:111 msgid "The sequence in the trial balance must be an integer" -msgstr "" -"Il numero che indica la posizione nel bilancio deve essere un numero intero" +msgstr "Il numero che indica la posizione nel bilancio deve essere un numero intero" -#: AccountGroups.php:118 +#: AccountGroups.php:117 msgid "The sequence in the TB must be numeric and less than" msgstr "La sequenza della TB deve essere numerico e meno" -#: AccountGroups.php:135 +#: AccountGroups.php:134 msgid "An error occurred in updating the account group" -msgstr "È verificato un errore nell'aggiornamento del gruppo di account" +msgstr "Si è verificato un errore nell'aggiornamento del gruppo di account" -#: AccountGroups.php:136 +#: AccountGroups.php:135 msgid "The SQL that was used to update the account group was" -msgstr "" -"Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" +msgstr "Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" -#: AccountGroups.php:138 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:137 +#: AccountSections.php:104 +#: PaymentMethods.php:82 msgid "Record Updated" msgstr "Record aggiornato" -#: AccountGroups.php:156 +#: AccountGroups.php:155 msgid "An error occurred in inserting the account group" msgstr "È verificato un errore nel mettere il gruppo di account" -#: AccountGroups.php:157 +#: AccountGroups.php:156 msgid "The SQL that was used to insert the account group was" -msgstr "" -"L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" -#: AccountGroups.php:158 AccountSections.php:116 PaymentMethods.php:106 +#: AccountGroups.php:157 +#: AccountSections.php:116 +#: PaymentMethods.php:106 msgid "Record inserted" msgstr "Record inserito" -#: AccountGroups.php:175 +#: AccountGroups.php:174 msgid "An error occurred in retrieving the group information from chartmaster" -msgstr "" -"È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +msgstr "È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +#: AccountGroups.php:179 +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "Impossibile eliminare questo gruppo di conti, perché ci sono conti di contabilità generale che sono stati creati utilizzando questo gruppo" + #: AccountGroups.php:180 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "" -"Non ĂŠ possibile cancellare questo conto perchĂŠ ci sono dei sottoconti che " -"vi fanno riferimento" - -#: AccountGroups.php:181 AccountGroups.php:191 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 -#: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 -#: CustomerBranches.php:316 Customers.php:312 Customers.php:321 -#: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:130 -#: GLAccounts.php:80 GLAccounts.php:94 Locations.php:244 Locations.php:252 -#: Locations.php:261 Locations.php:269 Locations.php:277 Locations.php:285 -#: Locations.php:293 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:140 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:152 SalesCategories.php:125 SalesCategories.php:133 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:475 Stocks.php:484 Stocks.php:492 Stocks.php:500 Stocks.php:508 -#: Stocks.php:516 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 -#: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 +#: AccountGroups.php:190 +#: AccountSections.php:137 +#: Areas.php:116 +#: Areas.php:125 +#: BankAccounts.php:157 +#: CreditStatus.php:125 +#: Currencies.php:143 +#: Currencies.php:151 +#: Currencies.php:158 +#: CustomerBranches.php:286 +#: CustomerBranches.php:296 +#: CustomerBranches.php:306 +#: CustomerBranches.php:316 +#: Customers.php:311 +#: Customers.php:320 +#: Customers.php:328 +#: Customers.php:336 +#: CustomerTypes.php:147 +#: CustomerTypes.php:157 +#: Factors.php:134 +#: FixedAssetCategories.php:130 +#: GLAccounts.php:80 +#: GLAccounts.php:94 +#: Locations.php:244 +#: Locations.php:252 +#: Locations.php:261 +#: Locations.php:269 +#: Locations.php:277 +#: Locations.php:285 +#: Locations.php:293 +#: Locations.php:301 +#: MRPDemandTypes.php:87 +#: PaymentMethods.php:140 +#: PaymentTerms.php:147 +#: PaymentTerms.php:154 +#: PcExpenses.php:152 +#: SalesCategories.php:125 +#: SalesCategories.php:133 +#: SalesPeople.php:144 +#: SalesPeople.php:151 +#: SalesTypes.php:145 +#: SalesTypes.php:155 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:179 +#: Stocks.php:475 +#: Stocks.php:484 +#: Stocks.php:492 +#: Stocks.php:500 +#: Stocks.php:508 +#: Stocks.php:516 +#: Suppliers.php:609 +#: Suppliers.php:618 +#: Suppliers.php:626 +#: SupplierTypes.php:145 +#: TaxCategories.php:131 +#: TaxGroups.php:127 +#: TaxGroups.php:134 +#: TaxProvinces.php:125 +#: UnitsOfMeasure.php:138 +#: WorkCentres.php:89 +#: WorkCentres.php:95 +#: WWW_Access.php:83 msgid "There are" msgstr "Ci sono" -#: AccountGroups.php:181 +#: AccountGroups.php:180 msgid "general ledger accounts that refer to this account group" msgstr "sottoconti fanno riferimento a questo conto" -#: AccountGroups.php:185 +#: AccountGroups.php:184 msgid "An error occurred in retrieving the parent group information" -msgstr "" -"È verificato un errore di estrarre le informazioni del gruppo di genitore" +msgstr "È verificato un errore di estrarre le informazioni del gruppo di genitore" +#: AccountGroups.php:189 +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "Impossibile eliminare questo gruppo considerazione perché si tratta di un gruppo di account principale del gruppo di altri account" + #: AccountGroups.php:190 -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "" -"Impossibile eliminare questo gruppo considerazione perché si tratta di un " -"gruppo di account principale del gruppo di altri account (s)" - -#: AccountGroups.php:191 msgid "account groups that have this group as its/there parent account group" -msgstr "" -"gruppi di account che hanno questo gruppo come il suo / gruppo di " -"appartenenza ci conto" +msgstr "gruppi di account che hanno questo gruppo come il suo / gruppo di appartenenza ci conto" -#: AccountGroups.php:194 +#: AccountGroups.php:193 msgid "An error occurred in deleting the account group" -msgstr "" -"È verificato un errore durante l'eliminazione del gruppo di account" +msgstr "Si è verificato un errore durante l'eliminazione del gruppo di account" -#: AccountGroups.php:195 +#: AccountGroups.php:194 msgid "The SQL that was used to delete the account group was" -msgstr "" -"L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" -#: AccountGroups.php:197 +#: AccountGroups.php:196 msgid "group has been deleted" msgstr "e' stato cancellato" -#: AccountGroups.php:222 +#: AccountGroups.php:221 msgid "The sql that was used to retrieve the account group information was " -msgstr "" -"L'SQL che è stato utilizzato per recuperare le informazioni di account " -"di gruppo è stato " +msgstr "L'SQL che è stato utilizzato per recuperare le informazioni di account di gruppo è stato " -#: AccountGroups.php:223 +#: AccountGroups.php:222 msgid "Could not get account groups because" -msgstr "Non ĂŠ possibile estrarre il piano dei conti perchè" +msgstr "Non àŠ possibile estrarre il piano dei conti perchè" -#: AccountGroups.php:225 AccountSections.php:175 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:101 -#: AddCustomerTypeNotes.php:95 AgedDebtors.php:454 AgedSuppliers.php:268 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 -#: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 -#: BOMInquiry.php:171 BOMListing.php:112 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:1983 -#: CounterSales.php:2107 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:124 DiscountCategories.php:10 -#: DiscountCategories.php:128 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:238 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:374 InventoryPlanningPrefSupplier.php:474 -#: Labels.php:117 Labels.php:273 MRPReport.php:515 OutstandingGRNs.php:150 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:131 PDFStockLocTransfer.php:21 -#: PO_AuthorisationLevels.php:10 POReport.php:60 POReport.php:64 -#: POReport.php:68 PO_SelectOSPurchOrder.php:133 PricesBasedOnMarkUp.php:11 -#: Prices_Customer.php:39 Prices.php:30 PurchData.php:138 PurchData.php:249 -#: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 -#: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 -#: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 -#: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1463 -#: SelectOrderItems.php:1583 SelectProduct.php:485 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 -#: StockLocMovements.php:13 StockLocStatus.php:26 Suppliers.php:302 -#: SupplierTenders.php:260 SupplierTenders.php:317 SupplierTransInquiry.php:11 -#: TaxGroups.php:15 TaxProvinces.php:10 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:110 WorkCentres.php:157 -#: WorkOrderCosting.php:12 WorkOrderEntry.php:10 WorkOrderIssue.php:20 -#: WorkOrderReceive.php:13 WorkOrderStatus.php:41 WWW_Access.php:11 -#: WWW_Users.php:32 Z_BottomUpCosts.php:51 +#: AccountGroups.php:224 +#: AccountSections.php:175 +#: AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 +#: AddCustomerNotes.php:97 +#: AddCustomerTypeNotes.php:94 +#: AgedDebtors.php:454 +#: AgedSuppliers.php:277 +#: Areas.php:144 +#: AuditTrail.php:11 +#: BankReconciliation.php:13 +#: BOMExtendedQty.php:272 +#: BOMIndented.ph... [truncated message content] |
From: <dai...@us...> - 2011-07-08 10:28:21
|
Revision: 4626 http://web-erp.svn.sourceforge.net/web-erp/?rev=4626&view=rev Author: daintree Date: 2011-07-08 10:28:14 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Items.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/PO_Items.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -159,39 +159,38 @@ deliverydate, paymentterms, allowprint) - VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . "', - '" . $_SESSION['PO'.$identifier]->Comments . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->ExRate . "', - '" . $_SESSION['PO'.$identifier]->Initiator . "', - '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->Tel . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->SupplierContact . "', - '" . $_SESSION['PO'.$identifier]->SuppTel. "', - '" . $_SESSION['PO'.$identifier]->Contact . "', - '" . $_SESSION['PO'.$identifier]->Version . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - '" . $_SESSION['PO'.$identifier]->Status . "', - '" . $StatusComment . "', - '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', - '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', - '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' - )"; + VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $_SESSION['PO'.$identifier]->Comments . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->ExRate . "', + '" . $_SESSION['PO'.$identifier]->Initiator . "', + '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->Tel . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->SupplierContact . "', + '" . $_SESSION['PO'.$identifier]->SuppTel. "', + '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . $_SESSION['PO'.$identifier]->Version . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + '" . $_SESSION['PO'.$identifier]->Status . "', + '" . $StatusComment . "', + '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', + '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' )"; $ErrMsg = _('The purchase order header record could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); @@ -213,20 +212,19 @@ suppliers_partno, assetid, conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + VALUES ('" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); @@ -386,7 +384,7 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])))){ + if (!is_numeric($_POST['Qty'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } @@ -394,7 +392,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ + if (!is_numeric($_POST['Price'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -465,8 +463,6 @@ if ($AllowUpdate == true){ //adding the non-stock item - $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); - $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', @@ -505,10 +501,10 @@ foreach ($_POST as $FormVariableName => $Quantity) { if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - + $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); $AlreadyOnThisOrder = 0; - + if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ if (count($_SESSION['PO'.$identifier]->LineItems)!=0){ @@ -530,11 +526,11 @@ decimalplaces, stockact, accountname - FROM stockmaster INNER JOIN stockcategory - ON stockcategory.categoryid = stockmaster.categoryid - INNER JOIN chartmaster - ON chartmaster.accountcode = stockcategory.stockact - WHERE stockmaster.stockid = '". $ItemCode . "'"; + FROM stockmaster INNER JOIN stockcategory + ON stockcategory.categoryid = stockmaster.categoryid + INNER JOIN chartmaster + ON chartmaster.accountcode = stockcategory.stockact + WHERE stockmaster.stockid = '". $ItemCode . "'"; $ErrMsg = _('The item details for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -661,9 +657,9 @@ // Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places // This should help display where item-price is a fraction if ($POLine->Price > 1) { - $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces,'.',''); + $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); } else { - $DisplayPrice = number_format($POLine->Price,4,'.',''); + $DisplayPrice = number_format($POLine->Price,4); } if ($k==1){ @@ -705,7 +701,7 @@ echo '<br /><table class="selection"><tr> <td>' . _('Item Description') . '</td>'; - echo '<td><input type=text name=ItemDescription size=40></td></tr>'; + echo '<td><input type="text" name="ItemDescription" size="40" /></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; $sql="SELECT accountcode, @@ -759,29 +755,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid - LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + ORDER BY stockmaster.stockid + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } elseif ($_POST['StockCode']){ @@ -792,29 +788,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - and stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + and stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } else { @@ -822,27 +818,27 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } } @@ -865,10 +861,10 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, categorydescription - FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' - ORDER BY categorydescription"; + FROM stockcategory + WHERE stocktype<>'L' + AND stocktype<>'D' + ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -926,13 +922,13 @@ echo '<table cellpadding="1" colspan="7" class="selection">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Our Units') . '</th> - <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> - <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> - <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Our Units') . '</th> + <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> + <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> + <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> + </tr>'; echo $TableHeader; $j = 1; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -897,6 +897,7 @@ $ExRate = 1; } + /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ if (isset($_POST['order_items']) @@ -906,8 +907,8 @@ /* 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; - + $Discount = 0; + $AlreadyWarnedAboutCredit = false; $i=1; while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { $QuickEntryCode = 'part_' . $i; @@ -1053,14 +1054,14 @@ taxcatid, materialcost) VALUES ('" . $AssetStockID . "', - '" . $AssetRow['description'] . "', - '" . $AssetRow['longdescription'] . "', - 'ASSETS', - 'D', - '0', - '0', - '" . $_SESSION['DefaultTaxCategory'] . "', - '". $NBV . "')" , $db); + '" . $AssetRow['description'] . "', + '" . $AssetRow['longdescription'] . "', + 'ASSETS', + 'D', + '0', + '0', + '" . $_SESSION['DefaultTaxCategory'] . "', + '". $NBV . "')" , $db); /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query("INSERT INTO locstock (loccode, stockid) @@ -1091,7 +1092,9 @@ $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; } } - + + $AlreadyWarnedAboutCredit = false; + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1142,18 +1145,20 @@ $WithinCreditLimit = true; - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn - and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn + breach their credit limit and 2 for prohibit sales */ $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercentage)); $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('This change would put the customer over their credit limit and is prohibited'),'warn'); $WithinCreditLimit = false; $_SESSION['Items'.$identifier]->CreditAvailable += $DifferenceInOrderValue; + $AlreadyWarnedAboutCredit = true; } } @@ -1170,8 +1175,39 @@ } //within credit limit so make changes } //there are changes to the order line to process } //page not called from itself - POST variables not set - } - } + } // Loop around all items on the order + + + /* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ + $DiscCatsDone = array(); + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { + + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ + $DiscCatsDone[]=$OrderLine->DiscCat; + $QuantityOfDiscCat = 0; + + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + /* add up total quantity of all lines of this DiscCat */ + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $QuantityOfDiscCat += $OrderLine_2->Quantity; + } + } + $result = DB_query("SELECT MAX(discountrate) AS discount + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <" . $QuantityOfDiscCat,$db); + $myrow = DB_fetch_row($result); + if ($myrow[0]!=0){ /* need to update the lines affected */ + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $myrow[0]; + } + } + }//a none zero discount percentage was returned + } + } /* end of discount matrix lookup code */ + } // the order session is started or there is a new item being added if (isset($_POST['DeliveryDetails'])){ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the delivery details page') . '. ' . _('if this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -1229,6 +1265,7 @@ if (isset($NewItem_array) AND isset($_POST['order_items'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ /*Now figure out if the item is a kit set - the field MBFlag='K'*/ + $AlreadyWarnedAboutCredit = false; foreach($NewItem_array as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag @@ -1245,11 +1282,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -1300,8 +1337,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ + if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; } } @@ -1415,12 +1451,13 @@ $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - $ColSpanNumber = 3; + $ColSpanNumber = 2; } else { $ColSpanNumber = 1; } - echo '<tr class="EvenTableRows"><td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; + echo '<tr class="EvenTableRows"> + <td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> + <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); @@ -1431,8 +1468,10 @@ </tr></table>'; - 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>'; + 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 />'; } # end of if lines /* Now show the stock item selection search stuff below */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) @@ -1,5 +1,7 @@ webERP Change Log +8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function +8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -112,6 +112,7 @@ if (strstr($CheckVariable,"'") OR strstr($CheckVariable,'+') OR strstr($CheckVariable,'?') + OR strstr($CheckVariable,'.') OR strstr($CheckVariable,"\"") OR strstr($CheckVariable,'&') OR strstr($CheckVariable,"\\") Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-08 10:28:14 UTC (rev 4626) @@ -89,7 +89,7 @@ $NewLineNo = -1; /* this is ok b/c CartClass will change to the correct line no */ } - if (isset($StockItem) and $myItemRow['discountcategory'] != "" ){ + if (isset($StockItem) and $myItemRow['discountcategory'] != '' ){ $DiscCatsDone[$Counter]=$StockItem->DiscCat; $QuantityOfDiscCat =0; $result = DB_query("SELECT MAX(discountrate) AS discount @@ -114,15 +114,17 @@ if ($_SESSION['Items'.$identifier]->SpecialInstructions) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable -= round(($NewItemQty * $Price * (1- $Discount)),2); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('No more lines can be added to this order the customer account is currently at or over their credit limit'),'warn'); $WithinCreditLimit = false; + $AlreadyWarnedAboutCredit = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:28:21
|
Revision: 4626 http://web-erp.svn.sourceforge.net/web-erp/?rev=4626&view=rev Author: daintree Date: 2011-07-08 10:28:14 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Items.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/PO_Items.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -159,39 +159,38 @@ deliverydate, paymentterms, allowprint) - VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . "', - '" . $_SESSION['PO'.$identifier]->Comments . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->ExRate . "', - '" . $_SESSION['PO'.$identifier]->Initiator . "', - '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->Tel . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->SupplierContact . "', - '" . $_SESSION['PO'.$identifier]->SuppTel. "', - '" . $_SESSION['PO'.$identifier]->Contact . "', - '" . $_SESSION['PO'.$identifier]->Version . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - '" . $_SESSION['PO'.$identifier]->Status . "', - '" . $StatusComment . "', - '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', - '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', - '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' - )"; + VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $_SESSION['PO'.$identifier]->Comments . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->ExRate . "', + '" . $_SESSION['PO'.$identifier]->Initiator . "', + '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->Tel . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->SupplierContact . "', + '" . $_SESSION['PO'.$identifier]->SuppTel. "', + '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . $_SESSION['PO'.$identifier]->Version . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + '" . $_SESSION['PO'.$identifier]->Status . "', + '" . $StatusComment . "', + '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', + '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' )"; $ErrMsg = _('The purchase order header record could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); @@ -213,20 +212,19 @@ suppliers_partno, assetid, conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + VALUES ('" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); @@ -386,7 +384,7 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])))){ + if (!is_numeric($_POST['Qty'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } @@ -394,7 +392,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ + if (!is_numeric($_POST['Price'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -465,8 +463,6 @@ if ($AllowUpdate == true){ //adding the non-stock item - $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); - $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', @@ -505,10 +501,10 @@ foreach ($_POST as $FormVariableName => $Quantity) { if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - + $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); $AlreadyOnThisOrder = 0; - + if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ if (count($_SESSION['PO'.$identifier]->LineItems)!=0){ @@ -530,11 +526,11 @@ decimalplaces, stockact, accountname - FROM stockmaster INNER JOIN stockcategory - ON stockcategory.categoryid = stockmaster.categoryid - INNER JOIN chartmaster - ON chartmaster.accountcode = stockcategory.stockact - WHERE stockmaster.stockid = '". $ItemCode . "'"; + FROM stockmaster INNER JOIN stockcategory + ON stockcategory.categoryid = stockmaster.categoryid + INNER JOIN chartmaster + ON chartmaster.accountcode = stockcategory.stockact + WHERE stockmaster.stockid = '". $ItemCode . "'"; $ErrMsg = _('The item details for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -661,9 +657,9 @@ // Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places // This should help display where item-price is a fraction if ($POLine->Price > 1) { - $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces,'.',''); + $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); } else { - $DisplayPrice = number_format($POLine->Price,4,'.',''); + $DisplayPrice = number_format($POLine->Price,4); } if ($k==1){ @@ -705,7 +701,7 @@ echo '<br /><table class="selection"><tr> <td>' . _('Item Description') . '</td>'; - echo '<td><input type=text name=ItemDescription size=40></td></tr>'; + echo '<td><input type="text" name="ItemDescription" size="40" /></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; $sql="SELECT accountcode, @@ -759,29 +755,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid - LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + ORDER BY stockmaster.stockid + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } elseif ($_POST['StockCode']){ @@ -792,29 +788,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - and stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + and stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } else { @@ -822,27 +818,27 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } } @@ -865,10 +861,10 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, categorydescription - FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' - ORDER BY categorydescription"; + FROM stockcategory + WHERE stocktype<>'L' + AND stocktype<>'D' + ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -926,13 +922,13 @@ echo '<table cellpadding="1" colspan="7" class="selection">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Our Units') . '</th> - <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> - <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> - <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Our Units') . '</th> + <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> + <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> + <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> + </tr>'; echo $TableHeader; $j = 1; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -897,6 +897,7 @@ $ExRate = 1; } + /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ if (isset($_POST['order_items']) @@ -906,8 +907,8 @@ /* 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; - + $Discount = 0; + $AlreadyWarnedAboutCredit = false; $i=1; while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { $QuickEntryCode = 'part_' . $i; @@ -1053,14 +1054,14 @@ taxcatid, materialcost) VALUES ('" . $AssetStockID . "', - '" . $AssetRow['description'] . "', - '" . $AssetRow['longdescription'] . "', - 'ASSETS', - 'D', - '0', - '0', - '" . $_SESSION['DefaultTaxCategory'] . "', - '". $NBV . "')" , $db); + '" . $AssetRow['description'] . "', + '" . $AssetRow['longdescription'] . "', + 'ASSETS', + 'D', + '0', + '0', + '" . $_SESSION['DefaultTaxCategory'] . "', + '". $NBV . "')" , $db); /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query("INSERT INTO locstock (loccode, stockid) @@ -1091,7 +1092,9 @@ $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; } } - + + $AlreadyWarnedAboutCredit = false; + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1142,18 +1145,20 @@ $WithinCreditLimit = true; - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn - and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn + breach their credit limit and 2 for prohibit sales */ $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercentage)); $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('This change would put the customer over their credit limit and is prohibited'),'warn'); $WithinCreditLimit = false; $_SESSION['Items'.$identifier]->CreditAvailable += $DifferenceInOrderValue; + $AlreadyWarnedAboutCredit = true; } } @@ -1170,8 +1175,39 @@ } //within credit limit so make changes } //there are changes to the order line to process } //page not called from itself - POST variables not set - } - } + } // Loop around all items on the order + + + /* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ + $DiscCatsDone = array(); + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { + + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ + $DiscCatsDone[]=$OrderLine->DiscCat; + $QuantityOfDiscCat = 0; + + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + /* add up total quantity of all lines of this DiscCat */ + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $QuantityOfDiscCat += $OrderLine_2->Quantity; + } + } + $result = DB_query("SELECT MAX(discountrate) AS discount + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <" . $QuantityOfDiscCat,$db); + $myrow = DB_fetch_row($result); + if ($myrow[0]!=0){ /* need to update the lines affected */ + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $myrow[0]; + } + } + }//a none zero discount percentage was returned + } + } /* end of discount matrix lookup code */ + } // the order session is started or there is a new item being added if (isset($_POST['DeliveryDetails'])){ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the delivery details page') . '. ' . _('if this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -1229,6 +1265,7 @@ if (isset($NewItem_array) AND isset($_POST['order_items'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ /*Now figure out if the item is a kit set - the field MBFlag='K'*/ + $AlreadyWarnedAboutCredit = false; foreach($NewItem_array as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag @@ -1245,11 +1282,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -1300,8 +1337,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ + if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; } } @@ -1415,12 +1451,13 @@ $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - $ColSpanNumber = 3; + $ColSpanNumber = 2; } else { $ColSpanNumber = 1; } - echo '<tr class="EvenTableRows"><td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; + echo '<tr class="EvenTableRows"> + <td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> + <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); @@ -1431,8 +1468,10 @@ </tr></table>'; - 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>'; + 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 />'; } # end of if lines /* Now show the stock item selection search stuff below */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) @@ -1,5 +1,7 @@ webERP Change Log +8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function +8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -112,6 +112,7 @@ if (strstr($CheckVariable,"'") OR strstr($CheckVariable,'+') OR strstr($CheckVariable,'?') + OR strstr($CheckVariable,'.') OR strstr($CheckVariable,"\"") OR strstr($CheckVariable,'&') OR strstr($CheckVariable,"\\") Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-08 10:28:14 UTC (rev 4626) @@ -89,7 +89,7 @@ $NewLineNo = -1; /* this is ok b/c CartClass will change to the correct line no */ } - if (isset($StockItem) and $myItemRow['discountcategory'] != "" ){ + if (isset($StockItem) and $myItemRow['discountcategory'] != '' ){ $DiscCatsDone[$Counter]=$StockItem->DiscCat; $QuantityOfDiscCat =0; $result = DB_query("SELECT MAX(discountrate) AS discount @@ -114,15 +114,17 @@ if ($_SESSION['Items'.$identifier]->SpecialInstructions) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable -= round(($NewItemQty * $Price * (1- $Discount)),2); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('No more lines can be added to this order the customer account is currently at or over their credit limit'),'warn'); $WithinCreditLimit = false; + $AlreadyWarnedAboutCredit = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:30:48
|
Revision: 4627 http://web-erp.svn.sourceforge.net/web-erp/?rev=4627&view=rev Author: daintree Date: 2011-07-08 10:30:40 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CounterSales.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/SelectOrderItems.php trunk/StockSerialItemResearch.php trunk/SuppLoginSetup.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_debtortransactions.php trunk/api/api_salesorders.php trunk/api/api_stock.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/install/save.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CounterSales.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -35,7 +35,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItemArray[mb_substr($key,3)] = trim($value); } } Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (strstr($_POST['Abbreviation'],"'") OR strstr($_POST['Abbreviation'],'+') OR strstr($_POST['Abbreviation'],"\"") OR strstr($_POST['Abbreviation'],'&') OR strstr($_POST['Abbreviation'],' ') OR strstr($_POST['Abbreviation'],"\\") OR strstr($_POST['Abbreviation'],'.') OR strstr($_POST['Abbreviation'],'"')) { + if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustEDISetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ //first off validate inputs sensible if (ContainsIllegalCharacters($_POST['EDIReference']) - OR strstr($_POST['EDIReference'],' ')) { + OR mb_strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); } Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -40,7 +40,7 @@ if (mb_strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR mb_strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (mb_strlen($_POST['Password'])<5){ @@ -48,7 +48,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustomerBranches.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -46,7 +46,7 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain any of the following characters')." - & \'",'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SelectOrderItems.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -24,7 +24,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItem_array[mb_substr($key,3)] = trim($value); } } Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/StockSerialItemResearch.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,8 +38,8 @@ if ($SN!='') { //the point here is to allow a semi fuzzy search, but still keep someone from killing the db server - if (strstr($SN,'%')){ - while(strstr($SN,'%%')) { + if (mb_strstr($SN,'%')){ + while(mb_strstr($SN,'%%')) { $SN = str_replace('%%','%',$SN); } if (mb_strlen($SN) < 11){ Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SuppLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -82,7 +82,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SystemParameters.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -33,7 +33,7 @@ } elseif (mb_strlen($_POST['X_DefaultCreditLimit']) > 12 || !is_numeric($_POST['X_DefaultCreditLimit']) ) { $InputError = 1; prnMsg(_('Default Credit Limit must be a number'),'error'); - } elseif (strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { + } elseif (mb_strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { $InputError = 1; prnMsg(_('The Romalpa Clause may not contain single quotes and may not be longer than 5000 chars'),'error'); } elseif (mb_strlen($_POST['X_QuickEntries']) > 2 || !is_numeric($_POST['X_QuickEntries']) || Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/UpgradeDatabase.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -146,7 +146,7 @@ if (mb_substr($SQLEntries[$i], 0, 2) != '--' AND mb_substr($SQLEntries[$i], 0, 3) != 'USE' - AND strstr($SQLEntries[$i],'/*')==FALSE + AND mb_strstr($SQLEntries[$i],'/*')==FALSE AND mb_strlen($SQLEntries[$i])>1){ $sql .= ' ' . $SQLEntries[$i]; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WWW_Users.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -70,7 +70,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WorkCentres.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -30,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { + if (mb_strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ include('includes/footer.inc'); exit; } - if (strstr($_POST['NewBranchCode'],".")>0 OR strstr($_POST['NewBranchCode'],"&") OR strstr($_POST['NewBranchCode'],"-") OR strstr($_POST['NewBranchCode']," ")){ + if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -120,7 +120,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (strstr($StockID,' ') OR strstr($StockID,"'") OR strstr($StockID,'+') OR strstr($StockID,"\\") OR strstr($StockID,"\"") OR strstr($StockID,'&') OR strstr($StockID,'"')) { + if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_MakeNewCompany.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -105,7 +105,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -36,7 +36,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_debtortransactions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -87,9 +87,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_salesorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -43,9 +43,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($orddate,"/")) { + if (mb_strstr($orddate,"/")) { $DateArray = explode('/',$orddate); - } elseif (strstr($orddate,".")) { + } elseif (mb_strstr($orddate,".")) { $DateArray = explode('.',$orddate); } if ($DateFormat=='d/m/Y') { @@ -121,9 +121,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($deliverydate,'/')) { + if (mb_strstr($deliverydate,'/')) { $DateArray = explode('/',$deliverydate); - } elseif (strstr($PeriodEnd,'.')) { + } elseif (mb_strstr($PeriodEnd,'.')) { $DateArray = explode('.',$deliverydate); } if ($DateFormat=='d/m/Y') { @@ -231,9 +231,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($itemdue,'/')) { + if (mb_strstr($itemdue,'/')) { $DateArray = explode('/',$itemdue); - } elseif (strstr($itemdue,'.')) { + } elseif (mb_strstr($itemdue,'.')) { $DateArray = explode('.',$itemdue); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_stock.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -79,9 +79,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_suppliers.php =================================================================== --- trunk/api/api_suppliers.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_suppliers.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -51,9 +51,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_workorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -48,9 +48,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { @@ -81,9 +81,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -109,16 +109,16 @@ function ContainsIllegalCharacters ($CheckVariable) { - if (strstr($CheckVariable,"'") - OR strstr($CheckVariable,'+') - OR strstr($CheckVariable,'?') - OR strstr($CheckVariable,'.') - OR strstr($CheckVariable,"\"") - OR strstr($CheckVariable,'&') - OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"') - OR strstr($CheckVariable,'>') - OR strstr($CheckVariable,'<')){ + if (mb_strstr($CheckVariable,"'") + OR mb_strstr($CheckVariable,'+') + OR mb_strstr($CheckVariable,'?') + OR mb_strstr($CheckVariable,'.') + OR mb_strstr($CheckVariable,"\"") + OR mb_strstr($CheckVariable,'&') + OR mb_strstr($CheckVariable,"\\") + OR mb_strstr($CheckVariable,'"') + OR mb_strstr($CheckVariable,'>') + OR mb_strstr($CheckVariable,'<')){ return true; } else { Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/install/save.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -348,7 +348,7 @@ $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); //ignore lines that start with -- or USE or /* if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:30:48
|
Revision: 4627 http://web-erp.svn.sourceforge.net/web-erp/?rev=4627&view=rev Author: daintree Date: 2011-07-08 10:30:40 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CounterSales.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/SelectOrderItems.php trunk/StockSerialItemResearch.php trunk/SuppLoginSetup.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_debtortransactions.php trunk/api/api_salesorders.php trunk/api/api_stock.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/install/save.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CounterSales.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -35,7 +35,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItemArray[mb_substr($key,3)] = trim($value); } } Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (strstr($_POST['Abbreviation'],"'") OR strstr($_POST['Abbreviation'],'+') OR strstr($_POST['Abbreviation'],"\"") OR strstr($_POST['Abbreviation'],'&') OR strstr($_POST['Abbreviation'],' ') OR strstr($_POST['Abbreviation'],"\\") OR strstr($_POST['Abbreviation'],'.') OR strstr($_POST['Abbreviation'],'"')) { + if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustEDISetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ //first off validate inputs sensible if (ContainsIllegalCharacters($_POST['EDIReference']) - OR strstr($_POST['EDIReference'],' ')) { + OR mb_strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); } Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -40,7 +40,7 @@ if (mb_strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR mb_strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (mb_strlen($_POST['Password'])<5){ @@ -48,7 +48,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustomerBranches.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -46,7 +46,7 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain any of the following characters')." - & \'",'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SelectOrderItems.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -24,7 +24,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItem_array[mb_substr($key,3)] = trim($value); } } Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/StockSerialItemResearch.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,8 +38,8 @@ if ($SN!='') { //the point here is to allow a semi fuzzy search, but still keep someone from killing the db server - if (strstr($SN,'%')){ - while(strstr($SN,'%%')) { + if (mb_strstr($SN,'%')){ + while(mb_strstr($SN,'%%')) { $SN = str_replace('%%','%',$SN); } if (mb_strlen($SN) < 11){ Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SuppLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -82,7 +82,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SystemParameters.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -33,7 +33,7 @@ } elseif (mb_strlen($_POST['X_DefaultCreditLimit']) > 12 || !is_numeric($_POST['X_DefaultCreditLimit']) ) { $InputError = 1; prnMsg(_('Default Credit Limit must be a number'),'error'); - } elseif (strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { + } elseif (mb_strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { $InputError = 1; prnMsg(_('The Romalpa Clause may not contain single quotes and may not be longer than 5000 chars'),'error'); } elseif (mb_strlen($_POST['X_QuickEntries']) > 2 || !is_numeric($_POST['X_QuickEntries']) || Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/UpgradeDatabase.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -146,7 +146,7 @@ if (mb_substr($SQLEntries[$i], 0, 2) != '--' AND mb_substr($SQLEntries[$i], 0, 3) != 'USE' - AND strstr($SQLEntries[$i],'/*')==FALSE + AND mb_strstr($SQLEntries[$i],'/*')==FALSE AND mb_strlen($SQLEntries[$i])>1){ $sql .= ' ' . $SQLEntries[$i]; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WWW_Users.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -70,7 +70,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WorkCentres.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -30,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { + if (mb_strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ include('includes/footer.inc'); exit; } - if (strstr($_POST['NewBranchCode'],".")>0 OR strstr($_POST['NewBranchCode'],"&") OR strstr($_POST['NewBranchCode'],"-") OR strstr($_POST['NewBranchCode']," ")){ + if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -120,7 +120,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (strstr($StockID,' ') OR strstr($StockID,"'") OR strstr($StockID,'+') OR strstr($StockID,"\\") OR strstr($StockID,"\"") OR strstr($StockID,'&') OR strstr($StockID,'"')) { + if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_MakeNewCompany.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -105,7 +105,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -36,7 +36,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_debtortransactions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -87,9 +87,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_salesorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -43,9 +43,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($orddate,"/")) { + if (mb_strstr($orddate,"/")) { $DateArray = explode('/',$orddate); - } elseif (strstr($orddate,".")) { + } elseif (mb_strstr($orddate,".")) { $DateArray = explode('.',$orddate); } if ($DateFormat=='d/m/Y') { @@ -121,9 +121,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($deliverydate,'/')) { + if (mb_strstr($deliverydate,'/')) { $DateArray = explode('/',$deliverydate); - } elseif (strstr($PeriodEnd,'.')) { + } elseif (mb_strstr($PeriodEnd,'.')) { $DateArray = explode('.',$deliverydate); } if ($DateFormat=='d/m/Y') { @@ -231,9 +231,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($itemdue,'/')) { + if (mb_strstr($itemdue,'/')) { $DateArray = explode('/',$itemdue); - } elseif (strstr($itemdue,'.')) { + } elseif (mb_strstr($itemdue,'.')) { $DateArray = explode('.',$itemdue); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_stock.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -79,9 +79,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_suppliers.php =================================================================== --- trunk/api/api_suppliers.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_suppliers.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -51,9 +51,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_workorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -48,9 +48,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { @@ -81,9 +81,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -109,16 +109,16 @@ function ContainsIllegalCharacters ($CheckVariable) { - if (strstr($CheckVariable,"'") - OR strstr($CheckVariable,'+') - OR strstr($CheckVariable,'?') - OR strstr($CheckVariable,'.') - OR strstr($CheckVariable,"\"") - OR strstr($CheckVariable,'&') - OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"') - OR strstr($CheckVariable,'>') - OR strstr($CheckVariable,'<')){ + if (mb_strstr($CheckVariable,"'") + OR mb_strstr($CheckVariable,'+') + OR mb_strstr($CheckVariable,'?') + OR mb_strstr($CheckVariable,'.') + OR mb_strstr($CheckVariable,"\"") + OR mb_strstr($CheckVariable,'&') + OR mb_strstr($CheckVariable,"\\") + OR mb_strstr($CheckVariable,'"') + OR mb_strstr($CheckVariable,'>') + OR mb_strstr($CheckVariable,'<')){ return true; } else { Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/install/save.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -348,7 +348,7 @@ $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); //ignore lines that start with -- or USE or /* if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:43:15
|
Revision: 4628 http://web-erp.svn.sourceforge.net/web-erp/?rev=4628&view=rev Author: daintree Date: 2011-07-08 10:43:09 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Currencies.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/doc/Change.log Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Currencies.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { + if (ContainsIllegalCharacters($_POST['Abbreviation'])) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/*Script to Delete all sales transactions*/ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('UTILITY PAGE To Changes A Customer Branch Code In All Tables'); include('includes/header.inc'); @@ -11,29 +9,28 @@ /*First check the customer code exists */ $result=DB_query("SELECT debtorno, - branchcode - FROM custbranch - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); + branchcode + FROM custbranch + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); if (DB_num_rows($result)==0){ prnMsg (_('The customer branch code') . ': ' . $_POST['DebtorNo'] . ' - ' . $_POST['OldBranchCode'] . ' ' . _('does not currently exist as a customer branch code in the system'),'error'); include('includes/footer.inc'); exit; } - if ($_POST['NewBranchCode']==""){ + if ($_POST['NewBranchCode']==''){ prnMsg(_('The new customer branch code to change the old code to must be entered as well'),'error'); include('includes/footer.inc'); exit; } - if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ + if (ContainsIllegalCharacters($_POST['NewBranchCode']) OR mb_strstr($_POST['NewBranchCode'],' ')){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; } - /*Now check that the new code doesn't already exist */ $result=DB_query("SELECT debtorno FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "' AND branchcode ='" . $_POST['NewBranchCode'] . "'",$db); if (DB_num_rows($result)!=0){ Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ImportStocks.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* Script to make stock locations for all parts that do not have stock location records set up*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Items'); include('includes/header.inc'); @@ -120,7 +118,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { + if (ContainsIllegalCharacters($StockID) OR mb_strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:43:15
|
Revision: 4628 http://web-erp.svn.sourceforge.net/web-erp/?rev=4628&view=rev Author: daintree Date: 2011-07-08 10:43:09 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Currencies.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/doc/Change.log Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Currencies.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { + if (ContainsIllegalCharacters($_POST['Abbreviation'])) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/*Script to Delete all sales transactions*/ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('UTILITY PAGE To Changes A Customer Branch Code In All Tables'); include('includes/header.inc'); @@ -11,29 +9,28 @@ /*First check the customer code exists */ $result=DB_query("SELECT debtorno, - branchcode - FROM custbranch - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); + branchcode + FROM custbranch + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); if (DB_num_rows($result)==0){ prnMsg (_('The customer branch code') . ': ' . $_POST['DebtorNo'] . ' - ' . $_POST['OldBranchCode'] . ' ' . _('does not currently exist as a customer branch code in the system'),'error'); include('includes/footer.inc'); exit; } - if ($_POST['NewBranchCode']==""){ + if ($_POST['NewBranchCode']==''){ prnMsg(_('The new customer branch code to change the old code to must be entered as well'),'error'); include('includes/footer.inc'); exit; } - if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ + if (ContainsIllegalCharacters($_POST['NewBranchCode']) OR mb_strstr($_POST['NewBranchCode'],' ')){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; } - /*Now check that the new code doesn't already exist */ $result=DB_query("SELECT debtorno FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "' AND branchcode ='" . $_POST['NewBranchCode'] . "'",$db); if (DB_num_rows($result)!=0){ Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ImportStocks.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* Script to make stock locations for all parts that do not have stock location records set up*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Items'); include('includes/header.inc'); @@ -120,7 +118,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { + if (ContainsIllegalCharacters($StockID) OR mb_strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-09 08:23:06
|
Revision: 4629 http://web-erp.svn.sourceforge.net/web-erp/?rev=4629&view=rev Author: daintree Date: 2011-07-09 08:22:59 +0000 (Sat, 09 Jul 2011) Log Message: ----------- wrapping text on quotation comments Modified Paths: -------------- trunk/GLAccounts.php trunk/PDFQuotation.php trunk/doc/Change.log Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/GLAccounts.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -37,7 +37,7 @@ $sql = "UPDATE chartmaster SET accountname='" . $_POST['AccountName'] . "', group_='" . $_POST['Group'] . "' - WHERE accountcode ='" . $SelectedAccount . "'"; + WHERE accountcode ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not update the account because'); $result = DB_query($sql,$db,$ErrMsg); @@ -52,8 +52,7 @@ group_) VALUES ('" . $_POST['AccountCode'] . "', '" . $_POST['AccountName'] . "', - '" . $_POST['Group'] . "' - )"; + '" . $_POST['Group'] . "')"; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('The new general ledger account has been added'),'success'); @@ -69,9 +68,10 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'ChartDetails' - - - $sql= "SELECT COUNT(*) FROM chartdetails WHERE chartdetails.accountcode ='" . $SelectedAccount . "' AND chartdetails.actual <>0"; + $sql= "SELECT COUNT(*) + FROM chartdetails + WHERE chartdetails.accountcode ='" . $SelectedAccount . "' + AND chartdetails.actual <>0"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -81,7 +81,9 @@ } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'GLTrans' - $sql= "SELECT COUNT(*) FROM gltrans WHERE gltrans.account ='" . $SelectedAccount . "'"; + $sql= "SELECT COUNT(*) + FROM gltrans + WHERE gltrans.account ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not test for existing transactions because'); @@ -96,14 +98,14 @@ } else { //PREVENT DELETES IF Company default accounts set up to this account $sql= "SELECT COUNT(*) FROM companies - WHERE debtorsact='" . $SelectedAccount ."' - OR pytdiscountact='" . $SelectedAccount ."' - OR creditorsact='" . $SelectedAccount ."' - OR payrollact='" . $SelectedAccount ."' - OR grnact='" . $SelectedAccount ."' - OR exchangediffact='" . $SelectedAccount ."' - OR purchasesexchangediffact='" . $SelectedAccount ."' - OR retainedearnings='" . $SelectedAccount ."'"; + WHERE debtorsact='" . $SelectedAccount ."' + OR pytdiscountact='" . $SelectedAccount ."' + OR creditorsact='" . $SelectedAccount ."' + OR payrollact='" . $SelectedAccount ."' + OR grnact='" . $SelectedAccount ."' + OR exchangediffact='" . $SelectedAccount ."' + OR purchasesexchangediffact='" . $SelectedAccount ."' + OR retainedearnings='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for default company GL codes because'); @@ -144,7 +146,9 @@ prnMsg( _('Cannot delete this account because it is used by one of the sales GL posting interface records'),'warn'); } else { //PREVENT DELETES IF COGS POSTINGS USE THE GL ACCOUNT - $sql= "SELECT COUNT(*) FROM cogsglpostings WHERE glcode='" . $SelectedAccount ."'"; + $sql= "SELECT COUNT(*) + FROM cogsglpostings + WHERE glcode='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for existing cost of sales interface codes because'); @@ -158,11 +162,11 @@ } else { //PREVENT DELETES IF STOCK POSTINGS USE THE GL ACCOUNT $sql= "SELECT COUNT(*) FROM stockcategory - WHERE stockact='" . $SelectedAccount ."' - OR adjglact='" . $SelectedAccount ."' - OR purchpricevaract='" . $SelectedAccount ."' - OR materialuseagevarac='" . $SelectedAccount ."' - OR wipact='" . $SelectedAccount ."'"; + WHERE stockact='" . $SelectedAccount ."' + OR adjglact='" . $SelectedAccount ."' + OR purchpricevaract='" . $SelectedAccount ."' + OR materialuseagevarac='" . $SelectedAccount ."' + OR wipact='" . $SelectedAccount ."'"; $Errmsg = _('Could not test for existing stock GL codes because'); Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/PDFQuotation.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -186,10 +186,10 @@ $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,$DisplayTotal,'right'); if (mb_strlen($myrow2['narrative'])>1){ $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$myrow2['narrative']); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$myrow2['narrative']); if (mb_strlen($LeftOvers) >1){ $YPos -= 11; - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$LeftOvers); } } $QuotationTotal +=$LineTotal; @@ -209,35 +209,36 @@ include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up - $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); - $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); - + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,20,10,_('Notes:')); + $LeftOvers = $pdf->addTextWrap($XPos+28,$YPos,800,10,$myrow['comments']); + if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); } } } } - $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); - } /*end if there are line details to show on the quotation*/ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/doc/Change.log 2011-07-09 08:22:59 UTC (rev 4629) @@ -1,6 +1,7 @@ webERP Change Log -8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts +9/7/11 Phil/Beth Lesko: Comments not wrapping correctly on quotations - fixed landscape quotation +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts Z_ChangeBranchCode.php and Z_ImportStockCodes.php 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-09 08:23:06
|
Revision: 4629 http://web-erp.svn.sourceforge.net/web-erp/?rev=4629&view=rev Author: daintree Date: 2011-07-09 08:22:59 +0000 (Sat, 09 Jul 2011) Log Message: ----------- wrapping text on quotation comments Modified Paths: -------------- trunk/GLAccounts.php trunk/PDFQuotation.php trunk/doc/Change.log Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/GLAccounts.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -37,7 +37,7 @@ $sql = "UPDATE chartmaster SET accountname='" . $_POST['AccountName'] . "', group_='" . $_POST['Group'] . "' - WHERE accountcode ='" . $SelectedAccount . "'"; + WHERE accountcode ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not update the account because'); $result = DB_query($sql,$db,$ErrMsg); @@ -52,8 +52,7 @@ group_) VALUES ('" . $_POST['AccountCode'] . "', '" . $_POST['AccountName'] . "', - '" . $_POST['Group'] . "' - )"; + '" . $_POST['Group'] . "')"; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('The new general ledger account has been added'),'success'); @@ -69,9 +68,10 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'ChartDetails' - - - $sql= "SELECT COUNT(*) FROM chartdetails WHERE chartdetails.accountcode ='" . $SelectedAccount . "' AND chartdetails.actual <>0"; + $sql= "SELECT COUNT(*) + FROM chartdetails + WHERE chartdetails.accountcode ='" . $SelectedAccount . "' + AND chartdetails.actual <>0"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -81,7 +81,9 @@ } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'GLTrans' - $sql= "SELECT COUNT(*) FROM gltrans WHERE gltrans.account ='" . $SelectedAccount . "'"; + $sql= "SELECT COUNT(*) + FROM gltrans + WHERE gltrans.account ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not test for existing transactions because'); @@ -96,14 +98,14 @@ } else { //PREVENT DELETES IF Company default accounts set up to this account $sql= "SELECT COUNT(*) FROM companies - WHERE debtorsact='" . $SelectedAccount ."' - OR pytdiscountact='" . $SelectedAccount ."' - OR creditorsact='" . $SelectedAccount ."' - OR payrollact='" . $SelectedAccount ."' - OR grnact='" . $SelectedAccount ."' - OR exchangediffact='" . $SelectedAccount ."' - OR purchasesexchangediffact='" . $SelectedAccount ."' - OR retainedearnings='" . $SelectedAccount ."'"; + WHERE debtorsact='" . $SelectedAccount ."' + OR pytdiscountact='" . $SelectedAccount ."' + OR creditorsact='" . $SelectedAccount ."' + OR payrollact='" . $SelectedAccount ."' + OR grnact='" . $SelectedAccount ."' + OR exchangediffact='" . $SelectedAccount ."' + OR purchasesexchangediffact='" . $SelectedAccount ."' + OR retainedearnings='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for default company GL codes because'); @@ -144,7 +146,9 @@ prnMsg( _('Cannot delete this account because it is used by one of the sales GL posting interface records'),'warn'); } else { //PREVENT DELETES IF COGS POSTINGS USE THE GL ACCOUNT - $sql= "SELECT COUNT(*) FROM cogsglpostings WHERE glcode='" . $SelectedAccount ."'"; + $sql= "SELECT COUNT(*) + FROM cogsglpostings + WHERE glcode='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for existing cost of sales interface codes because'); @@ -158,11 +162,11 @@ } else { //PREVENT DELETES IF STOCK POSTINGS USE THE GL ACCOUNT $sql= "SELECT COUNT(*) FROM stockcategory - WHERE stockact='" . $SelectedAccount ."' - OR adjglact='" . $SelectedAccount ."' - OR purchpricevaract='" . $SelectedAccount ."' - OR materialuseagevarac='" . $SelectedAccount ."' - OR wipact='" . $SelectedAccount ."'"; + WHERE stockact='" . $SelectedAccount ."' + OR adjglact='" . $SelectedAccount ."' + OR purchpricevaract='" . $SelectedAccount ."' + OR materialuseagevarac='" . $SelectedAccount ."' + OR wipact='" . $SelectedAccount ."'"; $Errmsg = _('Could not test for existing stock GL codes because'); Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/PDFQuotation.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -186,10 +186,10 @@ $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,$DisplayTotal,'right'); if (mb_strlen($myrow2['narrative'])>1){ $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$myrow2['narrative']); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$myrow2['narrative']); if (mb_strlen($LeftOvers) >1){ $YPos -= 11; - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$LeftOvers); } } $QuotationTotal +=$LineTotal; @@ -209,35 +209,36 @@ include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up - $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); - $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); - + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,20,10,_('Notes:')); + $LeftOvers = $pdf->addTextWrap($XPos+28,$YPos,800,10,$myrow['comments']); + if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); } } } } - $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); - } /*end if there are line details to show on the quotation*/ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/doc/Change.log 2011-07-09 08:22:59 UTC (rev 4629) @@ -1,6 +1,7 @@ webERP Change Log -8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts +9/7/11 Phil/Beth Lesko: Comments not wrapping correctly on quotations - fixed landscape quotation +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts Z_ChangeBranchCode.php and Z_ImportStockCodes.php 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-14 10:27:37
|
Revision: 4630 http://web-erp.svn.sourceforge.net/web-erp/?rev=4630&view=rev Author: daintree Date: 2011-07-14 10:27:29 +0000 (Thu, 14 Jul 2011) Log Message: ----------- consistency review Modified Paths: -------------- trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GetStockImage.php trunk/GoodsReceived.php trunk/Stocks.php trunk/includes/session.inc Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountCSV.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -43,7 +43,7 @@ echo '</select></td>'; echo '<td>'._('For Period range').':</td> - <td><select Name=Period[] multiple>'; + <td><select name="Period[]" multiple>'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); $id=0; @@ -139,30 +139,30 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' + WHERE gltrans.account = '" . $SelectedAccount . "' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' ORDER BY periodno, gltrans.trandate, counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = '" . $SelectedAccount . "' + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='".$_POST['tag']."' + ORDER BY periodno, gltrans.trandate, counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -176,7 +176,7 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); @@ -202,11 +202,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' - AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountInquiry.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.28 $ */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('General Ledger Account Inquiry'); include('includes/header.inc'); Modified: trunk/GLAccountReport.php =================================================================== --- trunk/GLAccountReport.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountReport.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,6 @@ <?php +/* $Id: GLAccountReport.php 4618 2011-07-02 23:04:59Z daintree $*/ -/* $Id: $*/ -/* $Revision: 1.00 $ */ - -//$PageSecurity = 8; include ('includes/session.inc'); if (isset($_POST['Period'])){ @@ -39,10 +36,10 @@ foreach ($_POST['Account'] as $SelectedAccount){ /*Is the account a balance sheet or a profit and loss account */ $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode='" . $SelectedAccount . "'",$db); $AccountDetailRow = DB_fetch_row($result); $AccountName = $AccountDetailRow[0]; if ($AccountDetailRow[1]==1){ @@ -56,38 +53,42 @@ if ($_POST['tag']==0) { $sql= "SELECT type, - typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - ORDER BY periodno, gltrans.trandate, counterindex"; + typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='" . $_POST['tag'] . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -105,11 +106,11 @@ $RunningTotal = 0; } else { $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -137,11 +138,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -149,9 +150,9 @@ $YPos -=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Period Total')); if ($PeriodTotal < 0 ){ //its a credit balance b/fwd - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } } $PeriodNo = $myrow['periodno']; @@ -162,10 +163,10 @@ $PeriodTotal += $myrow['amount']; if($myrow['amount']>=0){ - $DebitAmount = number_format($myrow['amount'],2); + $DebitAmount = number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $CreditAmount = ''; } elseif ($myrow['amount']<0){ - $CreditAmount = number_format(-$myrow['amount'],2); + $CreditAmount = number_format(-$myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $DebitAmount = ''; } @@ -201,9 +202,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Balance C/Fwd')); } if ($RunningTotal < 0){ - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } $YPos -=$line_height; //draw a line under each account printed @@ -218,28 +219,6 @@ } else { //print the report - /* - $pdfcode = $pdf->output(); - $len = mb_strlen($pdfcode); - - if ($len<=20){ - $title = _('Print GL Accounts Report Error'); - include('includes/header.inc'); - prnMsg (_('There were no accounts to print out'),'error'); - echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=GL_Accounts_' . date('Y-m-d') . '.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('GL_Accounts_' . date('Y-m-d') . '.pdf', 'I'); - } - */ $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Accounts_' . date('Y-m-d') . '.pdf'); $pdf->__destruct(); } //end if the report has some output @@ -253,7 +232,7 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br />'; - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -269,10 +248,10 @@ $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; @@ -285,29 +264,31 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option selected value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; } } echo '</select></td></tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; + tagdescription + FROM tags + ORDER BY tagref"; $result=DB_query($SQL,$db); - echo '<option value=0>0 - '._('All tags'); + echo '<option value=0>0 - '._('All tags') . '</option>'; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -315,7 +296,7 @@ echo '</table><p> <div class="centre"> - <input type=submit name="RunReport" VALUE="' ._('Run Report'). '"></div> + <input type=submit name="RunReport" value="' ._('Run Report'). '"></div> </form>'; include ('includes/footer.inc'); @@ -323,7 +304,6 @@ } - function NewPageHeader () { global $PageNumber, $pdf, Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLProfit_Loss.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -21,7 +21,7 @@ . _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' . _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (Date('m') > $_SESSION['YearEnd']){ @@ -39,22 +39,25 @@ <tr><td>' . _('Select Period From') . ':</td> <td><select Name="FromPeriod">'; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, + lastdate_in_period + FROM periods + ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } } @@ -71,29 +74,34 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To') . ':</td><td><select Name="ToPeriod">'; + echo '<tr> + <td>' . _('Select Period To') . ':</td> + <td><select Name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; - echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; - echo '</select></td></tr>'; + echo '<tr><td>'._('Detail Or Summary').':</td> + <td><select name="Detail"> + <option selected value="Summary">'._('Summary') . '</option> + <option selected value="Detailed">'._('All Accounts') . '</option> + </select> + </td> + </tr>'; echo '</table>'; - 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>"; + 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 */ @@ -126,30 +134,30 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode , - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails - ON chartmaster.accountcode= chartdetails.accountcode - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - chartdetails.accountcode"; + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode , + chartmaster.accountname, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails + ON chartmaster.accountcode= chartdetails.accountcode + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db); @@ -157,7 +165,7 @@ $title = _('Profit and Loss') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug == 1){ echo '<br />'. $SQL; } @@ -167,9 +175,9 @@ if (DB_num_rows($AccountsResult)==0){ $title = _('Print Profit and Loss Error'); include('includes/header.inc'); - echo '<p>'; + echo '<br />'; prnMsg( _('There were no entries to print out for the selections specified'),'warn' ); - echo '<br /><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="'. $rootpath.'/index.php">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -213,15 +221,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -241,15 +249,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -274,9 +282,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -284,16 +292,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $pdf->line($Left_Margin+310, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height); $pdf->line($Left_Margin+310, $YPos,$Left_Margin+500, $YPos); $YPos -= (2 * $line_height); @@ -381,13 +389,13 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$myrow['accountcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$myrow['accountname']); if ($Section == 1) { /*Income*/ - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } else { - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } $YPos -= $line_height; } @@ -406,15 +414,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -434,15 +442,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -463,9 +471,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -473,16 +481,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(100*($TotalIncome - $SectionPrdActual)/$TotalIncome,1) . '%','right'); @@ -493,9 +501,9 @@ } $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Profit').' - '._('Loss')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$PeriodBudgetProfitLoss),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); if ($TotalIncome != 0){ @@ -531,13 +539,13 @@ include('includes/header.inc'); echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "> - <input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; + echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '"> + <input type=hidden name="ToPeriod" value="' . $_POST['ToPeriod'] . '">'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; if ($NumberOfMonths >12){ - echo '<p>'; + echo '<br />'; prnMsg(_('A period up to 12 months in duration can be specified') . ' - ' . _('the system automatically shows a comparative for the same period from the previous year') . ' - ' . _('it cannot do this if a period of more than 12 months is specified') . '. ' . _('Please select an alternative period range'),'error'); include('includes/footer.inc'); exit; @@ -550,32 +558,32 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails - ON chartmaster.accountcode= chartdetails.accountcode - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - accountgroups.sequenceintb, - chartdetails.accountcode"; - + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails + ON chartmaster.accountcode= chartdetails.accountcode + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + accountgroups.sequenceintb, + chartdetails.accountcode"; + $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Profit Loss Inquiry') . '" alt="" />' . ' ' . _('Statement of Profit and Loss for the') . ' ' . $NumberOfMonths . ' ' . _('months to') . ' and including ' . $PeriodToDate . '</p>'; @@ -587,19 +595,19 @@ if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> - <th>' . _('Account') . '</th> - <th>'._('Account Name') .'</th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') .'</th> - <th colspan=2>' . _('Last Year') . '</th> - </tr>'; + <th>' . _('Account') . '</th> + <th>'._('Account Name') .'</th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') .'</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') . '</th> - <th colspan=2>' . _('Last Year') . '</th> - </tr>'; + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') . '</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } @@ -635,41 +643,41 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -680,9 +688,9 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; @@ -690,32 +698,32 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -731,71 +739,71 @@ if ($Section==1) { /*Income*/ echo '<tr> - <td colspan=3></td> + <td colspan=3></td> <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format(-$SectionPrdActual), - number_format(-$SectionPrdBudget), - number_format(-$SectionPrdLY)); - $TotalIncome = -$SectionPrdActual; - $TotalBudgetIncome = -$SectionPrdBudget; - $TotalLYIncome = -$SectionPrdLY; + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + $TotalIncome = -$SectionPrdActual; + $TotalBudgetIncome = -$SectionPrdBudget; + $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format($SectionPrdActual), - number_format($SectionPrdBudget), - number_format($SectionPrdLY)); + <td colspan=2></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; + printf('<tr> + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - number_format($TotalIncome - $SectionPrdActual), - number_format($TotalBudgetIncome - $SectionPrdBudget), - number_format($TotalLYIncome - $SectionPrdLY)); - + <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + if ($TotalIncome !=0){ $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; } else { @@ -812,21 +820,21 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', - number_format($PrdGPPercent,1) . '%', - number_format($BudgetGPPercent,1) . '%', - number_format($LYGPPercent,1). '%'); + <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + </tr><tr><td colspan=6> </td></tr>', + number_format($PrdGPPercent,1) . '%', + number_format($BudgetGPPercent,1) . '%', + number_format($LYGPPercent,1). '%'); $j++; } } @@ -898,34 +906,34 @@ if ($Section ==1){ printf('<td>%s</td> - <td>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format(-$AccountPeriodActual), - number_format(-$AccountPeriodBudget), - number_format(-$AccountPeriodLY)); + <td>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces'])); } else { printf('<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format($AccountPeriodActual), - number_format($AccountPeriodBudget), - number_format($AccountPeriodLY)); + <td>%s</td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodLY,$_SESSION['Compan... [truncated message content] |
From: <dai...@us...> - 2011-07-14 10:27:37
|
Revision: 4630 http://web-erp.svn.sourceforge.net/web-erp/?rev=4630&view=rev Author: daintree Date: 2011-07-14 10:27:29 +0000 (Thu, 14 Jul 2011) Log Message: ----------- consistency review Modified Paths: -------------- trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GetStockImage.php trunk/GoodsReceived.php trunk/Stocks.php trunk/includes/session.inc Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountCSV.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -43,7 +43,7 @@ echo '</select></td>'; echo '<td>'._('For Period range').':</td> - <td><select Name=Period[] multiple>'; + <td><select name="Period[]" multiple>'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); $id=0; @@ -139,30 +139,30 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' + WHERE gltrans.account = '" . $SelectedAccount . "' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' ORDER BY periodno, gltrans.trandate, counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = '" . $SelectedAccount . "' + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='".$_POST['tag']."' + ORDER BY periodno, gltrans.trandate, counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -176,7 +176,7 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); @@ -202,11 +202,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' - AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountInquiry.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.28 $ */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('General Ledger Account Inquiry'); include('includes/header.inc'); Modified: trunk/GLAccountReport.php =================================================================== --- trunk/GLAccountReport.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountReport.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,6 @@ <?php +/* $Id: GLAccountReport.php 4618 2011-07-02 23:04:59Z daintree $*/ -/* $Id: $*/ -/* $Revision: 1.00 $ */ - -//$PageSecurity = 8; include ('includes/session.inc'); if (isset($_POST['Period'])){ @@ -39,10 +36,10 @@ foreach ($_POST['Account'] as $SelectedAccount){ /*Is the account a balance sheet or a profit and loss account */ $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode='" . $SelectedAccount . "'",$db); $AccountDetailRow = DB_fetch_row($result); $AccountName = $AccountDetailRow[0]; if ($AccountDetailRow[1]==1){ @@ -56,38 +53,42 @@ if ($_POST['tag']==0) { $sql= "SELECT type, - typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - ORDER BY periodno, gltrans.trandate, counterindex"; + typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='" . $_POST['tag'] . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -105,11 +106,11 @@ $RunningTotal = 0; } else { $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -137,11 +138,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -149,9 +150,9 @@ $YPos -=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Period Total')); if ($PeriodTotal < 0 ){ //its a credit balance b/fwd - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } } $PeriodNo = $myrow['periodno']; @@ -162,10 +163,10 @@ $PeriodTotal += $myrow['amount']; if($myrow['amount']>=0){ - $DebitAmount = number_format($myrow['amount'],2); + $DebitAmount = number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $CreditAmount = ''; } elseif ($myrow['amount']<0){ - $CreditAmount = number_format(-$myrow['amount'],2); + $CreditAmount = number_format(-$myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $DebitAmount = ''; } @@ -201,9 +202,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Balance C/Fwd')); } if ($RunningTotal < 0){ - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } $YPos -=$line_height; //draw a line under each account printed @@ -218,28 +219,6 @@ } else { //print the report - /* - $pdfcode = $pdf->output(); - $len = mb_strlen($pdfcode); - - if ($len<=20){ - $title = _('Print GL Accounts Report Error'); - include('includes/header.inc'); - prnMsg (_('There were no accounts to print out'),'error'); - echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=GL_Accounts_' . date('Y-m-d') . '.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('GL_Accounts_' . date('Y-m-d') . '.pdf', 'I'); - } - */ $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Accounts_' . date('Y-m-d') . '.pdf'); $pdf->__destruct(); } //end if the report has some output @@ -253,7 +232,7 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br />'; - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -269,10 +248,10 @@ $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; @@ -285,29 +264,31 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option selected value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; } } echo '</select></td></tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; + tagdescription + FROM tags + ORDER BY tagref"; $result=DB_query($SQL,$db); - echo '<option value=0>0 - '._('All tags'); + echo '<option value=0>0 - '._('All tags') . '</option>'; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -315,7 +296,7 @@ echo '</table><p> <div class="centre"> - <input type=submit name="RunReport" VALUE="' ._('Run Report'). '"></div> + <input type=submit name="RunReport" value="' ._('Run Report'). '"></div> </form>'; include ('includes/footer.inc'); @@ -323,7 +304,6 @@ } - function NewPageHeader () { global $PageNumber, $pdf, Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLProfit_Loss.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -21,7 +21,7 @@ . _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' . _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (Date('m') > $_SESSION['YearEnd']){ @@ -39,22 +39,25 @@ <tr><td>' . _('Select Period From') . ':</td> <td><select Name="FromPeriod">'; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, + lastdate_in_period + FROM periods + ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } } @@ -71,29 +74,34 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To') . ':</td><td><select Name="ToPeriod">'; + echo '<tr> + <td>' . _('Select Period To') . ':</td> + <td><select Name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; - echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; - echo '</select></td></tr>'; + echo '<tr><td>'._('Detail Or Summary').':</td> + <td><select name="Detail"> + <option selected value="Summary">'._('Summary') . '</option> + <option selected value="Detailed">'._('All Accounts') . '</option> + </select> + </td> + </tr>'; echo '</table>'; - 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>"; + 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 */ @@ -126,30 +134,30 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode , - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails - ON chartmaster.accountcode= chartdetails.accountcode - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - chartdetails.accountcode"; + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode , + chartmaster.accountname, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails + ON chartmaster.accountcode= chartdetails.accountcode + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db); @@ -157,7 +165,7 @@ $title = _('Profit and Loss') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug == 1){ echo '<br />'. $SQL; } @@ -167,9 +175,9 @@ if (DB_num_rows($AccountsResult)==0){ $title = _('Print Profit and Loss Error'); include('includes/header.inc'); - echo '<p>'; + echo '<br />'; prnMsg( _('There were no entries to print out for the selections specified'),'warn' ); - echo '<br /><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="'. $rootpath.'/index.php">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -213,15 +221,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -241,15 +249,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -274,9 +282,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -284,16 +292,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $pdf->line($Left_Margin+310, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height); $pdf->line($Left_Margin+310, $YPos,$Left_Margin+500, $YPos); $YPos -= (2 * $line_height); @@ -381,13 +389,13 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$myrow['accountcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$myrow['accountname']); if ($Section == 1) { /*Income*/ - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } else { - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } $YPos -= $line_height; } @@ -406,15 +414,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -434,15 +442,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $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,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -463,9 +471,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -473,16 +481,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(100*($TotalIncome - $SectionPrdActual)/$TotalIncome,1) . '%','right'); @@ -493,9 +501,9 @@ } $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Profit').' - '._('Loss')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$PeriodBudgetProfitLoss),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); if ($TotalIncome != 0){ @@ -531,13 +539,13 @@ include('includes/header.inc'); echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "> - <input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; + echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '"> + <input type=hidden name="ToPeriod" value="' . $_POST['ToPeriod'] . '">'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; if ($NumberOfMonths >12){ - echo '<p>'; + echo '<br />'; prnMsg(_('A period up to 12 months in duration can be specified') . ' - ' . _('the system automatically shows a comparative for the same period from the previous year') . ' - ' . _('it cannot do this if a period of more than 12 months is specified') . '. ' . _('Please select an alternative period range'),'error'); include('includes/footer.inc'); exit; @@ -550,32 +558,32 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails - ON chartmaster.accountcode= chartdetails.accountcode - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - accountgroups.sequenceintb, - chartdetails.accountcode"; - + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails + ON chartmaster.accountcode= chartdetails.accountcode + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + accountgroups.sequenceintb, + chartdetails.accountcode"; + $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Profit Loss Inquiry') . '" alt="" />' . ' ' . _('Statement of Profit and Loss for the') . ' ' . $NumberOfMonths . ' ' . _('months to') . ' and including ' . $PeriodToDate . '</p>'; @@ -587,19 +595,19 @@ if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> - <th>' . _('Account') . '</th> - <th>'._('Account Name') .'</th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') .'</th> - <th colspan=2>' . _('Last Year') . '</th> - </tr>'; + <th>' . _('Account') . '</th> + <th>'._('Account Name') .'</th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') .'</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') . '</th> - <th colspan=2>' . _('Last Year') . '</th> - </tr>'; + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') . '</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } @@ -635,41 +643,41 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -680,9 +688,9 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; @@ -690,32 +698,32 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -731,71 +739,71 @@ if ($Section==1) { /*Income*/ echo '<tr> - <td colspan=3></td> + <td colspan=3></td> <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format(-$SectionPrdActual), - number_format(-$SectionPrdBudget), - number_format(-$SectionPrdLY)); - $TotalIncome = -$SectionPrdActual; - $TotalBudgetIncome = -$SectionPrdBudget; - $TotalLYIncome = -$SectionPrdLY; + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + $TotalIncome = -$SectionPrdActual; + $TotalBudgetIncome = -$SectionPrdBudget; + $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format($SectionPrdActual), - number_format($SectionPrdBudget), - number_format($SectionPrdLY)); + <td colspan=2></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; + printf('<tr> + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - number_format($TotalIncome - $SectionPrdActual), - number_format($TotalBudgetIncome - $SectionPrdBudget), - number_format($TotalLYIncome - $SectionPrdLY)); - + <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + if ($TotalIncome !=0){ $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; } else { @@ -812,21 +820,21 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', - number_format($PrdGPPercent,1) . '%', - number_format($BudgetGPPercent,1) . '%', - number_format($LYGPPercent,1). '%'); + <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + </tr><tr><td colspan=6> </td></tr>', + number_format($PrdGPPercent,1) . '%', + number_format($BudgetGPPercent,1) . '%', + number_format($LYGPPercent,1). '%'); $j++; } } @@ -898,34 +906,34 @@ if ($Section ==1){ printf('<td>%s</td> - <td>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format(-$AccountPeriodActual), - number_format(-$AccountPeriodBudget), - number_format(-$AccountPeriodLY)); + <td>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces'])); } else { printf('<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format($AccountPeriodActual), - number_format($AccountPeriodBudget), - number_format($AccountPeriodLY)); + <td>%s</td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodLY,$_SESSION['Compan... [truncated message content] |