Fixed invoice batch creation

Fixes #1126