|
From: <dai...@us...> - 2011-01-24 05:25:49
|
Revision: 4475
http://web-erp.svn.sourceforge.net/web-erp/?rev=4475&view=rev
Author: daintree
Date: 2011-01-24 05:25:42 +0000 (Mon, 24 Jan 2011)
Log Message:
-----------
Asset module fixes
Modified Paths:
--------------
trunk/FixedAssetDepreciation.php
trunk/FixedAssetItems.php
trunk/SelectAsset.php
trunk/doc/Change.log.html
Modified: trunk/FixedAssetDepreciation.php
===================================================================
--- trunk/FixedAssetDepreciation.php 2011-01-23 04:38:44 UTC (rev 4474)
+++ trunk/FixedAssetDepreciation.php 2011-01-24 05:25:42 UTC (rev 4475)
@@ -18,7 +18,8 @@
FROM fixedassettrans INNER JOIN periods
ON fixedassettrans.periodno=periods.periodno
WHERE transtype=44
- GROUP BY periods.lastdate_in_period',$db);
+ GROUP BY periods.lastdate_in_period
+ ORDER BY periods.lastdate_in_period DESC',$db);
$LastDepnRun = DB_fetch_row($result);
@@ -41,6 +42,8 @@
} else { //depn calc has been run previously
$AllowUserEnteredProcessDate = false;
+ prnMsg('LastDepnRun[0] = ' . $LastDepnRun[0] . '<br />ConvertSQLDate($LastDepnRun[0]) = ' . ConvertSQLDate($LastDepnRun[0]) . '<br />DateAdd(ConvertSQLDate($LastDepnRun[0]),d,28) = ' . DateAdd(ConvertSQLDate($LastDepnRun[0]),'d',28), 'info');
+
$_POST['ProcessDate'] = LastDayOfMonth(DateAdd(ConvertSQLDate($LastDepnRun[0]),'d',28));
}
Modified: trunk/FixedAssetItems.php
===================================================================
--- trunk/FixedAssetItems.php 2011-01-23 04:38:44 UTC (rev 4474)
+++ trunk/FixedAssetItems.php 2011-01-24 05:25:42 UTC (rev 4475)
@@ -538,7 +538,14 @@
echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . number_format($AssetRow['accumdepn'],2) . '</td></tr>';
echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],2) . '</td></tr>';
-$result = DB_query('SELECT periods.lastdate_in_period, max(fixedassettrans.periodno) FROM fixedassettrans INNER JOIN periods ON fixedassettrans.periodno=periods.periodno WHERE transtype=44 GROUP BY periods.lastdate_in_period',$db);
+$result = DB_query('SELECT periods.lastdate_in_period,
+ max(fixedassettrans.periodno)
+ FROM fixedassettrans INNER JOIN periods
+ ON fixedassettrans.periodno=periods.periodno
+ WHERE transtype=44
+ GROUP BY periods.lastdate_in_period
+ ORDER BY periods.lastdate_in_period DESC',$db);
+
$LastDepnRun = DB_fetch_row($result);
if(DB_num_rows($result)==0){
$LastRunDate = _('Not Yet Run');
Modified: trunk/SelectAsset.php
===================================================================
--- trunk/SelectAsset.php 2011-01-23 04:38:44 UTC (rev 4474)
+++ trunk/SelectAsset.php 2011-01-24 05:25:42 UTC (rev 4475)
@@ -124,7 +124,7 @@
//insert wildcard characters in spaces
$_POST['Keywords'] = strtoupper($_POST['Keywords']);
$SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%';
- if ($_POST['AssetCategory'] == 'All') {
+ if ($_POST['AssetCategory'] == 'ALL') {
if ($_POST['AssetLocation']=='ALL'){
$SQL .= 'WHERE description ' . LIKE . "'" . $SearchString . "' ORDER BY fixedassets.assetid";
} else {
@@ -171,6 +171,7 @@
$ErrMsg = _('No assets were returned by the SQL because');
$DbgMsg = _('The SQL that returned an error was');
$searchresult = DB_query($SQL, $db, $ErrMsg, $DbgMsg);
+
if (DB_num_rows($searchresult) == 0) {
prnMsg(_('No assets were returned by this search please re-enter alternative criteria to try again'), 'info');
}
Modified: trunk/doc/Change.log.html
===================================================================
--- trunk/doc/Change.log.html 2011-01-23 04:38:44 UTC (rev 4474)
+++ trunk/doc/Change.log.html 2011-01-24 05:25:42 UTC (rev 4475)
@@ -1,5 +1,6 @@
<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p>
<p></p>
+<p>24/1/11:Phil Depreciation fixes - SelectAsset by description fix</p>
<p>23/1/11:Peter Otandeka: PDFTopItems.php SQL quoting fixes</p>
<p>23/1/11: phil Fix Depreciation posting and dates of end of periods</p>
<p>23/1/11:Phil changed back references throughout several MRP scripts from is_date to Is_Date - as Is_Date is used throughout the code and much bigger job to change all references to is_date</p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|