diff --git a/REST/functions.php b/REST/functions.php index 88c1d08d..f5286d70 100644 --- a/REST/functions.php +++ b/REST/functions.php @@ -339,10 +339,12 @@ function createCSVReports() END AS group_ks, GROUP_CONCAT(c.name ORDER BY cb.position SEPARATOR ' | ') AS category, ii.quantity, - ii.price_netto + ii.price_netto, + cur.name AS currency_name FROM ecminvoiceouts AS i INNER JOIN ecminvoiceoutitems AS ii ON i.id = ii.ecminvoiceout_id INNER JOIN ecmproducts AS p ON ii.ecmproduct_id = p.id +INNER JOIN currencies AS cur ON cur.id = i.currency_id LEFT JOIN ecmproductcategories_bean AS cb ON cb.bean_id COLLATE utf8_general_ci = p.id COLLATE utf8_general_ci AND cb.bean_name = 'EcmProducts' AND cb.deleted = 0 @@ -379,10 +381,12 @@ ORDER BY i.register_date DESC; END AS group_ks, GROUP_CONCAT(c.name ORDER BY cb.position SEPARATOR ' | ') AS category, ii.quantity, - ii.price_netto + ii.price_netto, + cur.name AS currency_name FROM ecminvoiceouts AS i INNER JOIN ecminvoiceoutitems AS ii ON i.id = ii.ecminvoiceout_id INNER JOIN ecmproducts AS p ON ii.ecmproduct_id = p.id +INNER JOIN currencies AS cur ON cur.id = i.currency_id LEFT JOIN ecmproductcategories_bean AS cb ON cb.bean_id COLLATE utf8_general_ci = p.id COLLATE utf8_general_ci AND cb.bean_name = 'EcmProducts' AND cb.deleted = 0 @@ -421,11 +425,13 @@ SELECT END AS group_ks, GROUP_CONCAT(c.name ORDER BY cb.position SEPARATOR ' | ') AS category, ii.quantity_corrected AS quantity_correced, - ii.total_netto_corrected AS total_netto_corrected + ii.total_netto_corrected AS total_netto_corrected, + cur.name AS currency_name FROM ecminvoiceouts AS i INNER JOIN ecminvoiceoutitems AS ii ON i.id = ii.ecminvoiceout_id INNER JOIN ecmproducts AS p ON ii.ecmproduct_id = p.id INNER JOIN ecminvoiceouts AS oi ON oi.id = i.ecminvoiceout_id + INNER JOIN currencies AS cur ON cur.id = i.currency_id LEFT JOIN ecmproductcategories_bean AS cb ON cb.bean_id COLLATE utf8_general_ci = p.id COLLATE utf8_general_ci AND cb.bean_name = 'EcmProducts' AND cb.deleted = 0 @@ -468,11 +474,13 @@ SELECT END AS group_ks, GROUP_CONCAT(c.name ORDER BY cb.position SEPARATOR ' | ') AS category, ii.quantity_corrected AS quantity_correced, - ii.total_netto_corrected AS total_netto_corrected + ii.total_netto_corrected AS total_netto_corrected, + cur.name AS currency_name FROM ecminvoiceouts AS i INNER JOIN ecminvoiceoutitems AS ii ON i.id = ii.ecminvoiceout_id INNER JOIN ecmproducts AS p ON ii.ecmproduct_id = p.id INNER JOIN ecminvoiceouts AS oi ON oi.id = i.ecminvoiceout_id + INNER JOIN currencies AS cur ON cur.id = i.currency_id LEFT JOIN ecmproductcategories_bean AS cb ON cb.bean_id COLLATE utf8_general_ci = p.id COLLATE utf8_general_ci AND cb.bean_name = 'EcmProducts' AND cb.deleted = 0