diff --git a/REST/functions.php b/REST/functions.php index ebff4797..e96f8055 100644 --- a/REST/functions.php +++ b/REST/functions.php @@ -269,10 +269,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 @@ -308,10 +310,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 @@ -349,11 +353,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 @@ -395,11 +401,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