how to optionally sum multiple has many - Gadget Developers