From: <dai...@us...> - 2011-07-26 09:21:59
|
Revision: 4638 http://web-erp.svn.sourceforge.net/web-erp/?rev=4638&view=rev Author: daintree Date: 2011-07-26 09:21:52 +0000 (Tue, 26 Jul 2011) Log Message: ----------- Modified Paths: -------------- trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/SalesCategories.php trunk/doc/Change.log Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-07-24 03:17:05 UTC (rev 4637) +++ trunk/CustomerAllocations.php 2011-07-26 09:21:52 UTC (rev 4638) @@ -4,9 +4,9 @@ /* Call this page with: - 1. A TransID to show the make up and to modify existing allocations. - 2. A DebtorNo to show all outstanding receipts or credits yet to be allocated. - 3. No parameters to show all outstanding credits and receipts yet to be allocated. + 1. A TransID to show the make up and to modify existing allocations. + 2. A DebtorNo to show all outstanding receipts or credits yet to be allocated. + 3. No parameters to show all outstanding credits and receipts yet to be allocated. */ include('includes/DefineCustAllocsClass.php'); @@ -216,22 +216,23 @@ $_POST['AllocTrans'] = $_GET['AllocTrans']; // Set AllocTrans when page first called $SQL= "SELECT systypes.typename, - debtortrans.type, - debtortrans.transno, - debtortrans.trandate, - debtortrans.debtorno, - debtorsmaster.name, - rate, - (debtortrans.ovamount+debtortrans.ovgst+debtortrans.ovfreight+debtortrans.ovdiscount) as total, - debtortrans.diffonexch, - debtortrans.alloc - FROM debtortrans, - systypes, - debtorsmaster - WHERE - debtortrans.type = systypes.typeid AND - debtortrans.debtorno = debtorsmaster.debtorno AND - debtortrans.id='" . $_POST['AllocTrans'] . "'"; + debtortrans.type, + debtortrans.transno, + debtortrans.trandate, + debtortrans.debtorno, + debtorsmaster.name, + debtortrans.rate, + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount) as total, + debtortrans.diffonexch, + debtortrans.alloc, + currencies.decimalplaces + FROM debtortrans INNER JOIN systypes + ON debtortrans.type = systypes.typeid + INNER JOIN debtorsmaster + ON debtortrans.debtorno = debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.id='" . $_POST['AllocTrans'] . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_array($Result); DB_free_result($Result); @@ -246,93 +247,92 @@ $_SESSION['Alloc']->TransAmt = $myrow['total']; $_SESSION['Alloc']->PrevDiffOnExch = $myrow['diffonexch']; $_SESSION['Alloc']->TransDate = ConvertSQLDate($myrow['trandate']); + $_SESSION['Alloc']->CurrDecimalPlaces = $myrow['decimalplaces']; // First get transactions that have outstanding balances $SQL = "SELECT debtortrans.id, - typename, - transno, - trandate, - rate, - ovamount+ovgst+ovfreight+ovdiscount as total, - diffonexch, - alloc - FROM debtortrans, systypes - WHERE debtortrans.type = systypes.typeid - AND debtortrans.settled=0 + typename, + transno, + trandate, + rate, + ovamount+ovgst+ovfreight+ovdiscount as total, + diffonexch, + alloc + FROM debtortrans INNER JOIN systypes + ON debtortrans.type = systypes.typeid + WHERE debtortrans.settled=0 AND debtorno='" . $_SESSION['Alloc']->DebtorNo . "' ORDER BY debtortrans.trandate"; $Result = DB_query($SQL,$db); while ($myrow=DB_fetch_array($Result)) { - $_SESSION['Alloc']->add_to_AllocsAllocn ( - $myrow['id'], - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - 0, - $myrow['total'], - $myrow['rate'], - $myrow['diffonexch'], - $myrow['diffonexch'], - $myrow['alloc'], - 'NA' - ); + $_SESSION['Alloc']->add_to_AllocsAllocn ($myrow['id'], + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + 0, + $myrow['total'], + $myrow['rate'], + $myrow['diffonexch'], + $myrow['diffonexch'], + $myrow['alloc'], + 'NA'); } DB_free_result($Result); // Get trans previously allocated to by this trans - this will overwrite incomplete allocations above $SQL= "SELECT debtortrans.id, - typename, - transno, - trandate, - rate, - ovamount+ovgst+ovfreight+ovdiscount AS total, - diffonexch, - debtortrans.alloc-custallocns.amt AS prevallocs, - amt, - custallocns.id AS allocid - FROM debtortrans, - systypes, - custallocns - WHERE debtortrans.type = systypes.typeid AND - debtortrans.id=custallocns.transid_allocto AND - custallocns.transid_allocfrom='" . $_POST['AllocTrans'] . "' AND - debtorno='" . $_SESSION['Alloc']->DebtorNo . "' + typename, + transno, + trandate, + rate, + ovamount+ovgst+ovfreight+ovdiscount AS total, + diffonexch, + debtortrans.alloc-custallocns.amt AS prevallocs, + amt, + custallocns.id AS allocid + FROM debtortrans INNER JOIN systypes + ON debtortrans.type = systypes.typeid + INNER JOIN custallocns + ON debtortrans.id=custallocns.transid_allocto + WHERE custallocns.transid_allocfrom='" . $_POST['AllocTrans'] . "' + AND debtorno='" . $_SESSION['Alloc']->DebtorNo . "' ORDER BY debtortrans.trandate"; + $Result=DB_query($SQL,$db); while ($myrow=DB_fetch_array($Result)) { $DiffOnExchThisOne = ($myrow['amt']/$myrow['rate']) - ($myrow['amt']/$_SESSION['Alloc']->TransExRate); - $_SESSION['Alloc']->add_to_AllocsAllocn ( - $myrow['id'], - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['amt'], - $myrow['total'], - $myrow['rate'], - $DiffOnExchThisOne, - ($myrow['diffonexch'] - $DiffOnExchThisOne), - $myrow['prevallocs'], - $myrow['allocid'] - ); + $_SESSION['Alloc']->add_to_AllocsAllocn ($myrow['id'], + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['amt'], + $myrow['total'], + $myrow['rate'], + $DiffOnExchThisOne, + ($myrow['diffonexch'] - $DiffOnExchThisOne), + $myrow['prevallocs'], + $myrow['allocid']); } DB_free_result($Result); } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . ' + </p>'; $TableHeader = '<tr> - <th>' . _('Trans Type') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Cust No') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Date') . '</th> - <th>' . _('Total') . '</th> - <th>' . _('To Alloc') . '</th> - <th>' . _('Action') . '</th> - </tr>'; + <th>' . _('Trans Type') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Cust No') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('To Alloc') . '</th> + <th>' . _('Action') . '</th> + </tr>'; if (isset($_POST['AllocTrans'])) { // Page called with trans number @@ -342,11 +342,11 @@ // Show trans already allocated and potential new allocations - echo '<p><table class=selection>'; - echo '<tr><th colspan=7><div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; + echo '<p><table class="selection">'; + echo '<tr><th colspan="7"><div class="centre"><font color="blue"><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; if ($_SESSION['Alloc']->TransExRate != 1) { - echo '<br />'._('Amount in customer currency').' <b>' . + echo '<br />' . _('Amount in customer currency') . ' <b>' . number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-24 03:17:05 UTC (rev 4637) +++ trunk/CustomerBranches.php 2011-07-26 09:21:52 UTC (rev 4638) @@ -580,7 +580,7 @@ } - echo '<input type=hidden name="DebtorNo" value="'. $DebtorNo . '" />'; + echo '<input type="hidden" name="DebtorNo" value="'. $DebtorNo . '" />'; echo '<tr> Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2011-07-24 03:17:05 UTC (rev 4637) +++ trunk/SalesCategories.php 2011-07-26 09:21:52 UTC (rev 4638) @@ -21,7 +21,7 @@ } else if (isset($_POST['ParentCategory'])){ $ParentCategory = mb_strtoupper($_POST['ParentCategory']); } -if( isset($ParentCategory) AND $ParentCategory == 0 ) { +if(isset($ParentCategory) AND $ParentCategory == 0 ) { unset($ParentCategory); } @@ -112,7 +112,7 @@ unset($_POST['SalesCatName']); unset($EditName); -} elseif (isset($_GET['delete']) && $EditName == 1) { +} elseif (isset($_GET['delete']) AND $EditName == 1) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMaster' @@ -121,16 +121,14 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this sales category because stock items have been added to this category') . - '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('items under to this category'),'warn'); + prnMsg(_('Cannot delete this sales category because stock items have been added to this category') . '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('items under to this category'),'warn'); } else { $sql = "SELECT COUNT(*) FROM salescat WHERE parentcatid='".$SelectedCategory."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { - prnMsg(_('Cannot delete this sales category because sub categories have been added to this category') . - '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sub categories'),'warn'); + prnMsg(_('Cannot delete this sales category because sub categories have been added to this category') . '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sub categories'),'warn'); } else { $sql="DELETE FROM salescat WHERE salescatid='".$SelectedCategory."'"; $result = DB_query($sql,$db); @@ -142,13 +140,10 @@ unset($_GET['delete']); unset($EditName); } elseif( isset($_POST['submit']) && isset($_POST['AddStockID']) ) { - $sql = "INSERT INTO salescatprod ( - stockid, - salescatid - ) VALUES ( - '". $_POST['AddStockID']."', - '".(isset($ParentCategory)?($ParentCategory):('NULL'))."' - )"; + $sql = "INSERT INTO salescatprod (stockid, + salescatid + ) VALUES ('". $_POST['AddStockID']."', + '".(isset($ParentCategory)?($ParentCategory):('NULL'))."')"; $result = DB_query($sql,$db); prnMsg(_('Stock item') . ' ' . $_POST['AddStockID'] . ' ' . _('has been added') . ' !','success'); @@ -166,17 +161,20 @@ // ---------------------------------------------------------------------------------------- // Calculate Path for navigation -$CategoryPath = '<a href="'.$_SERVER['PHP_SELF'] . '?ParentCategory=NULL">' . _('Main') . '</a>' . " \\ "; +$CategoryPath = '<a href="'.$_SERVER['PHP_SELF'] . '?ParentCategory=0">' . _('Main') . '</a>' . " \\ "; $TempPath = ''; +if ($ParentCategory == null){ + $ParentCategory =0; +} if (isset($ParentCategory)) { $TmpParentID = $ParentCategory; } $LastParentName = ''; -for($Buzy = (isset($TmpParentID) && ($TmpParentID <> '')); +for($Buzy = (isset($TmpParentID) AND ($TmpParentID != 0)); $Buzy == true; - $Buzy = (isset($TmpParentID) && ($TmpParentID <> '')) ) { + $Buzy = (isset($TmpParentID) AND ($TmpParentID != 0)) ) { $sql = "SELECT parentcatid, salescatname FROM salescat WHERE salescatid='".$TmpParentID."'"; $result = DB_query($sql,$db); if( $result ) { @@ -209,10 +207,10 @@ or deletion of the records*/ $sql = "SELECT salescatid, - salescatname - FROM salescat - WHERE parentcatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " - ORDER BY salescatname"; + salescatname + FROM salescat + WHERE parentcatid". (isset($ParentCategory)?('='.$ParentCategory):' =0') . " + ORDER BY salescatname"; $result = DB_query($sql,$db); @@ -220,7 +218,7 @@ if (DB_num_rows($result) == 0) { prnMsg(_('There are no categories defined at this level.')); } else { - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><th>' . _('Sub Category') . '</th></tr>'; $k=0; //row colour counter @@ -257,16 +255,16 @@ <td><a href="%sSelectedCategory=%s&delete=yes&EditName=1&ParentCategory=%s">' . _('Delete') . '</td> <td>%s</td> </tr>', - $myrow['salescatname'], - $_SERVER['PHP_SELF'] . '?', - $myrow['salescatid'], - $_SERVER['PHP_SELF'] . '?', - $myrow['salescatid'], - $ParentCategory, - $_SERVER['PHP_SELF'] . '?', - $myrow['salescatid'], - $ParentCategory, - $CatImgLink); + $myrow['salescatname'], + $_SERVER['PHP_SELF'] . '?', + $myrow['salescatid'], + $_SERVER['PHP_SELF'] . '?', + $myrow['salescatid'], + $ParentCategory, + $_SERVER['PHP_SELF'] . '?', + $myrow['salescatid'], + $ParentCategory, + $CatImgLink); } //END WHILE LIST LOOP echo '</table>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-24 03:17:05 UTC (rev 4637) +++ trunk/doc/Change.log 2011-07-26 09:21:52 UTC (rev 4638) @@ -1,5 +1,8 @@ webERP Change Log + +26/7/11 SalesCategories.php fixed display of active categories - this script is not used by webERP - only by Mo Kelly's joomla cart application + 24/7/11 Version 4.04.5 24/7/11 Phil: CustomerBranches.php check for existance of Shippers and TaxGroups This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |