From: <dai...@us...> - 2011-11-04 04:56:34
|
Revision: 4739 http://web-erp.svn.sourceforge.net/web-erp/?rev=4739&view=rev Author: daintree Date: 2011-11-04 04:56:22 +0000 (Fri, 04 Nov 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/CustomerReceipt.php trunk/DailySalesInquiry.php trunk/PDFReceipt.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/DefineReceiptClass.php trunk/install/save.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/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.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo 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.mo 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.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo 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.mo 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.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo 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_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/CustomerReceipt.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -16,7 +16,6 @@ unset($_SESSION['ReceiptBatch']->Items); unset($_SESSION['ReceiptBatch']); unset($_SESSION['CustomerRecord']); - } if (isset($_POST['Cancel'])) { @@ -27,7 +26,11 @@ $_POST['GLEntry']=1; } -if ((isset($_POST['BatchInput']) and $_POST['BankAccount']=='') or (isset($_POST['Process']) and $_POST['BankAccount']=='')) { +if ((isset($_POST['BatchInput']) + AND $_POST['BankAccount']=='') + OR (isset($_POST['Process']) + AND $_POST['BankAccount']=='')) { + echo '<br />'; prnMsg(_('A bank account must be selected for this receipt'), 'warn'); $BankAccountEmpty=TRUE; @@ -37,13 +40,17 @@ $BankAccountEmpty=FALSE; } -if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ //always process a header update unless deleting an item +if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ + //always process a header update unless deleting an item - $_SESSION['ReceiptBatch']->Account = $_POST['BankAccount']; /*Get the bank account currency and set that too */ - $SQL = "SELECT bankaccountname, currcode FROM bankaccounts WHERE accountcode='" . $_POST['BankAccount']."'"; + $SQL = "SELECT bankaccountname, + currcode + FROM bankaccounts + WHERE accountcode='" . $_POST['BankAccount']."'"; + $ErrMsg =_('The bank account name cannot be retrieved because'); $result= DB_query($SQL,$db,$ErrMsg); @@ -69,7 +76,7 @@ prnMsg(_('The exchange rate entered should be numeric'),'warn'); } } - if (isset($_POST['FunctionalExRate']) and $_POST['FunctionalExRate']!=''){ + if (isset($_POST['FunctionalExRate']) AND $_POST['FunctionalExRate']!=''){ if (is_numeric(filter_number_format($_POST['FunctionalExRate']))){ $_SESSION['ReceiptBatch']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between receipt currency and account currency } else { @@ -119,14 +126,14 @@ */ /*Get suggested FunctionalExRate */ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->AccountCurrency . "'",$db); - $myrow = DB_fetch_row($result); - $SuggestedFunctionalExRate = $myrow[0]; - + $result = DB_query("SELECT rate, decimalplaces FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->AccountCurrency . "'",$db); + $myrow = DB_fetch_array($result); + $SuggestedFunctionalExRate = $myrow['rate']; + $_SESSION['ReceiptBatch']->CurrDecimalPlaces = $myrow['decimalplaces']; /*Get the exchange rate between the functional currency and the receipt currency*/ $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); - $myrow = DB_fetch_row($result); - $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the receipt currency + $myrow = DB_fetch_array($result); + $tableExRate = $myrow['rate']; //this is the rate of exchange between the functional currency and the receipt currency /*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */ $SuggestedExRate = $tableExRate/$SuggestedFunctionalExRate; } //end else account currency != functional currency @@ -156,17 +163,17 @@ $_POST['CustomerName']=''; } - if ($_POST['GLCode'] == '' and $_GET['Type']=='GL') { + if ($_POST['GLCode'] == '' AND $_GET['Type']=='GL') { prnMsg( _('No General Ledger code has been chosen') . ' - ' . _('so this GL analysis item could not be added'),'warn'); } else { - $_SESSION['ReceiptBatch']->add_to_batch($_POST['Amount'], - $_POST['CustomerID'], - $_POST['Discount'], - $_POST['Narrative'], - $_POST['GLCode'], - $_POST['PayeeBankDetail'], - $_POST['CustomerName'], - $_POST['tag']); + $_SESSION['ReceiptBatch']->add_to_batch(filter_number_format($_POST['Amount']), + $_POST['CustomerID'], + filter_number_format($_POST['Discount']), + $_POST['Narrative'], + $_POST['GLCode'], + $_POST['PayeeBankDetail'], + $_POST['CustomerName'], + $_POST['tag']); /*Make sure the same receipt is not double processed by a page refresh */ $Cancel = 1; @@ -228,13 +235,20 @@ $k=0; //Table row counter for row styles $CustomerReceiptCounter=1; //Count lines of customer receipts in this batch - echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'</p><br />'; + echo '<br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').' + </p> + <br />'; - echo '<table class=selection><tr><th>'._('Batch Number').'</th> + echo '<table class="selection"> + <tr> + <th>'._('Batch Number').'</th> <th>' . _('Date Banked') . '</th> <th>' . _('Customer Name') . '</th> <th>' . _('GL Code') . '</th> - <th>' . _('Amount of Receipt').'</th></tr>'; + <th>' . _('Amount of Receipt').'</th> + </tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -254,7 +268,7 @@ <td>'.$_SESSION['ReceiptBatch']->DateBanked.'</td> <td>'.$ReceiptItem->CustomerName.'</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> - <td class=number>'.locale_number_format($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate,2) .'</td>'; + <td class="number">'.locale_number_format($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) .'</td>'; if ($ReceiptItem->GLCode ==''){ echo '<td><a target="_blank" href="' . $rootpath . '/PDFReceipt.php?BatchNumber=' . $_SESSION['ReceiptBatch']->BatchNo. '&ReceiptNumber='.$CustomerReceiptCounter.'">'._('Print a Customer Receipt').'</a></td></tr>'; @@ -527,7 +541,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/PDFBankingSummary.php?BatchNo=' . $_SESSION['ReceiptBatch']->BatchNo . '">' . _('Print PDF Batch Summary') . '</a></p>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/allocation.png" title="' . _('Allocate') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts') . '</a></p>'; - echo '<p class="page_title_text">• ' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer ' . _('Enter Receipts') . ' </p>'; + echo '<p class="page_title_text"><a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a> + </p>'; unset($_SESSION['ReceiptBatch']); include('includes/footer.inc'); @@ -541,7 +556,10 @@ if ($_POST['Keywords'] AND $_POST['CustCode']) { $msg=_('Customer name keywords have been used in preference to the customer code extract entered'); } - if ($_POST['Keywords']=="" AND $_POST['CustCode']=="" AND $_POST['CustInvNo']=="") { + if ($_POST['Keywords']=='' + AND $_POST['CustCode']=='' + AND $_POST['CustInvNo']=='') { + $msg=_('At least one Customer Name keyword OR an extract of a Customer Code must be entered for the search'); } else { if (mb_strlen($_POST['Keywords'])>0) { @@ -549,24 +567,24 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name - FROM debtorsmaster - WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster + WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (mb_strlen($_POST['CustCode'])>0){ $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name - FROM debtorsmaster - WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster + WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (mb_strlen($_POST['CustInvNo'])>0){ $SQL = "SELECT debtortrans.debtorno, - debtorsmaster.name - FROM debtorsmaster LEFT JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster LEFT JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } $CustomerSearchResult = DB_query($SQL,$db,'','',false,false); @@ -609,6 +627,7 @@ debtorsmaster.currcode, currencies.currency, currencies.rate, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -629,21 +648,21 @@ 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, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "' - AND debtorsmaster.debtorno = debtortrans.debtorno + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "' GROUP BY debtorsmaster.name, debtorsmaster.pymtdiscount, debtorsmaster.currcode, currencies.currency, currencies.rate, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, paymentterms.daysbeforedue, @@ -667,19 +686,19 @@ debtorsmaster.pymtdiscount, currencies.currency, currencies.rate, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, debtorsmaster.creditlimit, debtorsmaster.currcode, holdreasons.dissallowinvoices, holdreasons.reasondescription - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; $ErrMsg = _('The customer details could not be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -708,11 +727,10 @@ /*show the batch header details and the entries in the batch so far */ $SQL = "SELECT bankaccountname, - bankaccounts.accountcode, - bankaccounts.currcode - FROM bankaccounts, - chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode"; + bankaccounts.accountcode, + bankaccounts.currcode + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode=chartmaster.accountcode"; $ErrMsg = _('The bank accounts could not be retrieved because'); @@ -725,11 +743,17 @@ 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> - <td><select tabindex=1 name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; +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){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr> + </table> + <p />'; 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'),'info'); include('includes/footer.inc'); exit; @@ -743,23 +767,27 @@ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname']. ' - ' . $myrow['currcode'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (!Is_Date($_SESSION['ReceiptBatch']->DateBanked)){ $_SESSION['ReceiptBatch']->DateBanked = Date($_SESSION['DefaultDateFormat']); } -echo '<tr><td>' . _('Date Banked') . ':</td> - <td><input tabindex=2 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength=10 size=10 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td></tr>'; -echo '<tr><td>' . _('Currency') . ':</td> - <td><select tabindex=3 name="Currency" onChange="ReloadForm(form1.BatchInput)">'; +echo '<tr> + <td>' . _('Date Banked') . ':</td> + <td><input tabindex="2" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength="10" size="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td> + </tr> + <tr> + <td>' . _('Currency') . ':</td> + <td><select tabindex="3" name="Currency" onChange="ReloadForm(form1.BatchInput)">'; if (!isset($_SESSION['ReceiptBatch']->Currency)){ $_SESSION['ReceiptBatch']->Currency=$_SESSION['CompanyRecord']['currencydefault']; } -$SQL = 'SELECT currency, currabrev, rate FROM currencies'; +$SQL = "SELECT currency, currabrev, rate FROM currencies"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ echo '</select></td></tr>'; @@ -773,7 +801,8 @@ echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } @@ -793,26 +822,33 @@ if ($_SESSION['ReceiptBatch']->ExRate==1 AND isset($SuggestedExRate)){ $_SESSION['ReceiptBatch']->ExRate = $SuggestedExRate; } - echo '<tr><td>' . _('Receipt Exchange Rate') . ':</td> - <td><input tabindex=4 type="text" name="ExRate" maxlength=10 size=12 class=number value="' . $_SESSION['ReceiptBatch']->ExRate . '"></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Receipt Exchange Rate') . ':</td> + <td><input tabindex="4" type="text" name="ExRate" maxlength="10" size="12" class="number" value="' . locale_number_format($_SESSION['ReceiptBatch']->ExRate,6) . '" /></td> + <td>' . locale_number_format($SuggestedExRateText,6) . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td> + </tr>'; } if ($_SESSION['ReceiptBatch']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] - AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ + AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,4) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } if ($_SESSION['ReceiptBatch']->FunctionalExRate==1 AND isset($SuggestedFunctionalExRate)){ $_SESSION['ReceiptBatch']->FunctionalExRate = $SuggestedFunctionalExRate; } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td><td><input tabindex=5 type="text" name="FunctionalExRate" class=number maxlength=10 size=12 value="' . $_SESSION['ReceiptBatch']->FunctionalExRate . '"></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Functional Exchange Rate') . ':</td> + <td><input tabindex="5" type="text" name="FunctionalExRate" class="number" maxlength="10" size="12" value="' . locale_number_format($_SESSION['ReceiptBatch']->FunctionalExRate,6) . '" /></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td> + </tr>'; } -echo '<tr><td>' . _('Receipt Type') . ':</td><td><select tabindex=6 name="ReceiptType">'; +echo '<tr> + <td>' . _('Receipt Type') . ':</td> + <td><select tabindex="6" name="ReceiptType">'; include('includes/GetPaymentMethods.php'); /* The array ReceiptTypes is defined from the setup tab of the main menu under payment methods - the array is populated from the include file GetPaymentMethods.php */ @@ -824,13 +860,24 @@ echo '<option value="' .$RcptType . '">' . $RcptType .'</option>'; } } -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; if (!isset($_SESSION['ReceiptBatch']->Narrative)) { $_SESSION['ReceiptBatch']->Narrative=''; } -echo '<tr><td>' . _('Narrative') . ':</td><td><input tabindex=7 type="text" name="BatchNarrative" maxlength=50 size=52 value="' . $_SESSION['ReceiptBatch']->Narrative . '"></td></tr>'; -echo '<tr><td colspan=3><div class="centre"><input tabindex=8 type=submit name="BatchInput" Value="' . _('Accept') . '"></div></td></tr>'; -echo '</table><br />'; +echo '<tr> + <td>' . _('Narrative') . ':</td> + <td><input tabindex="7" type="text" name="BatchNarrative" maxlength="50" size="52" value="' . $_SESSION['ReceiptBatch']->Narrative . '" /></td> + </tr> + <tr> + <td colspan="3"> + <div class="centre"> + <input tabindex="8" type="submit" name="BatchInput" value="' . _('Accept') . '" /> + </div> + </td> + </tr> + </table> + <br />'; if (isset($_SESSION['ReceiptBatch'])){ /* Now show the entries made so far */ @@ -840,13 +887,14 @@ $_SESSION['ReceiptBatch']->BankAccountName . ' ' . _('on') . ' ' . $_SESSION['ReceiptBatch']->DateBanked . '</p>'; } - echo '<table width="90%" class=selection><tr> + echo '<table width="90%" class="selection"> + <tr> <th>' . _('Amount') . ' ' . _('Received') . '</th> <th>' . _('Discount') . '</th> <th>' . _('Customer') . '</th> <th>' . _('GL Code') . '</th> <th>' . _('Narrative') . '</th> - </tr>'; + </tr>'; $BatchTotal = 0; @@ -857,8 +905,8 @@ $myrow=DB_fetch_array($Result); echo '<tr> - <td class=number>' . locale_number_format($ReceiptItem->Amount,2) . '</td> - <td class=number>' . locale_number_format($ReceiptItem->Discount,2) . '</td> + <td class="number">' . locale_number_format($ReceiptItem->Amount,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($ReceiptItem->Discount,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</td> <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . '</td> @@ -867,7 +915,10 @@ $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } - echo '<tr><td class=number><b>' . locale_number_format($BatchTotal,2) . '</b></td></tr></table>'; + echo '<tr> + <td class="number"><b>' . locale_number_format($BatchTotal,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</b></td> + </tr> + </table>'; } /*this next block of ifs deals with what information to display for input into the form @@ -897,43 +948,51 @@ 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') . ': ' . locale_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> + echo '<table width="90%" class="selection"> <tr> - <th width=20%>' . _('Total Balance') . '</th> - <th width=20%>' . _('Current') . '</th> - <th width=20%>' . _('Now Due') . '</th> - <th width=20%>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> - <th width=20%>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width="20%">' . _('Total Balance') . '</th> + <th width="20%">' . _('Current') . '</th> + <th width="20%">' . _('Now Due') . '</th> + <th width="20%">' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width="20%">' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> </tr>'; echo '<tr> - <td class=number>' . locale_number_format($_SESSION['CustomerRecord']['balance'],2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['balance'] - $_SESSION['CustomerRecord']['due']),2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['due']-$_SESSION['CustomerRecord']['overdue1']),2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,2) . '</td> - <td class=number>' . locale_number_format($_SESSION['CustomerRecord']['overdue2'],2) . '</td> + <td class="number">' . locale_number_format($_SESSION['CustomerRecord']['balance'],$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['balance'] - $_SESSION['CustomerRecord']['due']),$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['due']-$_SESSION['CustomerRecord']['overdue1']),$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format($_SESSION['CustomerRecord']['overdue2'],$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> </tr> - </table><br />'; + </table> + <br />'; echo '<table class="selection">'; $DisplayDiscountPercent = locale_number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . '%'; - echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '">'; - echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '">'; + echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '" />'; + echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '" />'; } if (isset($_POST['GLEntry']) AND isset($_SESSION['ReceiptBatch'])){ /* Set up a heading for the transaction entry for a GL Receipt */ - echo '<br /><table class=selection>'; - echo '<th colspan=2><font size=2 color=navy>' . _('General Ledger Receipt Entry') . '</font></th>'; + echo '<br /> + <table class="selection"> + <tr> + <th colspan="2"><font size="2" color="navy">' . _('General Ledger Receipt Entry') . '</font></th> + </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 @@ -949,15 +1008,20 @@ echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; // End select tag /*now set up a GLCode field to select from avaialble GL accounts */ - echo '<tr><td>' . _('GL Account') . ':</td><td><select tabindex=8 name="GLCode">'; - $SQL = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; + echo '<tr> + <td>' . _('GL Account') . ':</td> + <td><select tabindex="8" name="GLCode">'; + + $SQL = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select>' . _('No General ledger accounts have been set up yet') . ' - ' . _('receipts cannot be entered against GL accounts until the GL accounts are set up') . '</td></tr>'; + echo '</select>' . _('No General ledger accounts have been set up yet') . ' - ' . _('receipts cannot be entered against GL accounts until the GL accounts are set up') . '</td> + </tr>'; } else { echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ @@ -967,9 +1031,9 @@ echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - } /*if either a customer is selected or its a GL Entry then set out @@ -977,9 +1041,9 @@ if (((isset($_SESSION['CustomerRecord']) AND isset($_POST['CustomerID']) - AND $_POST['CustomerID']!="") + AND $_POST['CustomerID']!='') OR isset($_POST['GLEntry'])) - AND isset($_SESSION['ReceiptBatch'])){ + AND isset($_SESSION['ReceiptBatch'])){ if (!isset($_POST['Amount'])) { $_POST['Amount']=0; @@ -993,52 +1057,71 @@ if (!isset($_POST['Narrative'])) { $_POST['Narrative']=''; } - echo '<tr><td>' . _('Amount of Receipt') . ':</td> - <td><input tabindex=9 type="text" name="Amount" maxlength=12 size=13 class=number value="' . $_POST['Amount'] . '"></td> - </tr>'; + echo '<tr> + <td>' . _('Amount of Receipt') . ':</td> + <td><input tabindex="9" type="text" name="Amount" maxlength="12" size="13" class="number" value="' . $_POST['Amount'] . '" /></td> + </tr>'; if (!isset($_POST['GLEntry'])){ - echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input tabindex=10 type="text" name="Discount" maxlength=12 size=13 class=number value="' . $_POST['Discount'] . '"> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; + echo '<tr> + <td>' . _('Amount of Discount') . ':</td> + <td><input tabindex="10" type="text" name="Discount" maxlength="12" size="13" class="number" value="' . $_POST['Discount'] . '" /> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; } else { - echo '<input tabindex=11 type="hidden" name="Discount" Value=0>'; + echo '<input tabindex=11 type="hidden" name="Discount" value="0" />'; } - echo '<tr><td>' . _('Payee Bank Details') . ':</td> - <td><input tabindex=12 type="text" name="PayeeBankDetail" maxlength=22 size=20 value="' . $_POST['PayeeBankDetail'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Payee Bank Details') . ':</td> + <td><input tabindex="12" type="text" name="PayeeBankDetail" maxlength="22" size="20" value="' . $_POST['PayeeBankDetail'] . '" /></td> + </tr>'; // echo '<tr><td>' . _('Narrative') . ':</td> // <td><input tabindex=13 type="text" name="Narrative" maxlength=30 size=32 value="' . $_POST['Narrative'] . '"></td></tr>'; - 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 '<input tabindex=14 type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<td>' . _('Narrative') . ':</td> + <td><textarea name="Narrative" cols="40" rows="1"></textarea></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="14" type="submit" name="Process" value="' . _('Accept') . '" /> + <input tabindex="15" type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; -} elseif (isset($_SESSION['ReceiptBatch']) AND !isset($_POST['GLEntry'])){ +} elseif (isset($_SESSION['ReceiptBatch']) + AND !isset($_POST['GLEntry'])){ /*Show the form to select a customer */ echo '<br />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b>'; - echo '<table cellpadding=3 colspan=4 class=selection>'; - echo '<tr><td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td>'; - echo '<td><input tabindex=9 type="text" name="Keywords" size=15 maxlength=25></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td>' . _('Text extract in the Customer') . ' ' . '<b>' . _('code') . '</b>:</td>'; - echo '<td><input tabindex=10 type="text" name="CustCode" size=10 maxlength=18></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - 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 '<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>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b> + <table class="selection"> + <tr> + <td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td> + <td><input tabindex="9" type="text" name="Keywords" size="15" maxlength="25" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td>' . _('Text extract in the Customer') . ' ' . '<b>' . _('code') . '</b>:</td> + <td><input tabindex="10" type="text" name="CustCode" size="10" maxlength="18" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td>' . _('Customer invoice number') . ':</td> + <td><input tabindex="11" type="text" name="CustInvNo" size="8" maxlength="8" /></td> + </tr> + </table> + <div class="centre"> + <br /> + <input tabindex="11" type="submit" name="Search" value="' . _('Search Now') . '" /> + <br/> + <br/> + <input tabindex="12" type="submit" name="GLEntry" value="' . _('Enter A GL Receipt') . '" /> + <br /> + </div>'; if (isset($CustomerSearchResult)) { - echo '<table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Customer Name') . '</th></tr>'; + echo '<table class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Customer Name') . '</th> + </tr>'; echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -1052,9 +1135,9 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf('<td><font size=1> - <input tabindex='.locale_number_format(12+$j).' type=submit name="Select" value="%s"></font></td> - <td>%s</td></tr>', + printf('<td><font size=1><input tabindex="'. strval(12+$j).'" type="submit" name="Select" value="%s" /></font></td> + <td>%s</td> + </tr>', $myrow['debtorno'], $myrow['name']); @@ -1074,8 +1157,11 @@ } if (isset($_SESSION['ReceiptBatch']->Items) and count($_SESSION['ReceiptBatch']->Items) > 0){ - echo '<div class="centre"><br/><input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '"></div>'; + echo '<div class="centre"> + <br/> + <input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '" /> + </div>'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/DailySalesInquiry.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -5,7 +5,6 @@ include('includes/session.inc'); $title = _('Daily Sales Inquiry'); include('includes/header.inc'); -include('includes/DefineCartClass.php'); echo '<p class="page_title_text"> <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . ' @@ -21,16 +20,18 @@ <td>' . _('Month to Show') . ':</td> <td><select tabindex="1" name="MonthToShow">'; - if (!isset($_POST['MonthToShow'])){ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + $Result = DB_query("SELECT lastdate_in_period FROM periods WHERE period='" . $_POST['MonthToShow'] . "'",$db); + $myrow = DB_fetch_array($Result); + $EndDateSQL = $myrow['lastdate_in_period']; } $PeriodsResult = DB_query("SELECT periodno, lastdate_in_period FROM periods",$db); while ($PeriodRow = DB_fetch_array($PeriodsResult)){ if ($_POST['MonthToShow']==$PeriodRow['periodno']) { - echo '<option selected Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; $EndDateSQL = $PeriodRow['lastdate_in_period']; } else { echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; Modified: trunk/PDFReceipt.php =================================================================== --- trunk/PDFReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/PDFReceipt.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -46,23 +46,23 @@ $PageNumber++; -$sql="SELECT MIN(id) as start FROM debtortrans WHERE type=12 AND transno='". filer_locale_number_format($_GET['BatchNumber']). "'"; +$sql="SELECT MIN(id) as start FROM debtortrans WHERE type=12 AND transno='". $_GET['BatchNumber']. "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $StartReceiptNumber=$myrow['start']; -$sql="SELECT debtorno, - ovamount, - invtext - FROM debtortrans - WHERE type=12 - AND transno='".$_GET['BatchNumber']."' - AND id='". $StartReceiptNumber-1+$_GET['ReceiptNumber'] ."'"; -$result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$DebtorNo=$myrow['debtorno']; -$Amount=$myrow['ovamount']; -$Narrative=$myrow['invtext']; +$sql="SELECT debtorno, + ovamount, + invtext + FROM debtortrans + WHERE type=12 + AND transno='" . $_GET['BatchNumber'] . "' + AND id='". ($StartReceiptNumber-1+$_GET['ReceiptNumber']) ."'"; +$result = DB_query($sql, $db); +$myrow = DB_fetch_array($result); +$DebtorNo = $myrow['debtorno']; +$Amount = $myrow['ovamount']; +$Narrative = $myrow['invtext']; $sql="SELECT currency, decimalplaces @@ -76,13 +76,13 @@ $Currency=$myrow['currency']; $DecimalPlaces=$myrow['decimalplaces']; -$sql="SELECT name, - address1, - address2, - address3, - address4, - address5, - address6 +$sql="SELECT name, + address1, + address2, + address3, + address4, + address5, + address6 FROM debtorsmaster WHERE debtorno='".$DebtorNo."'"; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/WWW_Users.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -33,8 +33,10 @@ // Make an array of the security roles $sql = "SELECT secroleid, - secrolename - FROM securityroles ORDER BY secroleid"; + secrolename + FROM securityroles + ORDER BY secroleid"; + $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -72,7 +74,8 @@ } 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)) { + } elseif ((mb_strlen($_POST['Cust'])>0) + AND (mb_strlen($_POST['BranchCode'])==0)) { $InputError = 1; prnMsg(_('If you enter a Customer Code you must also enter a Branch Code valid for this Customer'),'error'); } @@ -173,15 +176,15 @@ theme, language, pdflanguage) - VALUES ('" . DB_escape_string($_POST['UserID']) . "', - '" . DB_escape_string($_POST['RealName']) ."', - '" . DB_escape_string($_POST['Cust']) ."', - '" . DB_escape_string($_POST['BranchCode']) ."', - '" . DB_escape_string($_POST['SupplierID']) ."', + VALUES ('" . $_POST['UserID'] . "', + '" . $_POST['RealName'] ."', + '" . $_POST['Cust'] ."', + '" . $_POST['BranchCode'] ."', + '" . $_POST['SupplierID'] ."', '" . $_POST['Salesman'] . "', '" . CryptPass($_POST['Password']) ."', - '" . DB_escape_string($_POST['Phone']) . "', - '" . DB_escape_string($_POST['Email']) ."', + '" . $_POST['Phone'] . "', + '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', @@ -327,7 +330,7 @@ $SecurityRoles[($myrow['fullaccess'])], $myrow['pagesize'], $myrow['theme'], - $LanguagesArray[$myrow['language']], + $LanguagesArray[$myrow['language']]['LanguageName'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['userid'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/doc/Change.log 2011-11-04 04:56:22 UTC (rev 4739) @@ -5,6 +5,7 @@ 29/10/11 High-Tech Bridge SA Security Research Lab <adv...@ht...> - sanitising $_SERVER['PHP_SELF'] and unquoted sql in reportwriter/FormMaker.php and reportwriter/ReportMaker.php 15/10/11 Phil: Tried to get correct characters for each language's thousands separator and decimal point in includes/LanguagesArray.php 15/10/11 Phil: Updated PHPplot to 5.5.0 +15/10/11 Fred Schuettler aguapop - theme 8/10/11 Ricard: PcExpenses.php PcAuthorizeExpense.php now uses GL tags 8/10/11 Phil: SelectSalesOrder.php now allows for creation of purchase orders for the components of assembly items on sales orders. 29/9/11 Ricard: added new query critera to AuditTrail.php to look for text in query strings to enable searching for updates/inserts/deletes relating to a specified customer or item code etc Modified: trunk/includes/DefineReceiptClass.php =================================================================== --- trunk/includes/DefineReceiptClass.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/includes/DefineReceiptClass.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -14,6 +14,7 @@ var $ExRate; /*Exchange rate conversion between currency received and bank account currency */ var $FunctionalExRate; /* Exchange Rate between Bank Account Currency and Functional(business reporting) currency */ var $Currency; /*Currency being banked - defaulted to company functional */ + var $CurrDecimalPlaces; var $Narrative; var $ReceiptType; /*Type of receipt ie credit card/cash/cheque etc - array of types defined in config.php*/ var $total; /*Total of the batch of receipts in the currency of the company*/ Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/install/save.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -298,7 +298,7 @@ $msg .= "\$CryptFunction = 'sha1';\n"; $msg .= "\$DefaultClock = 12;\n"; -$msg .= "\$rootpath = dirname(\htmlspecialchars($_SERVER['PHP_SELF']));\n"; +$msg .= "\$rootpath = dirname(htmlspecialchars(\$_SERVER['PHP_SELF']));\n"; $msg .= "if (isset(\$DirectoryLevelsDeep)){\n"; $msg .= " for (\$i=0;\$i<\$DirectoryLevelsDeep;\$i++){\n"; $msg .= "\$rootpath = mb_substr(\$rootpath,0, strrpos(\$rootpath,'/'));\n"; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-11-04 04:56:22 UTC (rev 4739) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-11 19:23+1200\n" +"POT-Creation-Date: 2011-11-01 22:26+1300\n" "PO-Revision-Date: 2011-02-07 15:33+0000\n" "Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" @@ -21,7 +21,7 @@ "X-Poedit-Language: Czech\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 index.php:1298 msgid "Account Groups" msgstr "Účetní skupiny" @@ -41,8 +41,8 @@ "SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " "byl" -#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:178 -#: AccountGroups.php:188 +#: AccountGroups.php:57 AccountGroups.php:102 AccountGroups.php:174 +#: AccountGroups.php:184 msgid "The SQL that was used to retrieve the information was" msgstr "SQL, který byl použit k získání informace" @@ -58,16 +58,22 @@ msgid "The account group name cannot contain the character" msgstr "Název účetní skupiny nemůže obsahovat znak" -#: AccountGroups.php:71 TaxCategories.php:31 TaxProvinces.php:30 -#: UnitsOfMeasure.php:30 +#: AccountGroups.php:71 TaxCategories.php:31 msgid "or the character" msgstr "nebo znak" #: AccountGroups.php:77 +#, fuzzy +msgid "" +"The sequence that the account group is listed in the trial balance is " +"expected to be numeric" +msgstr "Množství uvedené pro převody Očekává se, že číselné" + +#: AccountGroups.php:85 msgid "The account group name must be at least one character long" msgstr "Název účetní skupiny musí být dlouhý minimálně jeden znak" -#: AccountGroups.php:84 +#: AccountGroups.php:92 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 " @@ -77,11 +83,11 @@ "účtu - vyberte alternativní mateřské účet skupiny nebo tuto skupinu na " "nejvyšší úrovni účtové skupiny" -#: AccountGroups.php:95 +#: AccountGroups.php:103 msgid "Could not check whether the group is recursive because" msgstr "Nepodařilo se zjistit, zda skupina je rekurzivní, protože" -#: AccountGroups.php:103 +#: AccountGroups.php:111 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 " @@ -90,47 +96,39 @@ "will have no effect." msgstr "" -#: AccountGroups.php:108 +#: AccountGroups.php:116 msgid "The section in accounts must be an integer" msgstr "Sekce v účtech musí být celé kladné číslo" -#: AccountGroups.php:114 -msgid "The sequence in the trial balance must be an integer" -msgstr "Pořadí v předvaze musí být celé číslo" - -#: AccountGroups.php:120 -msgid "The sequence in the TB must be numeric and less than" -msgstr "Pořadí v TB musí být číslo a méně než" - -#: AccountGroups.php:137 +#: AccountGroups.php:133 msgid "An error occurred in updating the account group" msgstr "Došlo k chybě při aktualizaci účtové skupiny" -#: AccountGroups.php:138 +#: AccountGroups.php:134 msgid "The SQL that was used to update the account group was" msgstr "SQL, který byl použit k aktualizaci účtu skupina byla" -#: AccountGroups.php:140 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:136 AccountSections.php:104 PaymentMethods.php:82 msgid "Record Updated" msgstr "Záznam aktualizován" -#: AccountGroups.php:158 +#: AccountGroups.php:154 msgid "An error occurred in inserting the account group" msgstr "Došlo k chybě při vkládání účtové skupiny" -#: AccountGroups.php:159 +#: AccountGroups.php:155 msgid "The SQL that was used to insert the account group was" msgstr "SQL, který byl použit pro vložení na účet skupina byla" -#: AccountGroups.php:160 AccountSections.php:116 PaymentMethods.php:103 +#: AccountGroups.php:156 AccountSections.php:116 PaymentMethods.php:103 msgid "Record inserted" msgstr "Záznam vložen" -#: AccountGroups.php:177 +#: AccountGroups.php:173 msgid "An error occurred in retrieving the group information from chartmaster" msgstr "Došlo k chybě při získávání informací od skupiny chartmaster" -#: AccountGroups.php:182 +#: AccountGroups.php:178 msgid "" "Cannot delete this account group because general ledger accounts have been " "created using this group" @@ -138,37 +136,37 @@ "Nelze smazat tento účet skupiny, protože účtů hlavní knihy byly vytvořeny " "pomocí této skupině" -#: AccountGroups.php:183 AccountGroups.php:193 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 +#: AccountGroups.php:179 AccountGroups.php:189 AccountSections.php:137 +#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:125 +#: Currencies.php:166 Currencies.php:174 Currencies.php:182 #: 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:129 -#: GLAccounts.php:80 GLAccounts.php:96 Locations.php:237 Locations.php:245 -#: Locations.php:256 Locations.php:265 Locations.php:274 Locations.php:283 -#: Locations.php:292 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:138 PaymentTerms.php:144 PaymentTerms.php:151 -#: PcExpenses.php:152 SalesCategories.php:124 SalesCategories.php:131 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:604 Stocks.php:613 Stocks.php:621 Stocks.php:629 Stocks.php:637 -#: Stocks.php:645 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 +#: CustomerBranches.php:316 CustomerTypes.php:147 CustomerTypes.php:157 +#: Customers.php:289 Customers.php:298 Customers.php:306 Customers.php:314 +#: Factors.php:134 FixedAssetCategories.php:129 GLAccounts.php:80 +#: GLAccounts.php:96 Locations.php:237 Locations.php:245 Locations.php:256 +#: Locations.php:265 Locations.php:274 Locations.php:283 Locations.php:292 +#: Locations.php:301 MRPDemandTypes.php:87 PaymentMethods.php:138 +#: PaymentTerms.php:146 PaymentTerms.php:153 PcExpenses.php:158 +#: SalesCategories.php:124 SalesCategories.php:131 SalesPeople.php:150 +#: SalesPeople.php:157 SalesPeople.php:163 SalesTypes.php:140 +#: SalesTypes.php:150 Shippers.php:82 Shippers.php:94 StockCategories.php:181 +#: Stocks.php:615 Stocks.php:624 Stocks.php:632 Stocks.php:640 Stocks.php:648 +#: Stocks.php:656 SupplierTypes.php:145 Suppliers.php:612 Suppliers.php:621 +#: Suppliers.php:629 TaxCategories.php:131 TaxGroups.php:132 TaxGroups.php:140 +#: TaxProvinces.php:129 UnitsOfMeasure.php:135 WWW_Access.php:83 +#: WorkCentres.php:89 WorkCentres.php:95 msgid "There are" msgstr "Jsou zde" -#: AccountGroups.php:183 +#: AccountGroups.php:179 msgid "general ledger accounts that refer to this account group" msgstr "účtů hlavní knihy, které se vztahují k tomuto účtu skupině" -#: AccountGroups.php:187 +#: AccountGroups.php:183 msgid "An error occurred in retrieving the parent group information" msgstr "Došlo k chybě při načítání mateřské skupiny informací" -#: AccountGroups.php:192 +#: AccountGroups.php:188 msgid "" "Cannot delete this account group because it is a parent account group of " "other account group(s)" @@ -176,239 +174,237 @@ "Nelze smazat tento účet skupiny, protože se jedná o mateřskou účet skupinou " "dalších účtové skupiny (y)" -#: AccountGroups.php:193 +#: AccountGroups.php:189 msgid "account groups that have this group as its/there parent account group" msgstr "" "účet skupiny, které mají tuto skupinu jako jeho / je skupina rodičů účet" -#: AccountGroups.php:196 +#: AccountGroups.php:192 msgid "An error occurred in deleting the account group" msgstr "Došlo k chybě při mazání účtu skupiny" -#: AccountGroups.php:197 +#: AccountGroups.php:193 msgid "The SQL that was used to delete the account group was" msgstr "SQL, který byl použit smazat účet skupina byla" -#: AccountGroups.php:199 +#: AccountGroups.php:195 msgid "group has been deleted" msgstr "skupina byla smazána" -#: AccountGroups.php:224 +#: AccountGroups.php:220 msgid "The sql that was used to retrieve the account group information was " msgstr "Sql, který byl použit k načtení účtové skupiny informace " -#: AccountGroups.php:225 +#: AccountGroups.php:221 msgid "Could not get account groups because" msgstr "Nemohu získat účetní skupiny, protože" -#: AccountGroups.php:227 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:109 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:2002 -#: CounterSales.php:2123 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:125 DiscountCategories.php:10 -#: DiscountCategories.php:131 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:237 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:373 InventoryPlanningPrefSupplier.php:467 -#: Labels.php:115 Labels.php:270 MRPReport.php:515 OutstandingGRNs.php:160 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:139 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 +#: AccountGroups.php:223 AccountSections.php:175 AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 AddCustomerNotes.php:103 +#: AddCustomerTypeNotes.php:97 AgedDebtors.php:451 AgedSuppliers.php:278 +#: Areas.php:144 AuditTrail.php:11 BOMExtendedQty.php:261 BOMIndented.php:246 +#: BOMIndentedReverse.php:235 BOMInquiry.php:187 BOMListing.php:109 +#: BOMs.php:213 BOMs.php:832 BankReconciliation.php:13 COGSGLPostings.php:18 +#: CompanyPreferences.php:153 CounterSales.php:2010 CounterSales.php:2135 +#: CreditStatus.php:21 Credit_Invoice.php:255 Currencies.php:28 +#: CustEDISetup.php:17 DailyBankTransactions.php:11 DebtorsAtPeriodEnd.php:125 +#: DiscountCategories.php:10 DiscountCategories.php:131 DiscountMatrix.php:16 +#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 FixedAssetRegister.php:237 +#: FixedAssetTransfer.php:31 FormDesigner.php:129 GLBalanceSheet.php:362 +#: GLBudgets.php:29 GLJournal.php:246 InventoryPlanning.php:374 +#: InventoryPlanningPrefSupplier.php:467 Labels.php:115 Labels.php:270 +#: MRPReport.php:515 OutstandingGRNs.php:160 PDFPickingList.php:28 +#: PDFPrintLabel.php:140 PDFStockLocTransfer.php:17 POReport.php:60 +#: POReport.php:64 POReport.php:68 PO_AuthorisationLevels.php:10 +#: PO_SelectOSPurchOrder.php:135 PcAssignCashToTab.php:56 +#: PcAssignCashToTab.php:130 PcAssignCashToTab.php:146 +#: PcAssignCashToTab.php:187 Prices.php:30 PricesBasedOnMarkUp.php:8 +#: Prices_Customer.php:34 PurchData.php:137 PurchData.php:258 +#: PurchData.php:282 RecurringSalesOrders.php:309 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:215 -#: SelectCreditItems.php:283 SelectCustomer.php:247 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1512 -#: SelectOrderItems.php:1636 SelectProduct.php:496 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 +#: SelectCreditItems.php:286 SelectCustomer.php:260 SelectGLAccount.php:17 +#: SelectGLAccount.php:77 SelectOrderItems.php:575 SelectOrderItems.php:1468 +#: SelectOrderItems.php:1592 SelectProduct.php:496 SelectSalesOrder.php:533 +#: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:9 +#: SelectWorkOrder.php:151 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 +#: StockLocMovements.php:13 StockLocStatus.php:27 SupplierTenders.php:260 +#: SupplierTenders.php:317 SupplierTransInquiry.php:10 Suppliers.php:302 +#: TaxGroups.php:15 TaxProvinces.php:11 TopItems.php:77 WWW_Access.php:11 +#: WWW_Users.php:31 WhereUsedInquiry.php:18 WorkCentres.php:111 +#: WorkCentres.php:162 WorkOrderCosting.php:13 WorkOrderEntry.php:11 +#: WorkOrderIssue.php:22 WorkOrderReceive.php:15 WorkOrderStatus.php:42 +#: Z_BottomUpCosts.php:51 msgid "Search" msgstr "Vyhledávání" -#: AccountGroups.php:231 +#: AccountGroups.php:227 msgid "Group... [truncated message content] |