From: <tim...@us...> - 2010-07-15 21:53:31
|
Revision: 3624 http://web-erp.svn.sourceforge.net/web-erp/?rev=3624&view=rev Author: tim_schofield Date: 2010-07-15 21:53:24 +0000 (Thu, 15 Jul 2010) Log Message: ----------- Change report to show tag name in the heading Modified Paths: -------------- trunk/GLTagProfit_Loss.php trunk/doc/Change.log.html Added Paths: ----------- trunk/includes/PDFTagProfitAndLossPageHeader.inc Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2010-07-15 10:29:25 UTC (rev 3623) +++ trunk/GLTagProfit_Loss.php 2010-07-15 21:53:24 UTC (rev 3624) @@ -116,6 +116,10 @@ } else if (isset($_POST['PrintPDF'])) { + $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$_POST['tag']."'"; + $tagresult=DB_query($tagsql, $db); + $tagrow=DB_fetch_array($tagresult); + $Tag=$tagrow['tagdescription']; include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Income and Expenditure') ); $pdf->addInfo('Subject', _('Income and Expenditure') ); @@ -186,7 +190,7 @@ exit; } - include('includes/PDFProfitAndLossPageHeader.inc'); + include('includes/PDFTagProfitAndLossPageHeader.inc'); $Section = ''; $SectionPrdActual = 0; @@ -201,7 +205,7 @@ // Print heading if at end of page if ($YPos < ($Bottom_Margin)){ - include('includes/PDFProfitAndLossPageHeader.inc'); + include('includes/PDFTagProfitAndLossPageHeader.inc'); } if ($myrow['groupname'] != $ActGrp){ @@ -229,7 +233,7 @@ $Level--; // Print heading if at end of page if ($YPos < ($Bottom_Margin + (2*$line_height))){ - include('includes/PDFProfitAndLossPageHeader.inc'); + include('includes/PDFTagProfitAndLossPageHeader.inc'); } } //end of loop //still need to print out the group total for the same level @@ -254,7 +258,7 @@ // Print heading if at end of page if ($YPos < ($Bottom_Margin +(2 * $line_height))){ - include('includes/PDFProfitAndLossPageHeader.inc'); + include('includes/PDFTagProfitAndLossPageHeader.inc'); } if ($myrow['sectioninaccounts'] != $Section){ @@ -296,6 +300,8 @@ } } $SectionPrdActual = 0; + $SectionPrdBudget = 0; + $SectionPrdLY = 0; $Section = $myrow['sectioninaccounts']; @@ -370,7 +376,7 @@ $Level--; // Print heading if at end of page if ($YPos < ($Bottom_Margin + (2*$line_height))){ - include('includes/PDFProfitAndLossPageHeader.inc'); + include('includes/PDFTagProfitAndLossPageHeader.inc'); } } //still need to print out the group total for the same level @@ -393,7 +399,7 @@ } // Print heading if at end of page if ($YPos < ($Bottom_Margin + (2*$line_height))){ - include('includes/PDFProfitAndLossPageHeader.inc'); + include('includes/PDFTagProfitAndLossPageHeader.inc'); } if ($Section != ''){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-15 10:29:25 UTC (rev 3623) +++ trunk/doc/Change.log.html 2010-07-15 21:53:24 UTC (rev 3624) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>15/07/10 Tim: GLTagProfit_Loss.php - Change report to show tag name in the heading</p> <p>15/07/10 Tim: StockCheck.php - Bug fixes to show decimal places correctly and other fixes, fix sql quoting errors and layout changes</p> <p>14/07/10 Tim: MRPPlannedWorkOrders.php - Fix sql quoting errors and layout changes</p> <p>13/07/10 Tim: MRPPlannedPurchaseOrders.php - Bug fixes, correctly do the workflow, fix sql quoting errors and layout changes</p> Added: trunk/includes/PDFTagProfitAndLossPageHeader.inc =================================================================== --- trunk/includes/PDFTagProfitAndLossPageHeader.inc (rev 0) +++ trunk/includes/PDFTagProfitAndLossPageHeader.inc 2010-07-15 21:53:24 UTC (rev 3624) @@ -0,0 +1,39 @@ +<?php + /* + * PDF page header for the profit and loss report. + * Suren Naidu 28/08/2005 + * + */ +/* $Id$*/ + + $PageNumber++; + if ($PageNumber>1){ + $pdf->newPage(); + } + + $FontSize = 8; + $YPos = $Page_Height - $Top_Margin; + $pdf->addText($Left_Margin,$YPos,$FontSize,$_SESSION['CompanyRecord']['coyname']); + + $YPos -= $line_height; + $FontSize =10; + $pdf->setFont('','B'); + $Heading = _('Profit and loss for the ') . $NumberOfMonths . _(' months to ') . _('and including ') . $PeriodToDate; + $Heading1 = _('Transactions for tag') . ': '.$_POST['tag'].' - '.$Tag; + $pdf->addText($Left_Margin, $YPos, $FontSize, $Heading); + $pdf->addText($Left_Margin, $YPos-$line_height, $FontSize, $Heading1); + + $FontSize = 8; + $pdf->setFont('',''); + $pdf->addText($Page_Width-$Right_Margin-120,$YPos,$FontSize, + _('Printed'). ': ' . Date($_SESSION['DefaultDateFormat']) + . ' '. _('Page'). ' ' . $PageNumber); + + $YPos -= (3 * $line_height); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Account')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,100,$FontSize,_('Account Name')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,_('Period Actual'),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,_('Period Budget'),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,_('Last Year'),'right'); + $YPos -= (3 * $line_height); +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |