From: <dai...@us...> - 2011-04-14 10:28:59
|
Revision: 4550 http://web-erp.svn.sourceforge.net/web-erp/?rev=4550&view=rev Author: daintree Date: 2011-04-14 10:28:52 +0000 (Thu, 14 Apr 2011) Log Message: ----------- variosu Modified Paths: -------------- trunk/CustomerAllocations.php trunk/FixedAssetTransfer.php trunk/GeocodeSetup.php trunk/WorkOrderReceive.php trunk/Z_index.php Removed Paths: ------------- trunk/Z_PriceChanges.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/CustomerAllocations.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.30 $ */ + /* $Id$*/ /* @@ -10,7 +10,6 @@ */ include('includes/DefineCustAllocsClass.php'); -//$PageSecurity = 3; include('includes/session.inc'); $title = _('Customer Receipt') . '/' . _('Credit Note Allocations'); include('includes/header.inc'); @@ -70,7 +69,7 @@ if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . + $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); $InputError=1; @@ -324,22 +323,22 @@ 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>"; + $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>'; if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='AllocTrans' value=" . $_POST['AllocTrans'] . '>'; + echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; // Show trans already allocated and potential new allocations @@ -347,20 +346,20 @@ 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>'; } - echo "</th></tr><tr> - <th>" . _('Trans') . '<br>' . _('Type') . "</th> - <th>" . _('Trans') . '<br>' . _('Number') . "</th> - <th>" . _('Trans') . '<br>' . _('Date') . "</th> - <th>" . _('Total') . '<br>' . _('Amount') . "</th> - <th>" . _('Yet to') . '<br>' . _('Allocate') . "</th> - <th>" . _('This') . '<br>' . _('Allocation') . "</th> - <th>" . _('Running') . '<br>' . _('Balance') . "</th> - </tr>"; + echo '</th></tr><tr> + <th>' . _('Trans') . '<br />' . _('Type') . '</th> + <th>' . _('Trans') . '<br />' . _('Number') . '</th> + <th>' . _('Trans') . '<br />' . _('Date') . '</th> + <th>' . _('Total') . '<br />' . _('Amount') . '</th> + <th>' . _('Yet to') . '<br />' . _('Allocate') . '</th> + <th>' . _('This') . '<br />' . _('Allocation') . '</th> + <th>' . _('Running') . '<br />' . _('Balance') . '</th> + </tr>'; $Counter = 0; $TotalAllocated = 0; @@ -380,37 +379,37 @@ $curTrans = " "; } - echo "<td>" . $AllocnItem->TransType . "</td> - <td>" . $AllocnItem->TypeNo . "</td> - <td class=number>" . $AllocnItem->TransDate . "</td> - <td class=number>" . number_format($AllocnItem->TransAmount,2) . "</td> - <td class=number>" . number_format($YetToAlloc,2) . "</td>"; + echo '<td>' . $AllocnItem->TransType . '</td> + <td>' . $AllocnItem->TypeNo . '</td> + <td class=number>' . $AllocnItem->TransDate . '</td> + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo "<td>" . $curTrans ."</td><td class=number>" . number_format($balance,2) . "</td></tr>"; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { - echo "<input type=hidden name='YetToAlloc" . $Counter . "' value=" . round($YetToAlloc,2) . '></td>'; - echo "<td class=number><input tabindex=".$j." type='checkbox' name='All" . $Counter . "'"; + echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; + echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { - echo ' value=' . True . '>'; + echo ' value=' . True . ' />'; } else { - echo '>'; + echo ' />'; } $balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; - echo "<input tabindex=".$j." type=text class=number name='Amt" . $Counter ."' maxlength=12 size=13 value=" . round($AllocnItem->AllocAmt,2) . "> - <input type=hidden name='AllocID" . $Counter . "' value=" . $AllocnItem->ID . '></td> - <td class=number>' . number_format($balance,2) . '</td></tr>'; + echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> + <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; } - echo "<tr> - <td colspan=5 class=number><b>"._('Total Allocated').':</b></td> + echo '<tr> + <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j++; echo '<td rowspan=2> @@ -421,9 +420,9 @@ <td class=number><b>' . number_format($remaining-$TotalAllocated,2).'</b></td> </tr>'; echo '</table><p>'; - echo "<input type=hidden name=TotalNumberOfAllocs value=" . $Counter . ">"; - echo "<div class='centre'><input tabindex=".$j." type=submit name=UpdateDatabase value=" . _('Process Allocations') . ">"; - echo "<input tabindex=".$j." type=submit name=Cancel value=" . _('Cancel') . "></div>"; + echo '<input type="hidden" name="TotalNumberOfAllocs" value="' . $Counter . '">'; + echo '<div class="centre"><input tabindex="' . $j . '" type="submit" name="UpdateDatabase" value="' . _('Process Allocations') . '">'; + echo '<input tabindex="' . $j . '" type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_GET['DebtorNo'])) { // Page called with customer code @@ -467,14 +466,14 @@ echo '<tr class="OddTableRows">';; $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -516,7 +515,7 @@ if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"><td colspan=7 class="number">' . number_format($balance,2) . '</td><td><b>' . _('Balance') . '</b></td></tr>'; } $balance = 0; @@ -548,20 +547,22 @@ $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td>' . $allocate . '</td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td> + <td>' . $allocate . '</td></tr>'; if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"> + <td colspan="7" class="number">' . number_format($balance,2) .'</td> + <td><b>' . _('Balance') . '</b></td></tr>'; } } DB_free_result($result); Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/FixedAssetTransfer.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -26,7 +26,7 @@ } else { $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; $result=DB_query($sql, $db); - echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; + echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; @@ -121,11 +121,11 @@ while ($myrow=DB_fetch_array($Result)) { echo '<tr><td>'.$myrow['assetid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> - <td>'.$myrow['locationdescription'].'</td>'; + <td>'.$myrow['description'].'</td> + <td>'.$myrow['serialno'].'</td> + <td class=number>'.number_format($myrow['cost'],2).'</td> + <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; while ($LocationRow=DB_fetch_array($LocationResult)) { @@ -137,11 +137,11 @@ } DB_data_seek($LocationResult,0); echo '</select></td>'; - echo '<input type=hidden name=AssetCat value="' . $_POST['AssetCat'].'"'; - echo '<input type=hidden name=Keywords value="' . $_POST['Keywords'].'"'; - echo '<input type=hidden name=AssetID value="' . $_POST['AssetID'].'"'; - echo '<input type=hidden name=Search value="' . $_POST['Search'].'"'; - echo '<td><input type=submit name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<input type="hidden" name="AssetCat" value="' . $_POST['AssetCat'].'"'; + echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; + echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/GeocodeSetup.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Geocode Maintenance'); include('includes/header.inc'); @@ -139,15 +139,16 @@ '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br>'; echo '<table border=1>'; - echo "<tr> - <th>". _('Geocode ID') ."</th> - <th>". _('Geocode Key') ."</th> - <th>". _('Center Longitude') ."</th> - <th>". _('Center Latitude') ."</th> - <th>". _('Map height (px)') ."</th> - <th>". _('Map width (px)') ."</th> - <th>". _('Map host') .'</th>'; - + + echo '<tr> + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') .'</th> + <th>'. _('Center Latitude') .'</th> + <th>'. _('Map height (px)') .'</th> + <th>'. _('Map width (px)') .'</th> + <th>'. _('Map host') .'</th>'; + $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -159,15 +160,15 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedParam=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s?SelectedParam=%s&delete=%s\">". _('Delete') .'</a></td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> </tr>', $myrow[0], $myrow[1], @@ -193,7 +194,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedParam) and ($InputError!=1)) { @@ -220,11 +221,12 @@ $_POST['map_width'] = $myrow['map_width']; $_POST['map_host'] = $myrow['map_host']; - echo "<input type=hidden name='SelectedParam' VALUE='" . $SelectedParam . "'>"; - echo "<input type=hidden name='geocodeid' VALUE='" . $_POST['geocodeid'] . "'>"; + echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; + echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; - echo "<table><tr><td>". _('Geocode Code') .':</td><td>'; - echo $_POST['geocodeid'] . '</td></tr>'; + echo '<table> + <tr><td>'. _('Geocode Code') .':</td> + <td>' . $_POST['geocodeid'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered if (!isset($_POST['geocodeid'])) { @@ -242,29 +244,28 @@ $_POST['geocode_key'] = ''; } echo '<br><tr> - <td>'. _('Geocode Key') .":</td> - <td><input " . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=2 type='text' name='geocode_key' VALUE='". $_POST['geocode_key'] ."' size=28 maxlength=300> - </td></tr> - <tr><td>". _('Geocode Center Long') . "</td> - <td><input tabindex=3 type='text' name='center_long' VALUE='". $_POST['center_long'] ."' size=28 maxlength=300></td></tr> + <td>'. _('Geocode Key') .':</td> + <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + </td></tr> + + <tr><td>'. _('Geocode Center Long') . '</td> + <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Center Lat') . "</td> - <td><input tabindex=4 type='text' name='center_lat' VALUE='". $_POST['center_lat'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Center Lat') . '</td> + <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Height') . "</td> - <td><input tabindex=5 type='text' name='map_height' VALUE='". $_POST['map_height'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Height') . '</td> + <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Width') . "</td> - <td><input tabindex=6 type='text' name='map_width' VALUE='". $_POST['map_width'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Width') . '</td> + <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Host') . "</td> - <td><input tabindex=7 type='text' name='map_host' VALUE='". $_POST['map_host'] ."' size=20 maxlength=300></td></tr> - - - </table> - <div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'</div><br><br> - </form>"; + <tr><td>'. _('Geocode Host') . '</td> + <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + </table> + <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br><br> + </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/WorkOrderReceive.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -10,7 +10,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Deleted: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_PriceChanges.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,141 +0,0 @@ -<?php -/* $Id$*/ - -include('includes/session.inc'); -$title=_('Update Pricing'); -include('includes/header.inc'); - - -echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); - -prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); - -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; - -$result = DB_query($SQL,$db); - -echo '<p><table> - <tr> - <td>' . _('Select the Price List to update the costs for') .':</td> - <td><select name="PriceList">'; - -if (!isset($_POST['PriceList'])){ - echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; -} - -while ($PriceLists=DB_fetch_array($result)){ - echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; -} - -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Category') . ':</td> - <td><select name="StkCat">'; - -$sql = "SELECT categoryid, categorydescription FROM stockcategory"; - -$ErrMsg = _('The stock categories could not be retrieved because'); -$DbgMsg = _('The SQL used to retrieve stock categories and failed was'); -$result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - -while ($myrow=DB_fetch_array($result)){ - if ($myrow['categoryid']==$_POST['StkCat']){ - echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } else { - echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Which Prices to update') . ":</td> - <td><select name='WhichPrices'>"; - echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; - echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; - echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; - echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; -echo '</select></td></tr>'; - -if (!isset($_POST['IncreasePercent'])){ - $_POST['IncreasePercent']=0; -} - -echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; - - -echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; - -echo '</form>'; - -if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - - echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; - - if ($_POST['PriceList']=='0'){ - echo '<br />' . _('The price list/sales type to be updated must be selected first'); - include ('includes/footer.inc'); - exit; - } - - if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - - echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); - include ('includes/footer.inc'); - exit; - } - - echo '<p>' . _('Price list') . ' ' . $_POST['PriceList'] . ' ' . _('prices for') . ' ' . $_POST['WhichPrices'] . ' ' . _('for the stock category') . ' ' . $_POST['StkCat'] . ' ' . _('will been incremented by') . ' ' . $_POST['IncreasePercent'] . ' ' . _('percent'); - - $sql = "SELECT stockid FROM stockmaster WHERE categoryid='" . $_POST['StkCat'] . "'"; - $PartsResult = DB_query($sql,$db); - - $IncrementPercentage = $_POST['IncreasePercent']/100; - - while ($myrow=DB_fetch_array($PartsResult)){ - - if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno=''"; - - }else if ($_POST['WhichPrices'] == 'Only customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno!=''"; - - } else if ($_POST['WhichPrices'] == 'Both customer special prices and non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockd='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "'"; - - } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno='" . $_SESSION['CustomerID'] . "'"; - - } - - $result = DB_query($sql,$db); - $ErrMsg =_('Error updating prices for') . ' ' . $myrow['stockid'] . ' ' . _('because'); - prnMsg(_('Updating prices for') . ' ' . $myrow['stockid'],'info'); - } - -} -include('includes/footer.inc'); -?> \ No newline at end of file Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_index.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -// $PageSecurity = 15; include('includes/session.inc'); $title = _('Special Fixes and Utilities') . ' - ' . _('Only System Administrator'); @@ -8,38 +7,36 @@ echo '<p>' . _('BE VERY CAREFUL DO NOT RUN THESE LINKS BELOW WITHOUT UNDERSTANDING EXACTLY WHAT THEY DO AND THE IMPLICATIONS'); - echo "<p><a href='$rootpath/Z_ReApplyCostToSA.php?" . SID . "'>". _('Re-apply costs to Sales Analysis') . '</a>'; - echo "<p><a href='$rootpath/EDISendInvoices.php?" . SID . "'>" . _('Send All Unsent EDI Invoices and Credits') .'</a>'; - echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; - echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; - echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReApplyCostToSA.php">'. _('Re-apply costs to Sales Analysis') . '</a>'; + echo '<p><a href="' .$rootpath . '/EDISendInvoices.php">' . _('Send All Unsent EDI Invoices and Credits') .'</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeCustomerCode.php">'. _('Change A Customer Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeBranchCode.php">' . _('Change A Customer Branch Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeStockCode.php">' . _('Change An Inventory Item Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeSupplierCode.php">' . _('Change A Supplier Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_BottomUpCosts.php">' . _('Update costs for all BOM items, from the bottom up') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencyDebtorsBalances.php?" . SID . "'>" . _('Show Local Currency Total Debtor Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencySuppliersBalances.php?" . SID . "'>" . _('Show Local Currency Total Suppliers Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckGLTransBalance.php?" . SID . "'>" . _('Show General Transactions That Do Not Balance') . '</a>'; - echo "<p><a href='$rootpath/Z_poAdmin.php?" . SID . "'>" . _('Maintain Language Files') . '</a>'; - echo "<p><a href='$rootpath/Z_MakeNewCompany.php?" . SID . "'>" . _('Make New Company') . '</a>'; - echo "<p><a href='$rootpath/Z_DataExport.php?" . SID . "'>" . _('Data Export Options') . '</a>'; - echo "<p><a href='$rootpath/Z_GetStockImage.php?" . SID . "'>" . _('Image Manipulation Utility') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportStocks.php?" . SID . "'>" . _('Import Stock Items from .csv') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportFixedAssets.php?" . SID . "'>" . _('Import Fixed Assets from .csv file') . '</a>'; - echo "<p><a href='$rootpath/Z_CreateCompanyTemplateFile.php?" . SID . "'>" . _('Create new company template SQL file and submit to webERP') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencyDebtorsBalances.php">' . _('Show Local Currency Total Debtor Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencySuppliersBalances.php">' . _('Show Local Currency Total Suppliers Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckGLTransBalance.php">' . _('Show General Transactions That Do Not Balance') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_poAdmin.php">' . _('Maintain Language Files') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_MakeNewCompany.php">' . _('Make New Company') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DataExport.php">' . _('Data Export Options') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_GetStockImage.php">' . _('Image Manipulation Utility') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportStocks.php">' . _('Import Stock Items from .csv') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportFixedAssets.php">' . _('Import Fixed Assets from .csv file') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CreateCompanyTemplateFile.php">' . _('Create new company template SQL file and submit to webERP') . '</a>'; echo '<br><br><hr><br>' . _('The stuff below is really quite dangerous!'); echo '<p>' . _('To delete a credit note call') . ' ' . $rootpath . '/Z_DeleteCreditNote.php?' . ' ' ._('and the credit note number to delete'); echo '<p>' . _('To delete an invoice call') . ' ' . $rootpath . '/Z_DeleteInvoice.php?' . _('and the invoice number to delete'); - echo "<p><a href='$rootpath/Z_UploadForm.php?" . SID . "'>" . _('Upload a file to the server') . '</a>'; - echo "<p><a href='$rootpath/Z_DeleteSalesTransActions.php?" . SID . "'>" . _('Delete sales transactions') . '</a>'; - echo "<p><a href='$rootpath/Z_ReverseSuppPaymentRun.php?" . SID . "'>" . _('Reverse all supplier payments on a specified date') . '</a>'; - echo "<p><a href='$rootpath/Z_UpdateChartDetailsBFwd.php?" . SID . "'>" . _('Re-calculate brought forward amounts in GL') . '</a>'; - echo "<p><a href='$rootpath/Z_RePostGLFromPeriod.php?" . SID . "'>" . _('Re-Post all GL transactions from a specified period') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckDebtorsControl.php?" . SID . "'>" . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UploadForm.php">' . _('Upload a file to the server') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DeleteSalesTransActions.php">' . _('Delete sales transactions') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReverseSuppPaymentRun.php">' . _('Reverse all supplier payments on a specified date') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UpdateChartDetailsBFwd.php">' . _('Re-calculate brought forward amounts in GL') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_RePostGLFromPeriod.php">' . _('Re-Post all GL transactions from a specified period') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckDebtorsControl.php">' . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; 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. |