invoice_group_id when I display/print a quote/invoice

Dear all
Good day!
Any way to know which invoice_group_id (family) is the document I am printing?
Since I have several Invoice Families… I tried print_r and var_dump of $quote and $invoice but I haven’t been able to find the field invoice_group_id.
Thank you for your cooperation

Kindest regards, gsolina

You can do this by just add to your template

<?php echo $invoice->invoice_group_id; ?>

then the id of your invoice group will show.