POS paid amount calculation and patch to fix pos outstanding