MySQL query to retrieve sales by location

I have this query in MySQL for retrieving sales data from Dolibarr MySQL database:
What its doing is to link Customer Orders with shipping to get sales by location-:
SELECT DISTINCT c.date_commande as c_date_commande, c.ref, p.ref as p_ref, p.label as p_label, cd.total_ht as cd_total_ht, cd.total_ttc as cd_total_ttc, w.label
FROM llx_societe as s
LEFT JOIN llx_c_departements as d ON s.fk_departement = d.rowid
LEFT JOIN llx_c_country as co ON s.fk_pays = co.rowid, llx_commande as c
left join llx_element_element as el on c.rowid = el.fk_source
left join llx_expedition as e on e.rowid = el.fk_target
left join llx_expeditiondet as sd on sd.fk_expedition = e.rowid
left join llx_entrepot w on w.rowid = sd.fk_entrepot
LEFT JOIN llx_projet as pj ON c.fk_projet = pj.rowid
LEFT JOIN llx_user as uc ON c.fk_user_author = uc.rowid
LEFT JOIN llx_user as uv ON c.fk_user_valid = uv.rowid
LEFT JOIN llx_commande_extrafields as extra ON c.rowid = extra.fk_object , llx_commandedet as cd
LEFT JOIN llx_commandedet_extrafields as extra2 on cd.rowid = extra2.fk_object
LEFT JOIN llx_product as p on cd.fk_product = p.rowid
LEFT JOIN llx_product_extrafields as extra3 on p.rowid = extra3.fk_object
WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande AND c.entity IN (1)
order by p.label

It returns duplicate customer orders can anyone help? What would be a better query

Here is a SQL Query that does this: It basically retreives Customer orders by location:
SELECT DISTINCT c.date_commande as Date, c.ref as Order_No, p.ref as Item_Code, p.label as Item_Description, cd.qty as QTY, cd.total_ht as Amount, cd.total_ttc as Amount_VAT, w.label as Warehouse
FROM llx_societe as s
LEFT JOIN llx_c_departements as d ON s.fk_departement = d.rowid
LEFT JOIN llx_c_country as co ON s.fk_pays = co.rowid, llx_commande as c
left join llx_element_element as el on c.rowid = el.fk_source
join llx_expedition as e on e.rowid = el.fk_target
left join llx_expeditiondet as sd on sd.fk_expedition = e.rowid
right join llx_entrepot w on w.rowid = sd.fk_entrepot
LEFT JOIN llx_projet as pj ON c.fk_projet = pj.rowid
LEFT JOIN llx_user as uc ON c.fk_user_author = uc.rowid
LEFT JOIN llx_user as uv ON c.fk_user_valid = uv.rowid
LEFT JOIN llx_commande_extrafields as extra ON c.rowid = extra.fk_object , llx_commandedet as cd
LEFT JOIN llx_commandedet_extrafields as extra2 on cd.rowid = extra2.fk_object
LEFT JOIN llx_product as p on cd.fk_product = p.rowid
LEFT JOIN llx_product_extrafields as extra3 on p.rowid = extra3.fk_object
WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande AND c.entity IN (1)
and el.sourcetype = ‘commande’ and el.targettype = ‘shipping’
order by c.ref desc

Hope this helps someone