Fix error in Counter Sales where Invoice number and Period number not always being correct