lukasknol Posted May 30, 2014 Share Posted May 30, 2014 Hi there, I'm using Prestashop 1.6 witht the default theme. Presta has a nice option to select an invoice sorted on date (orders > invoices). The only thing is it shows all the products which are ordered. Is there a trick to select an invoice of products sorted on date and a user group? Does anyone knows a module for this? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted May 30, 2014 Share Posted May 30, 2014 Hi, when you are click "Generate PDF by date" OrderInvoice::getByDateInterval($date_from, $date_to) function executes with next SQL-query: $order_invoice_list = Db::getInstance()->executeS(' SELECT oi.* FROM `'._DB_PREFIX_.'order_invoice` oi LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = oi.`id_order`) WHERE DATE_ADD(oi.date_add, INTERVAL -1 DAY) <= \''.pSQL($date_to).'\' AND oi.date_add >= \''.pSQL($date_from).'\' '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').' ORDER BY oi.date_add ASC '); there is the new SQL-query with for example id_group=4: $order_invoice_list = Db::getInstance()->executeS(' SELECT oi.* FROM `'._DB_PREFIX_.'order_invoice` oi LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = oi.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer_group` cg ON ( cg.`id_customer` = o.`id_customer` ) WHERE DATE_ADD(oi.date_add, INTERVAL -1 DAY) <= \''.pSQL($date_to).'\' AND oi.date_add >= \''.pSQL($date_from).'\' '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').' AND cg.`id_group` =4 ORDER BY oi.date_add ASC '); so you can temporary manual edit the file: classes/order/OrderInvoice.php for your purpose Regards Link to comment Share on other sites More sharing options...
lukasknol Posted June 1, 2014 Author Share Posted June 1, 2014 Thank you for the idea. It works but it isn't really what I am looking for. I need a more simple overview with the products orderd with the names of the clients (of a specific group). Is there a user friendly module which has the option to generate invoices by different user groups and time. The idea is to create an invoice for a company where employees order their product. At the end of the month the invoice goes to the company with an overview of orderd products by every employee. 1 Link to comment Share on other sites More sharing options...
tommo3344 Posted November 19, 2015 Share Posted November 19, 2015 Hi Lukasknol, I am searching for a similar feature to the one you described. Did you manage to find a solution to this? Best regards, Tom Link to comment Share on other sites More sharing options...
lukasknol Posted November 19, 2015 Author Share Posted November 19, 2015 Hi Tom, Unfortunately I didn't. So I am working without this function and use the standard functions of Presta. Let me know if you have find anything! Regards, Lukas Link to comment Share on other sites More sharing options...
tommo3344 Posted November 19, 2015 Share Posted November 19, 2015 Fair enough, thanks for getting back to me. Best regards, Tom Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now