From: <tim...@us...> - 2010-10-02 15:04:51
|
Revision: 4090 http://web-erp.svn.sourceforge.net/web-erp/?rev=4090&view=rev Author: tim_schofield Date: 2010-10-02 15:04:45 +0000 (Sat, 02 Oct 2010) Log Message: ----------- Bug fixes and layout changes Modified Paths: -------------- trunk/DailySalesInquiry.php trunk/doc/Change.log.html Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2010-10-02 13:26:40 UTC (rev 4089) +++ trunk/DailySalesInquiry.php 2010-10-02 15:04:45 UTC (rev 4090) @@ -16,7 +16,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2><tr>'; +echo '<table cellpadding=2 class=selection><tr>'; echo '<td>' . _('Month to Show') . ':</td><td><select tabindex=1 name="MonthToShow">'; @@ -55,10 +55,9 @@ } echo '</select></td>'; -echo '</tr></table><div class="centre"><input tabindex=4 type=submit name="ShowResults" VALUE="' . _('Show Daily Sales For The Selected Month') . '">'; -echo '<hr>'; - +echo '</tr></table><br /><div class="centre"><input tabindex=4 type=submit name="ShowResults" VALUE="' . _('Show Daily Sales For The Selected Month') . '">'; echo '</form></div>'; +echo '<br />'; /*Now get and display the sales data returned */ if (strpos($EndDateSQL,'/')) { $Date_Array = explode('/',$EndDateSQL); @@ -93,7 +92,7 @@ $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=2>'; +echo '<table cellpadding=2 class=selection>'; echo'<tr> <th>' . _('Sunday') . '</th> @@ -109,13 +108,16 @@ $BilledDays = 0; $DaySalesArray = array(); while ($DaySalesRow=DB_fetch_array($SalesResult)) { - if (isset($DaySalesRow['salesvalue'])) { - $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->Sales = $DaySalesRow['salesvalue']; - } + $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])] = new Cart; + if ($DaySalesRow['salesvalue'] > 0) { + $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->Sales = $DaySalesRow['salesvalue']; + } else { + $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->Sales = 0; + } if ($DaySalesRow['salesvalue'] > 0 ) { - $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->GPPercent = ($DaySalesRow['salesvalue']-$DaySalesRow['cost'])/$DaySalesRow['salesvalue']; + $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->GPPercent = ($DaySalesRow['salesvalue']-$DaySalesRow['cost'])/$DaySalesRow['salesvalue']; } else { - $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->GPPercent = 0; + $DaySalesArray[DayOfMonthFromSQLDate($DaySalesRow['trandate'])]->GPPercent = 0; } $BilledDays++; $CumulativeTotalSales += $DaySalesRow['salesvalue']; @@ -142,7 +144,9 @@ for ($i=1;$i<=$LastDayOfMonth;$i++){ $ColumnCounter++; if(isset($DaySalesArray[$i])) { - echo '<td class="number">' . number_format($DaySalesArray[$i]->Sales,0) . '<br />' . number_format($DaySalesArray[$i]->GPPercent*100,1) . '</td>'; + echo '<td class="number" style="outline: 1px solid gray;">' . number_format($DaySalesArray[$i]->Sales,0) . '<br />' . number_format($DaySalesArray[$i]->GPPercent*100,1) . '%</td>'; + } else { + echo '<td class="number" style="outline: 1px solid gray;">' . number_format(0,0) . '<br />' . number_format(0,1) . '%</td>'; } if ($ColumnCounter==7){ echo '</tr><tr>'; @@ -171,9 +175,9 @@ $AverageDailySales = 0; } -echo '<td colspan=7>' . _('Total Sales for month') . ': ' . number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . number_format($AverageDailySales,0) . '</td></tr>'; +echo '<th colspan=7>' . _('Total Sales for month') . ': ' . number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . number_format($AverageDailySales,0) . '</th></tr>'; echo '</table>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-10-02 13:26:40 UTC (rev 4089) +++ trunk/doc/Change.log.html 2010-10-02 15:04:45 UTC (rev 4090) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/10/10 Tim: DailySalesInquiry.php - Bug fixes and layout changes</p> <p>02/10/10 Tim: session.inc - Corrections to sql quoting. Resolves bug 3023782</p> <p>02/10/10 Tim: ppdf_tpl.php - Make php 5.3 compatible</p> <p>02/10/10 Tim: GLJournal.php - Fix to create a reversing journal even when non english language is used.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |