vtiger Forum Index vtiger
The Honest Open Source CRM
 

customizing PDF for Sales Order
Click here to go to the original topic

 
       vtiger Forum Index -> Feature Requests - 5.0.2
Previous topic :: Next topic  
Author Message
sharok



Joined: 23 Jun 2007
Posts: 17

Posted: Thu Nov 22, 2007 12:47 pm    Post subject: customizing PDF for Sales Order  

Hi all,

I'm trying to customize the footer of my PDF in Sales Order and I have a problem. I really appreciate if any one can help me please. I've added the following code to modules\SalesOrder\pdf_templates\Footer.php file:

// ************** Begin company information *****************

// x,y,width
// draw a broken line
$lineData=array("10","256","190");
$pdf->drawLine($lineData);

$companyBlockPositions=array( "10","252","49" );
$companyText=$current_module_strings['LBL_VISIT_ADDRESS']."\n".$org_address."\n".$org_city."\n".$org_state."\n".$org_code;
$pdf->addTextFooter( $org_name, $companyText ,$companyBlockPositions );


$communicationPositions=array( "50","252","45" );
$communicationText=$current_module_strings['LBL_COMMUNICATION']."\n".$current_module_strings['LBL_LIST_PHONE'].": ".$org_phone."\n".$current_module_strings['LBL_LIST_FAX']."".$org_fax."\n".$current_module_strings['LBL_LIST_EMAIL_ADDRESS']." ".$org_email;
$pdf->addTextFooter( "", $communicationText ,$communicationPositions);

$communicationPositions=array( "100","252","45" );
$communicationText=$current_module_strings['LBL_LEGAL']."\n".$current_module_strings['LBL_LIST_VATNR']." ".$org_vatnr."\n".$current_module_strings['LBL_LIST_REG_OFFICE']." ".$org_registr_office."\n".$current_module_strings['LBL_LIST_REG_NUMBER']." ".$org_registr_number;
$pdf->addTextFooter( "", $communicationText ,$communicationPositions);

//Symply put this part as comment if you don't need this information.
$communicationPositions=array( "150","252","45" );
$communicationText="";
//$communicationText=$org_managertitle."\n".$org_managername."\n".;
$bankText=$current_module_strings['LBL_BANK']."\n".$current_module_strings['LBL_LIST_BANKNAME'].$org_bankname."\n".$current_module_strings['LBL_LIST_BANKACCNUMBER'].$org_bankaccnumber."\n".$current_module_strings['LBL_LIST_BANKACCPREFIX']." ".$org_bankaccprefix;
$pdf->addTextFooter( "", $communicationText.$bankText ,$communicationPositions);


// ************** End company information *******************

but when I click on 'Export To PDF' in my Sale Order I receive the following error:

Fatal error: Call to undefined method PDF::addTextFooter() in C:\Program Files\vtigercrm5\apache\htdocs\vtigerCRM\modules\SalesOrder\pdf_templates\footer.php on line 41

could any one help me please on how to resolve the problem?
thank you very much in advance,

cheers!
Sharok
Back to top  
andyrav



Joined: 29 Mar 2006
Posts: 82

Posted: Thu Nov 22, 2007 10:13 pm    Post subject: Re: customizing PDF for Sales Order  

hi sharok
I added all that code myself you can not use it in version 5, Plus you dont have the information in your database now you have upgraded it and there is no php code in for the setup for communitication.

You need to forget about using any code in version 4. like i have said before you can not use it in version 5

you will have to rewrite the code your self or get paul to pay me to do it.

fancy a beers again soon?
Back to top  
justinee



Joined: 20 Nov 2007
Posts: 17

Posted: Fri Nov 23, 2007 3:12 pm    Post subject: Re: customizing PDF for Sales Order  

check the pdf.php to see whether there's the addTextFooter() function.

if there's no, just as one if you want to use it.

copy some add*****block function, change the name, and do some modify.

good luck.
Back to top  
sharok



Joined: 23 Jun 2007
Posts: 17

Posted: Fri Nov 23, 2007 3:56 pm    Post subject: Re: customizing PDF for Sales Order  

thank you Andy,

I'm eagerly waiting for another appointment!!
Back to top  
sharok



Joined: 23 Jun 2007
Posts: 17

Posted: Fri Nov 23, 2007 4:00 pm    Post subject: Re: customizing PDF for Sales Order  

Hi justinee,

thank you very much for your kindly reply. no there is no such function in pdf.php. I've copied the codes to footer.php from version 4 to our new version 5.0.3. I really appreciate if you can help me how I can get it working as I'm a rookie in Vtiger and PHP.
thank you very much in advance!
Sharok
Back to top  
justinee



Joined: 20 Nov 2007
Posts: 17

Posted: Fri Nov 23, 2007 5:14 pm    Post subject: Re: customizing PDF for Sales Order  

As I said,

if there's no such function, just add one if you want to use it.

how to?

go to pdf.php,

copy some code from add*****block function,
change the name to what you want,
and do some modify.

good luck
Back to top  
sharok



Joined: 23 Jun 2007
Posts: 17

Posted: Sat Nov 24, 2007 7:45 pm    Post subject: Re: customizing PDF for Sales Order  

Thank you very much, justinee!
You've been of great help. I managed to get it working using your advice. Can I ask another question, please? Where & how can I change the height & width of the tables inside the Sales Order PDF?
Thank u very much for your all kindly help.
Sharok
Back to top  
 
       vtiger Forum Index -> Feature Requests - 5.0.2
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group