I created a new Print Format for a Quotation/Estimate that includes the Item Group name instead of the Product Name or Description. We use this to provide a summary to our clients in a proposal format.
I have setup the system so that each Item is part of a child Item Group. For example, Bose Home Theater Speaker are classified as Speakers (a child of Multimedia). In some cases, there’s one more level. With the the current modified Quotation/Estimate, I’m able to show child in the Item Group, such as Speakers in the previous example.
However, I would like to have the total of each main Item Group (Multimedia in my above example) shown in the Estimate.
Is that possible? Or do you need more details to clarify my question.
Thank you.
–
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
Are you looking for a single common ancestor Item Group of all Items in that Quotation?
Can you give an example with more than one Item in the Quotation? Just one line item doesn't give a complete idea of the possibilities.
Thanks,
Anand.
On 27-Jun-2013, at 4:13 PM, taljishi <ta...@gmail.com> wrote:
I created a new Print Format for a Quotation/Estimate that includes the Item Group name instead of the Product Name or Description. We use this to provide a summary to our clients in a proposal format.
I have setup the system so that each Item is part of a child Item Group. For example, Bose Home Theater Speaker are classified as Speakers (a child of Multimedia). In some cases, there's one more level. With the the current modified Quotation/Estimate, I'm able to show child in the Item Group, such as Speakers in the previous example.
However, I would like to have the total of each main Item Group (Multimedia in my above example) shown in the Estimate.
Is that possible? Or do you need more details to clarify my question.
Thank you.
–
You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.
You will need to write custom server script which stores the value of required ancestral Item Group for each Item in a Custom Field of the Item table of Quotation.
Then, you can calculate totals in the Print Format directly.
If you need help with the code, please post your question on the developer forum.
Thanks,
Anand.
On 28-Jun-2013, at 3:52 PM, taljishi <ta...@gmail.com> wrote:
I made a mistake in my second example. It should be as follows:
1 Speakers $330 2 AV Cables $160
3 Remote Controls $60 4 AV Receivers $150 Total $700
–
You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.
I have a similar request. I need to get totals of item-groups, rather than items on the sales invoice. Though, I have created a new print format for the same and I have the item-group field showing in the Sales Invoice Items file, I am not sure how to break and total on the item groups. Can you please help in this regard?
Instead of showing the Item Group so many times, I would like a sub-total of the item-groups, which will show Consumable on one line and Services on the next line, so that my invoice will get shortened. My code is as follows:
@uma13 can you show a mockup of what you are trying to achieve?
Tip: Also format your code by adding enclosing it in 3 back-ticks: ``` - see how I edited your previous post.
Suggestion: you can add custom fields in your item table to calculate the sub-totals and print them in Jinja. templates are not designed for calculating stuff.
Thanks for the reply, Rushabh. Also, thanks for the tip on how to format the code. Will keep that in mind for the next time.
Actually, I can add custom field and create custom-scripts for calculating the sub-totals in the Items table but the challenge would come when the number of item groups are not fixed. I will have to keep creating more custom fields when the new item groups are added.
Anyways, will try it out as a temporary solution and see how it goes.
The code that you had used was just a part of the entire code and it was not working that time. I created my report and it is working fine but am not able to attach the code here. Can you give me your email ID or something where I can send you the code in a Word format?
@UmaG did you menage to do this without modifying files on the server? I’m a bit confused on how to integrate calculation done in a custom script to a print format… and if you are referring to server custom scripts or client custom scripts.
Thanks for the code Uma, this is the error I get when trying to use the print format I’ve created using your code, maybe someone can help me understand why it’s not working.
Traceback (most recent call last):
File “/home/frappe/benches/bench-2017-02-27/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/frappe/benches/bench-2017-02-27/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/benches/bench-2017-02-27/apps/frappe/frappe/handler.py”, line 40, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/benches/bench-2017-02-27/apps/frappe/frappe/init.py”, line 897, in call
return fn(*args, **newargs)
File “/home/frappe/benches/bench-2017-02-27/apps/frappe/frappe/www/print.py”, line 181, in get_html_and_style
no_letterhead=no_letterhead, trigger_print=trigger_print),
File “/home/frappe/benches/bench-2017-02-27/apps/frappe/frappe/www/print.py”, line 152, in get_html
html = template.render(args, filters={“len”: len})
File “/home/frappe/benches/bench-2017-02-27/env/lib/python2.7/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe/benches/bench-2017-02-27/env/lib/python2.7/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "