Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

vm invoice fails with different shipping address
(1 viewing) (1) Guest
PDF Invoice generator and editor for Joomla and VirtueMart.

If your topic falls within one of the subcategories, then please post it directly there. Post to this parent category only if your question does not match any subcategory topic.

TOPIC: vm invoice fails with different shipping address

vm invoice fails with different shipping address 13 years, 9 months ago #20685

I have latest vm and vm invoice, with no other plugins etc.

If my customer selects a different delivery address in the order process, the order goes through correctly and can be viewed in vm and the order confirmation email contains all the correct data.

The problem is that vm invoice does not have a client name or mail associated with the order when the invoice comes through,
Therefore it cannot run the cron job and the orders remain in invoices..

It will not work unless the customer selects the default shipping address.

Please advise, my client is not too pleased.
The topic has been locked.

Re: vm invoice fails with different shipping address 13 years, 9 months ago #20704

  • jaku
Hello,
please, upgrade to 1.4.6. This issue should be addressed by this release.
Last Edit: 13 years, 9 months ago by .
The topic has been locked.

Re: vm invoice fails with different shipping address 13 years, 9 months ago #20710

Hi Jan
This does solve the issue of the pdfs not being sent.

However, it still does not show the name or email in the invoices area and it does not show the different delivery address on the sent pdf.

I had the invoice set to deliver to both if shipping is different.
And the delivery note set to deliver to shipping address.

I have tried different combinations and the result is the same, the delivery / shipping address is not shown on the pdfs.

I have just tried to use both-always for the invoice and delivery note but the pdfs have the same default address for both, they do not show the different delivery address entered on the order form.
It would appear that the db query is not selecting the correct table fields.

The customer order in vm shows everything correctly each time.
The topic has been locked.

Re: vm invoice fails with different shipping address 13 years, 9 months ago #20711

Hi Jan
There appears to be something wrong with the logic in
function generateAddresses ()


With the function as it is, if I select billing address and shipping address, BT and ST as they come through, the delivery note uses the bill to address. This is obviously wrong.

If I change
if (($adressType == 'ST' || $adressType == 'both') && ! empty($address['ST']->last_name))

to
if (($adressType == 'ST' || $adressType == 'both') && empty($address['ST']->last_name))

i.e. without the not clause !. then the correct delivery address is shown on the DN pdf.
However, as I have set the delivery note to ST, it should not be showing both addresses, which it is.
Like I say there is something wrong with the logic of displaying which selections have been made in the configuration.

Any comments?
The topic has been locked.

Re: vm invoice fails with different shipping address 13 years, 9 months ago #20712

  • jaku
The crucial test is, whether the shipping address DOES include the last_name.
If not, then VM Invoice will consider the address incomplete and will use the billing address instead.

// if ST address is empty and should be shown always both
if ($adressType == 'both' && strlen($address['ST']->last_name) == 0) {
$address['ST'] = $address['BT'];
}
Last Edit: 13 years, 9 months ago by .
The topic has been locked.

Re: vm invoice fails with different shipping address 13 years, 9 months ago #20714

VM does not set a last_name value when a user selects a different shipping address.
When vm_order_user_info has address_type = BT all the values are filled correctly.
Where address_type = ST, title, last_name, first_name and middle_name are all NULL.
Therefore when it checks for first_name it fails, but the row contains the alternative delivery address data.

Where does your code
// if ST address is empty and should be shown always both
if ($adressType == 'both' && strlen($address['ST']->last_name) == 0) {
$address['ST'] = $address['BT'];
}

come from?

My invoicehtml.php file has
        // if ST address is empty and should be shown always both
if ($adressType == 'both' && empty($address['ST']->last_name)) {
$address['ST'] = $address['BT'];
}


This only checks if both has been selected anyway.
I have mine set to BT and ST from config so the above if statement doesn't matter, and
$address['ST'] = $this->getVMAddress('ST');

is still set and then
if (($adressType == 'ST' || $adressType == 'both') && ! empty($address['ST']->last_name))

fails as last_name = NULL.
Last Edit: 13 years, 9 months ago by clunky.
The topic has been locked.
Přihlášení uživatele Prázdný