There is a big issue with invoices generated in some circumstances, for example on anonymous orders. Sometimes the line items are not included in this view and you just see the message "No line items found"!
No line items found invoice

But this is not a commerce_billy_mail.module or commerce_billy.module bug. It's a problem within the entity permission concept, that leads to this.

There are already some discussions about that, which I'd like to mention:
#2138157: sending invoice on "Completing the checkout process" event
http://www.drupalcommerce.org/discussions/976/no-line-items-found-email-...
#1811972: Commerce Line Item Anonymous Access Permissions
#1333174: Line Items missing from email

The solution (at least for my case) was mentioned in this issues: Disabling SQL Query Rewriting for the "Line Items" view. For example look here: https://drupal.org/comment/6063012#comment-6063012

The main problem is being discussed here and I think it's related:
#2155713: commerce_entity_access_query_alter can add crazy conditions if the base table does not match the entity type

Comments

erlendoos’s picture

As a workaround: allow users to view own orders.

shaneonabike’s picture

Status: Closed (duplicate) » Needs work

Could we add this to the frontpage or README instructions also. I was adjusting some settings to limit anonymous users and it was less than clear that by removing Anonymous folks to view their own orders that this no longer works (even for admins to generate the orders believe it or not)

anybody’s picture

Status: Needs work » Postponed (maintainer needs more info)

Please check if the problem still exists. It should be solved with this issue from my point of view:
#2155713: commerce_entity_access_query_alter can add crazy conditions if the base table does not match the entity type.

It should not be required to add this to documentation if it works cleanly from core.

aleksijohansson’s picture

Status: Postponed (maintainer needs more info) » Needs work

Latest version of Drupal Commerce and Commerce Billy Mail beta3 and the issue is still here. Adding permission for anonymous to view orders of the type solves the issue and the line items are shown on the invoice.

anybody’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#1541206: No line items in order for customer

Thanks a lot for your reply. This is not a problem of this module but of Drupal Views and Drupal Commerce.
We can't do anything about it here. Your workaround is correct.

See #1541206: No line items in order for customer for further links and details!