I have created product bundles for items. When I create a sales order and a sales invoice, the product bundle is added to those. However, in the invoice I want to print actual product names that are in a product bundle. For this I thought I could use ‘packed_items’ but not sure how to edit invoice format to do this.
Example scenario,
Let’s say we have three products
- Product A
- Product B
- Product C
I create a product bundle named ‘New Product Bundle’ by adding 1 quantity each from above products.
Create a sales order and create a sales invoice through SO, by adding 2 quantity of ‘New Product Bundle’
Now when I print the invoice, I can see that the ‘New Product Bundle’ is shown in the invoice with a quantity of 2.
Instead of showing ‘New Product Bundle’ in the invoice print format, I want to show the actual products which were associated with it.
I added following code to custom html but it is showing nothing,
{%- for item in doc.packed_items -%}
Keep the packing items in a separate table, currently you are adding the packing items into the sales invoice items.
Add below code after the sales invoice items table
I added above code external to the invoice item table and it is not still showing.
My requirement is to print all the items of the bundle in the invoice. Even if I get packed items printed, I will need a way to get quantity and unit price of each item. Is there a way that I can query these information and print in the invoice.
For quantity use: i.qty
for rate use : frappe.db.get_value(‘Item Price’, {‘item_code’: i.item_code, ‘price_list’: doc.selling_price_list}, ‘price_list_rate’)
I will be having lot of other question regarding these. Is there any documentation related to this where I can read and do my homework before asking questions on the forum?