BUGFIX: use FannieDB instead of invalid global ref
BUGFIX: verify array index exists
WFC BUGFIX: don't count patronage rebate discount twice