0

Our event uses webform for registrations. Some delegates receive 100% discounts that reduces the cost to zero.

In these cases CiviCRM does not create or send an invoice - is this standard, and is there a way to force an invoice even if the amount payable is zero?

Using latest D7 and current Civi.

2 Answers 2

1

We found a solution.

CiviCRM will create a zero invoice (as indicated by @Ramesh in the comments).

But we found that webform_civicrm doesn't create a Civi contribution (and hence no invoice) if totalContribution evaluates as true (not 0).

To fix it my dev changed the file includes/wf_crm_webform_postprocess.inc In webform_civicrm version: 7.x-5.8 it's at line 165.

Changed this

if (empty($this->ent['contribution'][1]['id']) && **$this->totalContribution**) {
  $this->createDeferredPayment();
}

to this

if (empty($this->ent['contribution'][1]['id']) && **count($this->line_items**)) {
  $this->createDeferredPayment();
}

$this->totalContribution refers to the total amount after adding up the line items (when contribution amount is used it serves as a line item)

0

when you register for an Event using discount code - even the amount is Zero CiviCRM will create an Invoice and it will send a email to the member

If this behavior is not working in your version then try upgrading to the latest version

login to https://dmaster.demo.civicrm.org/ username/password: demo/demo

I have created a example - which has an Invoice too

I guess this helps !!!

Thanks

3
  • Thanks Ramesh - good to know that Civi should generate a zero invoice. I can't fully check the functionality in the demo site because we are using webform for the registration and I wonder if that may have an impact? We've also edited the default Contributions - Invoice message template so perhaps we changed something by mistake there.
    – Davy Ivins
    Commented Jun 21, 2022 at 19:16
  • @DavyIvins try to register the event using CiviCRM link without webform - where you can test the functionality first then once you know CiviCRM is working correctly then test with Drupal webform - If you need help feel free to ask me - Thanks Commented Jun 21, 2022 at 19:39
  • Hi Ramesh - we found the cause of the missing invoice. Posted it as an answer. Thanks for your help
    – Davy Ivins
    Commented Jul 7, 2022 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.