Author Topic: 2 small Invoice problems  (Read 789 times)

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
2 small Invoice problems
« on: October 14, 2018, 18:47:39 pm »
Hi,

I get 2 problems in Invoice back-end customization:
see screenshot https://www.cjoint.com/doc/18_10/HJoqUoBIZpw_Capture-2018-10-14-à-18.35.02.jpg

1° I'd like to have a simple white background-color but can't manage that
 :-\
I went to the SHOP/Shop backend page and then to the Invoices/Emails tab. In the Appearance part there's a text field for "CSS Styles for the Document:"
I have tried almost everything (?) but couldn't make it.
Code: [Select]
<style>
body {background-color: white;}
background-color: white;
</style>
How should I insert code in this field?

2° I tried to get a PDF preview by clicking the link:
"Here you can configure the look of invoices, delivery notes etc. You can take a look at a preview page (after saving the changes) HERE."
But got an error
Quote
vmError: vmPdf: For the pdf, you must install the tcpdf library at /home/centreve/new/libraries/tcpdf
But I have TCPDF installed and available
Version: 1.0.5 of June 2018
TCPDF 6.2.12 by Nicola Asuni. Joomla Installer by the VirtueMart Team

How should I do?

Thanks for your help!
 ::)

Paul

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 387
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: 2 small Invoice problems
« Reply #1 on: October 15, 2018, 07:24:17 am »
Hello,

regarding the white background-color, I suggest to set that in the overrides as an inline style in the invoice view.

To test my invoices, I always generate a proper PDF invoice from an order, you can switch e.g. between confirmed and confirmed by customer to generate new invoices, or you delete the old one in the safe path invoice folder.

Not sure why your error message is coming, regarding that TCPDF is not installed. Did you try to install it again? Might be some files missing.

Regards
Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
Re: 2 small Invoice problems
« Reply #2 on: October 15, 2018, 07:40:33 am »
Thanks Stephan

For what I know invoice_items.php or invoice_order.php are only parts of the global incoice. So yes I tried it but I could get only the 2 main tables with white background but they are floating in the full invoice that has no background...
See partial screenshot : https://www.cjoint.com/doc/18_10/HJpfNqSrEuw_Capture-2018-10-15-à-07.38.04.jpg

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 387
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: 2 small Invoice problems
« Reply #3 on: October 15, 2018, 07:45:41 am »
The two mentioned files are called by invoice.php.
Here you can set the background for the full invoice.
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
Re: 2 small Invoice problems
« Reply #4 on: October 15, 2018, 08:26:07 am »
Thanks!
;)

But I got no success...
For now I tried on line 70
Code: [Select]
<body style="background:#FFFFFF;" onload="javascript:print();">and
Code: [Select]
<body style="background-color:#FFFFFF;" onload="javascript:print();">What's wrong ???

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 387
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: 2 small Invoice problems
« Reply #5 on: October 15, 2018, 09:54:39 am »
Actually I have no idea why you have the grey color at all, there should be no grey background.

Is there a style for the
<div class='spaceStyle'>...
in invoice.php?

It could help to set the color there with inline style, background-color should be preferred, since it is more precise than background.
Not sure, if TCPDF supports background.
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
Re: 2 small Invoice problems
« Reply #6 on: October 15, 2018, 10:26:17 am »
Quote
Actually I have no idea why you have the grey color at all, there should be no grey background.
It should be because it's empty, transparent. But I see it only in mails (I use Mail software from Apple). If I open the pdf invoice in Aperçu (Apple pdf viewer) or Acrobat Reader there's no transparent area. I suppose transparency is automatically replaced by these softwares on opening.

Quote
Is there a style for the
<div class='spaceStyle'>...
in invoice.php?
Yes it has

So I wrote this in custom.css:
Code: [Select]
.spaceStyle {
  background-color: #ffffff;
}

I have read that background-color was supported by TCPDF

Anyway, it still doesn't work
 :-[

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
Re: 2 small Invoice problems
« Reply #7 on: October 15, 2018, 10:41:39 am »
A little step further:
- styling .spaceStyle in custom.css from template doesn't do anything
- I tried to modify invoice.php line 74: <div class='spaceStyle' style="background-color:#ffffff;">
So now I get also the invoice number and the small gap betwteen the 2 main tables with white background.
see image: https://www.cjoint.com/doc/18_10/HJpjGRdJYzw_Capture-2018-10-15-à-11.31.48.jpg

But all this central white area is floating in the middle of a transparent page.
So there should be another .php file that includes invoice.php...

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 387
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: 2 small Invoice problems
« Reply #8 on: October 15, 2018, 12:28:51 pm »
How about adding a DIV in invoice.php that encloses everything else and set the background-color there?
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
Re: 2 small Invoice problems
« Reply #9 on: October 16, 2018, 07:00:42 am »
Good idea
But unfortunately not working...

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 387
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: 2 small Invoice problems
« Reply #10 on: October 16, 2018, 07:20:43 am »
But I see it only in mails (I use Mail software from Apple). If I open the pdf invoice in Aperçu (Apple pdf viewer) or Acrobat Reader there's no transparent area.

So are we talking about the emails and not the PDF?

The mails are generated by mail_html.php and the files called in there. Mail and PDF are two separate things.

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

  • Jr. Member
  • **
  • Posts: 201
Re: 2 small Invoice problems
« Reply #11 on: October 16, 2018, 12:34:46 pm »
Quote
So are we talking about the emails and not the PDF?
Not exactly:
my mail contains 2 elements:
- the order informations (yes I suppose that it's created by mail_html.php).
- the invoice. Its a pdf file and it dosn't display an uniform white background in my Mail software.

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 387
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: 2 small Invoice problems
« Reply #12 on: October 16, 2018, 12:48:31 pm »
The only two ideas left here are:

1. *********** Apple ********* Mail Software (not to make the moderators work too much, I put stars in place of inappropriate words)

2. Print it out and stick it to the screen where the email is opened.

Ok, third. Send a support request to Apple why the email agent is showing PDFs with transparent colors.

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.