Refactored the totals handling and added CoD totals to creditmemos and guest orders