Cross border EU shipments VAT

A fulfilment house is shipping orders from the UK.  These orders are being collected from various websites, each based in different countries, for a company based in France but VAT registered in various countries.

This leads to a possible scenario of:

Order taken on Danish website

Shipped from UK

Delivered to German customer

 

Company is VAT registered in all 3 countries

 

Assuming customer is not VAT registered,  the VAT registration number of which country does the invoice show and the VAT rate of which country applies?