Added code for sales credit auto-calc