From: <tim...@us...> - 2010-01-02 09:54:42
|
Revision: 3266 http://web-erp.svn.sourceforge.net/web-erp/?rev=3266&view=rev Author: tim_schofield Date: 2010-01-02 09:54:35 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Allow pdf output of the asset register. Modified Paths: -------------- trunk/FixedAssetRegister.php trunk/doc/Change.log.html Added Paths: ----------- trunk/includes/PDFAssetRegisterHeader.inc Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2010-01-01 16:03:50 UTC (rev 3265) +++ trunk/FixedAssetRegister.php 2010-01-02 09:54:35 UTC (rev 3266) @@ -1,130 +1,76 @@ <?php -/* $Id$*/ $PageSecurity = 11; include('includes/session.inc'); $title = _('Fixed Asset Register'); -include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Search') . '" alt="">' . ' ' . $title; - -$sql = "SELECT * FROM stockcategory WHERE stocktype='".'A'."'"; -$result = DB_query($sql,$db); - -echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table>'; -echo '<tr><th>'._('Asset Category').'</th>'; -echo '<td><select name=assetcategory>'; -echo '<option value="%">ALL</option>'; -while ($myrow=DB_fetch_array($result)) { - if (isset($_POST['assetcategory']) and $myrow['categoryid']==$_POST['assetcategory']) { - echo '<option selected value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; - } else { - echo '<option value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; - } -} -echo '</select></td></tr>'; - -$sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; -$result = DB_query($sql,$db); +if (isset($_POST['submit']) or isset($_POST['pdf'])) { -echo '<tr><th>'._('Asset Location').'</th>'; -echo '<td><select name=assetlocation>'; -echo '<option value="All">ALL</option>'; -while ($myrow=DB_fetch_array($result)) { - if (isset($_POST['assetlocation']) and $myrow['locationdescription']==$_POST['assetlocation']) { - echo '<option selected value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + if (isset($_POST['pdf'])) { + $PaperSize = 'A4_Landscape'; + include('includes/PDFStarter.php'); } else { - echo '<option value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . + _('Search') . '" alt="">' . ' ' . $title; } -} -echo '</select></td></tr>'; - -$sql = "SELECT stockid, description FROM stockmaster LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stocktype='A'"; -$result = DB_query($sql,$db); -echo '<tr><th>'._('Asset Type').'</th>'; -echo '<td><select name=assettype>'; -echo '<option value="%">ALL</option>'; -while ($myrow=DB_fetch_array($result)) { - if (isset($_POST['assettype']) and $myrow['stockid']==$_POST['assettype']) { - echo '<option selected value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; - } else { - echo '<option value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; - } -} + $dateFrom = FormatDateForSQL($_POST['fromDate']); + $dateTo = FormatDateForSQL($_POST['toDate']); -echo '</select></td></tr>'; -//FULUSI CHANGE BELOW TO ADD TIME -echo '<tr> - <th>'._(' From Date')."</th> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. - "' name='fromDate' maxlength=10 size=11 value='".$_POST['fromDate']."'></td>"; - -echo '</tr>'; -echo '<tr> - <th>'._('To Date ')."</th> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. - "' name='toDate' maxlength=10 size=11 value='".$_POST['toDate']."'></td>"; - -echo '</tr>'; -//end of FULUSI STUFF - -echo '</table><br>'; - -echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"></div>'; - -echo '</form>'; - -if (isset($_POST['submit'])) { - $dateFrom = FormatDateForSQL($_POST['fromDate']); - $dateTo = FormatDateForSQL($_POST['toDate']); - - - $sql='SELECT assetmanager.id, + $sql='SELECT assetmanager.id, assetmanager.stockid, stockmaster.longdescription, stockmaster.categoryid, assetmanager.serialno, - fixedassetlocations.locationdescription, - assetmanager.cost, + fixedassetlocations.locationdescription, + assetmanager.cost, assetmanager.datepurchased, assetmanager.depn, assetmanager.disposalvalue, fixedassetlocations.parentlocationid, assetmanager.location - FROM assetmanager - LEFT JOIN stockmaster ON assetmanager.stockid=stockmaster.stockid - LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid + FROM assetmanager + LEFT JOIN stockmaster ON assetmanager.stockid=stockmaster.stockid + LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid LEFT JOIN fixedassetlocations ON assetmanager.location=fixedassetlocations.locationid WHERE stockmaster.categoryid like "'.$_POST['assetcategory'].'" AND stockmaster.stockid like "'.$_POST['assettype'].'" AND assetmanager.datepurchased BETWEEN "'.$dateFrom.'" AND "'.$dateTo.'"'; $result=DB_query($sql, $db); - echo '<br><table width=80% cellspacing="9"><tr>'; - echo '<th colspan=6></th>'; - echo '<th colspan=3>'._('External Depreciation').'</th>'; - echo '<th colspan=3>'._('Internal Depreciation').'</th><th></th></tr><tr>'; - echo '<th>'._('Asset ID').'</th>'; - echo '<th>'._('Stock ID').'</th>'; - echo '<th>'._('Description').'</th>'; - echo '<th>'._('Serial Number').'</th>'; - echo '<th>'._('Location').'</th>'; - echo '<th>'._('Date Acquired').'</th>'; - echo '<th>'._('Cost').'</th>'; - echo '<th>'._('Depreciation').'</th>'; - echo '<th>'._('NBV').'</th>'; - echo '<th>'._('Cost').'</th>'; - echo '<th>'._('Depreciation').'</th>'; - echo '<th>'._('NBV').'</th>'; - echo '<th>'._('Disposal Value').'</th></tr>'; + if (isset($_POST['pdf'])) { + $FontSize=10; + $pdf->addinfo('Title', _('Fixed Asset Register') ); + $PageNumber=1; + $line_height=12; + include('includes/PDFAssetRegisterHeader.inc'); + } else { + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table>'; + echo '<br><table width=80% cellspacing="9"><tr>'; + echo '<th colspan=6></th>'; + echo '<th colspan=3>'._('External Depreciation').'</th>'; + echo '<th colspan=3>'._('Internal Depreciation').'</th><th></th></tr><tr>'; + echo '<th>'._('Asset ID').'</th>'; + echo '<th>'._('Stock ID').'</th>'; + echo '<th>'._('Description').'</th>'; + echo '<th>'._('Serial Number').'</th>'; + echo '<th>'._('Location').'</th>'; + echo '<th>'._('Date Acquired').'</th>'; + echo '<th>'._('Cost').'</th>'; + echo '<th>'._('Depreciation').'</th>'; + echo '<th>'._('NBV').'</th>'; + echo '<th>'._('Cost').'</th>'; + echo '<th>'._('Depreciation').'</th>'; + echo '<th>'._('NBV').'</th>'; + echo '<th>'._('Disposal Value').'</th></tr>'; + } while ($myrow=DB_fetch_array($result)) { - + $ancestors=array(); $ancestors[0]=$myrow['locationdescription']; $i=0; @@ -153,30 +99,145 @@ } if (in_array($_POST['assetlocation'],$ancestors) or $_POST['assetlocation']=='All') { - - echo '<tr><td style="vertical-align:top">'.$myrow['id'].'</td>'; - echo '<td style="vertical-align:top">'.$myrow['stockid'].'</td>'; - echo '<td style="vertical-align:top">'.$myrow['longdescription'].'</td>'; - echo '<td style="vertical-align:top">'.$myrow['serialno'].'</td>'; - echo '<td>'.$myrow['locationdescription'].'<br>'; - for ($i=1;$i<sizeOf($ancestors)-1;$i++) { - for ($j=0;$j<$i; $j++) { - echo ' '; + if (isset($_POST['pdf'])) { + $LeftOvers = $pdf->addTextWrap($Xpos,$YPos,300-$Left_Margin,$FontSize, $myrow['id']); + $LeftOvers = $pdf->addTextWrap($Xpos+40,$YPos,300-$Left_Margin,$FontSize, $myrow['stockid']); + $LeftOvers = $pdf->addTextWrap($Xpos+80,$YPos,300-$Left_Margin,$FontSize, $myrow['longdescription']); + $LeftOvers = $pdf->addTextWrap($Xpos+250,$YPos,300-$Left_Margin,$FontSize, $myrow['serialno']); + $LeftOvers = $pdf->addTextWrap($Xpos+300,$YPos,300-$Left_Margin,$FontSize, $myrow['locationdescription']); + $TempYPos=$YPos; + for ($i=1;$i<sizeOf($ancestors)-1;$i++) { + for ($j=0;$j<$i; $j++) { + $TempYPos -=(0.8*$line_height); + $LeftOvers = $pdf->addTextWrap($Xpos+300,$TempYPos,300-$Left_Margin,$FontSize, ' '); + } + $LeftOvers = $pdf->addTextWrap($Xpos+300,$TempYPos,300-$Left_Margin,$FontSize, '|_'.$ancestors[$i]); } - echo '|_'.$ancestors[$i].'<br>'; + $LeftOvers = $pdf->addTextWrap($Xpos+380,$YPos,300-$Left_Margin,$FontSize, ConvertSQLDate($myrow['datepurchased'])); + $LeftOvers = $pdf->addTextWrap($Xpos+440,$YPos,55,$FontSize, number_format($myrow['cost'],0), 'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+495,$YPos,55,$FontSize, number_format($myrow['depn'],0), 'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+550,$YPos,50,$FontSize, number_format($myrow['cost']-$myrow['depn'],0), 'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+600,$YPos,55,$FontSize, number_format($myrow['cost'],0),'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+655,$YPos,55,$FontSize, number_format($InternalDepreciation,0),'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+710,$YPos,50,$FontSize, number_format($myrow['cost']-$InternalDepreciation,0),'right'); + $YPos =$TempYPos-(0.8*$line_height); + if ($YPos < $Bottom_Margin + $line_height){ + include('includes/PDFAssetRegisterHeader.inc'); + } + } else { + echo '<tr><td style="vertical-align:top">'.$myrow['id'].'</td>'; + echo '<td style="vertical-align:top">'.$myrow['stockid'].'</td>'; + echo '<td style="vertical-align:top">'.$myrow['longdescription'].'</td>'; + echo '<td style="vertical-align:top">'.$myrow['serialno'].'</td>'; + echo '<td>'.$myrow['locationdescription'].'<br>'; + for ($i=1;$i<sizeOf($ancestors)-1;$i++) { + for ($j=0;$j<$i; $j++) { + echo ' '; + } + echo '|_'.$ancestors[$i].'<br>'; + } + echo '</td><td style="vertical-align:top">'.ConvertSQLDate($myrow['datepurchased']).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['depn'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$myrow['depn'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($InternalDepreciation,2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$InternalDepreciation,2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['disposalvalue'],2).'</td></tr>'; } - echo '</td><td style="vertical-align:top">'.ConvertSQLDate($myrow['datepurchased']).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['depn'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$myrow['depn'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($InternalDepreciation,2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$InternalDepreciation,2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['disposalvalue'],2).'</td></tr>'; } } + + if (isset($_POST['pdf'])) { + $pdf->Output($_SESSION['DatabaseName'] . '_Asset Register_' . date('Y-m-d').'.pdf', 'I'); + exit; + } else { + echo '<input type=hidden name=fromDate value="'.$_POST['fromDate'].'">'; + echo '<input type=hidden name=toDate value='.$_POST['toDate'].'>'; + echo '<input type=hidden name=assetcategory value='.$_POST['assetcategory'].'>'; + echo '<input type=hidden name=assettype value='.$_POST['assettype'].'>'; + echo '<input type=hidden name=assetlocation value='.$_POST['assetlocation'].'>'; + echo '</table><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"></div></form>'; + } +} else { + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . + _('Search') . '" alt="">' . ' ' . $title; + $sql = "SELECT * FROM stockcategory WHERE stocktype='".'A'."'"; + $result = DB_query($sql,$db); + + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table>'; + echo '<tr><th>'._('Asset Category').'</th>'; + echo '<td><select name=assetcategory>'; + echo '<option value="%">'._('ALL').'</option>'; + while ($myrow=DB_fetch_array($result)) { + if (isset($_POST['assetcategory']) and $myrow['categoryid']==$_POST['assetcategory']) { + echo '<option selected value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; + } else { + echo '<option value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; + } + } + echo '</select></td></tr>'; + + $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; + $result = DB_query($sql,$db); + + echo '<tr><th>'._('Asset Location').'</th>'; + echo '<td><select name=assetlocation>'; + echo '<option value="All">'._('ALL').'</option>'; + while ($myrow=DB_fetch_array($result)) { + if (isset($_POST['assetlocation']) and $myrow['locationdescription']==$_POST['assetlocation']) { + echo '<option selected value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + } else { + echo '<option value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + } + } + echo '</select></td></tr>'; + + $sql = "SELECT stockid, description FROM stockmaster LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stocktype='A'"; + $result = DB_query($sql,$db); + + echo '<tr><th>'._('Asset Type').'</th>'; + echo '<td><select name=assettype>'; + echo '<option value="%">'._('ALL').'</option>'; + while ($myrow=DB_fetch_array($result)) { + if (isset($_POST['assettype']) and $myrow['stockid']==$_POST['assettype']) { + echo '<option selected value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; + } else { + echo '<option value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; + } + } + + echo '</select></td></tr>'; + + if (empty($_POST['fromDate'])) { + $_POST['fromDate']=date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); + } + if (empty($_POST['toDate'])) { + $_POST['toDate']=date($_SESSION['DefaultDateFormat']); + } + + //FULUSI CHANGE BELOW TO ADD TIME + echo '<tr><th>'._(' From Date')."</th><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. + "' name='fromDate' maxlength=10 size=11 value='".$_POST['fromDate']."'></td>"; + + echo '</tr>'; + echo '<tr> + <th>'._('To Date ')."</th> + <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. + "' name='toDate' maxlength=10 size=11 value='".$_POST['toDate']."'></td>"; + + echo '</tr>'; + //end of FULUSI STUFF + + echo '</table><br>'; + + echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"></div><br />'; + echo '<div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"></div>'; + + echo '</form>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-01 16:03:50 UTC (rev 3265) +++ trunk/doc/Change.log.html 2010-01-02 09:54:35 UTC (rev 3266) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>02/01/10 Tim: Allow pdf output of the asset register. <p>24/12/09 Tim: Move the purchase ordering printing parameters to a separate file for the form designer. <p>23/12/09 Tim: Rename rtl theme to remove the space. <p>19/12/09 Pak Ricard: TopItems.php - Improvements to the top sales items report. @@ -43,8 +44,8 @@ <p>17/11/09 Pak Ricard: TopItems.php - Correct typo preventing the correct loading of type of customers. <p>15/11/09 Javier: button_bg.png - quick menu silverwolf button background to follow style of theme <p>15/11/09 Javier: default.css - removed duplicated and restored overwritten classes after the synchronization -<p>15/11/09 Javier: Change.log.html - This file, partially corrected xhtml code and convert tag being text to entities -<p>15/11/09 Javier: default.css - Added in menu_group_item <p> css style to restore and even enhance previous <li> appearance +<p>15/11/09 Javier: Change.log.html - This file, partially corrected xhtml code and convert tag being text to entities +<p>15/11/09 Javier: default.css - Added in menu_group_item <p> css style to restore and even enhance previous <li> appearance <p>15/11/09 Javier: index.php - Complete correction of PhP and xhtml code to follow Zend and W3C standard rules <p>15/11/09 Beth Lesko: DateFunctions.inc - Correction for North American style dates <p>15/11/09 csrbusiness: api_salesorders.php - Correct date checking functions @@ -99,7 +100,7 @@ <p>09/11/09 Javier: CustomerReceipt.php - v1.45 Removed br at Line 783 from html table first column title. <p>09/11/09 Javier: upgrade3.11-3.12.sql - corrected syntax for consistency. <p>08/11/09 Gilles Deacur: SelectCustomer.php - Add in facility to search by customer address -<p>08/11/09 Phil: New DailySalesInquiry.php - show sales for a selected month - day by day with average sales per billing day and GP% - work sponsored by Manny Neri +<p>08/11/09 Phil: New DailySalesInquiry.php - show sales for a selected month - day by day with average sales per billing day and GP% - work sponsored by Manny Neri <p>07/11/09 Tim: update3.10-3.11.sql - Remove FOI config value as feature not in 3.11 <p>07/11/09 Tim: PrintCstTransPortrait.php - Correct $pdf->Output() call to show invoice without saving first <p>07/11/09 Tim: upgrade3.11-3.12.sql - Remove duplicated line and corrected syntax for consistency @@ -234,7 +235,7 @@ <p>08/10/09 Tim: RCFunctions.inc - Fix problem with database criteria statement <p>08/10/09 Tim: WorkOrderIssue.php - Allow for the selection of a date for the manual issue to work orders <p>08/10/09 Pak Ricard: Top sales items report -<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights +<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights <p>03/10/09 Tim: upgrade3.11-3.11.1 - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: upgrade3.11-3.12.sql - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: weberp-new.sql - Enlarge language field in www_users for utf8 codeset @@ -271,7 +272,7 @@ <p>08/10/09 Tim: RCFunctions.inc - Fix problem with database criteria statement <p>08/10/09 Tim: WorkOrderIssue.php - Allow for the selection of a date for the manual issue to work orders <p>08/10/09 Pak Ricard: Top sales items report -<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights +<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights <p>03/10/09 Tim: upgrade3.11-3.11.1 - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: upgrade3.11-3.12.sql - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: weberp-new.sql - Enlarge language field in www_users for utf8 codeset @@ -325,7 +326,7 @@ <p>28/08/09 David: BankAccounts.php - Correct sql syntax for insert statement <p>28/08/09 Tim: upgrade3.10-3.11.sql - Add comments for use with the upgrade script <p>28/08/09 Tim: Z_Upgrade_3.10-3.11.php - Change upgrade script to handle the case where some upgrades have already been done. -<p>26/08/09 Phil: Fix Shoops CustLoginSetup.php by populating the $ModuleList +<p>26/08/09 Phil: Fix Shoops CustLoginSetup.php by populating the $ModuleList <p>26/08/09 Phil: SelectCustomer.php ORDER BY clause doubled up (now fixed) following salesman login changes <p>26/08/09 Paul: StockCategories.php - Fixed missing closing > in html <p>24/08/09 Phil: Saleman login - modifications to session.inc SelectOrderItems.php SelectCustomer.php WWW_Users.php - added a new field to www_users for salesman login - when entering orders users with this restricted login will only be able to enter orders against the selected salesman (in WWW_Users.php). The user will also only be able to select customers for the selected salesman too. Note that if this user has access to salesanalysis then they will be analyse the sales of all customers @@ -338,7 +339,7 @@ <p>16/08/09 Tim: config.distrib.php - Add mysql port configuration <p>15/08/09 Tim: api_xml-rpc.php - Updates to stock adjustment function <p>15/08/09 Tim: api_stock.php - Updates to stock adjustment function -<p>15/08/09 Tim: Tax.php - Fix problem with conversion of PeriodEndDate +<p>15/08/09 Tim: Tax.php - Fix problem with conversion of PeriodEndDate <p>13/08/09 Tim: Add GetStockCategory() function to api <p>13/08/09 Harald Ringehahn: DateFunctions.inc - Update for all supported date formats <p>13/08/09 Harald Ringehahn: MiscFunctions.js - Update for all supported date formats @@ -413,7 +414,7 @@ <p>13/07/09 Murray: fixed some div centering for SelectCustomer.php <p>10/07/09 Tim: PO_SelectOSPurchOrder.php - Correct sql for mysql strict mode <p>10/07/09 Tim: PO_Header.php - Correction to goods received link -<p>10/07/09 Tim: weberp-new.sql - Remove unecessary data +<p>10/07/09 Tim: weberp-new.sql - Remove unecessary data <p>10/07/09 Tim: weberp-demo.sql - Remove unecessary data (audittrail), and add in 3.11 database changes <p>10/07/09 Tim: sql/mysql/upgrade3.10-3.11.sql - Make alteration to type for notes field in custnotes table <p>10/07/09 Tim: weberp-new.sql - Add in new database changes @@ -719,7 +720,7 @@ <p>03/05/09 Tim: PrintCustTransPortrait.php - Show line description even when on more than one line <p>3/5/09 Phil: Mess with the API to add $_SESSION['AllowedSecurityTokens'] array to provide role based authentication infrastructure to the api_php.php script - now just to add the checking $PageSecurity variable in_array for exposed functions - Tim to check!! <p>2/5/09 Phil: Added new configuration parameters to SystemParameters for DefaultFactoryLocation, AutoCreateWOs and FactoryManagerEmail as preparation for the automatic creation of works orders at the default factory advising the factory manager of the work orders created. -<p>/30/4/09 Phil: DeliveryDetails.php and RecurringSalesOrdersProcess.php made it so sales order headers use the order number from GetNextTransNo (30) as well as the sales order details - and avoiding the inconsistency issues where the auto-increment was out of sync with the systypes typeid=30 typeno +<p>/30/4/09 Phil: DeliveryDetails.php and RecurringSalesOrdersProcess.php made it so sales order headers use the order number from GetNextTransNo (30) as well as the sales order details - and avoiding the inconsistency issues where the auto-increment was out of sync with the systypes typeid=30 typeno <p>02/05/09 Tim: StockCategories.php - Correct form refresh to show changes in stock types when a category is being edited <p>30/4/09 Phil: Add field to Stocks.php for NextSerialNo - where > 0 and Serialised then automatically allocates serial numbers for quantities on new work orders - and work orders will not allow quantities to change once created <p>29/04/09 Tim: StockCategories.php - Change default behaviour to show Stock GL Code @@ -807,7 +808,7 @@ <p>23/03/09 Tim: SuppInvGRNs.php - Add in closing <font> tag and show the suppliers name correctly <p>23/03/09 Tim: StockCategories.php - Correctly check for uninitialised POST variables <p>23/03/09 Tim: SelectOrderItems.php - Correct html for xhtml compatability -<p>23/03/09 Tim: SalesGLPostings.php - Initial assignment of +<p>23/03/09 Tim: SalesGLPostings.php - Initial assignment of <p>23/03/09 Tim: PO_PDFPurchOrder.php - Show purchase order number correctly <p>23/03/09 Tim: PO_Items.php - Only show Purchase order text once <p>23/03/09 Tim: PO_Header.php - Show location address when the lookup address button is pushed @@ -876,7 +877,7 @@ <p>17/2/09 Tim: WorkOrderCosting.php - Correctly calculate cost variances <p>17/2/09 Tim: PrintCustTrans. - Update to correctly email invoice to customer <p>12/2/09 Matt Taylor: BOMInquiry.php BOMs.php Stocks.php WorkOrderReceive.php WorOrderEntry.php includes/SQL_CommonFunctions.inc Z_Im/ortStocks.php - modifications to allow Phantom Items - a new class of item type G - ghost (since P for Phantom could mean purchased). These allow sub-components to be included in the top level of a bill of material as a single line making BOMs simpler to follow and create - the components of ghosts/phantoms are exploded automatically on work order entry so the full requirements show against the work order. -<p>11/2/09 Moxx consulting: first commit of web based install UI +<p>11/2/09 Moxx consulting: first commit of web based install UI <p>10/2/09 Tim: weberp-new.sql - Update data for factor companies and debtortype. <p>10/2/09 Tim: WorkOrderCosting.php - Correct sql to correctly calculate costings. <p>09/2/09 Tim: CustomerAllocations.php - Remove commented code that was preventing gettext from working Added: trunk/includes/PDFAssetRegisterHeader.inc =================================================================== --- trunk/includes/PDFAssetRegisterHeader.inc (rev 0) +++ trunk/includes/PDFAssetRegisterHeader.inc 2010-01-02 09:54:35 UTC (rev 3266) @@ -0,0 +1,84 @@ +<?php +/* $Revision: 1.3 $ */ +/* $Id$*/ +/*PDF page header for price list report */ +if ($PageNumber>1){ + $pdf->newPage(); +} + +$FontSize=10; +$YPos= $Page_Height-$Top_Margin; +$XPos=0; +$pdf->addJpegFromFile($_SESSION['LogoFile'] ,$XPos+20,$YPos-50,0,60); + +if ($_POST['assetcategory']=='%') { + $category=_('All'); +} else { + $categorysql='SELECT categorydescription FROM stockcategory WHERE categoryid="'.$_POST['assetcategory'].'"'; + $categoryresult=DB_query($categorysql, $db); + $categoryrow=DB_fetch_array($categoryresult); + $category=$categoryrow[0]; +} + +if ($_POST['assettype']=='%') { + $type=_('All'); +} else { + $typesql='SELECT description FROM stockmaster WHERE stockid="'.$_POST['assettype'].'"'; + $typeresult=DB_query($typesql, $db); + $typerow=DB_fetch_array($typeresult); + $type=$typerow[0]; +} + +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos,240,$FontSize,$_SESSION['CompanyRecord']['coyname']); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*1),240,$FontSize, _('Asset Category ').' ' . $category ); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*2),240,$FontSize, _('Asset Location ').' ' . $_POST['assetlocation'] ); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*3),240,$FontSize, _('Asset Type').': ' . $type); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*4),240,$FontSize, _('Acquired After').': ' . $_POST['fromDate']); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*5),240,$FontSize, _('and Before').': ' . $_POST['toDate']); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*7),240,$FontSize, _('Page'). ' ' . $PageNumber); + +$YPos -= 60; + +$YPos -=2*$line_height; +//Note, this is ok for multilang as this is the value of a Select, text in option is different + +$YPos -=(2*$line_height); + +/*Draw a rectangle to put the headings in */ +$YTopLeft=$YPos+$line_height; +$pdf->line($Left_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos+$line_height); +$pdf->line($Left_Margin, $YPos+$line_height,$Left_Margin, $YPos- $line_height); +$pdf->line($Left_Margin, $YPos- $line_height,$Page_Width-$Right_Margin, $YPos- $line_height); +$pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos- $line_height); + +/*set up the headings */ +$FontSize=8; +$Xpos = $Left_Margin+1; +$LeftOvers = $pdf->addTextWrap($Xpos+440,$YPos,300-$Left_Margin,$FontSize, _('<--------------External Depreciation-------------->'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+605,$YPos,300-$Left_Margin,$FontSize, _('<--------------Internal Depreciation-------------->'), 'centre'); +$YPos -=(0.8*$line_height); +$LeftOvers = $pdf->addTextWrap($Xpos,$YPos,40,$FontSize, _('Asset ID'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+40,$YPos,300-$Left_Margin,$FontSize, _('Stock ID'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+80,$YPos,300-$Left_Margin,$FontSize, _('Description'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+250,$YPos,300-$Left_Margin,$FontSize, _('Serial No.'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+300,$YPos,300-$Left_Margin,$FontSize, _('Location'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+380,$YPos,300-$Left_Margin,$FontSize, _('Date Acquired'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+440,$YPos,55,$FontSize, _('Cost'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+495,$YPos,55,$FontSize, _('Depn'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+550,$YPos,50,$FontSize, _('NBV'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+600,$YPos,55,$FontSize, _('Cost'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+655,$YPos,55,$FontSize, _('Depn'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+710,$YPos,50,$FontSize, _('NBV'), 'right'); + + +$pdf->line($Left_Margin, $YTopLeft,$Page_Width-$Right_Margin, $YTopLeft); +$pdf->line($Left_Margin, $YTopLeft,$Left_Margin, $Bottom_Margin); +$pdf->line($Left_Margin, $Bottom_Margin,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$Page_Width-$Right_Margin, $YTopLeft); + +$FontSize=8; +$YPos -= (1.5 * $line_height); + +$PageNumber++; + +?> \ No newline at end of file Property changes on: trunk/includes/PDFAssetRegisterHeader.inc ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |