I don't like the present invoice layout and it does not allow much tweaking. The only thing I can change I should not change, namely the line items. If the rest is outside the view and is hard-coded, so I cannot easily add the extra field with the tax registration number that is obligatory in this country.
From alpha1 I still have an invoice view (see attached) that is adaptable and I had it nicely laid out, but unfortunately the alpha2 invoice list cannot be customized to change the link to my old view (see my other feature request).
Most likely it is better to wait and stay with alpha1 for a while until these limitations are fixed and just go with the previous solution of an extra column in the Order table view where the invoice numbers appear when available (see other attached). This seems all more compact and clearly relate the invoice with the order.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | views.txt | 27.7 KB | marcoka |
| User's Order tab view with invoice link. | 19.8 KB | ñull | |
| Invoice view | 27.62 KB | ñull |
Comments
Comment #1
elmotri commented+1 This would make it easy to generate PDFs from the Invoice view with views_pdf.
Comment #2
Slacker commented+1 would love this functionality
Comment #3
CanOne commentedThank you very much for that!
Just tried it myself couple of minutes ago but couldnt get the billing data.
How do you got the relationship "(Order associated to the invoice) Commerce Order: Billing information" into the view?
And another question, what is the field_nif for?
I just deleted it before importing the view cause otherwise i get errors.
But maybe i should create such a field, if i know what it is for :)
*EDIT: Ah okay, just googled nif! So its the spanish tax number right?
Kay dont need it at the moment :D
Cheers
Can
Comment #4
brianlp commentedSame here. I need to be able to add the leagally required information like tax number, company name and address etc.
Comment #5
marcoka commentedat the basic state the invoices generated are not "according to law" in most of the countries :D
so customizing would be needed if anyone really want to use it for a real shop.
The main question
i can do a view with all stuff needed, adding all fields i want using a path like /user/%/incoice/%
first % is uid second is order-id.
the order id itself is unique and so can be used as invoice number, you can add creation date too and create invoice numbers like
(this is a good practice because you know which invoice matches which order from the invoice id)
after this you have a pretty invoice view you can modify like you want and even use views_pdf or the print module to generate pdfs?
my question now is what is the advantage of this module compared to a view only like i described.
Advantageof entity
If the invoice date is important and is NOT the date of the day when the customer bought the product. meaning invoice date is 6.6.2012 and date of order is 1.1.2012. When you use a view only (without commerce_invoice) this is not possible
Comment #6
ñull commentedYes e-anima, the only reason I use Commerce Invoice is for the pro-forma and final invoice distinction. The invoice becomes final when paid and in my country it should have consecutive numbering. The order number is the same as the cart id and so there are even unused order numbers which is totally unacceptable for local tax laws.
Comment #7
ñull commentedFor those that have used my view, I now have an issue with it myself that I don't seem to be able to solve easily. I can only access it as administrator (user id 1). I tried to change several view permissions of the authenticated user, but nothing helps. It is displaying the view, because the header text is visible, but somehow all invoice information is inaccessible for anonymous users.
Comment #8
ñull commentedMeanwhile I found out what is causing it to be inaccessible for authenticated users. Apparently it all depends on the "Administer orders" permission. When I enable it for authenticated users, then they are allowed to see the invoice data, but that gives also access to the complete order list and information on all client orders.
The question is why it depends on this permission? Shouldn't the view be overriding that?
Comment #9
marcoka commentedi now created a view myself, inspired by yours and overwrote the path that is linked from the invoice tab. so i have my own view to customize with all stuff.
@null, i am located in germany and thought that the numbering has to be without consecutive numbering. turns out law only says "unique" here. but i prefer consecutive numbering too and thats why i use this here too.
and the advantage when using views is that the print module or the views_pdf module can be used to make pdfs.
Comment #10
ñull commentedDid you manage to make it accessible for the authenticated user? Can you share the view here? At the moment I am trying to circumvent that problem without much success.
Comment #11
brianlp commentedI'd also be highly interested in that.
Comment #12
marcoka commentedim checking what null said, wait a minute :)
ok damn i know what you mean. i have the same problem
well lol...this explains it: http://www.root.artwaves.de/screensnapr/1339759174-9NPkxe.jpg
if a user is not admin there is always uid 0, thats wrong. i am checking the rule
Comment #13
marcoka commentedhaha, fixed.
be sure to SET the order access permissions, otherwise well order data that is needed for invoice is not avaliable
image: http://www.root.artwaves.de/screensnapr/1339759610-PYcQtL.jpg
with that your view should work again. if you still want mine tell me again.
Comment #14
ñull commentedyes please share your view here too. Mine still has the same issue despite the extra permissions.
Comment #15
marcoka commentedmy view
Comment #16
marcoka commentedComment #17
Elementica commentedI'd like to know how invoice's layout could be customized... views could be a solution, but can it be achieved via standard templates?
Comment #18
ñull commentede-anima, sorry to bother you again, but the view you shared was the list of invoices, not the invoice view itself.
Comment #19
silkogelman commentedI'm for having it Views based too.
That way we can generate PDF invoices together with the views_pdf module.
Comment #20
marcoka commenteds1l you can also just use the print module to generate a pdf. just style the page with css and print. done. look great
Comment #21
silkogelman commentedThanks, I'm aware of the print module.
Views (and Views PDF) lets me do customization through a neat UI.
Comment #22
c-logemannThe feature for building "invoice PDFs" is not needed because it can be done with views_pdf or the print module as described above. So first of all this is a "support request" and I think we can close this issue. I think some information about this should be placed in the documentation. I changed the title so this issue can better be found as part of documentation.
Comment #23
c-logemannfix the title
Comment #24
c-logemannclose the issue
Comment #25
dready2011 commentedI succesfully created a view for the invoice as well by importing the view from this post.
But what I would like to achieve as well, is that the output of this view is shown if the (admin/shopowner) user clicks on the invoice link that is under store/orders (/admin/commerce/orders). The link is something like
admin/commerce/orders/1034/invoice
where the parameter is the orderID. But the view from above takes an invoice ID as a parameter. I couldn't figure out how to change the view to take an order-ID as parameter, or use something like URL-Redirects...
any ideas on how to do this?
Comment #26
ibuildit commentedThis works in alpha3!