Client/Server Commands to pull items from Child Table (Taxes and Charges)

Hi all I’m trying to modify my print format document for quotations and purchase orders by adding a list of all the taxes and charges.

I know I can get the total taxes and charges from doc.total_taxes_and_charges, but how would I grab out the elements from the child table.

Something like this makes sense to me. I guess I’m unsure of how to target child tables.

{%- for row in doc.taxes_and_charges -%}
{{row.get_formatted(“account_head”,doc) + " - " + row.get_formatted(“total”,doc)}}
{%- endfor -%}


Looking at the schema I can see that the “table” called “Sales Taxes and Charges” has a schema name “taxes”.

So doc.taxes is the child table ?

Am I on the right track here, any nuance or bonus commands I should know about?

To investigate this sort of question I immediately resort to using Chrome Developer tools.

So, for example, you’d create a Purchase Order client script with a before_save event handler containing console logging lines:

const before_save = () => {
    const event = "before_save";
    console.log(`########################## -->| ${event} |<-- ############################ ${this.frm.docname}`);
    console.dir(this.frm.doc);

You can then use the console log pane of the Chrome Developer Tools to inspect every element of your doc.