For the bill reference to be generated, enable the configuration ‘Use default Bill-wise details for Bill Allocation’ in the Sales voucher.