Jump to content

John Kennedy

Senior Member
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

0 Neutral

About John Kennedy

  • Rank
    Junior Member
  1. I'm trying to set up short term promotions (only 3 cycles) and apply them to existing products. The issue is whenever I generate an invoice with the said promotions applied to products, those product prices are reset to default and the promo code is wiped off. Original Pricing: Promotion code applied: Invoice generated: Pricing reset to default, no promo code: Not sure why this is happening, but it's making it impossible to apply short term discouns to existing services. The issue is similar to below, but not the same
  2. Anyone looking to do the same: update the last call to "InvoiceCreation" add_hook("InvoiceCreation",1,"generate_custom_invoice_number_hook"); @brian! Thanks for all the help! You're a legend.
  3. OK, got it working, but now I got a new problem - I need the same to work for manual invoices after having them published. Sometimes we need to backdate invoices and the only way to do it is to create an invoice, publish it without sending, change the dates and only them email it. This hook doesn't work it you publish without sending it right away. Can it be changed to something like "InvoiceCreationPostCreate"? What will it break if it can?
  4. This is also what I'm seeing after rewriting everything: Still doesn't work 😞
  5. Guessing it's safe to assume something funky is going on with the encoding here. I've tried uploading/creating the file numerous times - either pasting or typing it out. The only thing I haven't tried yet is using the hosting platform editor to create the hook.
  6. Lol no 😄 This is fucked up. All other hooks in that folder work fine
  7. Tried that before reuploading - didn't work. I'll try changing the var altogether to something else. Edit: nope.
  8. OK, this is bizarre - copied and pasted again, saved as UTF-8, uploaded into hooks. Still doesn't work.
  9. Works fine when done directly in the database:
  10. This doesn't seem to work in 7.6.1. /includes/hooks]# cat customInvoicePrefix.php <?php /** * Generate Custom Invoice Number Format * @author brian! */ use Illuminate\Database\Capsule\Manager as Capsule; function generate_custom_invoice_number_hook($vars) { $invoiceid = $vars['invoiceid']; $customnumber = "SI-".$invoiceid; if (isset($customnumber)) { try { $updatedInvoiceNumber = Capsule::table('tblinvoices') ->where('id', $invoiceid) ->update(['invoicenum' => $customnumber,]); } catch (\Exception $e) { // Deal with error } } } add_hook("InvoiceCreationPreEmail",1,"generate_custom_invoice_number_hook"); Tried several different variants.
  11. We need to achieve the following: Upon updating client profile, check custom field and, if not blank, call external API with the value as token. The problem is https://developers.whmcs.com/hooks-reference/client/#clientedit has no reference to any custom fields. Does that mean I can't reference custom fields in the ClientEdit function?
  12. Like this one? https://requests.whmcs.com/topic/add-client-to-multiple-client-groups I'm not waiting 5+ years for a feature that, in all honesty, could have been available from the get go. Why not allow all merge fields in all templates? It make no sense to have them restricted.
  13. Is there a way to have additional merge fields in the Admin Messages templates? Namely, $client_company_name is not an available field in 'Service Unsuspension Successful' and 'Service Unsuspension Failed' templates. I'd like to be able to tell at a glance what client this is about when I get the email. I tried just putting the field in, but it doesn't work as it's not defined as an available merge field for this type/group of emails.
  14. That should be achievable in Setup-> Automation Setting -> Billing Settings You will need to change the email template to say whatever you need it to. I found some of the default templates lacking, but it's expected you customise the system to suit your needs after the install.
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated