Closed (won't fix)
Project:
Storm
Version:
6.x-2.x-dev
Component:
Storm Invoice
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
7 Mar 2010 at 21:25 UTC
Updated:
25 Jul 2011 at 18:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
francewhoaThe below mockup invoice-html-view.png shows the final expected result. The optional image logo is display at the top and the customized title under it. This would be the invoice HTML view at
width="100%">
/storm/invoice/report/*/html/enrel="nofollow">
The mockups before.png and after.png show the invoice configuration screen at
/node/*/edit. Looking at below after.png notice the two new sections: Invoice image logo settings and Invoice title:. The Invoice image logo settings is heavily inspired from Drupal core theme settings screen atadmin/build/themes/settings/garland. Maybe some of its code could be re-use. What do you thing?rel="nofollow">
width="100%">
Both new features would be optional. So it matches everybody needs. If the ckeck box Use the logo is uncheck then no logo image would not display. Same for the field Invoice title, if empty then it would not display.
Comment #2
squ1rr3l commented+1
Comment #3
francewhoaIn second thought maybe the invoice configuration screen (after.png) should go under
/admin/settings/storm/invoice. For two reasons first this location seems more intuitive to find. I mean all invoice configurations would be on the same page. And second, once this configuration is done it would be done for all invoices. What do you think?Comment #4
tchurch commented+1
I'm looking for a general way of customising the html and pdf invoice layouts/fields and this sounds good.
Comment #5
juliangb commentedDefinitely go for the admin settings instead of the node form.
Any volunteers to code it?
Comment #6
fxarte commentedOne suggestion,
Why not instead using templates. That way it would allow to fully customize the output?
Comment #7
tchurch commentedI was thinking about templates too.
1) Convert the html and pdf invoices into standard templates files OR store the code for these pages in the DB.
2) Add admin fields for logo, name, address of company (or take it from the organisation records flagged as "myorg).
I'm going to play with this and see whether a template file or DB variable is better.
Comment #8
tchurch commentedOK. I've played with the code and extracted the code for creating the html invoice into a separate file and created a new variable (editable from the admin page) for the location.
I can do the same for the pdf too.
This then means that someone can create their own template file, in their own location in the website (not under the storm directory if required) and change the code.
If this is OK, I'll go ahead and continue.
We can then work on our own invoice templates without editing the main code.
Comment #9
juliangb commentedHang on, i'm sure these are all passed through theme functions anyway?
That means, if you can already override them...
Comment #10
tchurch commentedI noticed that (from the names of the functions).
The thinng I'm not sure about is this:
If you create a function called (e.g.) garland_storminvoice_report_html in the theme, it's restricted to that theme only (I think; correct me if wrong).
I was thinking about separating the parts. That way people could develop templates and share them around easily.
I don't mind either way.
I do have a customer who wants be to re-design his invoice layout but I'm waiting on the direction of this issue before I decide how to do it.
Comment #11
juliangb commentedWe should be able to use something like storminvoice-report-html.tpl.php too.
We might need to make a few changes, but it'd be better to do that way (the "drupal way") than use a setting to control which file to use.
Comment #12
tchurch commentedI like the idea although this is moving into an area I haven't really looked at yet (I'm willing to learn and help where I can).
If it was done this way, the current html and pdf templates could be moved into tpl.php files and overwritten by a copy (with the same name) in another directory higher in the Hierarchy.
That way we wouldn't need a variable.
Like you say, it might need a few changes. Like I say, I'm getting a bit out of my current zone of Drupal/Storm knowledge.
Comment #13
francewhoa+1 for doing it the Drupal way with template file(s). Being able to override almost everything in Drupal is awesome.
I'm not a coder but would be happy to contribute patch testing. Any volunteer for a patch?
Comment #14
tchurch commentedI will try with this one. I have to make a customised invoice layout anyway and this would be of benefit.
Comment #15
francewhoaGreat. Thanks tchurch :)
Comment #16
mp commented+1 invoice with template files which can be styled
Comment #17
JGonzalez commented+1 for invoice templates that allow much more customization.
NOTE: Should we change title of request to "Customizable invoice templates" or something similar?
Comment #18
tchurch commentedTitle changed.
Comment #19
lastdeadmouse commentedExactly what I want! +1
Comment #20
JGonzalez commentedThis shouldn't be to difficult to do I wouldn't think.
An implementation of hook_theme would allow us to create a base .tpl file within the module, that can be easily overridden in the users theme folder, although we would need to pass the arguments, and also preprocess the vars first.
But don't quote me on this ;-)
Comment #21
hlan commented+1 subscribing
Comment #22
Wolfke2800 commentedAny updates on the customizable invoices? Looking forward to try it :)
Comment #23
tchurch commentedCurrently there's no timescale at the moment for this feature. I've been working on other fixes and features and also have been on holiday.
Now I'm back I'll look over all my issues and update them.
Comment #24
NikaDevs commentedAre somebody has success with using
_preprocess_storm_report(&$variables) for overriding the variables?
I'm tried this way to change the $footer variable, but this PREPROCESS function didn't called!
Comment #25
juliangb commentedThis is a feature request.
Comment #26
Wolfke2800 commentedLooking forward to this feature :)
Do you have an idea if/when this will be available?
Comment #27
tchurch commentedSorry, I've been working on other things.
At the moment there's no real timescale for this one. I still need to look at the hook_theme function (mentioned in #20) as I'm not too familiar with this yet.
I will try.
Comment #28
tchurch commentedJust an update...
I might be getting somewhere. I think I've got the html invoice split.
I'll upload a 1st patch (html only) soon.
Now working on the PDF.
Comment #29
tchurch commentedI've uploaded 2 files:
A patch and a new tpl file.
The tpl file goes into the storminvoice directory. If you want to overwrite it, you can copy it into your theme directory and change it (then flush cache).
This is not the final patch. I still have to remove old code and comments but I'll do that after people are happy with it.
I'm working on the PDF side now.
Can someone look at it and give feedback before I get too far?
Thanks.
Comment #30
juliangb commentedLooks like the right approach, but we need to separate the html in the template from php processing in a separate function. Really, the only php we want in the template is print(), although we may also need a couple of loops.
Comment #31
juliangb commentedAlso, to make it easier for yourself, I suggest you commit a blank .tpl.php file to make it easier to diff it all at once.
Comment #32
tchurch commentedI'm not sure if this is what you were talking about in #30 but I've split the variable setting into the main file, leaving only the main variables for the page in the tpl file.
This isn't a final patch as I still need to sort out the PDF file template and also remove any old code (currently just commented out).
Comments?
Comment #33
juliangb commentedYes almost, just perhaps the variable setting could be in a non-theme function (I realise this is different to how it is at the moment).
Comment #34
juliangb commentedMoving this to 2.x branch.
Comment #35
juliangb commented#32: 735418_2.patch queued for re-testing.
Comment #36
JoshuaM commentedCan this be tested yet by non-programmers yet? The 2.x-dev has an empty tpl file that I'm not sure what to do with. I see where there are populated versions in this thread... This is my only hold-up from moving to this invoicing system.
Thanks for the wonderful work everyone :)
Comment #37
juliangb commented#32: 735418_2.patch queued for re-testing.
Comment #38
juliangb commented#1159022: Reimplement pdf invoices using Print module would solve this issue too.
Comment #39
juliangb commentedWon't fix for this as an individual issue - but I intend to work on #1159022: Reimplement pdf invoices using Print module, which should enable this functionality.
Comment #40
Andrwryn commentedThanks!
-andrew
http://nirvaha.com/billing-statements.html