In Sales Invoice Print format , i’m trying to fetch Delivery Note details for each Sales Invoice item but its not working!
Any changes required in below code:
{% set delivery_note_data = frappe.get_doc({“doctype”:“Delivery Note Item”, “item_code”: “R1002”}) %}
{% set delivery_note_data = frappe.get_doc(“Delivery Note Item”, “R1002”) %}
@ragh The frappe.get_doc has a syntax as frappe.get_doc("Delivery Note Item", "name")
I think there is not going to be any delivery note item with name “R1002” since its a child table of Delivery note and the name for this table are hash automatically generated and hence you are getting this error.
Well I am zero at the javascript syntax so I can probably give you an idea only, also item_code is going to be not very specific since there could be rows with same item code as well just bear in mind as well.
Also I am just enclosing a part of my print format code for Sales Invoice where doc.items would be the table name for Sales Invoice item, I hope this gives you an idea
Thanks for your quickly response @adityaduggal This code will work for only to iterate Sales Invoice Doc items.
Scenario is: For each Invoice item, i should fetch/check Delivery Note Item details.
So, any suggestions for that?