how can I attached an invoice to the email

More
10 years 1 month ago #76639 by alex
Hello,

Some of my events are free via coupon or membership group type discount so in some cases the invoice in amount of 0 I want to send the invoice in any case even if the amount of the invoice is 0.

how can I configure it ?

thank you/

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #76640 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic how can I attached an invoice to the email
Hi Alex

You will need to edit code to have that behavior. Please follow instructions below to edit the code:

1. Open the file components/com_eventbooking/helper/helper.php

2. Find this function
Code:
public static function needInvoice($row) { if ($row->amount > 0 || $row->total_amount > 0) { return true; } $config = self::getConfig(); if ($config->multiple_booking) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('SUM(total_amount)') ->from('#__eb_registrants') ->where('id=' . $row->id . ' OR cart_id=' . $row->id); $db->setQuery($query); $totalAmount = $db->loadResult(); if ($totalAmount > 0) { return true; } } return false; }

3. Change the code to
Code:
public static function needInvoice($row) { return true; }

With that change, invoice will be always be generated. And it should solve your issue

Suggest that you download latest version and upgrade it to your site before making the change as I fixed an issue with invoice feature today

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #76642 by alex
I haven't made the changes yet but are you sure you made any changes?

please see the screenshot it after the last update from today



:blink:

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #76643 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic how can I attached an invoice to the email
I am going to check it tonight my time to see whether I made any changes to the extension causes this issue. I will get back to you in the next few hours

Tuan

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #76704 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic how can I attached an invoice to the email
Hi Alex

I fixed this issue in latest download package on server. Could you please access to My Downloads menu item, download latest version from My Downloads section, upgrade it to your site and check it again ?

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc