This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <Ex...@us...> - 2012-02-20 01:22:12
|
Revision: 4926 http://web-erp.svn.sourceforge.net/web-erp/?rev=4926&view=rev Author: ExsonQu Date: 2012-02-20 01:22:05 +0000 (Mon, 20 Feb 2012) Log Message: ----------- Fixed the contract png not integrated with the background Modified Paths: -------------- branches/stable/css/silverwolf/images/contract.png Modified: branches/stable/css/silverwolf/images/contract.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-20 01:22:12
|
Revision: 4926 http://web-erp.svn.sourceforge.net/web-erp/?rev=4926&view=rev Author: ExsonQu Date: 2012-02-20 01:22:05 +0000 (Mon, 20 Feb 2012) Log Message: ----------- Fixed the contract png not integrated with the background Modified Paths: -------------- branches/stable/css/silverwolf/images/contract.png Modified: branches/stable/css/silverwolf/images/contract.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-19 19:26:25
|
Revision: 4925 http://web-erp.svn.sourceforge.net/web-erp/?rev=4925&view=rev Author: tim_schofield Date: 2012-02-19 19:26:19 +0000 (Sun, 19 Feb 2012) Log Message: ----------- tezozomoc: Fix bug number 0000010: "If" mis-spelled in file Prices_Customers.php line 337 Modified Paths: -------------- trunk/Prices_Customer.php Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2012-02-18 20:52:55 UTC (rev 4924) +++ trunk/Prices_Customer.php 2012-02-19 19:26:19 UTC (rev 4925) @@ -231,7 +231,7 @@ custbranch.brname, prices.startdate, prices.enddate - FROM prices LEFT JOIN custbranch + FROM prices LEFT JOIN custbranch ON prices.branchcode= custbranch.branchcode WHERE prices.typeabbrev = '".$SalesType."' AND prices.stockid='".$Item."' @@ -278,7 +278,7 @@ '&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> <td><a href="'.htmlspecialchars($_SERVER['PHP_SELF']).'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'] .'&EndDate='.$myrow['enddate'].'&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this price?') . '\');">' . _('Delete') . '</td> </tr>'; - + } //END WHILE LIST LOOP } @@ -334,7 +334,7 @@ } while ($myrow=DB_fetch_array($result)) { - f ($myrow['branchcode']==$_GET['Branch']) { + if ($myrow['branchcode']==$_GET['Branch']) { echo '<option selected="selected" value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; } else { echo '<option value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; @@ -360,7 +360,7 @@ <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> </form>'; - + include('includes/footer.inc'); exit; @@ -419,7 +419,7 @@ $StartDate = $myrow['startdate']; $EndDate = $myrow['enddate']; } - + //Now look for duplicate prices with no end $SQL = "SELECT price, startdate, @@ -434,7 +434,7 @@ AND enddate ='0000-00-00' ORDER BY startdate"; $result = DB_query($SQL,$db); - + while ($myrow = DB_fetch_array($result)) { if (isset($OldStartDate)){ /*Need to make the end date the new start date less 1 day */ @@ -450,7 +450,7 @@ AND debtorno =''"; $UpdateResult = DB_query($SQL,$db); } - $OldStartDate = $myrow['startdate'] + $OldStartDate = $myrow['startdate']; } // end of loop around duplicate no end date prices } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-19 19:26:25
|
Revision: 4925 http://web-erp.svn.sourceforge.net/web-erp/?rev=4925&view=rev Author: tim_schofield Date: 2012-02-19 19:26:19 +0000 (Sun, 19 Feb 2012) Log Message: ----------- tezozomoc: Fix bug number 0000010: "If" mis-spelled in file Prices_Customers.php line 337 Modified Paths: -------------- trunk/Prices_Customer.php Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2012-02-18 20:52:55 UTC (rev 4924) +++ trunk/Prices_Customer.php 2012-02-19 19:26:19 UTC (rev 4925) @@ -231,7 +231,7 @@ custbranch.brname, prices.startdate, prices.enddate - FROM prices LEFT JOIN custbranch + FROM prices LEFT JOIN custbranch ON prices.branchcode= custbranch.branchcode WHERE prices.typeabbrev = '".$SalesType."' AND prices.stockid='".$Item."' @@ -278,7 +278,7 @@ '&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> <td><a href="'.htmlspecialchars($_SERVER['PHP_SELF']).'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'] .'&EndDate='.$myrow['enddate'].'&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this price?') . '\');">' . _('Delete') . '</td> </tr>'; - + } //END WHILE LIST LOOP } @@ -334,7 +334,7 @@ } while ($myrow=DB_fetch_array($result)) { - f ($myrow['branchcode']==$_GET['Branch']) { + if ($myrow['branchcode']==$_GET['Branch']) { echo '<option selected="selected" value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; } else { echo '<option value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; @@ -360,7 +360,7 @@ <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> </form>'; - + include('includes/footer.inc'); exit; @@ -419,7 +419,7 @@ $StartDate = $myrow['startdate']; $EndDate = $myrow['enddate']; } - + //Now look for duplicate prices with no end $SQL = "SELECT price, startdate, @@ -434,7 +434,7 @@ AND enddate ='0000-00-00' ORDER BY startdate"; $result = DB_query($SQL,$db); - + while ($myrow = DB_fetch_array($result)) { if (isset($OldStartDate)){ /*Need to make the end date the new start date less 1 day */ @@ -450,7 +450,7 @@ AND debtorno =''"; $UpdateResult = DB_query($SQL,$db); } - $OldStartDate = $myrow['startdate'] + $OldStartDate = $myrow['startdate']; } // end of loop around duplicate no end date prices } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:53:02
|
Revision: 4924 http://web-erp.svn.sourceforge.net/web-erp/?rev=4924&view=rev Author: tim_schofield Date: 2012-02-18 20:52:55 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Corrections to column ordering Modified Paths: -------------- trunk/SelectProduct.php Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-02-18 20:52:22 UTC (rev 4923) +++ trunk/SelectProduct.php 2012-02-18 20:52:55 UTC (rev 4924) @@ -79,7 +79,7 @@ <tr> <th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . ' ' . $ItemStatus . '</b></th> </tr>'; - + echo '<tr> <td width="40%" valign="top"> <table align="left">'; //nested table @@ -129,12 +129,12 @@ if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<tr><th colspan="2">' . _('Sell Price') . ':</th> <td class="select">'; - $PriceResult = DB_query("SELECT typeabbrev, + $PriceResult = DB_query("SELECT typeabbrev, price FROM prices WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' AND debtorno='' - AND branchcode='' + AND branchcode='' AND startdate <= '". Date('Y-m-d') ."' AND ( enddate >= '" . Date('Y-m-d') . "' OR enddate = '0000-00-00') AND stockid='" . $StockID . "'", $db); if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { @@ -273,7 +273,7 @@ FROM purchorders INNER JOIN purchorderdetails ON purchorders.orderno=purchorderdetails.orderno WHERE purchorderdetails.itemcode='" . $StockID . "' - AND purchorderdetails.completed =0 + AND purchorderdetails.completed =0 AND purchorders.status<>'Cancelled' AND purchorders.status<>'Pending' AND purchorders.status<>'Rejected'"; @@ -346,7 +346,7 @@ </table>'; //end of nested table echo '</td>'; //end cell of master table -if (($myrow['mbflag'] == 'B' OR ($myrow['mbflag'] == 'M')) +if (($myrow['mbflag'] == 'B' OR ($myrow['mbflag'] == 'M')) AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens']))){ echo '<td width="50%" valign="top"><table> @@ -368,7 +368,7 @@ purchdata.preferred, currencies.decimalplaces FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid + ON purchdata.supplierno=suppliers.supplierid INNER JOIN currencies ON suppliers.currcode=currencies.currabrev WHERE purchdata.stockid = '" . $StockID . "' @@ -430,7 +430,7 @@ if( isset($StockID) AND file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { echo '<div class="centre"><img src="' . $rootpath . '/GetStockImage.php?automake=1&textcolor=FFFFF0&bgcolor=007F00&StockID=' . $StockID . '&text=' . $StockID . '&width=120&height=120" />'; } - if (($myrow['mbflag'] == 'B') + if (($myrow['mbflag'] == 'B') AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens'])) AND $myrow['discontinued']==0){ echo '<br />'; @@ -450,7 +450,7 @@ } echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$EOQ.'&LeadTime='.$SuppRow['leadtime'].'">'. _('Purchase this Item from') . ' ' . $SuppRow['suppname'] . '</a> <br />'; - + /**/ } /* end of while */ } /* end of $myrow['mbflag'] == 'B' */ @@ -469,8 +469,8 @@ } if (!$Its_A_Kitset) { echo '<a href="' . $rootpath . '/Prices.php?Item=' . $StockID . '">' . _('Maintain Pricing') . '</a><br />'; - if (isset($_SESSION['CustomerID']) - AND $_SESSION['CustomerID'] != '' + if (isset($_SESSION['CustomerID']) + AND $_SESSION['CustomerID'] != '' AND mb_strlen($_SESSION['CustomerID']) > 0) { echo '<a href="' . $rootpath . '/Prices_Customer.php?Item=' . $StockID . '">' . _('Special Prices for customer') . ' - ' . $_SESSION['CustomerID'] . '</a><br />'; } @@ -764,13 +764,13 @@ } else { $ItemStatus =''; } - + echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> <td>'.$myrow['description'].'</td> <td class="number">' . $qoh . '</td> <td>' . $myrow['units'] . '</td> + <td>' . $ItemStatus . '</td> <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> - <td>' . $ItemStatus . '</td> </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:53:02
|
Revision: 4924 http://web-erp.svn.sourceforge.net/web-erp/?rev=4924&view=rev Author: tim_schofield Date: 2012-02-18 20:52:55 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Corrections to column ordering Modified Paths: -------------- trunk/SelectProduct.php Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-02-18 20:52:22 UTC (rev 4923) +++ trunk/SelectProduct.php 2012-02-18 20:52:55 UTC (rev 4924) @@ -79,7 +79,7 @@ <tr> <th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . ' ' . $ItemStatus . '</b></th> </tr>'; - + echo '<tr> <td width="40%" valign="top"> <table align="left">'; //nested table @@ -129,12 +129,12 @@ if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<tr><th colspan="2">' . _('Sell Price') . ':</th> <td class="select">'; - $PriceResult = DB_query("SELECT typeabbrev, + $PriceResult = DB_query("SELECT typeabbrev, price FROM prices WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' AND debtorno='' - AND branchcode='' + AND branchcode='' AND startdate <= '". Date('Y-m-d') ."' AND ( enddate >= '" . Date('Y-m-d') . "' OR enddate = '0000-00-00') AND stockid='" . $StockID . "'", $db); if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { @@ -273,7 +273,7 @@ FROM purchorders INNER JOIN purchorderdetails ON purchorders.orderno=purchorderdetails.orderno WHERE purchorderdetails.itemcode='" . $StockID . "' - AND purchorderdetails.completed =0 + AND purchorderdetails.completed =0 AND purchorders.status<>'Cancelled' AND purchorders.status<>'Pending' AND purchorders.status<>'Rejected'"; @@ -346,7 +346,7 @@ </table>'; //end of nested table echo '</td>'; //end cell of master table -if (($myrow['mbflag'] == 'B' OR ($myrow['mbflag'] == 'M')) +if (($myrow['mbflag'] == 'B' OR ($myrow['mbflag'] == 'M')) AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens']))){ echo '<td width="50%" valign="top"><table> @@ -368,7 +368,7 @@ purchdata.preferred, currencies.decimalplaces FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid + ON purchdata.supplierno=suppliers.supplierid INNER JOIN currencies ON suppliers.currcode=currencies.currabrev WHERE purchdata.stockid = '" . $StockID . "' @@ -430,7 +430,7 @@ if( isset($StockID) AND file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { echo '<div class="centre"><img src="' . $rootpath . '/GetStockImage.php?automake=1&textcolor=FFFFF0&bgcolor=007F00&StockID=' . $StockID . '&text=' . $StockID . '&width=120&height=120" />'; } - if (($myrow['mbflag'] == 'B') + if (($myrow['mbflag'] == 'B') AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens'])) AND $myrow['discontinued']==0){ echo '<br />'; @@ -450,7 +450,7 @@ } echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$EOQ.'&LeadTime='.$SuppRow['leadtime'].'">'. _('Purchase this Item from') . ' ' . $SuppRow['suppname'] . '</a> <br />'; - + /**/ } /* end of while */ } /* end of $myrow['mbflag'] == 'B' */ @@ -469,8 +469,8 @@ } if (!$Its_A_Kitset) { echo '<a href="' . $rootpath . '/Prices.php?Item=' . $StockID . '">' . _('Maintain Pricing') . '</a><br />'; - if (isset($_SESSION['CustomerID']) - AND $_SESSION['CustomerID'] != '' + if (isset($_SESSION['CustomerID']) + AND $_SESSION['CustomerID'] != '' AND mb_strlen($_SESSION['CustomerID']) > 0) { echo '<a href="' . $rootpath . '/Prices_Customer.php?Item=' . $StockID . '">' . _('Special Prices for customer') . ' - ' . $_SESSION['CustomerID'] . '</a><br />'; } @@ -764,13 +764,13 @@ } else { $ItemStatus =''; } - + echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> <td>'.$myrow['description'].'</td> <td class="number">' . $qoh . '</td> <td>' . $myrow['units'] . '</td> + <td>' . $ItemStatus . '</td> <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> - <td>' . $ItemStatus . '</td> </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:52:29
|
Revision: 4923 http://web-erp.svn.sourceforge.net/web-erp/?rev=4923&view=rev Author: tim_schofield Date: 2012-02-18 20:52:22 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Fix contracts icon Modified Paths: -------------- trunk/css/silverwolf/images/contract.png Modified: trunk/css/silverwolf/images/contract.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:52:29
|
Revision: 4923 http://web-erp.svn.sourceforge.net/web-erp/?rev=4923&view=rev Author: tim_schofield Date: 2012-02-18 20:52:22 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Fix contracts icon Modified Paths: -------------- trunk/css/silverwolf/images/contract.png Modified: trunk/css/silverwolf/images/contract.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:17:06
|
Revision: 4922 http://web-erp.svn.sourceforge.net/web-erp/?rev=4922&view=rev Author: tim_schofield Date: 2012-02-18 20:16:59 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Fix error in javascript preventing focus being set to the user id field, and merge other changes from Tims branch Modified Paths: -------------- trunk/includes/Login.php Modified: trunk/includes/Login.php =================================================================== --- trunk/includes/Login.php 2012-02-18 09:13:01 UTC (rev 4921) +++ trunk/includes/Login.php 2012-02-18 20:16:59 UTC (rev 4922) @@ -9,16 +9,16 @@ } elseif (!isset($demo_text)) { $demo_text = _('Please login here'); } +echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<html> <head> - <title>webERP Login screen</title> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <link rel="stylesheet" href="css/<?php echo $theme;?>/login.css" type="text/css" /> + <title>webERP Login screen</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> + <link rel="stylesheet" href="css/<?php echo $theme;?>/login.css" type="text/css" /> </head> <body> @@ -33,21 +33,21 @@ <div id="container"> <div id="login_logo"></div> <div id="login_box"> - <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" id="loginform" method="post"> - <p><input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> + <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8');?>" method="post"> + <input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> <span><?php echo _('Company'); ?>:</span> - + <?php if ($AllowCompanySelectionBox == true){ echo '<select name="CompanyNameField">'; - + $Companies = scandir('companies/', 0); foreach ($Companies as $CompanyEntry){ if (is_dir('companies/' . $CompanyEntry) AND $CompanyEntry != '..' AND $CompanyEntry != '' AND $CompanyEntry!='.svn' AND $CompanyEntry!='.'){ if ($CompanyEntry==$DefaultCompany) { - echo '<option selected="selected" value="' . $CompanyEntry . '">' . $CompanyEntry . '</option>'; + echo '<option selected="selected" label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; } else { - echo '<option value="' . $CompanyEntry . '">' . $CompanyEntry . '</option>'; + echo '<option label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; } } } @@ -56,20 +56,21 @@ echo '<input type="text" name="CompanyNameField" value="' . $DefaultCompany . '" />'; } ?> - - <span><?php echo _('User name'); ?>:</span> - <input type="text" name="UserNameEntryField" /> - <span><?php echo _('Password'); ?>:</span> - <input type="password" name="Password" /></p> + + <br /> + <span><?php echo _('User name'); ?>:</span><br /> + <input type="text" name="UserNameEntryField" maxlength="20" /><br /> + <span><?php echo _('Password'); ?>:</span><br /> + <input type="password" name="Password" /><br /> <div id="demo_text"><?php echo $demo_text;?></div> - <p><input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /></p> + <input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /> </form> </div> </div> - <script type="text/javascript"> - <!-- - document.loginform.UserNameEntryField.focus(); - //--> - </script> + <script type="text/javascript"> + <!-- + document.forms[0].UserNameEntryField.focus(); + //--> + </script> </body> </html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-18 20:17:06
|
Revision: 4922 http://web-erp.svn.sourceforge.net/web-erp/?rev=4922&view=rev Author: tim_schofield Date: 2012-02-18 20:16:59 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Fix error in javascript preventing focus being set to the user id field, and merge other changes from Tims branch Modified Paths: -------------- trunk/includes/Login.php Modified: trunk/includes/Login.php =================================================================== --- trunk/includes/Login.php 2012-02-18 09:13:01 UTC (rev 4921) +++ trunk/includes/Login.php 2012-02-18 20:16:59 UTC (rev 4922) @@ -9,16 +9,16 @@ } elseif (!isset($demo_text)) { $demo_text = _('Please login here'); } +echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> +<html> <head> - <title>webERP Login screen</title> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <link rel="stylesheet" href="css/<?php echo $theme;?>/login.css" type="text/css" /> + <title>webERP Login screen</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> + <link rel="stylesheet" href="css/<?php echo $theme;?>/login.css" type="text/css" /> </head> <body> @@ -33,21 +33,21 @@ <div id="container"> <div id="login_logo"></div> <div id="login_box"> - <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" id="loginform" method="post"> - <p><input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> + <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8');?>" method="post"> + <input type="hidden" name="FormID" value="<?php echo $_SESSION['FormID']; ?>" /> <span><?php echo _('Company'); ?>:</span> - + <?php if ($AllowCompanySelectionBox == true){ echo '<select name="CompanyNameField">'; - + $Companies = scandir('companies/', 0); foreach ($Companies as $CompanyEntry){ if (is_dir('companies/' . $CompanyEntry) AND $CompanyEntry != '..' AND $CompanyEntry != '' AND $CompanyEntry!='.svn' AND $CompanyEntry!='.'){ if ($CompanyEntry==$DefaultCompany) { - echo '<option selected="selected" value="' . $CompanyEntry . '">' . $CompanyEntry . '</option>'; + echo '<option selected="selected" label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; } else { - echo '<option value="' . $CompanyEntry . '">' . $CompanyEntry . '</option>'; + echo '<option label="'.$CompanyEntry.'" value="'.$CompanyEntry.'">'.$CompanyEntry.'</option>'; } } } @@ -56,20 +56,21 @@ echo '<input type="text" name="CompanyNameField" value="' . $DefaultCompany . '" />'; } ?> - - <span><?php echo _('User name'); ?>:</span> - <input type="text" name="UserNameEntryField" /> - <span><?php echo _('Password'); ?>:</span> - <input type="password" name="Password" /></p> + + <br /> + <span><?php echo _('User name'); ?>:</span><br /> + <input type="text" name="UserNameEntryField" maxlength="20" /><br /> + <span><?php echo _('Password'); ?>:</span><br /> + <input type="password" name="Password" /><br /> <div id="demo_text"><?php echo $demo_text;?></div> - <p><input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /></p> + <input class="button" type="submit" value="<?php echo _('Login'); ?>" name="SubmitUser" /> </form> </div> </div> - <script type="text/javascript"> - <!-- - document.loginform.UserNameEntryField.focus(); - //--> - </script> + <script type="text/javascript"> + <!-- + document.forms[0].UserNameEntryField.focus(); + //--> + </script> </body> </html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-18 09:13:07
|
Revision: 4921 http://web-erp.svn.sourceforge.net/web-erp/?rev=4921&view=rev Author: daintree Date: 2012-02-18 09:13:01 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-02-17 10:59:12 UTC (rev 4920) +++ trunk/BankAccounts.php 2012-02-18 09:13:01 UTC (rev 4921) @@ -178,9 +178,8 @@ bankaddress, currcode, invoice - FROM bankaccounts - INNER JOIN chartmaster - ON bankaccounts.accountcode = chartmaster.accountcode"; + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; @@ -262,8 +261,8 @@ bankaddress, currcode, invoice - FROM bankaccounts - WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; + FROM bankaccounts + WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -291,11 +290,10 @@ $sql = "SELECT accountcode, accountname - FROM chartmaster - LEFT JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname - WHERE accountgroups.pandl = 0 - ORDER BY accountcode"; + FROM chartmaster LEFT JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname + WHERE accountgroups.pandl = 0 + ORDER BY accountcode"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-18 09:13:07
|
Revision: 4921 http://web-erp.svn.sourceforge.net/web-erp/?rev=4921&view=rev Author: daintree Date: 2012-02-18 09:13:01 +0000 (Sat, 18 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-02-17 10:59:12 UTC (rev 4920) +++ trunk/BankAccounts.php 2012-02-18 09:13:01 UTC (rev 4921) @@ -178,9 +178,8 @@ bankaddress, currcode, invoice - FROM bankaccounts - INNER JOIN chartmaster - ON bankaccounts.accountcode = chartmaster.accountcode"; + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; @@ -262,8 +261,8 @@ bankaddress, currcode, invoice - FROM bankaccounts - WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; + FROM bankaccounts + WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -291,11 +290,10 @@ $sql = "SELECT accountcode, accountname - FROM chartmaster - LEFT JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname - WHERE accountgroups.pandl = 0 - ORDER BY accountcode"; + FROM chartmaster LEFT JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname + WHERE accountgroups.pandl = 0 + ORDER BY accountcode"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-17 10:59:23
|
Revision: 4920 http://web-erp.svn.sourceforge.net/web-erp/?rev=4920&view=rev Author: tim_schofield Date: 2012-02-17 10:59:12 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-02-17 10:34:08 UTC (rev 4919) +++ trunk/BankAccounts.php 2012-02-17 10:59:12 UTC (rev 4920) @@ -80,7 +80,7 @@ /*Check if there are already transactions against this account - cant allow change currency if there are*/ - $sql = "SELECT * FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; + $sql = "SELECT banktransid FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', @@ -88,7 +88,7 @@ bankaccountnumber='" . $_POST['BankAccountNumber'] . "', bankaddress='" . $_POST['BankAddress'] . "', invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); echo '<br />'; } else { @@ -98,7 +98,7 @@ bankaddress='" . $_POST['BankAddress'] . "', currcode ='" . $_POST['CurrCode'] . "', invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + WHERE accountcode = '" . $SelectedBankAccount . "'"; } $msg = _('The bank account details have been updated'); @@ -112,14 +112,14 @@ bankaccountnumber, bankaddress, currcode, - invoice) - VALUES ('" . $_POST['AccountCode'] . "', - '" . $_POST['BankAccountName'] . "', - '" . $_POST['BankAccountCode'] . "', - '" . $_POST['BankAccountNumber'] . "', - '" . $_POST['BankAddress'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DefAccount'] . "' )"; + invoice + ) VALUES ('" . $_POST['AccountCode'] . "', + '" . $_POST['BankAccountName'] . "', + '" . $_POST['BankAccountCode'] . "', + '" . $_POST['BankAccountNumber'] . "', + '" . $_POST['BankAddress'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DefAccount'] . "' )"; $msg = _('The new bank account has been entered'); } @@ -149,13 +149,13 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'BankTrans' - $sql= "SELECT COUNT(*) FROM banktrans WHERE banktrans.bankact='" . $SelectedBankAccount . "'"; + $sql= "SELECT COUNT(bankact) AS accounts FROM banktrans WHERE banktrans.bankact='" . $SelectedBankAccount . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['accounts']>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); + echo '<br /> ' . _('There are') . ' ' . $myrow['accounts'] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { @@ -169,59 +169,59 @@ } /* Always show the list of accounts */ -If (!isset($SelectedBankAccount)) { +if (!isset($SelectedBankAccount)) { $sql = "SELECT bankaccounts.accountcode, - bankaccounts.bankaccountcode, - chartmaster.accountname, - bankaccountname, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts INNER JOIN chartmaster - ON bankaccounts.accountcode = chartmaster.accountcode"; + bankaccounts.bankaccountcode, + chartmaster.accountname, + bankaccountname, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class="selection">'; + echo '<table class="selection"> + <tr> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Bank Account Name') . '</th> + <th>' . _('Bank Account Code') . '</th> + <th>' . _('Bank Account Number') . '</th> + <th>' . _('Bank Address') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Default for Invoices') . '</th> + </tr>'; - echo '<tr> - <th>' . _('GL Account Code') . '</th> - <th>' . _('Bank Account Name') . '</th> - <th>' . _('Bank Account Code') . '</th> - <th>' . _('Bank Account Number') . '</th> - <th>' . _('Bank Address') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Default for Invoices') . '</th> - </tr>'; - $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - if ($myrow['invoice']==0) { - $DefaultBankAccount=_('No'); - } elseif ($myrow['invoice']==1) { - $DefaultBankAccount=_('Fall Back Default'); - } elseif ($myrow['invoice']==2) { - $DefaultBankAccount=_('Currency Default'); - } - printf('<td>%s<br /><font size="2">%s</font></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> - <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + if ($myrow['invoice']==0) { + $DefaultBankAccount=_('No'); + } elseif ($myrow['invoice']==1) { + $DefaultBankAccount=_('Fall Back Default'); + } elseif ($myrow['invoice']==2) { + $DefaultBankAccount=_('Currency Default'); + } + printf('<td>%s<br /><font size="2">%s</font></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> </tr>', $myrow['accountcode'], $myrow['accountname'], @@ -231,39 +231,39 @@ $myrow['bankaddress'], $myrow['currcode'], $DefaultBankAccount, - htmlspecialchars($_SERVER['PHP_SELF']), + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow['accountcode'], - htmlspecialchars($_SERVER['PHP_SELF']), + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow['accountcode']); } //END WHILE LIST LOOP - echo '</table><p>'; + echo '</table><br />'; } if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; echo '<br />'; } -echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { //editing an existing bank account - not deleting $sql = "SELECT accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts - WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -279,30 +279,31 @@ echo '<input type="hidden" name="SelectedBankAccount" value="' . $SelectedBankAccount . '" />'; echo '<input type="hidden" name="AccountCode" value="' . $_POST['AccountCode'] . '" />'; echo '<table class="selection"> - <tr><td>' . _('Bank Account GL Code') . ':</td> + <tr> + <td>' . _('Bank Account GL Code') . ':</td> <td>' . $_POST['AccountCode'] . '</td> </tr>'; } else { //end of if $Selectedbank account only do the else when a new record is being entered echo '<table class="selection"> - <tr><td>' . _('Bank Account GL Code') . ':</td> + <tr> + <td>' . _('Bank Account GL Code') . ':</td> <td><select tabindex="1" ' . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) .' name="AccountCode">'; $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_ = accountgroups.groupname - AND accountgroups.pandl = 0 - ORDER BY accountcode"; - + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname + WHERE accountgroups.pandl = 0 + ORDER BY accountcode"; + $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AccountCode']) and $myrow['accountcode']==$_POST['AccountCode']) { - echo '<option selected="selected" value="'; + echo '<option selected="selected" value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } else { - echo '<option value="'; + echo '<option value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } - echo $myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } //end while loop @@ -323,36 +324,45 @@ $_POST['BankAddress']=''; } -echo '<tr><td>' . _('Bank Account Name') . ': </td> - <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Account Code') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Account Number') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Address') . ': </td> - <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Currency Of Account') . ': </td> - <td><select tabindex="5" name="CurrCode">'; +echo '<tr> + <td>' . _('Bank Account Name') . ': </td> + <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Account Code') . ': </td> + <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Account Number') . ': </td> + <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Address') . ': </td> + <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Currency Of Account') . ': </td> + <td><select tabindex="5" name="CurrCode">'; -if (!isset($_POST['CurrCode']) OR $_POST['CurrCode']==''){ +if (!isset($_POST['CurrCode']) or $_POST['CurrCode']==''){ $_POST['CurrCode'] = $_SESSION['CompanyRecord']['currencydefault']; } -$result = DB_query("SELECT currabrev, - currency +$result = DB_query("SELECT currabrev, + currency FROM currencies",$db); - + while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { - echo '<option selected="selected" value="'; + echo '<option selected="selected" value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } else { - echo '<option value="'; + echo '<option value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } - echo $myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } //end while loop echo '</select></td>'; -echo '<tr><td>' . _('Default for Invoices') . ': </td> +echo '<tr> + <td>' . _('Default for Invoices') . ': </td> <td><select tabindex="6" name="DefAccount">'; if (!isset($_POST['DefAccount']) OR $_POST['DefAccount']==''){ @@ -360,10 +370,7 @@ } if (isset($SelectedBankAccount)) { - $result = DB_query("SELECT invoice - FROM bankaccounts - WHERE accountcode ='" . $SelectedBankAccount ."'", - $db); + $result = DB_query("SELECT invoice FROM bankaccounts where accountcode =" . $SelectedBankAccount ,$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['invoice']== 1) { echo '<option selected="selected" value="1">'._('Fall Back Default').'</option> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-17 10:59:23
|
Revision: 4920 http://web-erp.svn.sourceforge.net/web-erp/?rev=4920&view=rev Author: tim_schofield Date: 2012-02-17 10:59:12 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/BankAccounts.php Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-02-17 10:34:08 UTC (rev 4919) +++ trunk/BankAccounts.php 2012-02-17 10:59:12 UTC (rev 4920) @@ -80,7 +80,7 @@ /*Check if there are already transactions against this account - cant allow change currency if there are*/ - $sql = "SELECT * FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; + $sql = "SELECT banktransid FROM banktrans WHERE bankact='" . $SelectedBankAccount . "'"; $BankTransResult = DB_query($sql,$db); if (DB_num_rows($BankTransResult)>0) { $sql = "UPDATE bankaccounts SET bankaccountname='" . $_POST['BankAccountName'] . "', @@ -88,7 +88,7 @@ bankaccountnumber='" . $_POST['BankAccountNumber'] . "', bankaddress='" . $_POST['BankAddress'] . "', invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + WHERE accountcode = '" . $SelectedBankAccount . "'"; prnMsg(_('Note that it is not possible to change the currency of the account once there are transactions against it'),'warn'); echo '<br />'; } else { @@ -98,7 +98,7 @@ bankaddress='" . $_POST['BankAddress'] . "', currcode ='" . $_POST['CurrCode'] . "', invoice ='" . $_POST['DefAccount'] . "' - WHERE accountcode = '" . $SelectedBankAccount . "'"; + WHERE accountcode = '" . $SelectedBankAccount . "'"; } $msg = _('The bank account details have been updated'); @@ -112,14 +112,14 @@ bankaccountnumber, bankaddress, currcode, - invoice) - VALUES ('" . $_POST['AccountCode'] . "', - '" . $_POST['BankAccountName'] . "', - '" . $_POST['BankAccountCode'] . "', - '" . $_POST['BankAccountNumber'] . "', - '" . $_POST['BankAddress'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DefAccount'] . "' )"; + invoice + ) VALUES ('" . $_POST['AccountCode'] . "', + '" . $_POST['BankAccountName'] . "', + '" . $_POST['BankAccountCode'] . "', + '" . $_POST['BankAccountNumber'] . "', + '" . $_POST['BankAddress'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DefAccount'] . "' )"; $msg = _('The new bank account has been entered'); } @@ -149,13 +149,13 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'BankTrans' - $sql= "SELECT COUNT(*) FROM banktrans WHERE banktrans.bankact='" . $SelectedBankAccount . "'"; + $sql= "SELECT COUNT(bankact) AS accounts FROM banktrans WHERE banktrans.bankact='" . $SelectedBankAccount . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['accounts']>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this bank account because transactions have been created using this account'),'warn'); - echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions with this bank account code'); + echo '<br /> ' . _('There are') . ' ' . $myrow['accounts'] . ' ' . _('transactions with this bank account code'); } if (!$CancelDelete) { @@ -169,59 +169,59 @@ } /* Always show the list of accounts */ -If (!isset($SelectedBankAccount)) { +if (!isset($SelectedBankAccount)) { $sql = "SELECT bankaccounts.accountcode, - bankaccounts.bankaccountcode, - chartmaster.accountname, - bankaccountname, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts INNER JOIN chartmaster - ON bankaccounts.accountcode = chartmaster.accountcode"; + bankaccounts.bankaccountcode, + chartmaster.accountname, + bankaccountname, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class="selection">'; + echo '<table class="selection"> + <tr> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Bank Account Name') . '</th> + <th>' . _('Bank Account Code') . '</th> + <th>' . _('Bank Account Number') . '</th> + <th>' . _('Bank Address') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Default for Invoices') . '</th> + </tr>'; - echo '<tr> - <th>' . _('GL Account Code') . '</th> - <th>' . _('Bank Account Name') . '</th> - <th>' . _('Bank Account Code') . '</th> - <th>' . _('Bank Account Number') . '</th> - <th>' . _('Bank Address') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Default for Invoices') . '</th> - </tr>'; - $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - if ($myrow['invoice']==0) { - $DefaultBankAccount=_('No'); - } elseif ($myrow['invoice']==1) { - $DefaultBankAccount=_('Fall Back Default'); - } elseif ($myrow['invoice']==2) { - $DefaultBankAccount=_('Currency Default'); - } - printf('<td>%s<br /><font size="2">%s</font></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> - <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + if ($myrow['invoice']==0) { + $DefaultBankAccount=_('No'); + } elseif ($myrow['invoice']==1) { + $DefaultBankAccount=_('Fall Back Default'); + } elseif ($myrow['invoice']==2) { + $DefaultBankAccount=_('Currency Default'); + } + printf('<td>%s<br /><font size="2">%s</font></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> </tr>', $myrow['accountcode'], $myrow['accountname'], @@ -231,39 +231,39 @@ $myrow['bankaddress'], $myrow['currcode'], $DefaultBankAccount, - htmlspecialchars($_SERVER['PHP_SELF']), + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow['accountcode'], - htmlspecialchars($_SERVER['PHP_SELF']), + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow['accountcode']); } //END WHILE LIST LOOP - echo '</table><p>'; + echo '</table><br />'; } if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; echo '<br />'; } -echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { //editing an existing bank account - not deleting $sql = "SELECT accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts - WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -279,30 +279,31 @@ echo '<input type="hidden" name="SelectedBankAccount" value="' . $SelectedBankAccount . '" />'; echo '<input type="hidden" name="AccountCode" value="' . $_POST['AccountCode'] . '" />'; echo '<table class="selection"> - <tr><td>' . _('Bank Account GL Code') . ':</td> + <tr> + <td>' . _('Bank Account GL Code') . ':</td> <td>' . $_POST['AccountCode'] . '</td> </tr>'; } else { //end of if $Selectedbank account only do the else when a new record is being entered echo '<table class="selection"> - <tr><td>' . _('Bank Account GL Code') . ':</td> + <tr> + <td>' . _('Bank Account GL Code') . ':</td> <td><select tabindex="1" ' . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) .' name="AccountCode">'; $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_ = accountgroups.groupname - AND accountgroups.pandl = 0 - ORDER BY accountcode"; - + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname + WHERE accountgroups.pandl = 0 + ORDER BY accountcode"; + $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AccountCode']) and $myrow['accountcode']==$_POST['AccountCode']) { - echo '<option selected="selected" value="'; + echo '<option selected="selected" value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } else { - echo '<option value="'; + echo '<option value="'.$myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } - echo $myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } //end while loop @@ -323,36 +324,45 @@ $_POST['BankAddress']=''; } -echo '<tr><td>' . _('Bank Account Name') . ': </td> - <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Account Code') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Account Number') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Bank Address') . ': </td> - <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td></tr> - <tr><td>' . _('Currency Of Account') . ': </td> - <td><select tabindex="5" name="CurrCode">'; +echo '<tr> + <td>' . _('Bank Account Name') . ': </td> + <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Account Code') . ': </td> + <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Account Number') . ': </td> + <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Bank Address') . ': </td> + <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Currency Of Account') . ': </td> + <td><select tabindex="5" name="CurrCode">'; -if (!isset($_POST['CurrCode']) OR $_POST['CurrCode']==''){ +if (!isset($_POST['CurrCode']) or $_POST['CurrCode']==''){ $_POST['CurrCode'] = $_SESSION['CompanyRecord']['currencydefault']; } -$result = DB_query("SELECT currabrev, - currency +$result = DB_query("SELECT currabrev, + currency FROM currencies",$db); - + while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { - echo '<option selected="selected" value="'; + echo '<option selected="selected" value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } else { - echo '<option value="'; + echo '<option value="'.$myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } - echo $myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } //end while loop echo '</select></td>'; -echo '<tr><td>' . _('Default for Invoices') . ': </td> +echo '<tr> + <td>' . _('Default for Invoices') . ': </td> <td><select tabindex="6" name="DefAccount">'; if (!isset($_POST['DefAccount']) OR $_POST['DefAccount']==''){ @@ -360,10 +370,7 @@ } if (isset($SelectedBankAccount)) { - $result = DB_query("SELECT invoice - FROM bankaccounts - WHERE accountcode ='" . $SelectedBankAccount ."'", - $db); + $result = DB_query("SELECT invoice FROM bankaccounts where accountcode =" . $SelectedBankAccount ,$db); while ($myrow = DB_fetch_array($result)) { if ($myrow['invoice']== 1) { echo '<option selected="selected" value="1">'._('Fall Back Default').'</option> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-17 10:34:20
|
Revision: 4919 http://web-erp.svn.sourceforge.net/web-erp/?rev=4919&view=rev Author: daintree Date: 2012-02-17 10:34:08 +0000 (Fri, 17 Feb 2012) Log Message: ----------- bug fix Modified Paths: -------------- trunk/AccountGroups.php trunk/AddCustomerNotes.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/Areas.php trunk/SuppCreditGRNs.php trunk/SuppInvGRNs.php trunk/SupplierInvoice.php trunk/doc/Change.log trunk/includes/DefineSuppTransClass.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AccountGroups.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -61,7 +61,7 @@ $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); $myrow=DB_fetch_row($result); - if ($myrow[0]!=0 and $_POST['SelectedAccountGroup']=='') { + if ($myrow[0]!=0 AND $_POST['SelectedAccountGroup']=='') { $InputError = 1; prnMsg( _('The account group name already exists in the database'),'error'); $Errors[$i] = 'GroupName'; @@ -201,7 +201,7 @@ } -if (!isset($_GET['SelectedAccountGroup']) and !isset($_POST['SelectedAccountGroup'])) { +if (!isset($_GET['SelectedAccountGroup']) AND !isset($_POST['SelectedAccountGroup'])) { /* An account group could be posted when one has been edited and is being updated or GOT when selected for modification SelectedAccountGroup will exist because it was sent with the page in a GET . @@ -359,7 +359,7 @@ while ( $grouprow = DB_fetch_array($groupresult) ) { - if (isset($_POST['ParentGroupName']) and $_POST['ParentGroupName']==$grouprow['groupname']) { + if (isset($_POST['ParentGroupName']) AND $_POST['ParentGroupName']==$grouprow['groupname']) { echo '<option selected="selected" value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } else { echo '<option value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AddCustomerNotes.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -29,23 +29,23 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (!is_long((integer)$_POST['priority'])) { + if (!is_long((integer)$_POST['Priority'])) { $InputError = 1; prnMsg( _('The contact priority must be an integer.'), 'error'); - } elseif (mb_strlen($_POST['note']) >200) { + } elseif (mb_strlen($_POST['Note']) >200) { $InputError = 1; prnMsg( _('The contact\'s notes must be two hundred characters or less long'), 'error'); - } elseif( trim($_POST['note']) == '' ) { + } elseif( trim($_POST['Note']) == '' ) { $InputError = 1; prnMsg( _('The contact\'s notes may not be empty'), 'error'); } if (isset($Id) and $InputError !=1) { - $sql = "UPDATE custnotes SET note='" . $_POST['note'] . "', + $sql = "UPDATE custnotes SET note='" . $_POST['Note'] . "', date='" . FormatDateForSQL($_POST['date']) . "', - href='" . $_POST['href'] . "', - priority='" . $_POST['priority'] . "' + href='" . $_POST['Href'] . "', + priority='" . $_POST['Priority'] . "' WHERE debtorno ='".$DebtorNo."' AND noteid='".$Id."'"; $msg = _('Customer Notes') . ' ' . $DebtorNo . ' ' . _('has been updated'); @@ -57,10 +57,10 @@ date, priority) VALUES ('" . $DebtorNo. "', - '" . $_POST['href'] . "', - '" . $_POST['note'] . "', + '" . $_POST['Href'] . "', + '" . $_POST['Note'] . "', '" . FormatDateForSQL($_POST['date']) . "', - '" . $_POST['priority'] . "')"; + '" . $_POST['Priority'] . "')"; $msg = _('The contact notes record has been added'); } @@ -71,11 +71,11 @@ echo '<br />'; prnMsg($msg, 'success'); unset($Id); - unset($_POST['note']); - unset($_POST['noteid']); + unset($_POST['Note']); + unset($_POST['Noteid']); unset($_POST['date']); - unset($_POST['href']); - unset($_POST['priority']); + unset($_POST['Href']); + unset($_POST['Priority']); } } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -181,19 +181,19 @@ $myrow = DB_fetch_array($result); - $_POST['noteid'] = $myrow['noteid']; - $_POST['note'] = $myrow['note']; - $_POST['href'] = $myrow['href']; + $_POST['Noteid'] = $myrow['noteid']; + $_POST['Note'] = $myrow['note']; + $_POST['Href'] = $myrow['href']; $_POST['date'] = $myrow['date']; - $_POST['priority'] = $myrow['priority']; + $_POST['Priority'] = $myrow['priority']; $_POST['debtorno'] = $myrow['debtorno']; echo '<input type="hidden" name="Id" value="'. $Id .'" />'; - echo '<input type="hidden" name="Con_ID" value="' . $_POST['noteid'] . '" />'; + echo '<input type="hidden" name="Con_ID" value="' . $_POST['Noteid'] . '" />'; echo '<input type="hidden" name="DebtorNo" value="' . $_POST['debtorno'] . '" />'; echo '<table class="selection"> <tr> <td>'. _('Note ID').':</td> - <td>' . $_POST['noteid'] . '</td> + <td>' . $_POST['Noteid'] . '</td> </tr>'; } else { echo '<table class="selection">'; @@ -201,20 +201,20 @@ echo '<tr> <td>' . _('Contact Note'). '</td>'; - if (isset($_POST['note'])) { - echo '<td><textarea name="note">' .$_POST['note'] . '</textarea></td> + if (isset($_POST['Note'])) { + echo '<td><textarea name="Note">' .$_POST['Note'] . '</textarea></td> </tr>'; } else { - echo '<td><textarea name="note"></textarea></td> + echo '<td><textarea name="Note"></textarea></td> </tr>'; } echo '<tr> <td>'. _('WWW').'</td>'; - if (isset($_POST['href'])) { - echo '<td><input type="text" name="href" value="'.$_POST['href'].'" size="35" maxlength="100" /></td> + if (isset($_POST['Href'])) { + echo '<td><input type="text" name="Href" value="'.$_POST['Href'].'" size="35" maxlength="100" /></td> </tr>'; } else { - echo '<td><input type="text" name="href" size="35" maxlength="100" /></td> + echo '<td><input type="text" name="Href" size="35" maxlength="100" /></td> </tr>'; } echo '<tr> @@ -228,11 +228,11 @@ } echo '<tr> <td>'. _('Priority'). '</td>'; - if (isset($_POST['priority'])) { - echo '<td><input type="text" name="priority" value="' .$_POST['priority']. '" size="1" maxlength="3" /></td> + if (isset($_POST['Priority'])) { + echo '<td><input type="text" name="Priority" value="' .$_POST['Priority']. '" size="1" maxlength="3" /></td> </tr>'; } else { - echo '<td><input type="text" name="priority" size="1" maxlength="3" /></td> + echo '<td><input type="text" name="Priority" size="1" maxlength="3" /></td> </tr>'; } echo '<tr> Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AgedDebtors.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -186,82 +186,80 @@ debtorsmaster.creditlimit, holdreasons.dissallowinvoices, holdreasons.reasondescription, - SUM(debtortrans.ovamount + - debtortrans.ovgst + - debtortrans.ovfreight + - debtortrans.ovdiscount - - debtortrans.alloc) AS balance, - SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= paymentterms.daysbeforedue - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate," . INTERVAL('1', 'MONTH') . ")," . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0) - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END - ) AS due, - SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END - ) AS overdue1, - SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= ".$_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END - ) AS overdue2 - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = debtortrans.debtorno - AND holdreasons.dissallowinvoices=1 - AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' - AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' - AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' - " . $SalesLimit . " - GROUP BY debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription - HAVING ABS(SUM( - debtortrans.ovamount + - debtortrans.ovgst + - debtortrans.ovfreight + - debtortrans.ovdiscount - - debtortrans.alloc)) >0.005"; + SUM(debtortrans.ovamount + + debtortrans.ovgst + + debtortrans.ovfreight + + debtortrans.ovdiscount - + debtortrans.alloc) AS balance, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate," . INTERVAL('1', 'MONTH') . ")," . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0) + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS due, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS overdue1, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= ".$_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS overdue2 + FROM debtorsmaster, + paymentterms, + holdreasons, + currencies, + debtortrans + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = debtortrans.debtorno + AND holdreasons.dissallowinvoices=1 + AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' + AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' + AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' + " . $SalesLimit . " + GROUP BY debtorsmaster.debtorno, + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription + HAVING ABS(SUM( + debtortrans.ovamount + + debtortrans.ovgst + + debtortrans.ovfreight + + debtortrans.ovdiscount - + debtortrans.alloc)) >0.005"; } $CustomerResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors handled below*/ - //$ListCount = count ($CustomerResult); // Javier - if (DB_error_no($db) !=0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AgedSuppliers.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -81,24 +81,24 @@ ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue2 - FROM suppliers INNER JOIN paymentterms - ON suppliers.paymentterms = paymentterms.termsindicator - INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - INNER JOIN supptrans - ON suppliers.supplierid = supptrans.supplierno - WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' - AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' - AND suppliers.currcode ='" . $_POST['Currency'] . "' - GROUP BY suppliers.supplierid, - suppliers.suppname, - currencies.currency, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth - HAVING SUM(IF (paymentterms.daysbeforedue > 0, - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END, - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END)) > 0"; + FROM suppliers INNER JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + INNER JOIN supptrans + ON suppliers.supplierid = supptrans.supplierno + WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' + AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' + AND suppliers.currcode ='" . $_POST['Currency'] . "' + GROUP BY suppliers.supplierid, + suppliers.suppname, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth + HAVING SUM(IF (paymentterms.daysbeforedue > 0, + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END, + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END)) > 0"; } Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/Areas.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -39,7 +39,7 @@ prnMsg(_('The area code must be three characters or less long'),'error'); $Errors[$i] = 'AreaCode'; $i++; - } elseif (DB_num_rows($result)>0 and !isset($SelectedArea)){ + } elseif (DB_num_rows($result)>0 AND !isset($SelectedArea)){ $InputError = 1; prnMsg(_('The area code entered already exists'),'error'); $Errors[$i] = 'AreaCode'; Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/SuppCreditGRNs.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -51,6 +51,7 @@ } if ($InputError==False){ + $_SESSION['SuppTrans']->Add_GRN_To_Trans($_POST['GRNNumber'], $_POST['PODetailItem'], $_POST['ItemCode'], @@ -67,7 +68,9 @@ $_POST['GLCode'], $_POST['PONo'], $_POST['AssetID'], - $_POST['DecimalPlaces']); + 0, + $_POST['DecimalPlaces'], + $_POST['GRNBatchNo']); } } @@ -236,6 +239,7 @@ if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ $SQL = "SELECT grnno, + grns.grnbatch, grns.podetailitem, purchorderdetails.orderno, purchorderdetails.unitprice, @@ -320,6 +324,7 @@ echo '<input type="hidden" name="PONo" value="' . $myrow['orderno'] . '" />'; echo '<input type="hidden" name="AssetID" value="' . $myrow['assetid'] . '" />'; echo '<input type="hidden" name="DecimalPlaces" value="' . $myrow['decimalplaces'] . '" />'; + echo '<input type="hidden" name="GRNBatchNo" value="' . $myrow['grnbatch'] . '" />'; } } //end if there were GRNs to select echo '</form>'; Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/SuppInvGRNs.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -236,7 +236,9 @@ $myrow['glcode'], $myrow['orderno'], $myrow['assetid'], - $myrow['decimalplaces']); + 0, + $myrow['decimalplaces'], + $myrow['grnbatch']); } } } Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/SupplierInvoice.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -1211,12 +1211,13 @@ /* First update the stockmoves delivery cost */ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the delivery could not have the cost updated to the actual cost'); - $result = DB_query("UPDATE stockmoves SET price = '" . $ActualCost . "' + $SQL = "UPDATE stockmoves SET price = '" . $ActualCost . "' WHERE stockid='" .$EnteredGRN->ItemCode . "' AND type=25 AND loccode='" . $LocCode . "' - AND transno='" . $EnteredGRN->GRNNo . "'", - $db,$ErrMsg,$DbgMsg,True); + AND transno='" . $EnteredGRN->GRNBatchNo . "'"; + + $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,True); if ($_SESSION['WeightedAverageCosting']==1){ /* Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/doc/Change.log 2012-02-17 10:34:08 UTC (rev 4919) @@ -1,5 +1,10 @@ webERP Change Log +17/2/12 Phil: SuppCreditGRNs.php SuppInvGRNs.php DefineSuppTransClass.php SupplierInvoice.php stock movement was not being updated correctly with cost on purchase invoice entry as was using GRNNo not GRNBatchNo - which is used as the GRN transaction number in stock movements. +16/2/12 Tim: Modified index.php to use arrays of links rather than hard code all menus +16/2/12 Exson: Fixed StockAdjustments.php was not producing gltrans entries when stock code entered directly + + Release 4.07 11/2/12 Phil: Fix Prices.php for end dates when a new price with no end date is inserted with a start date in the future. Modified: trunk/includes/DefineSuppTransClass.php =================================================================== --- trunk/includes/DefineSuppTransClass.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/includes/DefineSuppTransClass.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -100,7 +100,9 @@ $GLCode, $PONo, $AssetID=0, - $DecimalPlaces=2){ + $Hold=0, + $DecimalPlaces=2, + $GRNBatchNo){ if ($This_QuantityInv!=0 AND isset($This_QuantityInv)){ $this->GRNs[$GRNNo] = new GRNs($GRNNo, @@ -119,7 +121,9 @@ $GLCode, $PONo, $AssetID, - $DecimalPlaces); + $Hold, + $DecimalPlaces, + $GRNBatchNo); Return 1; } Return 0; @@ -181,7 +185,8 @@ $GRNSrc->PONo, $GRNSrc->AssetID, $GRNSrc->Hold, - $GRNSrc->DecimalPlaces); + $GRNSrc->DecimalPlaces, + $GRNSrc->GRNBatchNo); Return 1; } Return 0; @@ -317,6 +322,7 @@ var $Hold; var $AssetID; var $DecimalPlaces; + var $GRNBatchNo; function GRNs ($GRNNo, $PODetailItem, @@ -335,9 +341,11 @@ $PONo, $AssetID, $Hold=0, - $DecimalPlaces=2){ + $DecimalPlaces=2, + $GRNBatchNo){ + /* Constructor function to add a new GRNs object with passed params */ $this->GRNNo = $GRNNo; $this->PODetailItem = $PODetailItem; @@ -357,22 +365,23 @@ $this->AssetID = $AssetID; $this->Hold = $Hold; $this->DecimalPlaces = $DecimalPlaces; + $this->GRNBatchNo = $GRNBatchNo; } function Modify ($PODetailItem, - $ItemCode, - $ItemDescription, - $QtyRecd, - $Prev_QuantityInv, - $This_QuantityInv, - $OrderPrice, - $ChgPrice, - $Complete, - $StdCostUnit, - $ShiptRef, - $JobRef, - $GLCode, - $Hold){ + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit, + $ShiptRef, + $JobRef, + $GLCode, + $Hold){ /* Modify function to edit a GRNs object with passed params */ $this->PODetailItem = $PODetailItem; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-17 10:34:19
|
Revision: 4919 http://web-erp.svn.sourceforge.net/web-erp/?rev=4919&view=rev Author: daintree Date: 2012-02-17 10:34:08 +0000 (Fri, 17 Feb 2012) Log Message: ----------- bug fix Modified Paths: -------------- trunk/AccountGroups.php trunk/AddCustomerNotes.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/Areas.php trunk/SuppCreditGRNs.php trunk/SuppInvGRNs.php trunk/SupplierInvoice.php trunk/doc/Change.log trunk/includes/DefineSuppTransClass.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AccountGroups.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -61,7 +61,7 @@ $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); $myrow=DB_fetch_row($result); - if ($myrow[0]!=0 and $_POST['SelectedAccountGroup']=='') { + if ($myrow[0]!=0 AND $_POST['SelectedAccountGroup']=='') { $InputError = 1; prnMsg( _('The account group name already exists in the database'),'error'); $Errors[$i] = 'GroupName'; @@ -201,7 +201,7 @@ } -if (!isset($_GET['SelectedAccountGroup']) and !isset($_POST['SelectedAccountGroup'])) { +if (!isset($_GET['SelectedAccountGroup']) AND !isset($_POST['SelectedAccountGroup'])) { /* An account group could be posted when one has been edited and is being updated or GOT when selected for modification SelectedAccountGroup will exist because it was sent with the page in a GET . @@ -359,7 +359,7 @@ while ( $grouprow = DB_fetch_array($groupresult) ) { - if (isset($_POST['ParentGroupName']) and $_POST['ParentGroupName']==$grouprow['groupname']) { + if (isset($_POST['ParentGroupName']) AND $_POST['ParentGroupName']==$grouprow['groupname']) { echo '<option selected="selected" value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } else { echo '<option value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AddCustomerNotes.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -29,23 +29,23 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (!is_long((integer)$_POST['priority'])) { + if (!is_long((integer)$_POST['Priority'])) { $InputError = 1; prnMsg( _('The contact priority must be an integer.'), 'error'); - } elseif (mb_strlen($_POST['note']) >200) { + } elseif (mb_strlen($_POST['Note']) >200) { $InputError = 1; prnMsg( _('The contact\'s notes must be two hundred characters or less long'), 'error'); - } elseif( trim($_POST['note']) == '' ) { + } elseif( trim($_POST['Note']) == '' ) { $InputError = 1; prnMsg( _('The contact\'s notes may not be empty'), 'error'); } if (isset($Id) and $InputError !=1) { - $sql = "UPDATE custnotes SET note='" . $_POST['note'] . "', + $sql = "UPDATE custnotes SET note='" . $_POST['Note'] . "', date='" . FormatDateForSQL($_POST['date']) . "', - href='" . $_POST['href'] . "', - priority='" . $_POST['priority'] . "' + href='" . $_POST['Href'] . "', + priority='" . $_POST['Priority'] . "' WHERE debtorno ='".$DebtorNo."' AND noteid='".$Id."'"; $msg = _('Customer Notes') . ' ' . $DebtorNo . ' ' . _('has been updated'); @@ -57,10 +57,10 @@ date, priority) VALUES ('" . $DebtorNo. "', - '" . $_POST['href'] . "', - '" . $_POST['note'] . "', + '" . $_POST['Href'] . "', + '" . $_POST['Note'] . "', '" . FormatDateForSQL($_POST['date']) . "', - '" . $_POST['priority'] . "')"; + '" . $_POST['Priority'] . "')"; $msg = _('The contact notes record has been added'); } @@ -71,11 +71,11 @@ echo '<br />'; prnMsg($msg, 'success'); unset($Id); - unset($_POST['note']); - unset($_POST['noteid']); + unset($_POST['Note']); + unset($_POST['Noteid']); unset($_POST['date']); - unset($_POST['href']); - unset($_POST['priority']); + unset($_POST['Href']); + unset($_POST['Priority']); } } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -181,19 +181,19 @@ $myrow = DB_fetch_array($result); - $_POST['noteid'] = $myrow['noteid']; - $_POST['note'] = $myrow['note']; - $_POST['href'] = $myrow['href']; + $_POST['Noteid'] = $myrow['noteid']; + $_POST['Note'] = $myrow['note']; + $_POST['Href'] = $myrow['href']; $_POST['date'] = $myrow['date']; - $_POST['priority'] = $myrow['priority']; + $_POST['Priority'] = $myrow['priority']; $_POST['debtorno'] = $myrow['debtorno']; echo '<input type="hidden" name="Id" value="'. $Id .'" />'; - echo '<input type="hidden" name="Con_ID" value="' . $_POST['noteid'] . '" />'; + echo '<input type="hidden" name="Con_ID" value="' . $_POST['Noteid'] . '" />'; echo '<input type="hidden" name="DebtorNo" value="' . $_POST['debtorno'] . '" />'; echo '<table class="selection"> <tr> <td>'. _('Note ID').':</td> - <td>' . $_POST['noteid'] . '</td> + <td>' . $_POST['Noteid'] . '</td> </tr>'; } else { echo '<table class="selection">'; @@ -201,20 +201,20 @@ echo '<tr> <td>' . _('Contact Note'). '</td>'; - if (isset($_POST['note'])) { - echo '<td><textarea name="note">' .$_POST['note'] . '</textarea></td> + if (isset($_POST['Note'])) { + echo '<td><textarea name="Note">' .$_POST['Note'] . '</textarea></td> </tr>'; } else { - echo '<td><textarea name="note"></textarea></td> + echo '<td><textarea name="Note"></textarea></td> </tr>'; } echo '<tr> <td>'. _('WWW').'</td>'; - if (isset($_POST['href'])) { - echo '<td><input type="text" name="href" value="'.$_POST['href'].'" size="35" maxlength="100" /></td> + if (isset($_POST['Href'])) { + echo '<td><input type="text" name="Href" value="'.$_POST['Href'].'" size="35" maxlength="100" /></td> </tr>'; } else { - echo '<td><input type="text" name="href" size="35" maxlength="100" /></td> + echo '<td><input type="text" name="Href" size="35" maxlength="100" /></td> </tr>'; } echo '<tr> @@ -228,11 +228,11 @@ } echo '<tr> <td>'. _('Priority'). '</td>'; - if (isset($_POST['priority'])) { - echo '<td><input type="text" name="priority" value="' .$_POST['priority']. '" size="1" maxlength="3" /></td> + if (isset($_POST['Priority'])) { + echo '<td><input type="text" name="Priority" value="' .$_POST['Priority']. '" size="1" maxlength="3" /></td> </tr>'; } else { - echo '<td><input type="text" name="priority" size="1" maxlength="3" /></td> + echo '<td><input type="text" name="Priority" size="1" maxlength="3" /></td> </tr>'; } echo '<tr> Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AgedDebtors.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -186,82 +186,80 @@ debtorsmaster.creditlimit, holdreasons.dissallowinvoices, holdreasons.reasondescription, - SUM(debtortrans.ovamount + - debtortrans.ovgst + - debtortrans.ovfreight + - debtortrans.ovdiscount - - debtortrans.alloc) AS balance, - SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= paymentterms.daysbeforedue - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate," . INTERVAL('1', 'MONTH') . ")," . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0) - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END - ) AS due, - SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END - ) AS overdue1, - SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue - AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= ".$_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - END - ) AS overdue2 - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = debtortrans.debtorno - AND holdreasons.dissallowinvoices=1 - AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' - AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' - AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' - " . $SalesLimit . " - GROUP BY debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription - HAVING ABS(SUM( - debtortrans.ovamount + - debtortrans.ovgst + - debtortrans.ovfreight + - debtortrans.ovdiscount - - debtortrans.alloc)) >0.005"; + SUM(debtortrans.ovamount + + debtortrans.ovgst + + debtortrans.ovfreight + + debtortrans.ovdiscount - + debtortrans.alloc) AS balance, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate," . INTERVAL('1', 'MONTH') . ")," . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0) + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS due, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS overdue1, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue + AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= ".$_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS overdue2 + FROM debtorsmaster, + paymentterms, + holdreasons, + currencies, + debtortrans + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = debtortrans.debtorno + AND holdreasons.dissallowinvoices=1 + AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' + AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' + AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' + " . $SalesLimit . " + GROUP BY debtorsmaster.debtorno, + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription + HAVING ABS(SUM( + debtortrans.ovamount + + debtortrans.ovgst + + debtortrans.ovfreight + + debtortrans.ovdiscount - + debtortrans.alloc)) >0.005"; } $CustomerResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors handled below*/ - //$ListCount = count ($CustomerResult); // Javier - if (DB_error_no($db) !=0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '.... '; include('includes/header.inc'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/AgedSuppliers.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -81,24 +81,24 @@ ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue2 - FROM suppliers INNER JOIN paymentterms - ON suppliers.paymentterms = paymentterms.termsindicator - INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - INNER JOIN supptrans - ON suppliers.supplierid = supptrans.supplierno - WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' - AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' - AND suppliers.currcode ='" . $_POST['Currency'] . "' - GROUP BY suppliers.supplierid, - suppliers.suppname, - currencies.currency, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth - HAVING SUM(IF (paymentterms.daysbeforedue > 0, - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END, - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END)) > 0"; + FROM suppliers INNER JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + INNER JOIN supptrans + ON suppliers.supplierid = supptrans.supplierno + WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' + AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' + AND suppliers.currcode ='" . $_POST['Currency'] . "' + GROUP BY suppliers.supplierid, + suppliers.suppname, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth + HAVING SUM(IF (paymentterms.daysbeforedue > 0, + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END, + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END)) > 0"; } Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/Areas.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -39,7 +39,7 @@ prnMsg(_('The area code must be three characters or less long'),'error'); $Errors[$i] = 'AreaCode'; $i++; - } elseif (DB_num_rows($result)>0 and !isset($SelectedArea)){ + } elseif (DB_num_rows($result)>0 AND !isset($SelectedArea)){ $InputError = 1; prnMsg(_('The area code entered already exists'),'error'); $Errors[$i] = 'AreaCode'; Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/SuppCreditGRNs.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -51,6 +51,7 @@ } if ($InputError==False){ + $_SESSION['SuppTrans']->Add_GRN_To_Trans($_POST['GRNNumber'], $_POST['PODetailItem'], $_POST['ItemCode'], @@ -67,7 +68,9 @@ $_POST['GLCode'], $_POST['PONo'], $_POST['AssetID'], - $_POST['DecimalPlaces']); + 0, + $_POST['DecimalPlaces'], + $_POST['GRNBatchNo']); } } @@ -236,6 +239,7 @@ if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ $SQL = "SELECT grnno, + grns.grnbatch, grns.podetailitem, purchorderdetails.orderno, purchorderdetails.unitprice, @@ -320,6 +324,7 @@ echo '<input type="hidden" name="PONo" value="' . $myrow['orderno'] . '" />'; echo '<input type="hidden" name="AssetID" value="' . $myrow['assetid'] . '" />'; echo '<input type="hidden" name="DecimalPlaces" value="' . $myrow['decimalplaces'] . '" />'; + echo '<input type="hidden" name="GRNBatchNo" value="' . $myrow['grnbatch'] . '" />'; } } //end if there were GRNs to select echo '</form>'; Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/SuppInvGRNs.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -236,7 +236,9 @@ $myrow['glcode'], $myrow['orderno'], $myrow['assetid'], - $myrow['decimalplaces']); + 0, + $myrow['decimalplaces'], + $myrow['grnbatch']); } } } Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/SupplierInvoice.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -1211,12 +1211,13 @@ /* First update the stockmoves delivery cost */ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the delivery could not have the cost updated to the actual cost'); - $result = DB_query("UPDATE stockmoves SET price = '" . $ActualCost . "' + $SQL = "UPDATE stockmoves SET price = '" . $ActualCost . "' WHERE stockid='" .$EnteredGRN->ItemCode . "' AND type=25 AND loccode='" . $LocCode . "' - AND transno='" . $EnteredGRN->GRNNo . "'", - $db,$ErrMsg,$DbgMsg,True); + AND transno='" . $EnteredGRN->GRNBatchNo . "'"; + + $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,True); if ($_SESSION['WeightedAverageCosting']==1){ /* Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/doc/Change.log 2012-02-17 10:34:08 UTC (rev 4919) @@ -1,5 +1,10 @@ webERP Change Log +17/2/12 Phil: SuppCreditGRNs.php SuppInvGRNs.php DefineSuppTransClass.php SupplierInvoice.php stock movement was not being updated correctly with cost on purchase invoice entry as was using GRNNo not GRNBatchNo - which is used as the GRN transaction number in stock movements. +16/2/12 Tim: Modified index.php to use arrays of links rather than hard code all menus +16/2/12 Exson: Fixed StockAdjustments.php was not producing gltrans entries when stock code entered directly + + Release 4.07 11/2/12 Phil: Fix Prices.php for end dates when a new price with no end date is inserted with a start date in the future. Modified: trunk/includes/DefineSuppTransClass.php =================================================================== --- trunk/includes/DefineSuppTransClass.php 2012-02-17 03:32:32 UTC (rev 4918) +++ trunk/includes/DefineSuppTransClass.php 2012-02-17 10:34:08 UTC (rev 4919) @@ -100,7 +100,9 @@ $GLCode, $PONo, $AssetID=0, - $DecimalPlaces=2){ + $Hold=0, + $DecimalPlaces=2, + $GRNBatchNo){ if ($This_QuantityInv!=0 AND isset($This_QuantityInv)){ $this->GRNs[$GRNNo] = new GRNs($GRNNo, @@ -119,7 +121,9 @@ $GLCode, $PONo, $AssetID, - $DecimalPlaces); + $Hold, + $DecimalPlaces, + $GRNBatchNo); Return 1; } Return 0; @@ -181,7 +185,8 @@ $GRNSrc->PONo, $GRNSrc->AssetID, $GRNSrc->Hold, - $GRNSrc->DecimalPlaces); + $GRNSrc->DecimalPlaces, + $GRNSrc->GRNBatchNo); Return 1; } Return 0; @@ -317,6 +322,7 @@ var $Hold; var $AssetID; var $DecimalPlaces; + var $GRNBatchNo; function GRNs ($GRNNo, $PODetailItem, @@ -335,9 +341,11 @@ $PONo, $AssetID, $Hold=0, - $DecimalPlaces=2){ + $DecimalPlaces=2, + $GRNBatchNo){ + /* Constructor function to add a new GRNs object with passed params */ $this->GRNNo = $GRNNo; $this->PODetailItem = $PODetailItem; @@ -357,22 +365,23 @@ $this->AssetID = $AssetID; $this->Hold = $Hold; $this->DecimalPlaces = $DecimalPlaces; + $this->GRNBatchNo = $GRNBatchNo; } function Modify ($PODetailItem, - $ItemCode, - $ItemDescription, - $QtyRecd, - $Prev_QuantityInv, - $This_QuantityInv, - $OrderPrice, - $ChgPrice, - $Complete, - $StdCostUnit, - $ShiptRef, - $JobRef, - $GLCode, - $Hold){ + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit, + $ShiptRef, + $JobRef, + $GLCode, + $Hold){ /* Modify function to edit a GRNs object with passed params */ $this->PODetailItem = $PODetailItem; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-17 03:32:38
|
Revision: 4918 http://web-erp.svn.sourceforge.net/web-erp/?rev=4918&view=rev Author: ExsonQu Date: 2012-02-17 03:32:32 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fixed bugs which leads to can credit GRNs without no invoiced quantity or quantity invoiced to become negative. Report by Crag. Fixed bug change logical operator from AND to OR on chgPrice judgment condition. Modified Paths: -------------- branches/stable/SuppCreditGRNs.php Modified: branches/stable/SuppCreditGRNs.php =================================================================== --- branches/stable/SuppCreditGRNs.php 2012-02-17 03:27:51 UTC (rev 4917) +++ branches/stable/SuppCreditGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) @@ -35,9 +35,16 @@ $InputError=False; $Complete = False; + // Validate Credit Quantity to prevent from credit quantity more than quantity invoiced + if (!is_numeric(filter_number_format($_POST['This_QuantityCredited'])) + or ($_POST['Prev_QuantityInv'] - filter_number_format($_POST['This_QuantityCredited']))<0){ + $InputError = True; + prnMsg(_('The credit quantity is not numeric or the quantity to credit is more that quantity invoiced') . '. ' . _('The goods received cannot be credited by this quantity'),'error'); + } + if (!is_numeric(filter_number_format($_POST['ChgPrice'])) - AND filter_number_format($_POST['ChgPrice'])<0){ + or filter_number_format($_POST['ChgPrice'])<0){ $InputError = True; prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be credited at this price'),'error'); @@ -317,4 +324,4 @@ } //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-17 03:32:38
|
Revision: 4918 http://web-erp.svn.sourceforge.net/web-erp/?rev=4918&view=rev Author: ExsonQu Date: 2012-02-17 03:32:32 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fixed bugs which leads to can credit GRNs without no invoiced quantity or quantity invoiced to become negative. Report by Crag. Fixed bug change logical operator from AND to OR on chgPrice judgment condition. Modified Paths: -------------- branches/stable/SuppCreditGRNs.php Modified: branches/stable/SuppCreditGRNs.php =================================================================== --- branches/stable/SuppCreditGRNs.php 2012-02-17 03:27:51 UTC (rev 4917) +++ branches/stable/SuppCreditGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) @@ -35,9 +35,16 @@ $InputError=False; $Complete = False; + // Validate Credit Quantity to prevent from credit quantity more than quantity invoiced + if (!is_numeric(filter_number_format($_POST['This_QuantityCredited'])) + or ($_POST['Prev_QuantityInv'] - filter_number_format($_POST['This_QuantityCredited']))<0){ + $InputError = True; + prnMsg(_('The credit quantity is not numeric or the quantity to credit is more that quantity invoiced') . '. ' . _('The goods received cannot be credited by this quantity'),'error'); + } + if (!is_numeric(filter_number_format($_POST['ChgPrice'])) - AND filter_number_format($_POST['ChgPrice'])<0){ + or filter_number_format($_POST['ChgPrice'])<0){ $InputError = True; prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be credited at this price'),'error'); @@ -317,4 +324,4 @@ } //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-17 03:27:58
|
Revision: 4917 http://web-erp.svn.sourceforge.net/web-erp/?rev=4917&view=rev Author: ExsonQu Date: 2012-02-17 03:27:51 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fixed bug which can credit grns with no any invoiced quantity issued, it'll leads to invoiced quantity become negative. Report by Crag. Fixed bug for ChgPrice judgment, change logical operator from AND to OR Modified Paths: -------------- trunk/SuppCreditGRNs.php Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2012-02-16 16:06:38 UTC (rev 4916) +++ trunk/SuppCreditGRNs.php 2012-02-17 03:27:51 UTC (rev 4917) @@ -35,9 +35,16 @@ $InputError=False; $Complete = False; + // Validate Credit Quantity to prevent from credit quantity more than quantity invoiced + if (!is_numeric(filter_number_format($_POST['This_QuantityCredited'])) + or ($_POST['Prev_QuantityInv'] - filter_number_format($_POST['This_QuantityCredited']))<0){ + $InputError = True; + prnMsg(_('The credit quantity is not numeric or the quantity to credit is more that quantity invoiced') . '. ' . _('The goods received cannot be credited by this quantity'),'error'); + } + if (!is_numeric(filter_number_format($_POST['ChgPrice'])) - AND filter_number_format($_POST['ChgPrice'])<0){ + or filter_number_format($_POST['ChgPrice'])<0){ $InputError = True; prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be credited at this price'),'error'); @@ -317,4 +324,4 @@ } //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-17 03:27:58
|
Revision: 4917 http://web-erp.svn.sourceforge.net/web-erp/?rev=4917&view=rev Author: ExsonQu Date: 2012-02-17 03:27:51 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fixed bug which can credit grns with no any invoiced quantity issued, it'll leads to invoiced quantity become negative. Report by Crag. Fixed bug for ChgPrice judgment, change logical operator from AND to OR Modified Paths: -------------- trunk/SuppCreditGRNs.php Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2012-02-16 16:06:38 UTC (rev 4916) +++ trunk/SuppCreditGRNs.php 2012-02-17 03:27:51 UTC (rev 4917) @@ -35,9 +35,16 @@ $InputError=False; $Complete = False; + // Validate Credit Quantity to prevent from credit quantity more than quantity invoiced + if (!is_numeric(filter_number_format($_POST['This_QuantityCredited'])) + or ($_POST['Prev_QuantityInv'] - filter_number_format($_POST['This_QuantityCredited']))<0){ + $InputError = True; + prnMsg(_('The credit quantity is not numeric or the quantity to credit is more that quantity invoiced') . '. ' . _('The goods received cannot be credited by this quantity'),'error'); + } + if (!is_numeric(filter_number_format($_POST['ChgPrice'])) - AND filter_number_format($_POST['ChgPrice'])<0){ + or filter_number_format($_POST['ChgPrice'])<0){ $InputError = True; prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be credited at this price'),'error'); @@ -317,4 +324,4 @@ } //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-16 16:06:50
|
Revision: 4916 http://web-erp.svn.sourceforge.net/web-erp/?rev=4916&view=rev Author: tim_schofield Date: 2012-02-16 16:06:38 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AgedSuppliers.php Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-02-16 12:14:37 UTC (rev 4915) +++ trunk/AgedSuppliers.php 2012-02-16 16:06:38 UTC (rev 4916) @@ -4,13 +4,12 @@ include('includes/session.inc'); -If (isset($_POST['PrintPDF']) - AND isset($_POST['FromCriteria']) - AND mb_strlen($_POST['FromCriteria'])>=1 - AND isset($_POST['ToCriteria']) - AND mb_strlen($_POST['ToCriteria'])>=1){ +if (isset($_POST['PrintPDF']) + and isset($_POST['FromCriteria']) + and mb_strlen($_POST['FromCriteria'])>=1 + and isset($_POST['ToCriteria']) + and mb_strlen($_POST['ToCriteria'])>=1){ - include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Aged Supplier Listing')); $pdf->addInfo('Subject',_('Aged Suppliers')); @@ -18,13 +17,13 @@ $PageNumber=0; $line_height=12; - /*Now figure out the aged analysis for the Supplier range under review */ + /*Now figure out the aged analysis for the Supplier range under review */ if ($_POST['All_Or_Overdues']=='All'){ - $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, + $SQL = "SELECT suppliers.supplierid, + suppliers.suppname, currencies.currency, - currencies.decimalplaces AS currdecimalplaces, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN @@ -46,7 +45,7 @@ ON suppliers.paymentterms = paymentterms.termsindicator INNER JOIN currencies ON suppliers.currcode = currencies.currabrev - INNER JOIN supptrans + INNER JOIN supptrans ON suppliers.supplierid = supptrans.supplierno WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' @@ -54,15 +53,14 @@ GROUP BY suppliers.supplierid, suppliers.suppname, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth HAVING SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) <>0"; - + } else { - $SQL = "SELECT suppliers.supplierid, + $SQL = "SELECT suppliers.supplierid, suppliers.suppname, currencies.currency, currencies.decimalplaces AS currdecimalplaces, @@ -83,11 +81,11 @@ ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue2 - FROM suppliers INNER JOIN paymentterms - ON suppliers.paymentterms = paymentterms.termsindicator - INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - INNER JOIN supptrans + FROM suppliers INNER JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + INNER JOIN supptrans ON suppliers.supplierid = supptrans.supplierno WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' @@ -95,11 +93,10 @@ GROUP BY suppliers.supplierid, suppliers.suppname, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth - HAVING Sum(IF (paymentterms.daysbeforedue > 0, + HAVING SUM(IF (paymentterms.daysbeforedue > 0, CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END, CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END)) > 0"; @@ -108,15 +105,15 @@ $SupplierResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors */ if (DB_error_no($db) !=0) { - $title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ; - include('includes/header.inc'); - prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; - if ($debug==1){ - echo '<br />' . $SQL; - } - include('includes/footer.inc'); - exit; + $title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ; + include('includes/header.inc'); + prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . $SQL; + } + include('includes/footer.inc'); + exit; } include ('includes/PDFAgedSuppliersPageHeader.inc'); @@ -126,13 +123,13 @@ $TotOD1 = 0; $TotOD2 = 0; $CurrDecimalPlaces =0; - - $ListCount = DB_num_rows($SupplierResult); // UldisN - While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - + $ListCount = DB_num_rows($SupplierResult); // UldisN + + while ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ + $CurrDecimalPlaces = $AgedAnalysis['currdecimalplaces']; - + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces); $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces); @@ -154,7 +151,7 @@ $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ - include('includes/PDFAgedSuppliersPageHeader.inc'); + include('includes/PDFAgedSuppliersPageHeader.inc'); } if ($_POST['DetailedReport']=='Yes'){ @@ -163,36 +160,38 @@ /*draw a line under the Supplier aged analysis*/ $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); - $sql = "SELECT systypes.typename, supptrans.suppreference, supptrans.trandate, - (supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, - CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - END AS due, - CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - END AS overdue1, - CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - END AS overdue2 - FROM suppliers, - paymentterms, - supptrans, - systypes - WHERE systypes.typeid = supptrans.type - AND suppliers.paymentterms = paymentterms.termsindicator - AND suppliers.supplierid = supptrans.supplierno - AND ABS(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) >0.009 - AND supptrans.settled = 0 - AND supptrans.supplierno = '" . $AgedAnalysis["supplierid"] . "'"; + $sql = "SELECT systypes.typename, + supptrans.suppreference, + supptrans.trandate, + (supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, + CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + END AS due, + CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + END AS overdue1, + CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + END AS overdue2 + FROM suppliers + LEFT JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + LEFT JOIN supptrans + ON suppliers.supplierid = supptrans.supplierno + LEFT JOIN systypes + ON systypes.typeid = supptrans.type + WHERE ABS(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) >0.009 + AND supptrans.settled = 0 + AND supptrans.supplierno = '" . $AgedAnalysis["supplierid"] . "'"; - $DetailResult = DB_query($sql,$db,'','',False,False); /*dont trap errors - trapped below*/ - if (DB_error_no($db) !=0) { + $DetailResult = DB_query($sql,$db,'','',False,False); /*dont trap errors - trapped below*/ + if (DB_error_no($db) !=0) { $title = _('Aged Supplier Account Analysis - Problem Report'); include('includes/header.inc'); prnMsg(_('The details of outstanding transactions for Supplier') . ' - ' . $AgedAnalysis['supplierid'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); @@ -202,35 +201,35 @@ } include('includes/footer.inc'); exit; - } + } - while ($DetailTrans = DB_fetch_array($DetailResult)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,50,$FontSize,$DetailTrans['suppreference'],'left'); - $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); + while ($DetailTrans = DB_fetch_array($DetailResult)){ - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,50,$FontSize,$DetailTrans['suppreference'],'left'); + $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); - $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); - $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); - $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); - $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); - $YPos -=$line_height; - if ($YPos < $Bottom_Margin + $line_height){ + $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); + $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); + $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); + $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); + + $YPos -=$line_height; + if ($YPos < $Bottom_Margin + $line_height){ $PageNumber++; include('includes/PDFAgedSuppliersPageHeader.inc'); $FontSize=6; - } - } /*end while there are detail transactions to show */ - /*draw a line under the detailed transactions before the next Supplier aged analysis*/ + } + } /*end while there are detail transactions to show */ + /*draw a line under the detailed transactions before the next Supplier aged analysis*/ $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); $FontSize=8; } /*Its a detailed report */ @@ -260,30 +259,29 @@ $YPos -=$line_height; $pdf->line($Page_Width-$Right_Margin, $YPos ,220, $YPos); - if ($ListCount == 0) { + if ($ListCount == 0) { $title = _('Aged Supplier Analysis'); include('includes/header.inc'); - prnMsg('There are no results so the PDF is empty'); - include('includes/footer.inc'); - } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_AggedSupliers_' . date('Y-m-d').'.pdf'); - } - $pdf->__destruct(); + prnMsg('There are no results so the PDF is empty'); + include('includes/footer.inc'); + } else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_AggedSupliers_' . date('Y-m-d').'.pdf'); + } + $pdf->__destruct(); } else { /*The option to print PDF was not hit */ $title = _('Aged Supplier Analysis'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if (!isset($_POST['FromCriteria']) OR !isset($_POST['ToCriteria'])) { + if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) { /*if $FromCriteria is not set then show a form to allow input */ - echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> - <table class="selection"> + echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> <tr> <td>' . _('From Supplier Code') . ':</font></td> <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> @@ -307,11 +305,11 @@ $result=DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ - echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } else { - echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } + if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ + echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } else { + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } } echo '</select></td> </tr> @@ -331,4 +329,4 @@ include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-16 16:06:50
|
Revision: 4916 http://web-erp.svn.sourceforge.net/web-erp/?rev=4916&view=rev Author: tim_schofield Date: 2012-02-16 16:06:38 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AgedSuppliers.php Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-02-16 12:14:37 UTC (rev 4915) +++ trunk/AgedSuppliers.php 2012-02-16 16:06:38 UTC (rev 4916) @@ -4,13 +4,12 @@ include('includes/session.inc'); -If (isset($_POST['PrintPDF']) - AND isset($_POST['FromCriteria']) - AND mb_strlen($_POST['FromCriteria'])>=1 - AND isset($_POST['ToCriteria']) - AND mb_strlen($_POST['ToCriteria'])>=1){ +if (isset($_POST['PrintPDF']) + and isset($_POST['FromCriteria']) + and mb_strlen($_POST['FromCriteria'])>=1 + and isset($_POST['ToCriteria']) + and mb_strlen($_POST['ToCriteria'])>=1){ - include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Aged Supplier Listing')); $pdf->addInfo('Subject',_('Aged Suppliers')); @@ -18,13 +17,13 @@ $PageNumber=0; $line_height=12; - /*Now figure out the aged analysis for the Supplier range under review */ + /*Now figure out the aged analysis for the Supplier range under review */ if ($_POST['All_Or_Overdues']=='All'){ - $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, + $SQL = "SELECT suppliers.supplierid, + suppliers.suppname, currencies.currency, - currencies.decimalplaces AS currdecimalplaces, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN @@ -46,7 +45,7 @@ ON suppliers.paymentterms = paymentterms.termsindicator INNER JOIN currencies ON suppliers.currcode = currencies.currabrev - INNER JOIN supptrans + INNER JOIN supptrans ON suppliers.supplierid = supptrans.supplierno WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' @@ -54,15 +53,14 @@ GROUP BY suppliers.supplierid, suppliers.suppname, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth HAVING SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) <>0"; - + } else { - $SQL = "SELECT suppliers.supplierid, + $SQL = "SELECT suppliers.supplierid, suppliers.suppname, currencies.currency, currencies.decimalplaces AS currdecimalplaces, @@ -83,11 +81,11 @@ ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue2 - FROM suppliers INNER JOIN paymentterms - ON suppliers.paymentterms = paymentterms.termsindicator - INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - INNER JOIN supptrans + FROM suppliers INNER JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + INNER JOIN supptrans ON suppliers.supplierid = supptrans.supplierno WHERE suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' @@ -95,11 +93,10 @@ GROUP BY suppliers.supplierid, suppliers.suppname, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth - HAVING Sum(IF (paymentterms.daysbeforedue > 0, + HAVING SUM(IF (paymentterms.daysbeforedue > 0, CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END, CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END)) > 0"; @@ -108,15 +105,15 @@ $SupplierResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors */ if (DB_error_no($db) !=0) { - $title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ; - include('includes/header.inc'); - prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; - if ($debug==1){ - echo '<br />' . $SQL; - } - include('includes/footer.inc'); - exit; + $title = _('Aged Supplier Account Analysis') . ' - ' . _('Problem Report') ; + include('includes/header.inc'); + prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . $SQL; + } + include('includes/footer.inc'); + exit; } include ('includes/PDFAgedSuppliersPageHeader.inc'); @@ -126,13 +123,13 @@ $TotOD1 = 0; $TotOD2 = 0; $CurrDecimalPlaces =0; - - $ListCount = DB_num_rows($SupplierResult); // UldisN - While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - + $ListCount = DB_num_rows($SupplierResult); // UldisN + + while ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ + $CurrDecimalPlaces = $AgedAnalysis['currdecimalplaces']; - + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces); $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces); @@ -154,7 +151,7 @@ $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ - include('includes/PDFAgedSuppliersPageHeader.inc'); + include('includes/PDFAgedSuppliersPageHeader.inc'); } if ($_POST['DetailedReport']=='Yes'){ @@ -163,36 +160,38 @@ /*draw a line under the Supplier aged analysis*/ $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); - $sql = "SELECT systypes.typename, supptrans.suppreference, supptrans.trandate, - (supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, - CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - END AS due, - CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - END AS overdue1, - CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - END AS overdue2 - FROM suppliers, - paymentterms, - supptrans, - systypes - WHERE systypes.typeid = supptrans.type - AND suppliers.paymentterms = paymentterms.termsindicator - AND suppliers.supplierid = supptrans.supplierno - AND ABS(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) >0.009 - AND supptrans.settled = 0 - AND supptrans.supplierno = '" . $AgedAnalysis["supplierid"] . "'"; + $sql = "SELECT systypes.typename, + supptrans.suppreference, + supptrans.trandate, + (supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, + CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + END AS due, + CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + END AS overdue1, + CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + ELSE + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + END AS overdue2 + FROM suppliers + LEFT JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + LEFT JOIN supptrans + ON suppliers.supplierid = supptrans.supplierno + LEFT JOIN systypes + ON systypes.typeid = supptrans.type + WHERE ABS(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) >0.009 + AND supptrans.settled = 0 + AND supptrans.supplierno = '" . $AgedAnalysis["supplierid"] . "'"; - $DetailResult = DB_query($sql,$db,'','',False,False); /*dont trap errors - trapped below*/ - if (DB_error_no($db) !=0) { + $DetailResult = DB_query($sql,$db,'','',False,False); /*dont trap errors - trapped below*/ + if (DB_error_no($db) !=0) { $title = _('Aged Supplier Account Analysis - Problem Report'); include('includes/header.inc'); prnMsg(_('The details of outstanding transactions for Supplier') . ' - ' . $AgedAnalysis['supplierid'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); @@ -202,35 +201,35 @@ } include('includes/footer.inc'); exit; - } + } - while ($DetailTrans = DB_fetch_array($DetailResult)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,50,$FontSize,$DetailTrans['suppreference'],'left'); - $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); + while ($DetailTrans = DB_fetch_array($DetailResult)){ - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,50,$FontSize,$DetailTrans['suppreference'],'left'); + $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); - $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); - $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); - $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); - $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); - $YPos -=$line_height; - if ($YPos < $Bottom_Margin + $line_height){ + $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); + $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); + $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); + $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); + + $YPos -=$line_height; + if ($YPos < $Bottom_Margin + $line_height){ $PageNumber++; include('includes/PDFAgedSuppliersPageHeader.inc'); $FontSize=6; - } - } /*end while there are detail transactions to show */ - /*draw a line under the detailed transactions before the next Supplier aged analysis*/ + } + } /*end while there are detail transactions to show */ + /*draw a line under the detailed transactions before the next Supplier aged analysis*/ $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); $FontSize=8; } /*Its a detailed report */ @@ -260,30 +259,29 @@ $YPos -=$line_height; $pdf->line($Page_Width-$Right_Margin, $YPos ,220, $YPos); - if ($ListCount == 0) { + if ($ListCount == 0) { $title = _('Aged Supplier Analysis'); include('includes/header.inc'); - prnMsg('There are no results so the PDF is empty'); - include('includes/footer.inc'); - } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_AggedSupliers_' . date('Y-m-d').'.pdf'); - } - $pdf->__destruct(); + prnMsg('There are no results so the PDF is empty'); + include('includes/footer.inc'); + } else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_AggedSupliers_' . date('Y-m-d').'.pdf'); + } + $pdf->__destruct(); } else { /*The option to print PDF was not hit */ $title = _('Aged Supplier Analysis'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if (!isset($_POST['FromCriteria']) OR !isset($_POST['ToCriteria'])) { + if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) { /*if $FromCriteria is not set then show a form to allow input */ - echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> - <table class="selection"> + echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> <tr> <td>' . _('From Supplier Code') . ':</font></td> <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> @@ -307,11 +305,11 @@ $result=DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ - echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } else { - echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } + if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ + echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } else { + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } } echo '</select></td> </tr> @@ -331,4 +329,4 @@ include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-16 12:14:48
|
Revision: 4915 http://web-erp.svn.sourceforge.net/web-erp/?rev=4915&view=rev Author: tim_schofield Date: 2012-02-16 12:14:37 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/Areas.php Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2012-02-16 08:51:26 UTC (rev 4914) +++ trunk/Areas.php 2012-02-16 12:14:37 UTC (rev 4915) @@ -31,16 +31,15 @@ //first off validate inputs sensible $_POST['AreaCode'] = mb_strtoupper($_POST['AreaCode']); - $sql = "SELECT count(areacode) from areas WHERE areacode='".$_POST['AreaCode']."'"; + $sql = "SELECT areacode FROM areas WHERE areacode='".$_POST['AreaCode']."'"; $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); // mod to handle 3 char area codes if (mb_strlen($_POST['AreaCode']) > 3) { $InputError = 1; prnMsg(_('The area code must be three characters or less long'),'error'); $Errors[$i] = 'AreaCode'; $i++; - } elseif ($myrow[0]>0 and !isset($SelectedArea)){ + } elseif (DB_num_rows($result)>0 and !isset($SelectedArea)){ $InputError = 1; prnMsg(_('The area code entered already exists'),'error'); $Errors[$i] = 'AreaCode'; @@ -66,9 +65,8 @@ /*SelectedArea could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE areas SET - areadescription='" . $_POST['AreaDescription'] . "' - WHERE areacode = '" . $SelectedArea . "'"; + $sql = "UPDATE areas SET areadescription='" . $_POST['AreaDescription'] . "' + WHERE areacode = '" . $SelectedArea . "'"; $msg = _('Area code') . ' ' . $SelectedArea . ' ' . _('has been updated'); @@ -77,16 +75,16 @@ /*Selectedarea is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new area form */ $sql = "INSERT INTO areas (areacode, - areadescription) - VALUES ( - '" . $_POST['AreaCode'] . "', - '" . $_POST['AreaDescription'] . "' - )"; + areadescription + ) VALUES ( + '" . $_POST['AreaCode'] . "', + '" . $_POST['AreaDescription'] . "' + )"; - $SelectedArea =$_POST['AreaCode']; + $SelectedArea = $_POST['AreaCode']; $msg = _('New area code') . ' ' . $_POST['AreaCode'] . ' ' . _('has been inserted'); } else { - $msg=''; + $msg = ''; } //run the SQL from either of the above possibilites @@ -107,22 +105,22 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorsMaster' - $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.area='$SelectedArea'"; + $sql= "SELECT COUNT(branchcode) AS branches FROM custbranch WHERE custbranch.area='$SelectedArea'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['branches']>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this area because customer branches have been created using this area'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches using this area code'); + echo '<br />' . _('There are') . ' ' . $myrow['branches'] . ' ' . _('branches using this area code'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.area ='$SelectedArea'"; + $sql= "SELECT COUNT(area) AS records FROM salesanalysis WHERE salesanalysis.area ='$SelectedArea'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['records']>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this area because sales analysis records exist that use this area'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records referring this area code'); + echo '<br />' . _('There are') . ' ' . $myrow['records'] . ' ' . _('sales analysis records referring this area code'); } } @@ -137,21 +135,22 @@ if (!isset($SelectedArea)) { - $sql = "SELECT * FROM areas"; + $sql = "SELECT areacode, + areadescription + FROM areas"; $result = DB_query($sql,$db); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<table> - <tr> - <th>' . _('Area Code') . '</th> - <th>' . _('Area Name') . '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>' . _('Area Code') . '</th> + <th>' . _('Area Name') . '</th> + </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -159,11 +158,12 @@ echo '<tr class="OddTableRows">'; $k++; } - echo '<td>' . $myrow[0] . '</td> - <td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; - echo '<td><a href="SelectCustomer.php'. '?Area=' . $myrow[0] . '">' . _('View Customers from this Area') . '</a></td>'; + echo '<td>' . $myrow['areacode'] . '</td> + <td>' . $myrow['areadescription'] . '</td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedArea=' . $myrow['areacode'] . '">' . _('Edit') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedArea=' . $myrow['areacode'] . '&delete=yes">' . _('Delete') . '</a></td> + <td><a href="SelectCustomer.php?Area=' . $myrow['areacode'] . '">' . _('View Customers from this Area') . '</a></td> + </tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -172,22 +172,22 @@ //end of ifs and buts! if (isset($SelectedArea)) { - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Areas Defined') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Areas Defined') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '"><br />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '"><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { //editing an existing area $sql = "SELECT areacode, - areadescription - FROM areas - WHERE areacode='" . $SelectedArea . "'"; + areadescription + FROM areas + WHERE areacode='" . $SelectedArea . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -213,7 +213,7 @@ echo '<table class="selection"> <tr> <td>' . _('Area Code') . ':</td> - <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size="3" maxlength="3"/></td> + <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size="3" maxlength="3" /></td> </tr>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-16 12:14:47
|
Revision: 4915 http://web-erp.svn.sourceforge.net/web-erp/?rev=4915&view=rev Author: tim_schofield Date: 2012-02-16 12:14:37 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/Areas.php Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2012-02-16 08:51:26 UTC (rev 4914) +++ trunk/Areas.php 2012-02-16 12:14:37 UTC (rev 4915) @@ -31,16 +31,15 @@ //first off validate inputs sensible $_POST['AreaCode'] = mb_strtoupper($_POST['AreaCode']); - $sql = "SELECT count(areacode) from areas WHERE areacode='".$_POST['AreaCode']."'"; + $sql = "SELECT areacode FROM areas WHERE areacode='".$_POST['AreaCode']."'"; $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); // mod to handle 3 char area codes if (mb_strlen($_POST['AreaCode']) > 3) { $InputError = 1; prnMsg(_('The area code must be three characters or less long'),'error'); $Errors[$i] = 'AreaCode'; $i++; - } elseif ($myrow[0]>0 and !isset($SelectedArea)){ + } elseif (DB_num_rows($result)>0 and !isset($SelectedArea)){ $InputError = 1; prnMsg(_('The area code entered already exists'),'error'); $Errors[$i] = 'AreaCode'; @@ -66,9 +65,8 @@ /*SelectedArea could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE areas SET - areadescription='" . $_POST['AreaDescription'] . "' - WHERE areacode = '" . $SelectedArea . "'"; + $sql = "UPDATE areas SET areadescription='" . $_POST['AreaDescription'] . "' + WHERE areacode = '" . $SelectedArea . "'"; $msg = _('Area code') . ' ' . $SelectedArea . ' ' . _('has been updated'); @@ -77,16 +75,16 @@ /*Selectedarea is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new area form */ $sql = "INSERT INTO areas (areacode, - areadescription) - VALUES ( - '" . $_POST['AreaCode'] . "', - '" . $_POST['AreaDescription'] . "' - )"; + areadescription + ) VALUES ( + '" . $_POST['AreaCode'] . "', + '" . $_POST['AreaDescription'] . "' + )"; - $SelectedArea =$_POST['AreaCode']; + $SelectedArea = $_POST['AreaCode']; $msg = _('New area code') . ' ' . $_POST['AreaCode'] . ' ' . _('has been inserted'); } else { - $msg=''; + $msg = ''; } //run the SQL from either of the above possibilites @@ -107,22 +105,22 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorsMaster' - $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.area='$SelectedArea'"; + $sql= "SELECT COUNT(branchcode) AS branches FROM custbranch WHERE custbranch.area='$SelectedArea'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['branches']>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this area because customer branches have been created using this area'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches using this area code'); + echo '<br />' . _('There are') . ' ' . $myrow['branches'] . ' ' . _('branches using this area code'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.area ='$SelectedArea'"; + $sql= "SELECT COUNT(area) AS records FROM salesanalysis WHERE salesanalysis.area ='$SelectedArea'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['records']>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this area because sales analysis records exist that use this area'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records referring this area code'); + echo '<br />' . _('There are') . ' ' . $myrow['records'] . ' ' . _('sales analysis records referring this area code'); } } @@ -137,21 +135,22 @@ if (!isset($SelectedArea)) { - $sql = "SELECT * FROM areas"; + $sql = "SELECT areacode, + areadescription + FROM areas"; $result = DB_query($sql,$db); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<table> - <tr> - <th>' . _('Area Code') . '</th> - <th>' . _('Area Name') . '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>' . _('Area Code') . '</th> + <th>' . _('Area Name') . '</th> + </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -159,11 +158,12 @@ echo '<tr class="OddTableRows">'; $k++; } - echo '<td>' . $myrow[0] . '</td> - <td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; - echo '<td><a href="SelectCustomer.php'. '?Area=' . $myrow[0] . '">' . _('View Customers from this Area') . '</a></td>'; + echo '<td>' . $myrow['areacode'] . '</td> + <td>' . $myrow['areadescription'] . '</td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedArea=' . $myrow['areacode'] . '">' . _('Edit') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedArea=' . $myrow['areacode'] . '&delete=yes">' . _('Delete') . '</a></td> + <td><a href="SelectCustomer.php?Area=' . $myrow['areacode'] . '">' . _('View Customers from this Area') . '</a></td> + </tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -172,22 +172,22 @@ //end of ifs and buts! if (isset($SelectedArea)) { - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Areas Defined') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Areas Defined') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '"><br />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '"><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { //editing an existing area $sql = "SELECT areacode, - areadescription - FROM areas - WHERE areacode='" . $SelectedArea . "'"; + areadescription + FROM areas + WHERE areacode='" . $SelectedArea . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -213,7 +213,7 @@ echo '<table class="selection"> <tr> <td>' . _('Area Code') . ':</td> - <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size="3" maxlength="3"/></td> + <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size="3" maxlength="3" /></td> </tr>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-16 08:51:39
|
Revision: 4914 http://web-erp.svn.sourceforge.net/web-erp/?rev=4914&view=rev Author: daintree Date: 2012-02-16 08:51:26 +0000 (Thu, 16 Feb 2012) Log Message: ----------- roll back stable to pre Tims menu changes Modified Paths: -------------- branches/stable/AccountGroups.php branches/stable/AccountSections.php branches/stable/AddCustomerContacts.php branches/stable/AddCustomerTypeNotes.php branches/stable/UpgradeDatabase.php branches/stable/css/fresh/default.css branches/stable/css/fresh/images/maintenance.png branches/stable/css/fresh/images/reports.png branches/stable/css/fresh/images/transactions.png branches/stable/css/fresh/login.css branches/stable/css/silverwolf/default.css branches/stable/includes/ConnectDB.inc branches/stable/includes/footer.inc branches/stable/includes/header.inc branches/stable/includes/session.inc branches/stable/index.php Removed Paths: ------------- branches/stable/includes/IndexArray.php branches/stable/sql/mysql/upgrade4.07-4.08.sql Modified: branches/stable/AccountGroups.php =================================================================== --- branches/stable/AccountGroups.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AccountGroups.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -52,8 +52,7 @@ $i=1; $sql="SELECT count(groupname) - FROM accountgroups - WHERE groupname='".$_POST['GroupName']."'"; + FROM accountgroups WHERE groupname='".$_POST['GroupName']."'"; $DbgMsg = _('The SQL that was used to retrieve the information was'); $ErrMsg = _('Could not check whether the group exists because'); @@ -116,7 +115,7 @@ $Errors[$i] = 'SequenceInTB'; $i++; } - if (!ctype_digit($_POST['SequenceInTB']) OR $_POST['SequenceInTB'] > 10000) { + if (!ctype_digit($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { $InputError = 1; prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); $Errors[$i] = 'SequenceInTB'; Modified: branches/stable/AccountSections.php =================================================================== --- branches/stable/AccountSections.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AccountSections.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -14,8 +14,9 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname) - VALUES (1, + sectionname + ) VALUES ( + 1, 'Income')"; $result = DB_query($sql,$db); } @@ -25,8 +26,9 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname) - VALUES (2, + sectionname + ) VALUES ( + 2, 'Cost Of Sales')"; $result = DB_query($sql,$db); } @@ -56,7 +58,7 @@ WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql, $db); - if ((DB_num_rows($result)!=0 AND !isset($_POST['SelectedSectionID']))) { + if ((DB_num_rows($result)!=0 and !isset($_POST['SelectedSectionID']))) { $InputError = 1; prnMsg( _('The account section already exists in the database'),'error'); $Errors[$i] = 'SectionID'; @@ -75,20 +77,20 @@ $Errors[$i] = 'SectionName'; $i++; } - if (isset($_POST['SectionID']) AND (!is_numeric($_POST['SectionID']))) { + if (isset($_POST['SectionID']) and (!is_numeric($_POST['SectionID']))) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SectionID']) AND mb_strpos($_POST['SectionID'],".")>0) { + if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SelectedSectionID']) AND $_POST['SelectedSectionID']!='' AND $InputError !=1) { + if (isset($_POST['SelectedSectionID']) and $_POST['SelectedSectionID']!='' AND $InputError !=1) { /*SelectedSectionID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -147,7 +149,7 @@ unset ($_POST['SectionName']); } -if (!isset($_GET['SelectedSectionID']) AND !isset($_POST['SelectedSectionID'])) { +if (!isset($_GET['SelectedSectionID']) and !isset($_POST['SelectedSectionID'])) { /* An account section could be posted when one has been edited and is being updated or GOT when selected for modification Modified: branches/stable/AddCustomerContacts.php =================================================================== --- branches/stable/AddCustomerContacts.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AddCustomerContacts.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -34,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -43,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) AND ($Id AND $InputError !=1)) { + if (isset($Id) and ($Id and $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -89,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) AND $_GET['delete']) { +} elseif (isset($_GET['delete']) and $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -127,8 +127,7 @@ <th>' . _('Role') . '</th> <th>' . _('Phone no') . '</th> <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th> - </tr>'; + <th>' . _('Notes') . '</th>'; $k=0; //row colour counter @@ -209,8 +208,7 @@ echo '<table class="selection">'; } - echo '<tr> - <td>'. _('Contact Name') . '</td>'; + echo '<tr><td>'. _('Contact Name') . '</td>'; if (isset($_POST['ContactName'])) { echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> </tr>'; @@ -227,8 +225,7 @@ echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> </tr>'; } - echo '<tr> - <td>' . _('Phone') . '</td>'; + echo '<tr><td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; Modified: branches/stable/AddCustomerTypeNotes.php =================================================================== --- branches/stable/AddCustomerTypeNotes.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AddCustomerTypeNotes.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -111,8 +111,7 @@ <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th> - </tr>'; + <th>' . _('Priority') . '</th>'; $k=0; //row colour counter Modified: branches/stable/UpgradeDatabase.php =================================================================== --- branches/stable/UpgradeDatabase.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/UpgradeDatabase.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -134,8 +134,6 @@ case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; case '4.07.0': - $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; - case '4.08': break; } //end switch } Modified: branches/stable/css/fresh/default.css =================================================================== --- branches/stable/css/fresh/default.css 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/css/fresh/default.css 2012-02-16 08:51:26 UTC (rev 4914) @@ -2,7 +2,7 @@ | | | default.css | |---------------------------------------------------| | For use with: | -| Web-ERP - http://weberp.sourceforge.net | +| Web-ERP - http://web-erp.sourceforge.net | | by Logic Works Ltd | |---------------------------------------------------| | Developer: | @@ -19,11 +19,11 @@ body { font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 10px; - background-color: #FFF; - margin-left: 0px; - margin-top: 0px; + background-color: #F1FFDD; + margin-left: 10px; + margin-top: 5px; margin-bottom: 0px; - margin-right: 0px; + margin-right: 10px; padding: 0px; } @@ -37,7 +37,7 @@ font-size: 10px; font-weight: bold; text-decoration: none; - color: #4D4E1A; + color: black; } /*links on any screen when mouse is hovering over them */ @@ -47,7 +47,7 @@ } table { - background-color: #ffffff; + background-color: #B4BB86; margin: 0 auto; } @@ -106,11 +106,11 @@ } .EvenTableRows { - background-color: #72824D; + background-color: #CCCCCC; } .OddTableRows { - background-color: #CAF17C; + background-color: #EEEEEE; } th { @@ -147,7 +147,7 @@ div.info { background-color:#c7ccf6; color: navy; - border: 0px solid navy; + border: 1px solid navy; } input { @@ -190,7 +190,7 @@ #topMenu { width: 100%; color: black; - background-color: #A0C462; + background-color: #ffffff; border: none; border-bottom: 1px solid #999999; } @@ -248,16 +248,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } @@ -302,12 +296,18 @@ /* Main page heading with quick menu within */ .quick_menu { width: 100%; - background-color: #C9D392; + background-color: #ffffff; border: none; margin: 0px; padding: 0px; color: black; + /*border-top: 2px #aaaaaa solid; + border-left: 2px #aaaaaa solid; + border-right: 2px #ffffff solid; + border-bottom: 4px #ffffff solid; */ text-align: right; + /* position: relative; + top: 3px; */ } #quick_menu{ @@ -319,14 +319,14 @@ font-size: 11px; border: 0px; white-space: nowrap; - margin: 0px; + margin: 2px; padding: 0px; color: black; } /*the Select Customer / Item / Supplier Menu tabs */ .quick_menu_tabs { - background-color: #5A5F00; + background-color: #ffffff; white-space: nowrap; border: none; margin: 0px; @@ -399,7 +399,6 @@ .main_menu { border: 2px inset #ffffff; - background-color: #ffffff; } .main_menu table { @@ -411,21 +410,11 @@ .main_menu_unselected { background-color: #617C4F; - border: 1px solid #5C874D; + border: 2px #f1ffdd outset; text-align: center; white-space: nowrap; - height: 16pt; } -.main_menu_selected { - background-color: #C9D392; - border: 1px solid #5C874D; - text-align: center; - white-space: nowrap; - color: #2B570F; - height: 16pt; -} - .main_menu_unselected:hover{ } .main_menu_selected:hover{ @@ -437,13 +426,20 @@ .main_menu_unselected a:hover{ } +.main_menu_selected { + background-color: #617C4F; + border: 2px inset #41437D; + text-align: center; + white-space: nowrap; +} + .main_menu_selected a{ - color: #2B570F; + color: #eee; font-weight:bold; } .main_menu_selected a:hover{ - color: #2B570F; + color: #fff; text-decoration: none; } @@ -480,7 +476,7 @@ } .menu_group_area { - border: 0px inset #ffffff; + border: 2px inset #ffffff; } .blank_area table { @@ -489,8 +485,7 @@ } .menu_group_headers { - border: 0px #aaaaaa; - background-color: #C9D392; + border: 2px outset #aaaaaa; width: 25%; } @@ -507,32 +502,30 @@ .menu_group_items { vertical-align: top; background-color: #ffffff; - border: 0px #aaaaaa; + border: 2px outset #aaaaaa; padding: 10px; } .menu_group_item { + background-color: #ffffff; padding-top: 2px; padding-bottom: 2px; } .menu_group_item p { - color: #5AAE34; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -12px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } -p.page_title_text { +.page_title_text { font-family: Arial, Verdana, Helvetica, sans-serif; - padding-top: 2px; - padding-bottom: 2px; + padding-top: 2px; + padding-bottom: 2px; font-weight: bold; font-size: 10px; color: black; - background-color: #C9D392; - width: 30%; TEXT-ALIGN:center; - margin: 10px auto; } DIV.page_help_text { @@ -593,21 +586,20 @@ #footer { position: relative; bottom: -3px; - background-color: #C9D392; } a.footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 10px; + font-size: 8px; } .footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 10px; + font-size: 8px; text-align: center; } @@ -696,4 +688,4 @@ li { list-style-image: url(bullet.gif); -} +} \ No newline at end of file Modified: branches/stable/css/fresh/images/maintenance.png =================================================================== --- branches/stable/css/fresh/images/maintenance.png 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/css/fresh/images/maintenance.png 2012-02-16 08:51:26 UTC (rev 4914) @@ -1,7 +1,7 @@ \x89PNG |