News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

PDF Invoice gen failing with vmError: getInvoicePDF Cant create pdf, no entry

Started by rednaxela, September 03, 2023, 14:21:34 PM

Previous topic - Next topic

rednaxela

Hi,

I upgraded to the latest Virtuemart (VirtueMart 4.2.2 10908) and Joomla (4.3.4) version. Since then, I can no longer generate invoices from the orders page. Error: vmError: getInvoicePDF Cant create pdf, no entry

I have removed the overrides for the invoice template, but I still receive the same error.

Any help would be greatly appreciated

Best, Alexander

rednaxela

It is likely failing as no invoice number is generated/available:

com_virtuemart > controllers > invoice.php

if( $layout == 'invoice' and (!$invoiceNumber or empty($invoiceNumber))){
   $r = 'getInvoicePDF Cant create pdf, no entry for layout '.$layout;
   vmError($r, $r);
   return 0;

When and where is the invoice number generated? Can I set it manually?

rednaxela

From Max Milbers via support ticket.

I think I found the problem. A fast solution, open the invoice model at /administrator/components/com_virtuemart/models/inovice.php around line 162, search for

function getExistingIfUnlockedCreateNewInvoiceNumber($orderDetails, &$invoiceNumber, $force_create_invoice = 0){

and just change the last 0 to null
function getExistingIfUnlockedCreateNewInvoiceNumber($orderDetails, &$invoiceNumber, $force_create_invoice = null){

Kuubs

Quote from: rednaxela on September 06, 2023, 20:18:23 PM
From Max Milbers via support ticket.

I think I found the problem. A fast solution, open the invoice model at /administrator/components/com_virtuemart/models/inovice.php around line 162, search for

function getExistingIfUnlockedCreateNewInvoiceNumber($orderDetails, &$invoiceNumber, $force_create_invoice = 0){

and just change the last 0 to null
function getExistingIfUnlockedCreateNewInvoiceNumber($orderDetails, &$invoiceNumber, $force_create_invoice = null){

I have the same error, and I cannot find that line of code...

jenkinhill

The file is /administrator/components/com_virtuemart/models/invoice.php   not  inovice.php  (a Max typo)

It is correct in current member version 4.2.4 10922
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Kuubs

Quote from: jenkinhill on October 05, 2023, 15:53:02 PM
The file is /administrator/components/com_virtuemart/models/invoice.php   not  inovice.php  (a Max typo)

It is correct in current member version 4.2.4 10922

function getExistingIfUnlockedCreateNewInvoiceNumber($orderDetails, &$invoiceNumber, $force_create_invoice = 0){

this function does not have the force create invoice parameter.

Can.Y

Quote from: jenkinhill on October 05, 2023, 15:53:02 PM
The file is /administrator/components/com_virtuemart/models/invoice.php   not  inovice.php  (a Max typo)

It is correct in current member version 4.2.4 10922

I have the same issue and apply this fix in VM 4.2.0 10905
Then I got a new error msg: array_push(): Argument #1 ($array) must be of type array, null given

Does anyone know what can be done?
Really appreciated

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum


jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum