LukeDouglas Posted January 13, 2016 Share Posted January 13, 2016 I posted a payment of $30 on a $90 invoice: 01/13/2016 11:32 Mail In Payment Ck #3371 $30.00 USD The invoice on the WHMCS shows the correct information: Client Name CLIENT NAME (View Invoices) Invoice Date 12/03/2015 Due Date 12/13/2015 Total Due $90.00 USD Balance $60.00 USD However, the email shows the full amount has been paid: This is a payment receipt for Invoice 203140 sent on 12/03/2015 Due Date: 12/13/2015 Amount Paid: $90.00 USD You may review your invoice history at any time by logging in to your client area. I have a similar issue with credits being applied. Credit was applied towards an invoice: 12/17/2015 Credit Applied - $30.00 USD Invoice reflects correct balance: Client Name CLIENT NAME (View Invoices) Invoice Date 10/22/2015 Due Date 11/01/2015 Total Due $30.00 USD Balance $0.00 USD Paid 12/17/2015 02:10 Payment Method: Fully Paid by Credit Invoice shows nothing was paid: This is a payment receipt for Invoice 203050 sent on 10/22/2015 Due Date: 11/01/2015 Amount Paid: $0.00 USD You may review your invoice history at any time by logging in to your client area. So how do I get the payment confirmation email to reflect what was actually done? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted January 15, 2016 WHMCS Support Manager Share Posted January 15, 2016 Hi, The Invoice Payment Confirmation email template can be customised to use the {$invoice_last_payment_amount} merge field to display the amount of the last payment made against the invoice. Related documentation: http://docs.whmcs.com/Email_Templates 0 Quote Link to comment Share on other sites More sharing options...
LukeDouglas Posted January 15, 2016 Author Share Posted January 15, 2016 (edited) Staff, Added the variable to the template (created $75 credit): Payment of $150 to a $75 invoice: Due Date: 12/01/2015 Invoice Total: $75.00 USD Amount Paid: $invoice_last_payment_amount Applied $75 credit to next invoice: Due Date: 01/01/2016 Invoice Total: $0.00 USD Amount Paid: $invoice_last_payment_amount I would like to display the credit balance when one is created as well as show 'Credit Applied' instead of 'Amount Paid'. Now why didn't the variable '$invoice_last_payment_amount' show $150 on the first one and $75 on the 2nd one? I could not find a single page in your documentation that defines this particular variable. To be honest, whoever did the documentation on template syntax has no clue how to create an orderly way of displaying values. I looked at the http://docs.whmcs.com/Hooks:Invoicing page and could only find these links concerning payments. InvoicePaid, InvoicePaidPreEmail, InvoiceUnpaid, AddInvoicePayment and InvoicePaymentReminder. The only variables listed for all of them is 'invoiceid'. I would have expected a list of all of the available variables. This is an area of your documentation that needs some work. Can you give me a link to 'any' page that has a list of 'all' variables that can be used in email templates? Thanks. Luke Edited January 15, 2016 by LukeDouglas 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 15, 2016 Share Posted January 15, 2016 Luke, Can you give me a link to 'any' page that has a list of 'all' variables that can be used in email templates? i'll answer that - though i'm not on the staff! as far as i'm aware, I don't think there is a comprehensive list of mergefields... also, remember that some mergefields are only available to certain email template types, e.g, products, invoices etc - and while you can use one in one template type, it doesn't necessarily mean that you can use it in another type. however, in general, the mergefields available to an email template are shown in the box at the bottom of the page when you edit it - so in your Invoice Paymetn Confirmation template, you should have access to the mergefields below. whether there is an issue with the mergefields you're using in your template (perhaps using the wrong ones), or if they're giving incorrect results caused by a bug, I don't know. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted January 18, 2016 WHMCS Support Manager Share Posted January 18, 2016 Hi, To view all available template variables you will just need to enter {debug} into any email template (Setup > Email Templates > Edit), send the message to a client and then load it in your browser via the client's Email tab. Once loaded you will get a popup showing what template variables are available on that particular page. Not all variables are available on every page, and if the variable you wish to use isn't there, then you would need to obtain this yourself. http://docs.whmcs.com/Hooks:EmailPreSend can be used to create your own smarty variables to use on email templates. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 18, 2016 Share Posted January 18, 2016 To view all available template variables you will just need to enter {debug} into any email template (Setup > Email Templates > Edit), send the message to a client and then load it in your browser via the client's Email tab. Once loaded you will get a popup showing what template variables are available on that particular page. very interesting - I didn't know that you could do that.. it works too! 0 Quote Link to comment Share on other sites More sharing options...
LukeDouglas Posted January 18, 2016 Author Share Posted January 18, 2016 Didn't work for me. Dear {$client_name}, This is a payment receipt for Invoice {$invoice_num} sent on {$invoice_date_paid} Date created: {$invoice_date_created} Due Date: {$invoice_date_due} Invoice Total: {$invoice_total} Amount Paid: {$invoice_last_payment_amount} Invoice Credit, if any: {$invoice_credit} You may review your invoice history at any time by logging in to your client area. Note: This email will serve as an official receipt for this payment. {$signature} {debug} Here is the email copy I received: Dear CLIENTS NAME (Website name), This is a payment receipt for Invoice 203066 sent on 10/28/2015 12:17 Date created: 10/23/2015 Due Date: 10/23/2015 Invoice Total: $90.00 USD Amount Paid: $60.00 USD Invoice Credit, if any: $0.00 USD You may review your invoice history at any time by logging in to your client area. Note: This email will serve as an official receipt for this payment. No codes were listed in the email as view in my Firefox browser. Just for commentary but I find it incredulous that variable documentation is not supplied in your email template documentation. I know the old saying that 'developers are awful at manuals' but I've developed applications as well as written manuals. It can be done. Your online documentation for email templates should have a section dealing with 'all' variables available for use and which ones are restricted to certain templates. Just my two cents. Luke 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 18, 2016 Share Posted January 18, 2016 Didn't work for me.No codes were listed in the email as view in my Firefox browser. do you have a pop-up blocker ? if you go to the client's email tab in the admin area and view the email, then you should get a pop-up with a list of variables (mergefields) and their values. Just for commentary but I find it incredulous that variable documentation is not supplied in your email template documentation. I know the old saying that 'developers are awful at manuals' but I've developed applications as well as written manuals. It can be done. Your online documentation for email templates should have a section dealing with 'all' variables available for use and which ones are restricted to certain templates. Just my two cents. I would guess their reply would be that a list of available mergefields is shown in each template, but the point you make about the documentation in general is valid. 0 Quote Link to comment Share on other sites More sharing options...
LukeDouglas Posted January 18, 2016 Author Share Posted January 18, 2016 It wasn't a popup. It appeared down below the template and I hadn't scrolled down far enough to see it. Thanks. To be honest, you don't have to use {debug} anywhere as it looks like the available variables are listed below the templates anyway. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.