I have a problem with tax settings in membership 2 pro

To apply a fixed tax to all invoices, it was suggested the following code:

add_filter( ‘ms_invoice_tax_rate’, ‘my_custom_tax_rate’, 10, 2 );

function my_custom_tax_rate( $amount, $invoice ) {

return 19.0;


I need to call my tax in the template, and then I need to take the tax and display it in a sum from the total amount. And I need to display my membership payment without the tax sum.

How can I do that?