When included reference to branch in the CID for a company with multi-branch support in the payment settings of Customer Ledger Preferences (AR101000). The generated Payment Reference Nbr in Sales Invoice screen (AR301000) contained the internal id for branch instead of the CD (visible ID). This has now been fixed.