Topic: Add a page to sales order (rep109.php)

dear masters,

I need to add a page at the bottom of the sales order called a tax invoice.
I tried (in rep109.php) adding a line:

// START my modification
$rep->NewPage();
/*
here i want to write predefined html report here
*/
// END my modification

before the end of the script, exactly above

if ($ email == 1)
  {
    $ rep-> End ($ email);
  }
}
if ($ email == 0)
  $ rep-> End ();

the result is that there is a new page with the same format with the sales order,
but I want to create a new page with a blank format because I haven't write any script yet.

is there anyone that can give me guidance on how to realize my purpose.

I wonder if the functions used to create a report on the FA is wrapped tcpdf. is it true?

-jojo-

Re: Add a page to sales order (rep109.php)

You will have to modify the fragment to:

// START my modification
$rep->SetHeaderType('');
$rep->NewPage();
/*
here i want to write predefined html report here 
*/
// END my modification

And yes, FA use TCPDF class as pdf engine.

Janusz

Re: Add a page to sales order (rep109.php)

Wiki-ed it.

4 (edited by jojobbing 12/26/2013 09:51:17 am)

Re: Add a page to sales order (rep109.php)

i try to create a new header function called Header4() in pdf_report.inc and wants to call in rep109.php.

i add new function in rep109.php name print_tax_invoice(); calls under print_sales_orders();

some difficulties i encounter was when i want to create table header with column and row span, so i think it's easier to use HTML table to create report. but when i write  syntax html like <table><tr><td> and so on in the report, the progress bar keep continuing move back and forth unfinished. whereas when i NOT using <table> tags the result is ok.

for example (in rep109.php, function print_tax_invoice()):
               ...
               ...
               ...
        $rep->SetHeaderType("Header4"); // i call Header4 here to create different header style
        $rep->NewPage(0);

        // just testing
        // create some HTML content
        $html = '<table border="1">
        <tr>
            <td>testing 1,1</td>
            <td>testing 1,2</td>
        </tr>
        <tr>
            <td>testing 2,1</td>
            <td>testing 2,2</td>
        </tr>
        </table>';

        // output the HTML content
        $rep->writeHTML($html, true, false, false, false, '');

        if ($email == 1)
        {
            $rep->End($email);
        }
    }
    if ($email == 0)
        $rep->End();

Re: Add a page to sales order (rep109.php)

why i can't use writeHTML function in this condition?
the PDF document does not generate successfully.

// just testing
        // create some HTML content
        $html = '<table border="1">
        <tr>
            <td colspan='2'>testing 1,1 and testing 1,2</td>
        </tr>
        <tr>
            <td>testing 2,1</td>
            <td>testing 2,2</td>
        </tr>
        </table>';

        // output the HTML content
        $rep->writeHTML($html, true, false, false, false, '');

Re: Add a page to sales order (rep109.php)

Using HTML TCPDF conversion you have no control over e.g. dimensions of the generated page, so we do not use this function in FA (therefore you are on your own in this case).
Janusz