How to Print Invoice?

hi, can anyone help me how to print invoice based on PHPMAKER 2020.
Thank’s

I usually create a custom template for a report and export to pdf after using search box/extended search for searching the main value I need (customer name, unique ID…).
There is a portion of the report that has always the same text and what it changes are the values related to the record (using the template tags).

1 Like

it’s good but I see that it is not practical. I created a button in the invoice file and I want it when I click
on this button Allow me to print this invoice, is there a solution?

For me it had to be that way because I have multiple templates to print per record and none is similar to the view page for each record.
Maybe if you specify better what you have and need, I’m sure someone will help you out in a better way.

I think it would help if you specify where is the template that you want to print or if it is like the “view” page for the record, for example so that someone can help you construct the url.
Don’t know if this post helps http://www.hkvforums.com/viewtopic.php?f=4&t=43233

thank you csmgomes,
firstly it is for the first time that I try PHPMAKER to create a commercial management application that is why I am looking for the necessary solutions to make this application, but I sometimes find myself blocked by how to organize these events.
I simply created a button which I will use to print the customer invoice.
I saw that this method is done in the custom template phase, the problem is how I can connect my button with this code created in custom template.
ie what are the steps to follow.

You may read “Tutorial - Custom Template for Summary Report” in the help file, it uses Custom Template to format the report like an invoice and export as PDF.

Hi, how to connect my button ‘Print Invoice’ to this famous custom template?

My button is created like this :

in ListOption_Load
// ListOptions Load event
function ListOptions_Load() {
// Example:
$opt = &$this->ListOptions->Add(“PrintButton”);
$opt->Header = “Action”;
$opt->OnRight = TRUE; // Link on left
//$opt->MoveTo(0); // Move to first column

}
Then, in ListOption_Rendered

// ListOptions Rendered event
function ListOptions_Rendered() {
// Example:
//$this->ListOptions[“new”]->Body = “Action”;
//$this->ListOptions->Items[“new”]->Body = "<a href="#" onclick="return ew.submitAction(event, {action: ‘star’, method: ‘ajax’, msg: ‘Add star?’, key: " . $this->KeyToJson(TRUE) . “});">Imprimer facture”;
$this->ListOptions->Items[“PrintButton”]->Body = “<button type="button" class="btn btn-default btn-sm" title="Invoice Print" onclick="window.location=‘invoiceprint.php?showdetail=&Id=&Id_Products’">Invoice Print”;

}