I have added a UDF of Number of pieces in Stock item and also in Vouchers. How to get Closing stock for Number of pieces in Stock Summary ?
Find the collection which is used in the Stock Summary and Fetch the UDF you created. Add Parts, lines or fields to the Stock Summary and use the fetched Method as per your needs.