Jump to content
chris23

[CONTRIBUTION] PDF Customer Invoice

Recommended Posts

Chris

 

Hope you are still active - have installed your contribution and am getting both invoice and packing slip from the orders page in admin. Just a couple of points/questions

 

1 Did get an error until I changed the admin/images/oscommerce file from .jpg to .jpeg!!

2 should I be able to configure the way the pdf files appear in the config section as nothing appears in my menu.

clipboard01.jpg

 

Thanks for a great contribution.

 

Aidan

Share this post


Link to post
Share on other sites

Chris

 

A further error I am afraid - pdf packing slip is populating correctly but pdf invoice remains empty. Any ideas?

 

Thanks Aidan

Share this post


Link to post
Share on other sites

Chris

 

A further error I am afraid - pdf packing slip is populating correctly but pdf invoice remains empty. Any ideas?

 

Thanks Aidan

 

 

Hi,

 

To change the format of the pdf invoice you need to change the file catalog/pdfinvoice.php. I suggest using www.fpdf.org to start with learning how to code the pdf - that is what I did!

 

Don't know why your pdf invoice is not populating, mine is. You can give your code so I can compare with mine if you would like.

 

Ali

Share this post


Link to post
Share on other sites

Hi Ali

 

Thanks for the offer of help. Everything seemed to install without worry apart from my struggling to run the SQL - did not select the database correctly. The instructions I followed tell you to put the pdf_invoice.php into catalog/admin/.. is yours working correctly in catalog folder?

 

Here is the code

<?php
/*
 $Id: create_pdf,v 1.4 2005/04/07

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

 Written by Neil Westlake (nwestlake@gmail.com) for www.Digiprintuk.com

 Version History:
 1.1
 Initial release
 1.2
 Corrected problem displaying PDF when from a HTTPS URL.
 1.3
 Modified item display to allow page continuation when more than 20 products are on one invoice.
 1.4
 Corrected problem with page continuation, now invoices will allow for an unlimited amount of products on one invoice
 1.6
 full control over the color, fonts,size etc.
*/

define('FPDF_FONTPATH','fpdf/font/');
require('fpdf/fpdf.php');

//require('includes/application_top.php');
// prevents reinclusion if called from checkout_process.php
require_once('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ORDERS_INVOICE );
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PDF_INVOICE );

//require(DIR_WS_CLASSES . 'currencies.php');
// prevents reinclusion if called from checkout_process.php
require_once(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

//include(DIR_WS_CLASSES . 'order.php');
// prevents reinclusion if called from checkout_process.php
require_once(DIR_WS_CLASSES . 'order.php');

// if called from order editor than use this ordernumber
if ($stream) {
$oID = $invoice_number ;
}

// search order number
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . 110 . "'");
$order = new order($oID);

class PDF extends FPDF
{
//Page header
function RoundedRect($x, $y, $w, $h,$r, $style = '')
   {
       $k = $this->k;
       $hp = $this->h;
       if($style=='F')
           $op='f';
       elseif($style=='FD' or $style=='DF')
           $op='B';
       else
           $op='S';
       $MyArc = 4/3 * (sqrt(2) - 1);
       $this->_out(sprintf('%.2f %.2f m',($x+$r)*$k,($hp-$y)*$k ));
       $xc = $x+$w-$r ;
       $yc = $y+$r;
       $this->_out(sprintf('%.2f %.2f l', $xc*$k,($hp-$y)*$k ));

       $this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc);
       $xc = $x+$w-$r ;
       $yc = $y+$h-$r;
       $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-$yc)*$k));
       $this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r);
       $xc = $x+$r ;
       $yc = $y+$h-$r;
       $this->_out(sprintf('%.2f %.2f l',$xc*$k,($hp-($y+$h))*$k));
       $this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc);
       $xc = $x+$r ;
       $yc = $y+$r;
       $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$yc)*$k ));
       $this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r);
       $this->_out($op);
   }

   function _Arc($x1, $y1, $x2, $y2, $x3, $y3)
   {
       $h = $this->h;
       $this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c ', $x1*$this->k, ($h-$y1)*$this->k,
           $x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k));
   }

function Header()
{
global $oID;
$date = strftime('%A, %d %B %Y');

   $bg_color=explode(",",PDF_INV_PAGE_FILL_COLOR );
   $this->SetFillColor($bg_color[0], $bg_color[1], $bg_color[2]);
   $this->Rect($this->lMargin,0,$this->w-$this->rMargin,$this->h,'F');

//Logo
   if ( PDF_INV_SHOW_LOGO == 'true' ) {
    $this->Image( PDF_INV_STORE_LOGO ,5,10,90);
   }

   // Invoice Number and date
$this->SetFont('Arial','B', 14);
$this->SetTextColor(158,11,14);
$this->SetY(37);
$this->MultiCell(100,6,"Invoice: #" . $oID . "\n" . $date ,0,'L');	


// Company Address
$this->SetX(0);
$this->SetY(10);
   $this->SetFont( PDF_INV_HEADER_TEXT_FONT,
                   PDF_INV_HEADER_TEXT_EFFECT,
                   PDF_INV_HEADER_TEXT_HEIGHT);  

   $text_color=explode(",",PDF_INV_HEADER_TEXT_COLOR );
   $this->SetTextColor($text_color[0], $text_color[1], $text_color[2]);  

   $text_color=explode(",",PDF_INV_HEADER_FILL_COLOR );
   $this->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

   $text_color=explode(",",PDF_INV_HEADER_LINE_COLOR );
   $this->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );       

   $this->Ln(0);
   $this->Cell(149);

   if ( PDF_INV_SHOW_ADRESSSHOP == 'true' ) {    
   $this->MultiCell(50, 3.5, STORE_NAME_ADDRESS,0,'L', '1' ); 
   }   

//email
$this->SetX(0);
$this->SetY(37);
//	$this->SetFont('Arial','B',10);
   $this->SetFont( PDF_INV_HEADER_TEXT_FONT,
                   PDF_INV_HEADER_TEXT_EFFECT,
                   PDF_INV_HEADER_TEXT_HEIGHT);  

   $text_color=explode(",",PDF_INV_HEADER_TEXT_COLOR );
   $this->SetTextColor($text_color[0], $text_color[1], $text_color[2]);  

   $text_color=explode(",",PDF_INV_HEADER_FILL_COLOR );
   $this->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

   $text_color=explode(",",PDF_INV_HEADER_LINE_COLOR );
   $this->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );     

$this->Ln(0);
   $this->Cell(81);
   if ( PDF_INV_SHOW_MAILWEB == 'true' ) {    
   $this->MultiCell(100, 6, "E-mail: " . STORE_OWNER_EMAIL_ADDRESS,0,'R', '1' );
   }   

//website
$this->SetX(0);
$this->SetY(42);
   $this->SetFont( PDF_INV_HEADER_TEXT_FONT,
                   PDF_INV_HEADER_TEXT_EFFECT,
                   PDF_INV_HEADER_TEXT_HEIGHT);  

   $text_color=explode(",",PDF_INV_HEADER_TEXT_COLOR );
   $this->SetTextColor($text_color[0], $text_color[1], $text_color[2]);  

   $text_color=explode(",",PDF_INV_HEADER_FILL_COLOR );
   $this->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

   $text_color=explode(",",PDF_INV_HEADER_LINE_COLOR );
   $this->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );     

$this->Ln(0);
   $this->Cell(88);
   if ( PDF_INV_SHOW_MAILWEB == 'true' ) {    
   $this->MultiCell(100, 6, "Web  : " . HTTP_SERVER,0,'R', '1' );
   }  

   //Draw the top line with invoice text
   $this->Cell(50);
   $this->SetY(60);

   $text_color=explode(",",PDF_INV_HEADINVOICE_TEXT_COLOR );
   $this->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );

   $this->Cell(15,.1,'',1,1,'L',1);

   $this->SetFont( PDF_INV_HEADINVOICE_TEXT_FONT,
                   PDF_INV_HEADINVOICE_TEXT_EFFECT,
                   PDF_INV_HEADINVOICE_TEXT_HEIGHT); 

   $text_color=explode(",",PDF_INV_HEADINVOICE_TEXT_COLOR );
   $this->SetTextColor( $text_color[0], $text_color[1], $text_color[2] );

   $this->Text(22,61.5,PRINT_INVOICE);
   $this->SetY(60);

   $text_color=explode(",",PDF_INV_HEADINVOICE_TEXT_COLOR );
   $this->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );

   $this->Cell(38);
   $this->Cell(160,.1,'',1,1,'L',1);    

}

function Footer()
{
   //Position at 1.5 cm from bottom
   $this->SetY(-17);
   //Arial italic 8

   $this->SetFont( PDF_INV_FOOTER_TEXT_FONT,
                   PDF_INV_FOOTER_TEXT_EFFECT,
                   PDF_INV_FOOTER_TEXT_HEIGHT);  

   $text_color=explode(",",PDF_INV_FOOTER_TEXT_COLOR );
   $this->SetTextColor($text_color[0], $text_color[1], $text_color[2]);

   //$text_color=explode(",",PDF_INV_FOOTER_FILL_COLOR );
   //$this->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

$this->Cell(0,10, PDF_INV_FOOTER_TEXT, 0, 0,'C');

$this->SetY(-14);
//Page number
   $this->Cell(0,10,PRINT_INVOICE_PAGE_NUMBER.$this->PageNo(),0,0,'C' );
}
}
//Instanciation of inherited class
$pdf=new PDF( PDF_INV_PORTRAIT_LANDSCAPE,'mm',array(PDF_INV_PAPER_WIDTH, PDF_INV_PAPER_HEIGHT ) ) ;

// Set the Page Margins
$pdf->SetMargins(6,2,6);	

// Add the first page
$pdf->AddPage();

//Draw Box for Invoice Address
if ( PDF_INV_SHOW_SOLDTO == 'true' ) {  
 $text_color=explode(",",PDF_INV_SOLDTO_LINE_COLOR );
 $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );
 $pdf->SetLineWidth(0.2);
 $text_color=explode(",",PDF_INV_SOLDTO_FILL_COLOR );
 $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );
 $pdf->RoundedRect(6, 67, 90, 35, 2, 'DF');

 //Draw the invoice address text
 $pdf->SetFont( PDF_INV_SOLDTO_TEXT_FONT,
                PDF_INV_SOLDTO_TEXT_EFFECT,
                PDF_INV_SOLDTO_TEXT_HEIGHT );  

 $text_color=explode(",",PDF_INV_SOLDTO_TEXT_COLOR );
 $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]);  

 $pdf->Text(11,77, ENTRY_SOLD_TO);
 $pdf->SetX(0);
 $pdf->SetY(80);
 $pdf->Cell(9);
 $pdf->MultiCell(70, 3.3, tep_address_format(1, $order->customer, '', '', "\n"),0,'L', '1' );
}  

//Draw Box for Delivery Address
if ( PDF_INV_SHOW_SENDTO == 'true' ) { 	
   $text_color=explode(",",PDF_INV_SENDTO_LINE_COLOR );
   $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );
$pdf->SetLineWidth(0.2);
   $text_color=explode(",",PDF_INV_SENDTO_FILL_COLOR );
   $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );
$pdf->RoundedRect(108, 67, 90, 35, 2, 'DF');

//Draw the invoice delivery address text
   $pdf->SetFont( PDF_INV_SENDTO_TEXT_FONT,
                  PDF_INV_SENDTO_TEXT_EFFECT,
                  PDF_INV_SENDTO_TEXT_HEIGHT );

   $text_color=explode(",",PDF_INV_SENDTO_TEXT_COLOR );
   $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]);  
$pdf->Text(113,77, ENTRY_SHIP_TO);
$pdf->SetX(0);
$pdf->SetY(80);
   $pdf->Cell(111);
$pdf->MultiCell(70, 3.3, tep_address_format(1, $order->delivery, '', '', "\n"),0,'L', '1');
}	

//Draw Box for Order Number, Date & Payment method
   $text_color=explode(",",PDF_INV_ORDERDETAILS_LINE_COLOR );
   $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );
$pdf->SetLineWidth(0.2);
   $text_color=explode(",",PDF_INV_ORDERDETAILS_FILL_COLOR );
   $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );
$pdf->RoundedRect(6, 107, 192, 11, 2, 'DF');

// print the order details
$pdf->SetFont( PDF_INV_ORDERDETAILS_TEXT_FONT,
                  PDF_INV_ORDERDETAILS_TEXT_EFFECT,
                  PDF_INV_ORDERDETAILS_TEXT_HEIGHT);  

   $text_color=explode(",",PDF_INV_ORDERDETAILS_TEXT_COLOR );
   $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]);  

//Draw Order Number Text
$temp = str_replace(' ', ' ', PRINT_INVOICE_ORDER);
$pdf->Text(10,113, $temp . tep_db_input($oID));	
//Draw Date of Order Text
$temp = str_replace(' ', ' ', PRINT_INVOICE_DATE);
$pdf->Text(50,113,$temp . tep_date_short($order->info['date_purchased']));	
//Draw Payment Method Text
$temp = substr ($order->info['payment_method'] , 0, 23);
$pdf->Text(107,113,ENTRY_PAYMENT_METHOD . ' ' . $temp);	

//Fields Name position
$Y_Fields_Name_position = 125;
//Table position, under Fields Name
$Y_Table_Position = 131;


function output_table_heading($Y_Fields_Name_position){
   global $pdf;
//First create each Field Name
// color filling each Field Name box

//Bold Font for Field Name
$pdf->SetFont( PDF_INV_TABLEHEADING_TEXT_FONT,
              PDF_INV_TABLEHEADING_TEXT_EFFECT,
              PDF_INV_TABLEHEADING_TEXT_HEIGHT);  

$text_color=explode(",",PDF_INV_TABLEHEADING_TEXT_COLOR );
$pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]); 

$text_color=explode(",",PDF_INV_TABLEHEADING_LINE_COLOR );
$pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );
$text_color=explode(",",PDF_INV_TABLEHEADING_FILL_COLOR );
$pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );                

$pdf->SetY($Y_Fields_Name_position);
$pdf->SetX(6);
$pdf->Cell(9,6,TABLE_HEADING_QUANTITY,1,0,'C',1);
$pdf->SetX(15);
$pdf->Cell(27,6,TABLE_HEADING_PRODUCTS_MODEL,1,0,'C',1);
$pdf->SetX(40);
$pdf->Cell(78,6,TABLE_HEADING_PRODUCTS,1,0,'C',1);
//$pdf->SetX(105);
//$pdf->Cell(15,6,TABLE_HEADING_TAX,1,0,'C',1);
$pdf->SetX(118);
$pdf->Cell(20,6,TABLE_HEADING_PRICE_EXCLUDING_TAX,1,0,'C',1);
$pdf->SetX(138);
$pdf->Cell(20,6,TABLE_HEADING_PRICE_INCLUDING_TAX,1,0,'C',1);
$pdf->SetX(158);
$pdf->Cell(20,6,TABLE_HEADING_TOTAL_EXCLUDING_TAX,1,0,'C',1);
$pdf->SetX(178);
$pdf->Cell(20,6,TABLE_HEADING_TOTAL_INCLUDING_TAX,1,0,'C',1);
$pdf->Ln();
}
output_table_heading($Y_Fields_Name_position);
//Show the products information line by line
$item_count = 0 ;
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

   $pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                  PDF_INV_PRODUCTS_TEXT_EFFECT,
                  PDF_INV_PRODUCTS_TEXT_HEIGHT);  

   $text_color=explode(",",PDF_INV_PRODUCTS_TEXT_COLOR );
   $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]); 


   $text_color=explode(",",PDF_INV_PRODUCTS_FILL_COLOR );
   $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

   $text_color=explode(",",PDF_INV_PRODUCTS_LINE_COLOR );
   $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );                 

$pdf->SetY($Y_Table_Position);
$pdf->SetX(6);
$pdf->MultiCell(9,6,$order->products[$i]['qty'],1,'C', '1');

$pdf->SetY($Y_Table_Position);
$pdf->SetX(15);
   $pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                  PDF_INV_PRODUCTS_TEXT_EFFECT,
                  PDF_INV_PRODUCTS_TEXT_HEIGHT);  

$pdf->MultiCell(25,6,$order->products[$i]['model'],1,'L', '1');

$pdf->SetY($Y_Table_Position);
$pdf->SetX(40);
if (strlen($order->products[$i]['name']) > 40 && strlen($order->products[$i]['name']) < 50){
	$pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                      PDF_INV_PRODUCTS_TEXT_EFFECT,
                      PDF_INV_PRODUCTS_TEXT_HEIGHT);  
	$pdf->MultiCell(78,6,$order->products[$i]['name'],1,'L', '1');
	}
else if (strlen($order->products[$i]['name']) > 50){
	$pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                      PDF_INV_PRODUCTS_TEXT_EFFECT,
                      PDF_INV_PRODUCTS_TEXT_HEIGHT);  

	$pdf->MultiCell(78,6,substr($order->products[$i]['name'],0,50),1,'L', '1');
} else{
       $pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                      PDF_INV_PRODUCTS_TEXT_EFFECT,
                      PDF_INV_PRODUCTS_TEXT_HEIGHT);  

	$pdf->MultiCell(78,6,$order->products[$i]['name'],1,'L', '1');
   }


//$pdf->SetFont('Arial','',10);
//$pdf->SetY($Y_Table_Position);
//$pdf->SetX(95);
//$pdf->MultiCell(15,6,tep_display_tax_value($order->products[$i]['tax']) . '%',1,'C');

$pdf->SetY($Y_Table_Position);
$pdf->SetX(118);
   //$pdf->SetFont('Arial','',10);
$pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                  PDF_INV_PRODUCTS_TEXT_EFFECT,
                  PDF_INV_PRODUCTS_TEXT_HEIGHT);  

$pdf->MultiCell(20,6,$currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']),1,'R', '1');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(138);
$pdf->MultiCell(20,6,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']),1,'R', '1');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(158);
$pdf->MultiCell(20,6,$currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']),1,'R', '1');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(178);
$pdf->MultiCell(20,6,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']),1,'R', '1');
$Y_Table_Position += 6;	

//get attribs 
   if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
       for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
      $pdf->SetY($Y_Table_Position);
      $pdf->SetX(40);

   	  if (strlen(" - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] )> 40 && strlen(" - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']) < 50){

	    $pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                          PDF_INV_PRODUCTS_TEXT_EFFECT,
                          PDF_INV_PRODUCTS_TEXT_HEIGHT);  
	    $pdf->MultiCell(78,6," - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'],1,'L', '1');
	  }
      else if (strlen(" - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']) > 50){
           $pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                          PDF_INV_PRODUCTS_TEXT_EFFECT,
                          PDF_INV_PRODUCTS_TEXT_HEIGHT);  

	    $pdf->MultiCell(78,6,substr(" - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'],0,50),1,'L', '1');
      } else {
           $pdf->SetFont( PDF_INV_PRODUCTS_TEXT_FONT,
                          PDF_INV_PRODUCTS_TEXT_EFFECT,
                          PDF_INV_PRODUCTS_TEXT_HEIGHT);  

	    $pdf->MultiCell(78,6," - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'],1,'L', '1');
         }	      

         //$pdf->MultiCell(78,6," - " .$order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'],1,'L', '1');
         $Y_Table_Position += 6;

         //Check for product line overflow
         $item_count++;
      if ( $item_count > 20 ) {
            $pdf->AddPage();
            //Fields Name position
            $Y_Fields_Name_position = 125;
            //Table position, under Fields Name
            $Y_Table_Position = 70;
            output_table_heading($Y_Table_Position-6);
            $item_count = 1;
            $text_color=explode(",",PDF_INV_PRODUCTS_TEXT_COLOR );
            $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]); 


            $text_color=explode(",",PDF_INV_PRODUCTS_FILL_COLOR );
            $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

            $text_color=explode(",",PDF_INV_PRODUCTS_LINE_COLOR );
            $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );    
         }         
       }
   }   

   //Check for product line overflow
   $item_count++;
//    if ((is_long($item_count / 32) && $i >= 20) || ($i == 20)){
if ( $item_count > 20 ) {	
       $pdf->AddPage();
       //Fields Name position
       $Y_Fields_Name_position = 125;
       //Table position, under Fields Name
       $Y_Table_Position = 70;
       output_table_heading($Y_Table_Position-6);
       //if ($i == 20) 
       $item_count = 1;
       $text_color=explode(",",PDF_INV_PRODUCTS_TEXT_COLOR );
       $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]); 


       $text_color=explode(",",PDF_INV_PRODUCTS_FILL_COLOR );
       $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

       $text_color=explode(",",PDF_INV_PRODUCTS_LINE_COLOR );
       $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );    
   }
}

$pdf->SetFont( PDF_INV_ORDERTOTAL1_TEXT_FONT,
              PDF_INV_ORDERTOTAL1_TEXT_EFFECT,
              PDF_INV_ORDERTOTAL1_TEXT_HEIGHT);  

$text_color=explode(",",PDF_INV_ORDERTOTAL1_TEXT_COLOR );
$pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]);

$text_color=explode(",",PDF_INV_ORDERTOTAL1_FILL_COLOR );
$pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

$text_color=explode(",",PDF_INV_ORDERTOTAL1_LINE_COLOR );
$pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );       

for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
$pdf->SetY($Y_Table_Position + 5);
$pdf->SetX(103);
$temp = substr ($order->totals[$i]['text'],0 ,3);
if ($temp == '<b>') {
       $pdf->SetFont( PDF_INV_ORDERTOTAL2_TEXT_FONT,
                      PDF_INV_ORDERTOTAL2_TEXT_EFFECT,
                      PDF_INV_ORDERTOTAL2_TEXT_HEIGHT);  

       $text_color=explode(",",PDF_INV_ORDERTOTAL2_TEXT_COLOR );
       $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]);

       $text_color=explode(",",PDF_INV_ORDERTOTAL2_FILL_COLOR );
       $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

       $text_color=explode(",",PDF_INV_ORDERTOTAL2_LINE_COLOR );
       $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );   
	$temp2 = substr($order->totals[$i]['text'], 3);
	$order->totals[$i]['text'] = substr($temp2, 0, strlen($temp2)-4);
}
$pdf->MultiCell(94,6,$order->totals[$i]['title'] . ' ' . $order->totals[$i]['text'],0,'R', '1' );
$Y_Table_Position += 5;

//Check for product line overflow
   $item_count++;
if ( $item_count > 20 ) {	
       $pdf->AddPage();
       //Fields Name position
       $Y_Fields_Name_position = 125;
       //Table position, under Fields Name
       $Y_Table_Position = 70;
       output_table_heading($Y_Table_Position-6);

       $item_count = 1;
       $text_color=explode(",",PDF_INV_ORDERTOTAL1_TEXT_COLOR );
       $pdf->SetTextColor($text_color[0], $text_color[1], $text_color[2]); 


       $text_color=explode(",",PDF_INV_ORDERTOTAL1_FILL_COLOR );
       $pdf->SetFillColor( $text_color[0], $text_color[1], $text_color[2] );  

       $text_color=explode(",",PDF_INV_ORDERTOTAL1_LINE_COLOR );
       $pdf->SetDrawColor( $text_color[0], $text_color[1], $text_color[2] );    
   }	
}
// Draw the shipping address for label
//Draw the invoice delivery address text
/*
   $pdf->SetFont('Arial','B',11);
$pdf->SetTextColor(0);
//$pdf->Text(117,61,ENTRY_SHIP_TO);
//$pdf->SetX(0);
$pdf->SetY(240);
   $pdf->Cell(20);
$pdf->MultiCell(50, 4, strtoupper(tep_address_format(1, $order->delivery, '', '', "\n")),0,'L');
	*/
// PDF's created now output the file
 // are we streaming for email attachment or outputting to browser?
   if($stream){
       return $pdf->Output( "", "S" );
   } else {
    //$mode = (FORCE_PDF_INVOICE_DOWNLOAD == 'true') ? 'D' : 'I';
   // what do we do? display inline or force download
    $pdf->Output();
   }
?>

 

When I say not populating I get no send to and no bill to just a single comma in each and all products and prices are missing. They do however appear in the packing slip but obviously with no prices.

 

It would be great if you can help. Aidan

Share this post


Link to post
Share on other sites

Hope it is okay to insert so many lines of code?

 

Thinking now my problem may be the SQL as on investigating further I can alter the output of the pdf file by changing the content of the SQL. Example I have changed the footer text on both inv and ps - is that incorrect?

 

Regards Aidan

Share this post


Link to post
Share on other sites

Hello,

 

I have installed this PDF addon and it works great. Thanks for this one! I have one 'problem'. I can't locate the source of information that is stated in the upper right corner of invoice:

 

siteaddress.com

Store Name

Address

Country

Phone

 

Where do I change information above? Is it hard coded?

 

I hope someone can help.

 

Cheers!

Share this post


Link to post
Share on other sites

Hello,

 

I have installed this PDF addon and it works great. Thanks for this one! I have one 'problem'. I can't locate the source of information that is stated in the upper right corner of invoice:

 

siteaddress.com

Store Name

Address

Country

Phone

 

Where do I change information above? Is it hard coded?

 

I hope someone can help.

 

Cheers!

 

bump

 

Anyone?

Share this post


Link to post
Share on other sites

Hi

Is there any add on for batch printing, i have PDF Invoice V1.1 and like to

have it to print all orders in processing. Only push one button and print all.

Is it possible?

Best regards Anders (Sweden)

Edited by sixxnikki

Share this post


Link to post
Share on other sites

Hi,

 

Has anybody manged to stream a pdf into any email other than the Confirmation Email. I have tried unsuccessfully for the past week to stream a pdf into the Order Status Email...

 

or another option

 

Has anybody managed to attach a pdf created by this addon to an email, using the 'add_attachment' method. Again for the past week i have been trying this method as well. If i manage to attach a pdf, it is not decoded properly...

 

Any idea's, code snippets, full blown addons will be greatly received. Failing that the number of a good Doctor, cause this driving me MAD!!!!

Share this post


Link to post
Share on other sites

hi

 

been using this great contrib for ages now with no issues, just noticed though that its not loading the info, only the Logo is being shown.

 

I am not sure when it started doing this and have a heavily modified install but most of the niggly things latley have been after I switched off Register Globals, anybody know if this will effect this contrib and if so a remedy.

 

Thank you


David

Share this post


Link to post
Share on other sites

Hi, I was wondering if anyone could help me with a couple of problems with my PDF Invoice contribution installation.

I have been through it a couple of times adjusting the value's trying to reposition the text, but cannont find the answer.

 

Here are the pics.

 

PDF_Problem1.jpg

Notice the PDF_INV_COMMENTS

 

PDF_Problem2.jpg

 

This is the Payment Text all messed up.

 

Any help would be much appreciated.

Edited by pingpongrob

Share this post


Link to post
Share on other sites

Hi Chris,

I'm getting the order lines and prices, what I don't get is the address nor the order date and payment method.

pdfinvoice.jpg

My customers are only allowed one address.

I don't sell virtual products, so that's not the problem.

Everything is fine on the account_history_info.php as far as I can see.

The link to the invoice is there.

 

Cheers

Endre

 

Hi.

I know this is an old post and maybe I've missed something somewhere, but can anyone tell me how this was sorted? I have the same problem (no addresses showing) and can't find any other reference to the problem. Seems like this was sorted off-forum for Endre, and no fix was mentioned.

Thanks

Chris :)

Simply Scent

Share this post


Link to post
Share on other sites

Hi.

I know this is an old post and maybe I've missed something somewhere, but can anyone tell me how this was sorted? I have the same problem (no addresses showing) and can't find any other reference to the problem. Seems like this was sorted off-forum for Endre, and no fix was mentioned.

Thanks

Chris :)

Simply Scent

 

I had big problems too.

Found iour that changing the character height (to 6 or 8) solved some items like overlapping teksts. Found that changing the placement coordinates of the text in pdf+_nvoice.php solved more problems with overlapping teksts.

 

Had a problem that there where no customer and product details on the invoice when you take a look at it by pressing the pfd-invoice button, BUT, when you update the order and the PDF invoice is sent as email attachment these items ARE visible on the attached PDF invoice.

 

I still have 1 problem left; i want every customer who places an order to get a pdf-invoice standard by email with every order. Since the pdf-invoice is in the admin area i can't figure out how to do this.

Anyone ?

 

Grtx, Henk

Share this post


Link to post
Share on other sites

Hi Chris or anyone,

 

like many others I think this is a great contrib.

However, one important feature is still missing: create pdf for multiple invoices at the same time.

 

Something where you can select some orders (checkbox on order.php) OR based on status (e.g. like in batch print center).

 

I see this feature got requested before already:

- posts 302 + 306

- post 633

 

Unfortunately I have not seen any feedback or action to this type of request.

Last few days I have tried several other contribs and tried to combine them or use logic from those but all efforts were not successful hence my post now!

 

I would highly appreciate if someone could develop something (I'm not a PHP expert but willing to help testing).

The other contribs are not as good as this one so adding the "multiple invoice print" would be a great add on.

 

many thanks!

Share this post


Link to post
Share on other sites

Does anyone got an updated file for the admin add-onn.

invoice_pdf.php (catalog/admin/invoice_pdf.php)

So it will exactly be the same at the admin side as the client side.

Some things are displayed different in admin.

 

But more imprtant.

There is a bug fix for the customer reference:

 

EDIT pdfinvoice.php

 

FIND:

if($HTTP_GET_VARS['passthruID'] === $pass_phrase_hash){

 

 

IMMEDIATELY AFTER add:

 

// get customer_id for this order number
       $customer_info_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
       $customer_info = tep_db_fetch_array($customer_info_query);
       $customer_id = $customer_info['customers_id'];

 

But where is that first line ($HTTP_GET_VARS['passthruID'] === $pass_phrase_hash){ looked for it in catolog pfd invoice but its not in there checked it four times Used a search program to search in all my files couldn't find it there. Downloaded the default package also didn't found anything.

 

For the rest contribution works like it should. ;)

Share this post


Link to post
Share on other sites

Hi Chris or anyone,

 

like many others I think this is a great contrib.

However, one important feature is still missing: create pdf for multiple invoices at the same time.

 

Something where you can select some orders (checkbox on order.php) OR based on status (e.g. like in batch print center).

 

I see this feature got requested before already:

- posts 302 + 306

- post 633

 

Unfortunately I have not seen any feedback or action to this type of request.

Last few days I have tried several other contribs and tried to combine them or use logic from those but all efforts were not successful hence my post now!

 

I would highly appreciate if someone could develop something (I'm not a PHP expert but willing to help testing).

The other contribs are not as good as this one so adding the "multiple invoice print" would be a great add on.

 

many thanks!

 

 

Unfortunately no one has replied or provided some help. Is this a more complex request then I think it is?

If someone can take me in the right direction that would be great. thanks!

Share this post


Link to post
Share on other sites

Hi Chris...great contribution for someone who doesn't know too much about php but can follow your instructions gaining the desired affect.

 

I have just recently added a contribution Option Types v2.1.3that allows me to add selection boxes, text area, upload photos etc for some of the items i intend to sell.

 

Hence the reason why i am writing...for one aspect of pdf invoice works, but not totally for which i will share.

Subject to how many Option Types you use per product, when it comes to viewing your invoice, once you run out of line description that is it. Is there (for i am not savvy with php YET) a way in which the line expands similarly to admin/invoice or packing slip where you get a full list of the order but in pdf format.

 

oscommerce.png

 

I am guessing that the neccessary code changes might be in the catalog/pdfinvoice and account_history_info and likewise in the includes/pdfinvoice and account_history_info

 

any comments would be appreciated - thankyou

Share this post


Link to post
Share on other sites

I've got a strange one. I have v1.2 installed and haven't changed anything for over a year.

 

Today it stops working in IE - with force download set to true. When I click on the link, I get an IE popup saying it can't download the file. It works fine in firefox however.

 

If I disable force download, it then works inline in IE.

 

Anyone seen this before?

Share this post


Link to post
Share on other sites

Great Contribution this is however I'm having an issue with it, well actually I'm having an issue customizing something. in the code below, the pdf gets to the customers email thats perfect, even the second part of the snippet is fine sending a second email if the customer needs the invoice sent to multiple email addresses however the issue comes up with this:

 

include_once(FILENAME_CUSTOMER_PDF_PACKINGSLIP);

 

upon trying to call a second PDF, a different one that is, i can send the same one to many addresses but once a second pdf is called it crashes the checkout_process page and gives a blank page, does anyone know how I can fix this or what might be causing the problem?

 

However if I replace this:

 

include_once(FILENAME_CUSTOMER_PDF_PACKINGSLIP);

 

with this:

 

include_once(FILENAME_CUSTOMER_PDF);

 

then everything works perfectly.

 

// BEGIN added for pdfinvoice email attachment:

   if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') {
       // customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up
       $HTTP_GET_VARS['order_id'] = $insert_id;
       // set stream mode
       $stream = true;
       // include pdfinvoice.php
       include_once(FILENAME_CUSTOMER_PDF);
       // add text to email informing customer a pdf invoice copy has been attached:
       $email_order .= PDF_INVOICE_ATTACHED ."\n\n";
       // send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email
       // note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name']
       if (tep_not_null($pdf_data)) {
           tep_mail_string_attachment($order->customer['name'], $order->customer['email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' . EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
       } else {
           tep_mail($order->customer['name'], $order->customer['email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' . EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
       }
   } else {
       // send vanilla e-mail - if email attachment option is false
//Package Tracking Plus BEGIN
 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' . EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
//Package Tracking Plus END
   }

//Begin Secondary Email Address 
if ($order->customer['email_address2_tick'] == '1') {
//The below line should be IDENTICAL to the line about 5 rows up otherwise each email will get different emails
   if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') {
       // customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up
       $HTTP_GET_VARS['order_id'] = $insert_id;
       // set stream mode
       $stream = true;
       // include pdfinvoice.php
       include_once(FILENAME_CUSTOMER_PDF);
       // add text to email informing customer a pdf invoice copy has been attached:
       $email_order .= PDF_INVOICE_ATTACHED ."\n\n";
       // send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email
       // note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name']
       if (tep_not_null($pdf_data)) {
           tep_mail_string_attachment($order->customer['name'], $order->customer['email_address2'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' . EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
       } else {
           tep_mail($order->customer['name'], $order->customer['email_address2'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' . EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
       }
   } else {
       // send vanilla e-mail - if email attachment option is false
//Package Tracking Plus BEGIN
 tep_mail($order->customer['name'], $order->customer['email_address2'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1 . ' ' . $insert_id . ' ' . EMAIL_TEXT_SUBJECT_2 , $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
//Package Tracking Plus END
   }
}
//End Secondary Email Address 

// END added for pdfinvoice email attachment:

// Begin added for PDF Packing Slip Attachment for ADMIN

   if (PDF_PACKINGSLIP_EMAIL_ATTACHMENT == 'true') {
       // customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up
       $HTTP_GET_VARS['order_id'] = $insert_id;
       // set stream mode
       $stream = true;
       // include pdfinvoice.php
       include_once(FILENAME_CUSTOMER_PDF_PACKINGSLIP);
       // add text to email informing customer a pdf invoice copy has been attached:
//        $email_order .= PDF_INVOICE_ATTACHED ."\n\n";
       // send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email
       // note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name']
       if (tep_not_null($pdf_data)) {
           tep_mail_string_attachment($order->customer['name'], PDF_PACKINGSLIP_EMAIL, 'Drop Order - ' . $insert_id . ': ' , $email_order_packingslip, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
       }
   }

// END added for PDF Packing Slip Attachment for ADMIN

 

Thanks for any and all help :)

Share this post


Link to post
Share on other sites

The links in the installation are not in the right format to install it on v2.3.1.

 

 

This is the Problem:

 

iv) EDIT catalog/admin/orders.php

FIND (around line 321):

<tr>
       <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
     </tr>

REPLACE WITH:

<tr>
       <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $HTTP_GET_VARS['oID'] . '&passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice_pdf.gif', IMAGE_ORDERS_PDF_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
     </tr>

FIND (around line 412):

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

REPLACE WITH:

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $oInfo->orders_id . '&passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice_pdf.gif', IMAGE_ORDERS_PDF_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

 

 

in 2.3.1 it looks lik this

       $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete')));
       $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_ORDERS_INVOICE, 'document', tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id), null, array('newwindow' => true)) . tep_draw_button(IMAGE_ORDERS_PACKINGSLIP, 'document', tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id), null, array('newwindow' => true)));
       $contents[] = array('text' => '<br />' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
       if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
       $contents[] = array('text' => '<br />' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);

 

or this.

 

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
           <td class="smallText" align="right"><?php echo tep_draw_button(IMAGE_ORDERS_INVOICE, 'document', tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_ORDERS_PACKINGSLIP, 'document', tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')))); ?></td>

 

I don't know exactly whats the right lines.

Is some one able to convert this links?

 

greetings

farenhide

Share this post


Link to post
Share on other sites

Now i have a little problem whith the total of the pdf invoice.

 

Zwischensumme: 12,99EUR

Pauschalpreis (Best Way): 0,00EUR

Gesamtsumme: <strong>12,99EUR</strong>

MwSt. 19%: 2,07EUR

 

does someone know how i can fix that the html commands don't work and they are displayed in the pdf?

thanks

farenhide

Edited by farenhide

Share this post


Link to post
Share on other sites

Hey guysm great contrib.. But I have a strange problem when the invoice is pulled. It shows for example

Sub-Total: R4,900.00
Speed Services Couriers (Overnight Delivery to <b>Post office Counter</b> R70.00
Total: <strong> R4970.00</strong>

 

Instead of:

Sub-Total: R4,900.00

Speed Services Couriers (Overnight Delivery to Post office Counter R70.00

Total: R4970.00

 

I have changed the following:

 

$pdf->Text(130,113, tep_html_entity_decode(ENTRY_PAYMENT_METHOD) . ' ' . tep_html_entity_decode($temp));

 

TO

 

$pdf->Text(130,113, tep_html_entity_decode(ENTRY_PAYMENT_METHOD) . ' ' . tep_html_entity_decode(strip_tags($temp)));

 

But no luck.. please help

Share this post


Link to post
Share on other sites

Hi,

 

Fantastic addon. I did install the "pdf invoice" and the "add to email confirmation" addons both. The reason I want the pdf attached to the confirmation emails is that we have a separated handling / shipping location. The orders are handled and processed in one location, and after payment the confirmation email is forwarded to the shipping department. For all shipments, an invoice is included, so this really saves us a lot of time creating pdfs manually from the backend.

 

BUT:

 

(at least in my case) the pdf file is only attached to the customer's confirmation email, NOT the "copy to store owner" email. And that is the mail I've set up the whole thing for! Any way to make it being attached to the store owners' email as well?

 

Regards,

 

Marco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×