Child Table Calculations

Hi @SonalD,

Please apply/try it.

frappe.ui.form.on('Stock Entry',  {
    validate: function(frm) {
        var ttl_qty1 = 0;
        var ttl_qty2 = 0;
        var ttl_qty3 = 0;
        var ttl_qty4 = 0;
        var ttl_qty5 = 0;
        $.each(frm.doc.items,  function(i,  d) {
            if (d.item_group == "Unprocessed Seed") {
                ttl_qty1 += flt(d.qty);
            } else if (d.item_group == "Processed Seed") {
                ttl_qty2 += flt(d.qty);
            } else if (d.item_group == "Remnant Seed") {
                ttl_qty3 += flt(d.qty);
            } else if (d.item_group == "Treated Seed") {
                ttl_qty4 += flt(d.qty);
            } else {
                ttl_qty5 += flt(d.qty);
            }
        });
        frm.doc.total_unprocessed_seed = ttl_qty1;
        frm.doc.total_processed_seed = ttl_qty2;
        frm.doc.total_reminant_seed = ttl_qty3;
        frm.doc.total_treated_seed = ttl_qty4;
        frm.doc.total_untreated_seed = ttl_qty5;
    } 
});

Thank You!