Custom PDF template issue

I’m trying to edit the template of my invoices via css but I do not understand because it shows what imposed.

I have a template html css ready with her.
I renamed the css template.css custom.css or replacing the default ones but the template does not read my settings. There are blocks or limits the customization of the template?
Do not just report the php tags properly?

ps. tags php function, data is reported, but not following my template with my css

Why through the CSS? Why not direct on the View files?

What do you mean?

I’ve invoice.php and it point to <?php echo base_url(); ?>assets/default/css/templates.css">

If I post the template with css files can u help me?

EDIT: wait … resetting the server seems to read the css. …

stay tuned

Good to hear! :slight_smile:

if this is not based on the server, maybe the old css is cached by your browser!

Best

Patrick

1 Like

Guys i’m noob.

If I open my file out of invoiceplane it seems to be ok, if invoiceplane export to template no ways. It looks terrible.

Help me if someone want … is a good template, i need it.

Is AIO file.

html.php (8.0 KB)

Godd morning!

What do you mean with “open file out of invoiceplane”? Generally all invoices are opened out of invoiceplane…

Do you mean the online guest view or the final pdf? There you have two different templatefiles.
One ist in pdf/ and the other in public/

Therefore you have different syles for one invoice!

Best

Patrick

excuse my explanations inaccurate.
I mean that with the exports in the pdf template is “ruined” and is not as seen by opening the file directly html.php

I have to put the file is in / pdf in / public ?? … I do not have a chance to try now … stay tuned

yes!

in pdf/ you need to put the template file for the final .pdf document
in public/ you have the template for the online view!

Don’t forget to set the correct invoice template for both in settings and / or in the invoice!

Don’t work however :weary:

It’s full of errors … can you try with my file please?

Okay I’ll try!

Okay, the problem is, that you didn’t created the loop for each item! That was the reason why $item was unkown!

html.php (8.1 KB)

Here you have a corrected Version!

Have a nice day!

Patrick

Can u upload a pdf exported with my template?
On my system don’t work … now it report the items but it don’t respect the template…

html.php (8.1 KB)

Here, I don’t know what your original version looked like, but I did small changes and thats how it looks like right now.

Try out the new html.php

The original version looks like you can see opening directly the .php file
invoice data, amount etc are on the right of the page
the rest seems like i can see from your screenshot

However thanks for your patience. This evening i will try

You definitely need to work on the stylesheet and your html markdown!

The problem which occur here is, that the original stylesheet is still taking affect on some elements which you need to identify. But anyway good start at all and I’m sure you’ll find your way through!

Good resource for html&css

http://webdesign.tutsplus.com/categories/html-css

Have fun and best regards

Patrick

1 Like

Thanks a lot for the help.

If U say issues are all off caused by css/html structure I ll try to perfect the look of this template and i ll share it for the community.

Best

Sim

There is a way to show DATE of invoice like this “18/03/2015” like “18 March, 2015” ???

Thanks a lot

Hey there,

yes you need to modify the file:
application/helpers/date_helper.php

just add the new format

 'd F,Y' => array(
        'setting' => 'd F,Y',
        'datepicker' => 'd.m.yyyy'
    )

But don’t forget to add the comma before you add the new format :smile:

1 Like

You’re my hero :smiley:

I find in options the date format after the modify of date_helper.php

BUT

How can i translate date in my language? I see date in english … i’m italian

ps. I know to be so boring but i love this project and I want to personalize that to use it :'D

Well, this is more complex, because the date function does not provide locale settings…

Maybe this is a good thing to include in one of the next releases and to create an issue for this!

But i think for you the easiest way to accomplish this on your invoices and quotes is to create a small parser in your
templates like this…

	<th><span>Date</span></th>
	<?php
	$monthEng = array('January', 'February', 'March');
	$monthDeu = array('Januar', 'Februar', 'März');
	$date = date_from_mysql($invoice->invoice_date_created, TRUE);
	$date = str_ireplace($monthEng, $monthDeu, $date);
	?>
	<td><span><?php echo $date ?></span></td>

that way you’re free to set any language you want!

Patrick

1 Like