[#55886754] consider the max borrowable quantity from template.inventory_pools instead of the sum of them