Custom PDF template issue

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

AWESOME, it’s works. Thanks a lot! :+1:

1 Like

How can i show the name of tax in the template??
I dont want to see “Item tax” but the name of my tax

<th><?php echo lang('item_tax'); ?></th>
<td><?php echo format_currency($invoice->invoice_item_tax_total); ?> €</td>

edit:
how to add:

customer mail
customer vat
customer tax code

user mail
user vat
user tax code

to the template??? what are their ?php echo lang codes?

thanks a lot

Hi,

did you check the default template?

<?php if ($invoice->client_vat_id) {
 echo lang('vat_id_short') . ': ' . $invoice->client_vat_id . '<br/>';
 } ?>
 <?php if ($invoice->client_tax_code) {
 echo lang('tax_code_short') . ': ' . $invoice->client_tax_code . '<br/>';
  } ?>

and

 <?php if ($invoice->user_vat_id) {
  echo lang('vat_id_short') . ': ' . $invoice->user_vat_id . '<br/>';
  } ?>
 <?php if ($invoice->user_tax_code) {
   echo lang('tax_code_short') . ': ' . $invoice->user_tax_code . '<br/>';
   } ?>

Sorry Pitma, i didn’t see …

but i need also this

How can i show the name of tax in the template??
I dont want to see "Item tax" but the name of my tax

<th><?php echo lang('item_tax'); ?></th>
<td><?php echo format_currency($invoice->invoice_item_tax_total); ?> €</td>

My tax is “Rivalsa INPS 4%” … i want it on my template with php tag

thanks

Simply call

<pre><?php print_r($invoice); ?></pre>

at the end of the invoice template and it will create all variables that are currently available. Then just search for the information you are searching for.

Do you mean in the item table ie per item?

Else with Kovahs command you see everthing you need :slight_smile:

Best regards

This is what the script post …

stdClass Object
(
 [invoice_custom_id] =>
 [invoice_id] => 1
 [client_custom_id] => 1
 [client_id] => 1
 [user_custom_id] => 1
 [user_id] => 1
 [user_name] => User Name
 [user_company] =>
 [user_address_1] => Via adwadwad, 18
 [user_address_2] =>
 [user_city] => User city
 [user_state] => CT
 [user_zip] => 26548
 [user_country] => IT
 [user_phone] => 32255444445538
 [user_fax] =>
 [user_mobile] => 365894523344438
[user_email] => smailmail@mail.com
 [user_web] =>
 [user_vat_id] => 151515151151
 [user_tax_code] => 5515151515
 [client_date_created] => 2015-03-18 14:36:36
 [client_date_modified] => 2015-03-20 15:25:28
 [client_name] => Sdwdw Conndwti
 [client_address_1] => Via Badwdwwdwe, 18
 [client_address_2] =>
 [client_city] => Ridwdwd Ttirirra
 [client_state] => CT
 [client_zip] => 26840
 [client_country] => IT
 [client_phone] => 348995564421138
 [client_fax] =>
 [client_mobile] => 334878965362311
 [client_email] => smaila.dimaildwd@mail.com
 [client_web] => www.cliente.com
 [client_vat_id] => 0189236589
 [client_tax_code] => cscscscscscscscsc
 [client_active] => 1
 [invoice_amount_id] => 1
 [invoice_item_subtotal] => 335.00
 [invoice_item_tax_total] => 13.40
 [invoice_tax_total] => 0.00
 [invoice_total] => 348.40
 [invoice_paid] => 348.40
 [invoice_balance] => 0.00
 [invoice_sign] => 1
 [is_overdue] => 0
 [days_overdue] => -27
 [invoice_is_recurring] => 0
 [invoice_group_id] => 3
 [invoice_status_id] => 4
 [is_read_only] => 1
 [invoice_date_created] => 2015-03-18
 [invoice_date_modified] => 2015-03-21 19:19:44
 [invoice_date_due] => 2015-04-17
 [invoice_number] => 001
 [invoice_terms] =>
 [invoice_url_key] => IwyckrPL9KcO

But there is not what i want it show (see the pic)

In this case we would have to tweak the core.
But at the moment there’s simply no time for most of the feature wishes. :pensive:

1 Like

Sure, You think to implement this things in next releases?

Hovewer for my personal template I can put directly the name with no matters …

Thanks a lot for help =)

Where are “Pdf footer” of invoices Css’ attribs?

I want to change font etc but i can’t find it

Thanks.

Ps usefull to show also more taxes if used:
es.
item1 tax 4% 100.00
item2 tax 20% 100.00

Subtotal 200.00
item tax 4% 4.00
item tax 20% 20.00
Total 224.00

Thanks

Updates?

Thanks