veshop Posted March 2, 2015 Share Posted March 2, 2015 Hi there to everyone! When I'm generating the pdf with all invoices of a certain period, nowhere is written the total of all invoices of the period.This is what I mean:I'm generating the pdf of all invoices of february (1-28 february) and I got the pdf with all invoices of the month. So I got invoice 1 = 20€, invoice 2= 5€, etc. etc. But nowhere is writte the total. I want to add a new blank page in the beginning of pdf, where the sum of all invoices appear.Page 1:SUM invoices: 25€Page 2:Invoice 1Page 3: invoice 2etc. etc.What and where I should add the code?Another great thing, would be if the generated pdf, have the invoices orded by invoice number and not by the order date.Hope somebody can help me Best wishes,Marco. Link to comment Share on other sites More sharing options...
tuk66 Posted March 4, 2015 Share Posted March 4, 2015 Do you simply want to add up all invoice totals? What about pre-tax totals, taxes, different currencies? I did a similar template for the M4 PDF Extensions module - http://www.presta-addons.com/pdf/Tax report.pdf. This approach could be adapted to your needs. And to sort all invoice as well. Sorting is possible directly in a template in this module. Link to comment Share on other sites More sharing options...
veshop Posted March 4, 2015 Author Share Posted March 4, 2015 Hi there and thanks for your quickly answer!About the total, I just need a very easy module or adding code in the generating pdf, that show me the total of all invoices.Just 1 simply line:Total of generated invoices: 10€And than all pages with the invoices that you can generate in the BO. Link to comment Share on other sites More sharing options...
tuk66 Posted March 4, 2015 Share Posted March 4, 2015 I think it is not so simple as it looks. Aynway, the code would be patched somewhere around processGenerateInvoicesPDF and processGenerateInvoicesPDF2 methods in /controllers/admin/AdminPdfController.php. Link to comment Share on other sites More sharing options...
veshop Posted March 10, 2015 Author Share Posted March 10, 2015 Hi there!I solved the problem with order the generated invoices by invoice number and not by order date and will share the solution if somebody need it.Here is what I do.Open:public_html\classes\order\OrderInvoice.php and look for: public static function getByDateInterval($date_from, $date_to) Some lines down, you will find: ORDER BY oi.date_add ASC Change it to: ORDER BY oi.number ASC Hope to solve also the "problem" with creating the sum of generated invoices. 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