From: <tim...@us...> - 2012-01-19 10:53:11
|
Revision: 4809 http://web-erp.svn.sourceforge.net/web-erp/?rev=4809&view=rev Author: tim_schofield Date: 2012-01-19 10:53:00 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/SalesByTypePeriodInquiry.php Modified: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php 2012-01-19 10:17:22 UTC (rev 4808) +++ trunk/SalesByTypePeriodInquiry.php 2012-01-19 10:53:00 UTC (rev 4809) @@ -22,7 +22,7 @@ echo '<form name="Form1" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class="selection"> +echo '<table cellpadding="2" class="selection"> <tr><td valign=top> <table>'; @@ -77,7 +77,7 @@ echo '</table> </td><td valign="top"> <table>'; - + echo '<tr><th colspan="2" class="centre">' . _('Display Data') . '</th> </tr> <tr> @@ -185,20 +185,20 @@ case 'Daily': $sql = "SELECT debtortrans.trandate, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -212,26 +212,26 @@ tpe ORDER BY debtortrans.trandate, tpe"; - + break; case 'Weekly': $sql = "SELECT WEEKOFYEAR(debtortrans.trandate) as week_no, YEAR(debtortrans.trandate) as transyear, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -247,27 +247,27 @@ ORDER BY transyear, week_no, tpe"; - + break; case 'Monthly': $sql = "SELECT MONTH(debtortrans.trandate) as month_no, MONTHNAME(debtortrans.trandate) as month_name, YEAR(debtortrans.trandate) as transyear, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -284,26 +284,26 @@ ORDER BY transyear, month_no, tpe"; - + break; case 'Quarterly': $sql = "SELECT QUARTER(debtortrans.trandate) as quarter_no, YEAR(debtortrans.trandate) as transyear, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -315,20 +315,20 @@ AND debtortrans.trandate<='" . $ToDate . "' GROUP BY quarter_no, transyear, - tpe + tpe ORDER BY transyear, quarter_no, tpe"; - + break; } - + $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql,$db,$ErrMsg); - - echo '<table cellpadding=2 class="selection">'; - + + echo '<table cellpadding="2" class="selection">'; + echo'<tr> <th>' . _('Period') . '</th> <th>' . _('Sales') . '<br />' . _('Type') . '</th> @@ -339,21 +339,21 @@ <th>' . _('Cost of Sales') . '</th> <th>' . _('Gross Profit') . '</th> </tr>'; - + $CumulativeTotalSales = 0; $CumulativeTotalOrders = 0; $CumulativeTotalRefunds = 0; $CumulativeTotalNetSales = 0; $CumulativeTotalCost = 0; $CumulativeTotalGP = 0; - + $PrdTotalOrders =0; $PrdTotalSales=0; $PrdTotalRefunds=0; $PrdTotalNetSales=0; $PrdTotalCost=0; $PrdTotalGP=0; - + $PeriodHeadingDone = false; $LastPeriodHeading = 'First Run Through'; $k=0; @@ -399,7 +399,7 @@ $PeriodHeadingDone = true; } else { echo '<td></td>'; - } + } break; case 'Weekly': if ($LastPeriodHeading != _('wk'). '-' . $SalesRow['week_no'] . ' ' . $SalesRow['transyear']) { @@ -434,7 +434,7 @@ $PeriodHeadingDone = true; } else { echo '<td></td>'; - } + } break; case 'Monthly': if ($LastPeriodHeading != $SalesRow['month_name'] . ' ' . $SalesRow['transyear']) { @@ -521,7 +521,7 @@ $PrdTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); $PrdTotalCost += $SalesRow['cost']; $PrdTotalGP += ($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']); - + $CumulativeTotalSales += $SalesRow['salesvalue']; $CumulativeTotalOrders = $SalesRow['nooforders']; $CumulativeTotalRefunds += $SalesRow['returnvalue']; @@ -559,7 +559,7 @@ <td class="number">' . locale_number_format($CumulativeTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; - + echo '</table>'; } //end of if user hit show sales This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 10:53:11
|
Revision: 4809 http://web-erp.svn.sourceforge.net/web-erp/?rev=4809&view=rev Author: tim_schofield Date: 2012-01-19 10:53:00 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/SalesByTypePeriodInquiry.php Modified: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php 2012-01-19 10:17:22 UTC (rev 4808) +++ trunk/SalesByTypePeriodInquiry.php 2012-01-19 10:53:00 UTC (rev 4809) @@ -22,7 +22,7 @@ echo '<form name="Form1" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class="selection"> +echo '<table cellpadding="2" class="selection"> <tr><td valign=top> <table>'; @@ -77,7 +77,7 @@ echo '</table> </td><td valign="top"> <table>'; - + echo '<tr><th colspan="2" class="centre">' . _('Display Data') . '</th> </tr> <tr> @@ -185,20 +185,20 @@ case 'Daily': $sql = "SELECT debtortrans.trandate, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -212,26 +212,26 @@ tpe ORDER BY debtortrans.trandate, tpe"; - + break; case 'Weekly': $sql = "SELECT WEEKOFYEAR(debtortrans.trandate) as week_no, YEAR(debtortrans.trandate) as transyear, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -247,27 +247,27 @@ ORDER BY transyear, week_no, tpe"; - + break; case 'Monthly': $sql = "SELECT MONTH(debtortrans.trandate) as month_no, MONTHNAME(debtortrans.trandate) as month_name, YEAR(debtortrans.trandate) as transyear, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -284,26 +284,26 @@ ORDER BY transyear, month_no, tpe"; - + break; case 'Quarterly': $sql = "SELECT QUARTER(debtortrans.trandate) as quarter_no, YEAR(debtortrans.trandate) as transyear, debtortrans.tpe, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN 1 ELSE 0 END) as nooforders, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, SUM((standardcost * -qty)) as cost FROM stockmoves - INNER JOIN custbranch + INNER JOIN custbranch ON stockmoves.debtorno=custbranch.debtorno AND stockmoves.branchcode=custbranch.branchcode INNER JOIN debtortrans @@ -315,20 +315,20 @@ AND debtortrans.trandate<='" . $ToDate . "' GROUP BY quarter_no, transyear, - tpe + tpe ORDER BY transyear, quarter_no, tpe"; - + break; } - + $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql,$db,$ErrMsg); - - echo '<table cellpadding=2 class="selection">'; - + + echo '<table cellpadding="2" class="selection">'; + echo'<tr> <th>' . _('Period') . '</th> <th>' . _('Sales') . '<br />' . _('Type') . '</th> @@ -339,21 +339,21 @@ <th>' . _('Cost of Sales') . '</th> <th>' . _('Gross Profit') . '</th> </tr>'; - + $CumulativeTotalSales = 0; $CumulativeTotalOrders = 0; $CumulativeTotalRefunds = 0; $CumulativeTotalNetSales = 0; $CumulativeTotalCost = 0; $CumulativeTotalGP = 0; - + $PrdTotalOrders =0; $PrdTotalSales=0; $PrdTotalRefunds=0; $PrdTotalNetSales=0; $PrdTotalCost=0; $PrdTotalGP=0; - + $PeriodHeadingDone = false; $LastPeriodHeading = 'First Run Through'; $k=0; @@ -399,7 +399,7 @@ $PeriodHeadingDone = true; } else { echo '<td></td>'; - } + } break; case 'Weekly': if ($LastPeriodHeading != _('wk'). '-' . $SalesRow['week_no'] . ' ' . $SalesRow['transyear']) { @@ -434,7 +434,7 @@ $PeriodHeadingDone = true; } else { echo '<td></td>'; - } + } break; case 'Monthly': if ($LastPeriodHeading != $SalesRow['month_name'] . ' ' . $SalesRow['transyear']) { @@ -521,7 +521,7 @@ $PrdTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); $PrdTotalCost += $SalesRow['cost']; $PrdTotalGP += ($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']); - + $CumulativeTotalSales += $SalesRow['salesvalue']; $CumulativeTotalOrders = $SalesRow['nooforders']; $CumulativeTotalRefunds += $SalesRow['returnvalue']; @@ -559,7 +559,7 @@ <td class="number">' . locale_number_format($CumulativeTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; - + echo '</table>'; } //end of if user hit show sales This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2016-09-04 01:36:25
|
Revision: 7607 http://sourceforge.net/p/web-erp/reponame/7607 Author: exsonqu Date: 2016-09-04 01:36:23 +0000 (Sun, 04 Sep 2016) Log Message: ----------- 04/09/16 Dave Parrish fixed accumulated No of orders bug in SalesByTypePeriodInquiry.php. Modified Paths: -------------- trunk/SalesByTypePeriodInquiry.php Modified: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php 2016-08-31 06:33:53 UTC (rev 7606) +++ trunk/SalesByTypePeriodInquiry.php 2016-09-04 01:36:23 UTC (rev 7607) @@ -545,7 +545,7 @@ $PrdTotalGP += ($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']); $CumulativeTotalSales += $SalesRow['salesvalue']; - $CumulativeTotalOrders = $SalesRow['nooforders']; + $CumulativeTotalOrders += $SalesRow['nooforders']; $CumulativeTotalRefunds += $SalesRow['returnvalue']; $CumulativeTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); $CumulativeTotalCost += $SalesRow['cost']; |