From: <dai...@us...> - 2011-10-30 09:17:35
|
Revision: 4738 http://web-erp.svn.sourceforge.net/web-erp/?rev=4738&view=rev Author: daintree Date: 2011-10-30 09:17:27 +0000 (Sun, 30 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/Stocks.php trunk/doc/Change.log Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/BOMExtendedQty.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -77,7 +77,7 @@ bom.effectiveafter, bom.effectiveto, (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa - FROM bom + FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; @@ -188,11 +188,13 @@ GROUP BY purchorderdetails.itemcode) AS poqty, (SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) as netwoqty - FROM woitems + FROM woitems INNER JOIN workorders + ON woitems.wo = workorders.wo WHERE woitems.stockid = tempbom.component + AND workorders.closed=0 GROUP BY woitems.stockid) AS woqty - FROM tempbom,stockmaster - WHERE tempbom.component = stockmaster.stockid + FROM tempbom INNER JOIN stockmaster + ON tempbom.component = stockmaster.stockid GROUP BY tempbom.component, stockmaster.description, stockmaster.decimalplaces, Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/CustomerReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -52,7 +52,7 @@ $_SESSION['ReceiptBatch']->BankAccountName = $myrow[0]; $_SESSION['ReceiptBatch']->AccountCurrency=$myrow[1]; unset($result); - } elseif (DB_num_rows($result)==0 and !$BankAccountEmpty){ + } elseif (DB_num_rows($result)==0 AND !$BankAccountEmpty){ prnMsg( _('The bank account number') . ' ' . $_POST['BankAccount'] . ' ' . _('is not set up as a bank account'),'error'); include ('includes/footer.inc'); exit; @@ -62,7 +62,7 @@ $_POST['DateBanked'] = Date($_SESSION['DefaultDateFormat']); } $_SESSION['ReceiptBatch']->DateBanked = $_POST['DateBanked']; - if (isset($_POST['ExRate']) and $_POST['ExRate']!=''){ + if (isset($_POST['ExRate']) AND $_POST['ExRate']!=''){ if (is_numeric(filter_number_format($_POST['ExRate']))){ $_SESSION['ReceiptBatch']->ExRate = filter_number_format($_POST['ExRate']); } else { Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/CustomerTransInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -6,18 +6,20 @@ $title = _('Customer Transactions Inquiry'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Transaction Inquiry') . '" alt="" />' . ' ' . _('Transaction Inquiry') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Transaction Inquiry') . '" alt="" />' . ' ' . _('Transaction Inquiry') . ' + </p>'; echo '<div class="page_help_text">' . _('Choose which type of transaction to report on.') . '</div> <br />'; -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection><tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('Type') . ':</td> + <td><select tabindex="1" name="TransType"> '; -echo '<td>' . _('Type') . ':</td> - <td><select tabindex="1" name="TransType"> '; - $sql = "SELECT typeid, typename FROM systypes @@ -35,7 +37,7 @@ echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option Value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } echo '</select></td>'; @@ -46,31 +48,38 @@ if (!isset($_POST['ToDate'])){ $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); } -echo '<td>' . _('From') . ':</td><td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="FromDate" maxlength="10" size="11" VALUE="' . $_POST['FromDate'] . '"></td>'; -echo '<td>' . _('To') . ':</td><td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="ToDate" maxlength="10" size="11" VALUE="' . $_POST['ToDate'] . '"></td>'; +echo '<td>' . _('From') . ':</td> + <td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + <td>' . _('To') . ':</td> + <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td>'; -echo "</tr></table><br /><div class='centre'><input tabindex=4 type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; +echo '</tr></table> + <br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '"> + </div> + </form>'; -echo '</form></div>'; - if (isset($_POST['ShowResults']) && $_POST['TransType'] != ''){ $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT transno, - trandate, - debtortrans.debtorno, - branchcode, - reference, - invtext, - order_, - rate, - ovamount+ovgst+ovfreight+ovdiscount as totalamt, - currcode, - typename - FROM debtortrans - INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN systypes ON debtortrans.type = systypes.typeid - WHERE "; + trandate, + debtortrans.debtorno, + branchcode, + reference, + invtext, + order_, + debtortrans.rate, + ovamount+ovgst+ovfreight+ovdiscount as totalamt, + currcode, + typename, + decimalplaces AS currdecimalplaces + FROM debtortrans + INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN systypes ON debtortrans.type = systypes.typeid + WHERE "; $sql = $sql . "trandate >='" . $SQL_FromDate . "' AND trandate <= '" . $SQL_ToDate . "'"; if ($_POST['TransType']!='All') { @@ -82,21 +91,23 @@ $DbgMsg = _('The SQL that failed was'); $TransResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - echo '<br /><table cellpadding=2 class=selection>'; + echo '<br /> + <table class="selection">'; - $tableheader = "<tr> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Reference') . "</th> - <th>" . _('Comments') . "</th> - <th>" . _('Order') . "</th> - <th>" . _('Ex Rate') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Currency') . '</th></tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Comments') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Ex Rate') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Currency') . '</th> + </tr>'; + echo $TableHeader; $RowCounter = 1; $k = 0; //row colour counter @@ -111,70 +122,69 @@ $k++; } - $format_base = "<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td width='200'>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td>"; + $format_base = '<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td width="200">%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td>'; if ($_POST['TransType']==10){ /* invoices */ - printf("$format_base - <td><a target='_blank' href='%s/PrintCustTrans.php?%&FromTransNo=%s&InvOrCredit=Invoice'><IMG SRC='%s' title='" . _('Click to preview the invoice') . "'></a></td> - </tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode'], - $rootpath, - SID, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images/preview.gif'); + printf($format_base . + '<td><a target="_blank" href=%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice"><img src="%s" title="' . _('Click to preview the invoice') . '"></a></td> + </tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode'], + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images/preview.gif'); + } elseif ($_POST['TransType']==11){ /* credit notes */ - printf("$format_base - <td><a target='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Credit'><IMG SRC='%s' title='" . _('Click to preview the credit') . "'></a></td> - </tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode'], - $rootpath, - SID, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images/preview.gif'); + printf($format_base . + '<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit"><img src="%s" title="' . _('Click to preview the credit') . '"></a></td> + </tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode'], + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images/preview.gif'); } else { /* otherwise */ - printf("$format_base</tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode']); + printf($format_base . '</tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode']); } } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/Customers.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -10,8 +10,10 @@ include('includes/SQL_CommonFunctions.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Customer Maintenance') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . + '" alt="" />' . ' ' . _('Customer Maintenance') . ' + </p>'; if (isset($Errors)) { unset($Errors); @@ -84,37 +86,12 @@ prnMsg( _('The Line 6 of the address must be fifteen characters or less long'),'error'); $Errors[$i] = 'Address6'; $i++; - } - elseif (mb_strlen($_POST['Phone']) >25) { + } elseif (!is_numeric(filter_number_format($_POST['CreditLimit']))) { $InputError = 1; - prnMsg(_('The telephone number must be 25 characters or less long'),'error'); - $Errors[$i] = 'Telephone'; - $i++; - } - elseif (mb_strlen($_POST['Fax']) >25) { - $InputError = 1; - prnMsg(_('The fax number must be 25 characters or less long'),'error'); - $Errors[$i] = 'Fax'; - $i++; - } - elseif (mb_strlen($_POST['Email']) >55) { - $InputError = 1; - prnMsg(_('The email address must be 55 characters or less long'),'error'); - $Errors[$i] = 'Email'; - $i++; - } - elseif (mb_strlen($_POST['Email'])>0 and !IsEmailAddress($_POST['Email'])) { - $InputError = 1; - prnMsg(_('The email address is not correctly formed'),'error'); - $Errors[$i] = 'Email'; - $i++; - } - elseif (!is_numeric($_POST['CreditLimit'])) { - $InputError = 1; prnMsg( _('The credit limit must be numeric'),'error'); $Errors[$i] = 'CreditLimit'; $i++; - } elseif (!is_numeric($_POST['PymtDiscount'])) { + } elseif (!is_numeric(filter_number_format($_POST['PymtDiscount']))) { $InputError = 1; prnMsg( _('The payment discount must be numeric'),'error'); $Errors[$i] = 'PymtDiscount'; @@ -124,22 +101,22 @@ prnMsg( _('The customer since field must be a date in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); $Errors[$i] = 'ClientSince'; $i++; - } elseif (!is_numeric($_POST['Discount'])) { + } elseif (!is_numeric(filter_number_format($_POST['Discount']))) { $InputError = 1; prnMsg( _('The discount percentage must be numeric'),'error'); $Errors[$i] = 'Discount'; $i++; - } elseif ((double) $_POST['CreditLimit'] <0) { + } elseif (filter_number_format($_POST['CreditLimit']) <0) { $InputError = 1; prnMsg( _('The credit limit must be a positive number'),'error'); $Errors[$i] = 'CreditLimit'; $i++; - } elseif (((double) $_POST['PymtDiscount']> 10) OR ((double) $_POST['PymtDiscount'] <0)) { + } elseif ((filter_number_format($_POST['PymtDiscount'])> 10) OR (filter_number_format($_POST['PymtDiscount']) <0)) { $InputError = 1; prnMsg( _('The payment discount is expected to be less than 10% and greater than or equal to 0'),'error'); $Errors[$i] = 'PymtDiscount'; $i++; - } elseif (((double) $_POST['Discount']> 100) OR ((double) $_POST['Discount'] <0)) { + } elseif ((filter_number_format($_POST['Discount'])> 100) OR (filter_number_format($_POST['Discount']) <0)) { $InputError = 1; prnMsg( _('The discount is expected to be less than 100% and greater than or equal to 0'),'error'); $Errors[$i] = 'Discount'; @@ -171,10 +148,10 @@ clientsince='" . $SQL_ClientSince. "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount='" . ($_POST['Discount'])/100 . "', + discount='" . filter_number_format($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', - creditlimit='" . $_POST['CreditLimit'] . "', + pymtdiscount='" . filter_number_format($_POST['PymtDiscount'])/100 . "', + creditlimit='" . filter_number_format($_POST['CreditLimit']) . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -201,10 +178,10 @@ clientsince='" . $SQL_ClientSince . "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount='" . ($_POST['Discount'])/100 . "', + discount='" . filter_number_format($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', - creditlimit='" . $_POST['CreditLimit'] . "', + pymtdiscount='" . filter_number_format($_POST['PymtDiscount'])/100 . "', + creditlimit='" . filter_number_format($_POST['CreditLimit']) . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -266,10 +243,10 @@ '" . $SQL_ClientSince . "', '" . $_POST['HoldReason'] . "', '" . $_POST['PaymentTerms'] . "', - '" . ($_POST['Discount'])/100 . "', + '" . filter_number_format($_POST['Discount'])/100 . "', '" . $_POST['DiscountCode'] . "', - '" . ($_POST['PymtDiscount'])/100 . "', - '" . $_POST['CreditLimit'] . "', + '" . filter_number_format($_POST['PymtDiscount'])/100 . "', + '" . filter_number_format($_POST['CreditLimit']) . "', '" . $_POST['SalesType'] . "', '" . $_POST['AddrInvBranch'] . "', '" . $_POST['TaxRef'] . "', @@ -577,8 +554,9 @@ $myrow = DB_fetch_row($CurrResult); $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _('Customer Currency') . ':</td> - <td><select tabindex=17 name="CurrCode">'; + echo '<tr> + <td>' . _('Customer Currency') . ':</td> + <td><select tabindex="17" name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ echo '<option selected value='. $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; @@ -588,28 +566,34 @@ } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - echo '<tr><td>' . _('Customer PO Line on SO') . ':</td> + echo '<tr> + <td>' . _('Customer PO Line on SO') . ':</td> <td><select tabindex="18" name="CustomerPOLine"> <option selected value=0>' . _('No') . '</option> <option value=1>' . _('Yes') . '</option> </select> </td> - </tr>'; - - echo '<tr><td>' . _('Invoice Addressing') . ':</td> + </tr> + <tr> + <td>' . _('Invoice Addressing') . ':</td> <td><select tabindex="19" name="AddrInvBranch"> <option selected value=0>' . _('Address to HO') . '</option> <option value=1>' . _('Address to Branch') . '</option> </select> </td> - </tr>'; - - echo'</table></td></tr></table>'; + </tr> + </table></td> + </tr> + </table>'; if ($DataError ==0){ - echo '<br /><div class="centre"><input tabindex=20 type="Submit" name="submit" value="' . _('Add New Customer') . '"> <input tabindex=21 type="submit" action="Reset" value="' . _('Reset') . '"></div>'; + echo '<br /> + <div class="centre"> + <input tabindex="20" type="submit" name="submit" value="' . _('Add New Customer') . '" /> <input tabindex="21" type="submit" action="Reset" value="' . _('Reset') . '" /> + </div>'; } echo '</form>'; @@ -620,34 +604,34 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection cellspacing=4> - <tr><td valign=top><table class=selection>'; + echo '<table class="selection"> + <tr><td valign="top"><table class="selection">'; if (!isset($_POST['New'])) { $sql = "SELECT debtorsmaster.debtorno, - name, - address1, - address2, - address3, - address4, - address5, - address6, - currcode, - salestype, - clientsince, - holdreason, - paymentterms, - discount, - discountcode, - pymtdiscount, - creditlimit, - invaddrbranch, - taxref, - customerpoline, - typeid + name, + address1, + address2, + address3, + address4, + address5, + address6, + currcode, + salestype, + clientsince, + holdreason, + paymentterms, + discount, + discountcode, + pymtdiscount, + creditlimit, + invaddrbranch, + taxref, + customerpoline, + typeid FROM debtorsmaster - WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; - + WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; + $ErrMsg = _('The customer details could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -672,10 +656,10 @@ $_POST['ClientSince'] = ConvertSQLDate($myrow['clientsince']); $_POST['HoldReason'] = $myrow['holdreason']; $_POST['PaymentTerms'] = $myrow['paymentterms']; - $_POST['Discount'] = $myrow['discount'] * 100; + $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); $_POST['DiscountCode'] = $myrow['discountcode']; - $_POST['PymtDiscount'] = $myrow['pymtdiscount'] * 100; - $_POST['CreditLimit'] = $myrow['creditlimit']; + $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); + $_POST['CreditLimit'] = locale_number_format($myrow['creditlimit'],0); $_POST['InvAddrBranch'] = $myrow['invaddrbranch']; $_POST['TaxRef'] = $myrow['taxref']; $_POST['CustomerPOLine'] = $myrow['customerpoline']; @@ -690,34 +674,70 @@ /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then provide an input box for the DebtorNo to manually assigned */ if ($_SESSION['AutoDebtorNo']== 0 ) { - echo '<tr><td>' . _('Customer Code') . ':</td> - <td><input ' . (in_array('DebtorNo',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="DebtorNo" value="' . $DebtorNo . '" size=12 maxlength=10></td></tr>'; + echo '<tr> + <td>' . _('Customer Code') . ':</td> + <td><input ' . (in_array('DebtorNo',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="DebtorNo" value="' . $DebtorNo . '" size="12" maxlength="10" /></td></tr>'; } } if (isset($_GET['Modify'])) { - echo '<tr><td>' . _('Customer Name') . ':</td><td>' . $_POST['CustName'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td>' . $_POST['Address1'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td>' . $_POST['Address2'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td>' . $_POST['Address3'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td>' . $_POST['Address4'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 5') . ':</td><td>' . $_POST['Address5'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 6') . ':</td><td>' . $_POST['Address6'] . '</td></tr>'; + echo '<tr> + <td>' . _('Customer Name') . ':</td> + <td>' . $_POST['CustName'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> + <td>' . $_POST['Address1'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td>' . $_POST['Address2'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 3 (State/Province)') . ':</td> + <td>' . $_POST['Address3'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td>' . $_POST['Address4'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td>' . $_POST['Address5'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td>' . $_POST['Address6'] . '</td> + </tr>'; } else { - echo '<tr><td>' . _('Customer Name') . ':</td> - <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="CustName" value="' . $_POST['CustName'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> - <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> - <td><input ' . (in_array('Address2',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address2" size=42 maxlength=40 value="' . $_POST['Address2'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> - <td><input ' . (in_array('Address3',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address3" size=42 maxlength=40 value="' . $_POST['Address3'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> - <td><input ' . (in_array('Address4',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address4" size=42 maxlength=40 value="' . $_POST['Address4'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 5') . ':</td> - <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address5" size=42 maxlength=40 value="' . $_POST['Address5'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 6') . ':</td> - <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address6" size=42 maxlength=40 value="' . $_POST['Address6'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Customer Name') . ':</td> + <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CustName" value="' . $_POST['CustName'] . '" size="42" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> + <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address1" size="42" maxlength="40" value="' . $_POST['Address1'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input ' . (in_array('Address2',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address2" size="42" maxlength="40" value="' . $_POST['Address2'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input ' . (in_array('Address3',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address3" size="42" maxlength="40" value="' . $_POST['Address3'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input ' . (in_array('Address4',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address4" size="42" maxlength="40" value="' . $_POST['Address4'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address5" size="42" maxlength="40" value="' . $_POST['Address5'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address6" size="42" maxlength="40" value="' . $_POST['Address6'] . '" /></td> + </tr>'; } // Select sales types for drop down list @@ -743,12 +763,14 @@ if (isset($_GET['Modify'])) { $result=DB_query("SELECT typename FROM debtortype WHERE typeid='".$_POST['typeid']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Customer Type') . ':</td> + echo '<tr> + <td>' . _('Customer Type') . ':</td> <td>'.$myrow['typename'] . '</td> </tr>'; } else { $result=DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename",$db); - echo '<tr><td>' . _('Customer Type') . ':</td> + echo '<tr> + <td>' . _('Customer Type') . ':</td> <td><select name="typeid">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['typeid']==$myrow['typeid']){ @@ -765,45 +787,73 @@ <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td>' . $_POST['ClientSince'] . '</td></tr>'; - echo '</table></td><td><table class=selection>'; + echo '</table></td> + <td><table class="selection">'; - echo '<tr><td>' . _('Discount Percent') . ':</td> - <td>' . $_POST['Discount'] . '</td></tr>'; - echo '<tr><td>' . _('Discount Code') . ':</td> - <td>' . $_POST['DiscountCode'] . '</td></tr>'; - echo '<tr><td>' . _('Payment Discount Percent') . ':</td> - <td>' . $_POST['PymtDiscount'] . '</td></tr>'; - echo '<tr><td>' . _('Credit Limit') . ':</td> - <td>' . locale_number_format($_POST['CreditLimit'],2) . '</td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> - <td>' . $_POST['TaxRef'] . '</td></tr>'; + echo '<tr> + <td>' . _('Discount Percent') . ':</td> + <td>' . $_POST['Discount'] . '</td> + </tr> + <tr> + <td>' . _('Discount Code') . ':</td> + <td>' . $_POST['DiscountCode'] . '</td> + </tr> + <tr> + <td>' . _('Payment Discount Percent') . ':</td> + <td>' . $_POST['PymtDiscount'] . '</td> + </tr> + <tr> + <td>' . _('Credit Limit') . ':</td> + <td>' . $_POST['CreditLimit'] . '</td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> + <td>' . $_POST['TaxRef'] . '</td> + </tr>'; } else { - echo '</select></td></tr> - <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('ClientSince',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" size=11 maxlength=10 value=' . $_POST['ClientSince'] . '></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('ClientSince',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" size="11" maxlength="10" value="' . $_POST['ClientSince'] . '" /></td> + </tr> + </table></td> + <td><table class="selection">'; - echo '</table></td><td><table class="selection">'; - - echo '<tr><td>' . _('Discount Percent') . ':</td> - <td><input type="Text" name="Discount" class=number size=5 maxlength=4 value=' . $_POST['Discount'] . '></td></tr>'; - echo '<tr><td>' . _('Discount Code') . ':</td> - <td><input ' . (in_array('DiscountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="DiscountCode" size=3 maxlength=2 value="' . $_POST['DiscountCode'] . '"></td></tr>'; - echo '<tr><td>' . _('Payment Discount Percent') . ':</td> - <td><input ' . (in_array('PymtDiscount',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class=number name="PymtDiscount" size=5 maxlength=4 value=' . $_POST['PymtDiscount'] . '></td></tr>'; - echo '<tr><td>' . _('Credit Limit') . ':</td> - <td><input ' . (in_array('CreditLimit',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class=number name="CreditLimit" size=16 maxlength=14 value=' . $_POST['CreditLimit'] . '></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> - <td><input type="Text" name="TaxRef" size=22 maxlength=20 value="' . $_POST['TaxRef'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Discount Percent') . ':</td> + <td><input type="text" name="Discount" class="number" size="5" maxlength="4" value="' . $_POST['Discount'] . '" /></td> + </tr> + <tr> + <td>' . _('Discount Code') . ':</td> + <td><input ' . (in_array('DiscountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="DiscountCode" size="3" maxlength="2" value="' . $_POST['DiscountCode'] . '"></td> + </tr> + <tr> + <td>' . _('Payment Discount Percent') . ':</td> + <td><input ' . (in_array('PymtDiscount',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="PymtDiscount" size="5" maxlength="4" value="' . $_POST['PymtDiscount'] . '"></td> + </tr> + <tr> + <td>' . _('Credit Limit') . ':</td> + <td><input ' . (in_array('CreditLimit',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="CreditLimit" size="16" maxlength="14" value="' . $_POST['CreditLimit'] . '" /></td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size="22" maxlength="20" value="' . $_POST['TaxRef'] . '" /></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT terms FROM paymentterms WHERE termsindicator='".$_POST['PaymentTerms']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Payment Terms') . ':</td><td>' . $myrow['terms'] . '</td></tr>'; + echo '<tr> + <td>' . _('Payment Terms') . ':</td> + <td>' . $myrow['terms'] . '</td> + </tr>'; } else { $result=DB_query("SELECT terms, termsindicator FROM paymentterms",$db); - echo '<tr><td>' . _('Payment Terms') . ':</td> - <td><select name="PaymentTerms">'; + echo '<tr> + <td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms']==$myrow['termsindicator']){ echo '<option selected value="'. $myrow['termsindicator'] . '">' . $myrow['terms'] . '</option>'; @@ -812,18 +862,22 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT reasondescription FROM holdreasons WHERE reasoncode='".$_POST['HoldReason']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ':</td> - <td>'.$myrow['reasondescription'] . '</td></tr>'; + echo '<tr> + <td>' . _('Credit Status') . ':</td> + <td>'.$myrow['reasondescription'] . '</td> + </tr>'; } else { $result=DB_query("SELECT reasoncode, reasondescription FROM holdreasons",$db); - echo '<tr><td>' . _('Credit Status') . ':</td> - <td><select name="HoldReason">'; + echo '<tr> + <td>' . _('Credit Status') . ':</td> + <td><select name="HoldReason">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['HoldReason']==$myrow['reasoncode']){ echo '<option selected value="'. $myrow['reasoncode'] . '">' . $myrow['reasondescription'] . '</option>'; @@ -832,18 +886,21 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT currency FROM currencies WHERE currabrev='".$_POST['CurrCode']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>' . $myrow['currency'] . '</td></tr>'; } else { $result=DB_query("SELECT currency, currabrev FROM currencies",$db); - echo '<tr><td>' . _('Customers Currency') . ':</td> - <td><select name="CurrCode">'; + echo '<tr> + <td>' . _('Customers Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ echo '<option selected value="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; @@ -852,22 +909,26 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } /*added lines 8/23/2007 by Morris Kelly to get po line parameter Y/N*/ if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>'._('No') . '</td> </tr>'; } else { - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>'._('Yes') . '</td> - </tr>'; + </tr>'; } } else { - echo '<tr><td>' . _('Require Customer PO Line on SO') . ':</td> - <td><select name="CustomerPOLine">'; + echo '<tr> + <td>' . _('Require Customer PO Line on SO') . ':</td> + <td><select name="CustomerPOLine">'; if ($_POST['CustomerPOLine']==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -875,18 +936,26 @@ echo '<option value=0>' . _('No') . '</option>'; echo '<option selected value=1>' . _('Yes') . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to HO').'</td></tr>'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td>'._('Address to HO').'</td> + </tr>'; } else { - echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to Branch').'</td></tr>'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td>'._('Address to Branch').'</td> + </tr>'; } } else { - echo '<tr><td>' . _('Invoice Addressing') . ':</td> - <td><select name="AddrInvBranch">'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td><select name="AddrInvBranch">'; if ($_POST['InvAddrBranch']==0){ echo '<option selected value=0>' . _('Address to HO') . '</option>'; echo '<option value=1>' . _('Address to Branch') . '</option>'; @@ -896,11 +965,12 @@ } } - echo '</select></td></tr> - </table></td></tr>'; - echo '<tr><td colspan=2>'; + echo '</select></td> + </tr> + </table></td> + </tr> + <tr><td colspan="2">'; - if (isset($_GET['delete'])) { //User hit delete link on customer contacts /*Process this first before showing remaining contacts */ $resultupcc = DB_query("DELETE FROM custcontacts @@ -925,20 +995,22 @@ echo '<table class=selection>'; if (isset($_GET['Modify'])) { echo '<tr> - <th>' . _('Name') . '</th> - <th>' . _('Role') . '</th> - <th>' . _('Phone Number') . '</th> - <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Role') . '</th> + <th>' . _('Phone Number') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } else { echo '<tr> - <th>' . _('Name') . '</th> - <th>' . _('Role') . '</th> - <th>' . _('Phone Number') . '</th> - <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Edit') . '</th> - <th colspan=2><input type="Submit" name="AddContact" value="Add Contact"></th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Role') . '</th> + <th>' . _('Phone Number') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Edit') . '</th> + <th colspan="2"><input type="Submit" name="AddContact" value="' . _('Add Contact') . '" /></th> + </tr>'; } $k=0; //row colour counter @@ -953,51 +1025,54 @@ if (isset($_GET['Modify'])) { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=mailto:%s>%s</a></td> - <td>%s</td> - </tr>', - $myrow['contactname'], - $myrow['role'], - $myrow['phoneno'], - $myrow['email'], - $myrow['email'], - $myrow['notes']); + <td>%s</td> + <td>%s</td> + <td><a href=mailto:%s>%s</a></td> + <td>%s</td> + </tr>', + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['email'], + $myrow['email'], + $myrow['notes']); } else { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=mailto:%s>%s</a></td> - <td>%s</td> - <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> - <td><a href="%sID=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer contact?') . '\');">'. _('Delete'). '</a></td> - </tr>', - $myrow['contactname'], - $myrow['role'], - $myrow['phoneno'], - $myrow['email'], - $myrow['email'], - $myrow['notes'], - $myrow['contid'], - $myrow['debtorno'], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow['contid'], - $myrow['debtorno']); + <td>%s</td> + <td>%s</td> + <td><a href=mailto:%s>%s</a></td> + <td>%s</td> + <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> + <td><a href="%sID=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer contact?') . '\');">'. _('Delete'). '</a></td> + </tr>', + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['email'], + $myrow['email'], + $myrow['notes'], + $myrow['contid'], + $myrow['debtorno'], + htmlspecialchars($_SERVER['PHP_SELF']) . '?', + $myrow['contid'], + $myrow['debtorno']); } }//END WHILE LIST LOOP echo '</table>'; - - echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { - echo '<div class="centre"><input type="submit" name="submit" value="' . _('Add New Customer') . - '"> <input type=submit name="Reset" value="' . _('Reset') . '"></div></form>'; - } else if (!isset($_GET['Modify'])){ - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update Customer') . '">'; - echo ' <input type="Submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; + echo '<div class="centre"> + <input type="submit" name="submit" value="' . _('Add New Customer') . '" /> + <input type=submit name="Reset" value="' . _('Reset') . '" /> + </div> + </form>'; + } elseif (!isset($_GET['Modify'])){ + echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Update Customer') . '" /> + <input type="Submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" />'; } echo '</div>'; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DailyBankTransactions.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -6,14 +6,16 @@ $title = _('Bank Transactions Inquiry'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . + _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; if (!isset($_POST['Show'])) { echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; $SQL = "SELECT bankaccountname, bankaccounts.accountcode, @@ -26,7 +28,8 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); - echo '<tr><td>' . _('Bank Account') . ':</td> + echo '<tr> + <td>' . _('Bank Account') . ':</td> <td><select name="BankAccount">'; if (DB_num_rows($AccountsResults)==0){ @@ -49,18 +52,21 @@ } echo '</select></td></tr>'; } - echo '<tr><td>' . _('Transactions Dated From') . ':</td> - <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td></tr> - <tr><td>' . _('Transactions Dated To') . ':</td> - <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 - onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - - echo '</table>'; - echo '<br /><div class="centre"><input type="submit" name="Show" value="' . _('Show transactions'). '"></div>'; - echo '</form>'; + echo '<tr> + <td>' . _('Transactions Dated From') . ':</td> + <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . + date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + <tr> + <td>' . _('Transactions Dated To') . ':</td> + <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Show" value="' . _('Show transactions'). '" /> + </div> + </form>'; } else { $SQL = "SELECT bankaccountname, bankaccounts.currcode, @@ -78,6 +84,7 @@ banktrans.exrate, banktrans.banktranstype, banktrans.transdate, + banktrans.ref, bankaccounts.bankaccountname, systypes.typename, systypes.typeid @@ -95,20 +102,20 @@ prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); } else { $BankDetailRow = DB_fetch_array($BankResult); - echo '<table class=selection> + 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> + <th colspan="8"><font size="3" color="blue">' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + </tr> + <tr> + <th>' . ('Date') . '</th> + <th>'._('Transaction type').'</th> + <th>'._('Type').'</th> + <th>'._('Reference').'</th> + <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> + <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> + <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> + <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> </tr>'; - echo '<tr> - <th>' . ('Date') . '</th> - <th>'._('Transaction type').'</th> - <th>'._('Type').'</th> - <th>'._('Reference').'</th> - <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> - <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> - <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> - <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> - </tr>'; $AccountCurrTotal=0; $LocalCurrTotal =0; @@ -123,10 +130,10 @@ <td>'.$myrow['typename'].'</td> <td>'.$myrow['banktranstype'].'</td> <td>'.$myrow['ref'].'</td> - <td class=number>'.locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td> - <td class=number>'.locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td> - <td class=number>'.locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> - <td class=number>'.locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td> </tr>'; } echo '</table>'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DailySalesInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -7,17 +7,21 @@ 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') . '</p>'; -echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br />'; +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 '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection><tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('Month to Show') . ':</td> + <td><select tabindex="1" name="MonthToShow">'; -echo '<td>' . _('Month to Show') . ':</td><td><select tabindex=1 name="MonthToShow">'; - if (!isset($_POST['MonthToShow'])){ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); } @@ -29,11 +33,12 @@ 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>'; + echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } } -echo '</select></td>'; -echo '<td>' . _('Salesperson') . ':</td><td><select tabindex=2 name="Salesperson">'; +echo '</select></td> + <td>' . _('Salesperson') . ':</td> + <td><select tabindex="2" name="Salesperson">'; $SalespeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman",$db); if (!isset($_POST['Salesperson'])){ @@ -55,9 +60,11 @@ 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 />'; + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '" /> + </div> + </form> + <br />'; /*Now get and display the sales data returned */ if (mb_strpos($EndDateSQL,'/')) { $Date_Array = explode('/',$EndDateSQL); @@ -92,9 +99,8 @@ $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=2 class=selection>'; - -echo'<tr> +echo '<table class="selection"> + <tr> <th>' . _('Sunday') . '</th> <th>' . _('Monday') . '</th> <th>' . _('Tuesday') . '</th> @@ -176,7 +182,7 @@ $AverageDailySales = 0; } -echo '<th colspan=7>' . _('Total Sales for month') . ': ' . locale_number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . locale_number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . locale_number_format($AverageDailySales,0) . '</th></tr>'; +echo '<th colspan="7">' . _('Total Sales for month') . ': ' . locale_number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . locale_number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . locale_number_format($AverageDailySales,0) . '</th></tr>'; echo '</table>'; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DebtorsAtPeriodEnd.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -125,7 +125,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if (!isset($_POST['FromCriteria']) || !isset($_POST['ToCriteria'])) { + if (!isset($_POST['FromCriteria']) OR !isset($_POST['ToCriteria'])) { /*if $FromCriteria is not set then show a form to allow input */ @@ -134,13 +134,13 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('From Customer Code') .':</font></td> - <td><input tabindex=1 Type=text maxlength=6 size=7 name="FromCriteria" value="1"></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> </tr>'; echo '<tr><td>' . _('To Customer Code') . ':</td> - <td><input tabindex=2 type="text" maxlength=6 size=7 name="ToCriteria" value="zzzzzz"></td></tr>'; + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td></tr>'; echo '<tr><td>' . _('Balances As At') . ':</td> - <td><select tabindex=3 name="PeriodEnd">'; + <td><select tabindex="3" name="PeriodEnd">'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/Stocks.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -778,7 +778,10 @@ $_POST['TaxCat'] = $myrow['taxcatid']; $_POST['DecimalPlaces'] = $myrow['decimalplaces']; $_POST['NextSerialNo'] = $myrow['nextserialno']; + $_POST['Pansize'] = $myrow['pansize']; + $_POST['ShrinkFactor'] = $myrow['shrinkfactor']; + echo '<tr><td>' . _('Item Code') . ':</td> <td>'.$StockID.'</td> </tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/doc/Change.log 2011-10-30 09:17:27 UTC (rev 4738) @@ -1,5 +1,6 @@ webERP Change Log +30/10/11 Exson: Modification to Stocks.php to avoid losing PanSize and ShrinkFactor 30/10/11 Phil: Made it so a saleman cannot be deleted if a user is setup referring only to this salesperson 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 @@ -88,8 +89,8 @@ 28/6/11 Exson: MRPDemands.php links missing ? now fixed - script fixed for quoting variable name CamelCasing 27/6/11 Exson: MRP.php fixed modulus arithmetic that prevented suggesting production quantities where the quantity was less than 1 - the calculation using PanSize should round up to the nearest whole unit to manufacture 26/6/11 Phil: Fixed reference to $_POST['StockID'] in WorkOrderCosting.php when updating the new weighted average cost -26/6/11 Phil: Went back to no locale_number_formatting on PurchData.php -26/6/11 Phil: Went back to no locale_number_formatting on PO_Items.php price and quantity - Brian May still reporting issues +26/6/11 Phil: Went back to no number_formatting on PurchData.php +26/6/11 Phil: Went back to no number_formatting on PO_Items.php price and quantity - Brian May still reporting issues 25/6/11 Phil: Made PO_PDFPurchOrder.php have the description of the order item run over several lines where it exceeds the width of the space allowed for it 22/6/11 Phil: Added message to AccountGroups.php to show that child account groups cannot have changes to their account section, their profit and loss or balance sheet and sequence in TB as these properties belong only to parent account groups and are inherited by the kids 23/6/11 Phil: SelectOrderItems.php includes/DefineCartClass.php repaired credit checks @@ -143,7 +144,6 @@ 28/5/11 Phil: Reported by Daniel Brewer Fix SelectSalesOrder.php creation of PO with excluding redundant fields in purchorderdetails that were taken out. 28/5/11 Exson: UpdateCurrencyRateDaily was set to 1 when the option to enable it was clicked - should have been set to today's date in SystemParameters - fixed. Now no error reported bu ConvertSQLDate function when user enables update currencies daily. - 26/5/11 Version 4.04 Release 26/5/11 Ricard: require securitytoken 9 to allow user to see purchasing data in SelectProduct.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |