From: <tim...@us...> - 2010-07-08 19:50:03
|
Revision: 3591 http://web-erp.svn.sourceforge.net/web-erp/?rev=3591&view=rev Author: tim_schofield Date: 2010-07-08 19:49:56 +0000 (Thu, 08 Jul 2010) Log Message: ----------- Layout improvements and sql fixes Modified Paths: -------------- trunk/GLBudgets.php trunk/doc/Change.log.html trunk/includes/DateFunctions.inc trunk/sql/mysql/weberp-demo.sql Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2010-07-08 19:49:24 UTC (rev 3590) +++ trunk/GLBudgets.php 2010-07-08 19:49:56 UTC (rev 3591) @@ -34,10 +34,10 @@ echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -84,12 +84,12 @@ $ErrMsg = _('Cannot update GL budgets'); $DbgMsg = _('The SQL that failed to update the GL budgets was'); for ($i=1; $i<=12; $i++) { - $SQL='UPDATE chartdetails SET budget='.Round($_POST[$i.'this'],2). ' - WHERE period=' . ($CurrentYearEndPeriod-(12-$i)) ." + $SQL="UPDATE chartdetails SET budget='".Round($_POST[$i.'this'],2). "' + WHERE period='" . ($CurrentYearEndPeriod-(12-$i)) ."' AND accountcode = '" . $SelectedAccount."'"; $result=DB_query($SQL,$db,$ErrMsg,$DbgMsg); - $SQL='UPDATE chartdetails SET budget='.Round($_POST[$i.'next'],2).' - WHERE period=' . ($CurrentYearEndPeriod+$i) ." + $SQL="UPDATE chartdetails SET budget='".Round($_POST[$i.'next'],2)."' + WHERE period='" . ($CurrentYearEndPeriod+$i) ."' AND accountcode = '" . $SelectedAccount."'"; $result=DB_query($SQL,$db,$ErrMsg,$DbgMsg); } @@ -107,11 +107,11 @@ } // End of create periods - $SQL='SELECT period, + $SQL="SELECT period, budget, actual FROM chartdetails - WHERE accountcode=' . $SelectedAccount; + WHERE accountcode='" . $SelectedAccount . "'"; $result=DB_query($SQL,$db); while ($myrow=DB_fetch_array($result)) { @@ -215,14 +215,14 @@ $LastPeriod=$MyRow[0]; for ($i=$FirstPeriod;$i<=$LastPeriod;$i++) { - $sql='SELECT accountcode, + $sql="SELECT accountcode, period, budget, actual, bfwd, bfwdbudget FROM chartdetails - WHERE period ='. $i . ' AND accountcode = ' . $SelectedAccount; + WHERE period ='". $i . "' AND accountcode = '" . $SelectedAccount . "'"; $ErrMsg = _('Could not retrieve the ChartDetail records because'); $result = DB_query($sql,$db,$ErrMsg); @@ -230,7 +230,10 @@ while ($myrow=DB_fetch_array($result)){ $CFwdBudget = $myrow['bfwdbudget'] + $myrow['budget']; - $sql = 'UPDATE chartdetails SET bfwdbudget=' . $CFwdBudget . ' WHERE period=' . ($myrow['period'] +1) . ' AND accountcode = ' . $SelectedAccount; + $sql = "UPDATE chartdetails + SET bfwdbudget='" . $CFwdBudget . "' + WHERE period='" . ($myrow['period'] +1) . "' + AND accountcode = '" . $SelectedAccount . "'"; $ErrMsg =_('Could not update the chartdetails record because'); $updresult = DB_query($sql,$db,$ErrMsg); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-08 19:49:24 UTC (rev 3590) +++ trunk/doc/Change.log.html 2010-07-08 19:49:56 UTC (rev 3591) @@ -1,6 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>07/07/10 Tim: ManualPettyCash.html - Correct typo</p> +<p>08/07/10 Tim: GLBudgets - Layout improvements and sql fixes</p> +<p>08/07/10 Tim: index.php - Correct typo</p> +<p>08/07/10 Tim: ManualPettyCash.html - Correct typo</p> <p>07/07/10 Tim: GLBalanceSheet.php - Layout improvements and properly quoting sql</p> <p>07/07/10 Tim: GLAccounts.php - Layout improvements and properly quoting sql</p> <p>07/07/10 Tim: GLAccountInquiry.php - Layout improvements and properly quoting sql</p> Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-07-08 19:49:24 UTC (rev 3590) +++ trunk/includes/DateFunctions.inc 2010-07-08 19:49:56 UTC (rev 3591) @@ -803,7 +803,7 @@ $LastPeriodEnd = mktime(0,0,0,Date('m')+2,0,Date('Y')); } else { $Date_Array = explode('-', $myrow[0]); - $LastPeriodEnd = mktime(0,0,0,$Date_Array[1]+1,0,(int)$Date_Array[0]); + $LastPeriodEnd = mktime(0,0,0,$Date_Array[1]+2,0,(int)$Date_Array[0]); $LastPeriod = $myrow[1]; } /* Find the unix timestamp of the first period end date in periods table */ @@ -817,7 +817,6 @@ /* If the period number doesn't exist */ if (!PeriodExists($TransDate, $db)) { /* if the transaction is after the last period */ - echo (date('d/m/Y',$TransDate) .' '. date('d/m/Y',$LastPeriodEnd)); if ($TransDate > $LastPeriodEnd) { $PeriodEnd = mktime(0,0,0,Date('m', $TransDate)+1, 0, Date('Y', $TransDate)); $Period = $LastPeriod + 1; Modified: trunk/sql/mysql/weberp-demo.sql =================================================================== --- trunk/sql/mysql/weberp-demo.sql 2010-07-08 19:49:24 UTC (rev 3590) +++ trunk/sql/mysql/weberp-demo.sql 2010-07-08 19:49:56 UTC (rev 3591) @@ -10870,56 +10870,6 @@ -- Dumping data for table `periods` -- -INSERT INTO `periods` VALUES (-11,'2006-06-30'); -INSERT INTO `periods` VALUES (-10,'2006-07-31'); -INSERT INTO `periods` VALUES (-9,'2006-08-31'); -INSERT INTO `periods` VALUES (-8,'2006-09-30'); -INSERT INTO `periods` VALUES (-7,'2006-10-31'); -INSERT INTO `periods` VALUES (-6,'2006-11-30'); -INSERT INTO `periods` VALUES (-5,'2006-12-31'); -INSERT INTO `periods` VALUES (-4,'2007-01-31'); -INSERT INTO `periods` VALUES (-3,'2007-02-28'); -INSERT INTO `periods` VALUES (-2,'2007-03-31'); -INSERT INTO `periods` VALUES (-1,'2007-04-30'); -INSERT INTO `periods` VALUES (0,'2007-05-31'); -INSERT INTO `periods` VALUES (1,'2007-06-30'); -INSERT INTO `periods` VALUES (2,'2007-07-31'); -INSERT INTO `periods` VALUES (3,'2007-08-31'); -INSERT INTO `periods` VALUES (4,'2007-09-30'); -INSERT INTO `periods` VALUES (5,'2007-10-31'); -INSERT INTO `periods` VALUES (6,'2007-11-30'); -INSERT INTO `periods` VALUES (7,'2007-12-31'); -INSERT INTO `periods` VALUES (8,'2008-01-31'); -INSERT INTO `periods` VALUES (9,'2008-02-29'); -INSERT INTO `periods` VALUES (10,'2008-03-31'); -INSERT INTO `periods` VALUES (11,'2008-04-30'); -INSERT INTO `periods` VALUES (12,'2008-05-31'); -INSERT INTO `periods` VALUES (13,'2008-06-30'); -INSERT INTO `periods` VALUES (14,'2008-07-31'); -INSERT INTO `periods` VALUES (15,'2008-08-31'); -INSERT INTO `periods` VALUES (16,'2008-09-30'); -INSERT INTO `periods` VALUES (17,'2008-10-31'); -INSERT INTO `periods` VALUES (18,'2008-11-30'); -INSERT INTO `periods` VALUES (19,'2008-12-31'); -INSERT INTO `periods` VALUES (20,'2009-01-31'); -INSERT INTO `periods` VALUES (21,'2009-02-28'); -INSERT INTO `periods` VALUES (22,'2009-03-31'); -INSERT INTO `periods` VALUES (23,'2009-04-30'); -INSERT INTO `periods` VALUES (24,'2009-05-31'); -INSERT INTO `periods` VALUES (25,'2009-06-30'); -INSERT INTO `periods` VALUES (26,'2009-07-31'); -INSERT INTO `periods` VALUES (27,'2009-08-31'); -INSERT INTO `periods` VALUES (28,'2009-09-30'); -INSERT INTO `periods` VALUES (29,'2009-10-31'); -INSERT INTO `periods` VALUES (30,'2009-11-30'); -INSERT INTO `periods` VALUES (31,'2009-12-31'); -INSERT INTO `periods` VALUES (32,'2010-01-31'); -INSERT INTO `periods` VALUES (33,'2010-02-28'); -INSERT INTO `periods` VALUES (34,'2010-03-31'); -INSERT INTO `periods` VALUES (35,'2010-04-30'); -INSERT INTO `periods` VALUES (36,'2010-05-31'); -INSERT INTO `periods` VALUES (37,'2010-06-30'); - -- -- Dumping data for table `pickinglistdetails` -- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |