Try ERPNext Buy Support Partners Foundation Foundation Members

Add different fields to select dropdown

Hello everyone,
I am trying to add available stock of each batch number in dropdown by client side custom script.
i have written following script for filter batch number. But further i need to fetch available qty of each batch…

    frappe.ui.form.on('Production Plan', {
    	refresh(frm) {
    		// your code here
    		cur_frm.set_query("batch_no", "mr_items", function(doc, cdt, cdn) {
    	var d = locals[cdt][cdn];
    	return{
    		filters: [
    	
    			['Item', '=', d.item_code]
    	
    		]
    	}
    });

    	}
    }) 

Any help.
Thanks