developer10 Posted January 8, 2013 Share Posted January 8, 2013 Hi, I'm trying to customize the invoice PDF (invoicepdf.tpl). Everything is going OK except for the fact I'm unable to break the $item['description'] line items. Currently, it is in the following form: 6 x MyProductGroup - MyProductName @ 2.75(price) (also the discount rate will be shown if present) What I want to achieve is to break all of those grouped items so I can create additional columns, for example: Item No. Description (product name only) Quantity Discount rate Total amount or very similar to this How can this be achieved? I was looking at the quotepdf.tpl and saw there separate items like $item['unitprice'], $item['discount'], etc.. But when I try to apply those to invoicepdf.tpl, PDF fails to generate. Any suggestions? Thanks 0 Quote Link to comment Share on other sites More sharing options...
MemoryX2 Posted January 9, 2013 Share Posted January 9, 2013 (edited) I don't know if this is any help or not, but the description would be categorized as a string. (At least I think) Anyway, take a look at this page: http://www.tcpdf.org/examples.php It has examples of the available code as well as doc's. That is the engine used to generate pdf's. Kyle Edited January 9, 2013 by MemoryX2 0 Quote Link to comment Share on other sites More sharing options...
developer10 Posted January 9, 2013 Author Share Posted January 9, 2013 I don't know if this is any help or not, but the description would be categorized as a string. (At least I think) Anyway, take a look at this page: http://www.tcpdf.org/examples.php It has examples of the available code as well as doc's. That is the engine used to generate pdf's. Kyle Yes, it indeed seems that the invoice description is stored as a string (i looked it up directly in the database). I'm thinking about breaking up the string on certain criteria but not sure if that can be achieved correctly. Too bad there's no other option for this. In my country it's not very convenient to have such an item on the invoice. My ex hosting provider is using WHMCS. When I received the final invoice to my home address, I noticed they have their invoice in the form I want. However, when I log into my account with them (it's still active) and I click "View invoice" I notice the description item is not broke into separate items. That leads me to conclusion they probably manually make final invoices that are to be mailed to customers. It does, however, have the "PAID" title at the top, as with WHMCS invoices. 0 Quote Link to comment Share on other sites More sharing options...
MemoryX2 Posted January 9, 2013 Share Posted January 9, 2013 Yes, it indeed seems that the invoice description is stored as a string (i looked it up directly in the database). I'm thinking about breaking up the string on certain criteria but not sure if that can be achieved correctly. Too bad there's no other option for this. In my country it's not very convenient to have such an item on the invoice. My ex hosting provider is using WHMCS. When I received the final invoice to my home address, I noticed they have their invoice in the form I want. However, when I log into my account with them (it's still active) and I click "View invoice" I notice the description item is not broke into separate items. That leads me to conclusion they probably manually make final invoices that are to be mailed to customers. It does, however, have the "PAID" title at the top, as with WHMCS invoices. You could break the string up after each space then list each item that way. Not sure if this is what you are looking for but it is at least an idea. 0 Quote Link to comment Share on other sites More sharing options...
developer10 Posted January 9, 2013 Author Share Posted January 9, 2013 You could break the string up after each space then list each item that way. Not sure if this is what you are looking for but it is at least an idea. Spaces arent a good fit because I cant predict what number of words will be there in a descriptions (product group and product name are variable). But I think there must be something useful. I'll post back if I find a good solution so others can benefit from it too. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.