News:

Support the VirtueMart project and become a member

Main Menu

2 small Invoice problems

Started by Mister Paul, October 14, 2018, 18:47:39 PM

Previous topic - Next topic

Mister Paul

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.
<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
QuotevmError: 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

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 live shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

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

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 live shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

#4
Thanks!
;)

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

StefanSTS

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 live shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

QuoteActually 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.

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

So I wrote this in custom.css:.spaceStyle {
  background-color: #b9298b;
}


I have read that background-color was supported by TCPDF

Anyway, it still doesn't work
:-[

Mister Paul

#7
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:#b9298b;">
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

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 live shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

Good idea
But unfortunately not working...

StefanSTS

Quote from: Mister Paul on October 15, 2018, 10:26:17 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 live shop! Use Alpha versions only if you know what risk you are taking.

Mister Paul

QuoteSo 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

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 live shop! Use Alpha versions only if you know what risk you are taking.