copy from version 1
convert find_item_index_with_barcode into find_item_with_barcode
convert simple for-exp into forEach
convert for-if into forEach-filter
convert calc sum into reduce
convert generate_output into reduce & filter
remove a var in func 'generate_output_summary'