Jump to content

PDF Invoice adding additional info


wildorchid

Recommended Posts

Hi,

 

My main payment method is Bank Transfer". I'd like to add the bank transfer info that I've added in the Admin part to show in my PDF invoice. I understand that I need to edit the pdfconfig.php but what are the vars I need to add? :oops:

 

 

if($paymentmethod=="bank transfer") {

....

...

 

Thanks for your kind help

Link to comment
Share on other sites

These are the email ones

 

Product Email Merge Fields

 

[RegDate] Registration Date

[Product] * Product/Service

[ConfigOptions] Configurable Options

[Domain] * Domain

[serverName] Server Name

[serverIP] Server IP

[DedicatedIP] Dedicated IP

[AssignedIPs] Assigned IPs

[Nameserver1] Nameserver 1

[Nameserver1IP] Nameserver 1 IP

[Nameserver2] Nameserver 2

[Nameserver2IP] Nameserver 2 IP

[PaymentMethod] Payment Method

[Amount] Amount

[billingCycle] Billing Cycle

[NextDueDate] Next Due Date

[status] Status

[username] Username

[Password] Password

[RootUsername] Root Username

[RootPassword] Root Password

[status] Status

[ProductCustom-

FieldName] Custom Field Values

Order Confirmation Merge Fields

 

[OrderID] * Order ID

[OrderNumber] * Order Number

[OrderDetails] Order Details List

Client Email Merge Fields

 

[CustomerName] * Customer Name

[CustomerFirstName] First Name Only

[CustomerEmail] Email Address

[Address1] Address 1

[Address2] Address 2

[City] City

[state] State

[Postcode] Postcode

[Country] Country

[PhoneNumber] Phone Number

[CAPassword] Client Area Password

[Custom-FieldName] Custom Field Values

Other Merge Fields

 

[CompanyName] * Your Company Name

[ClientAreaLink] Link to Client Area

[signature] Default Email Signature

* Items marked with this symbol can be used in the messages subject

NOTE: Replace FieldName with name of custom field

Link to comment
Share on other sites

  • 2 months later...

apparently these are the PDF ones...

Available Variables

 

The following variables are available for usage in the pdfconfig.php file.

 

$datecreated - The date the invoice was created

$duedate - The date the invoice is due

$datepaid - Shows paid date/time if invoice is set to Paid

$userid - Client ID Number

$clientsdetails - Array of clients information

$subtotal

$tax

$taxrate

$credit

$total

$status - Paid, Unpaid or Cancelled

$paymentmethod

$notes

$companyname - Your Company Name

$companyurl - Your Default Website URL

$companyaddress - Your Company Address

$currencysymbol - Active Currency Symbol

$invoiceitems - Array of invoice items

But I can't see where to configure my $companyaddress in the WHMCS config / where it is stored in the DB. I've had to put in my address manually in the template for now.

Link to comment
Share on other sites

  • 2 months later...
  • 11 months later...

This pdfconfig.php copy gives you all you might want/need:

 

1- The Customer VAT number if entered in the Custom Fields

2- The payment details for several payment methods (like Bank Transfer)

3- Put your company legal details like IBAN/SWIFT, bank account number, your VAT number, your Chamber of Commerce number, disclaimer and link to your home page in your invoice footer.

 

before you try this make a copy of your original includes/pdfconfig.php file

 


<?php
function myVATNumber($myclientemail){ 
//$myclientemail can contain the user id or the user email; 
   global $db_name,$db_host, $db_username,$db_password; 
   $myVAT = ""; 

   if(!$myclientemail) return ""; 

   $link = mysql_connect($db_host, $db_username,$db_password) or  die('Could not connect: ' . mysql_error()); 
   mysql_select_db($db_name, $link) or die('Could not select database.'); 

   $sql="SELECT B.value from tblclients A, tblcustomfieldsvalues B WHERE B.fieldid=2 and B.relid=A.id and (A.email='$myclientemail' or A.id='$myclientemail')"; 
   $result = mysql_query($sql) or   die('Invalid query: ' . mysql_error()); 
   if(mysql_num_rows($result)>0) 
   { 
       $row = mysql_fetch_array($result); 
       if(strlen($row['value'])>0)    $myVAT = $row['value']; 
   } 

   mysql_close($link); 

   return $myVAT; 
}  
# Wijziging 11-06-2008
$ShowOnPayed = "1"; // 1 Shows the bankinformation even if the invoice is payed || 0 Shows the bankinformation only if the invoice isn't payed 

function wire_analize($payed, $status) { 
   if($status=="Cancelled" OR $status=="Paid") { 
       $InvoiceActive = 0; 
   } else { $InvoiceActive = 1; } 

   if ($payed==1)  
   { 
       return true; // true 
   } 
   elseif ($InvoiceActive==0 && $payed==0)  
   { 
       return false; // false 
   } 
   elseif ($InvoiceActive==1 && $payed==0)  
   { 
       return true; // false 
   }  
}
# einde wijziging 11-06-2008
$pdf->SetAuthor('DutchNet Bilthoven');
$pdf->SetCreator('DutchNet Bilthoven');
$pdf->SetAuthor('DutchNet'); 
$pdf->SetSubject('Invoice for hosting and domainname');

# Logo
$pdf->Image(ROOTDIR.'/images/logo.jpg',15,10,50);

# Company Details
$pdf->SetFont('Arial','',;
$Y=10;
for ( $i = 0; $i <= 4; $i += 1) {
       $pdf->SetXY(170,$Y);
$pdf->Cell(40,4,trim($companyaddress[$i]),0,1,'R');
$Y=$Y+4;
}
$pdf->Ln(5);

# Header Bar
$invoiceprefix = $_LANG["invoicenumber"];
/*
** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice **/
if ($status!="Paid") {
$invoiceprefix = $_LANG["proformainvoicenumber"];
}
$pdf->SetTitle($invoiceprefix.' : '.$invoicenum);

$pdf->SetXY(150,50);
$pdf->SetFillColor(239);
$pdf->SetFont('Arial','',;
$pdf->SetX(150);
$pdf->Cell(58,6,$_LANG["invoicesdatecreated"].' : '.$datecreated.'',0,1,'L','1');
$pdf->SetX(150);
$pdf->Cell(58,6,$invoiceprefix.' : '.$invoicenum,0,1,'L','1');
$pdf->SetX(150);
$pdf->Cell(58,6,$_LANG["invoicesdatedue"].' : '.$duedate.'',0,1,'L','1');

$pdf->SetX(150);

# Start wijziging 11-06-2008
///////----Wire transfer 
if(wire_analize($ShowOnPayed, $status)) 
{ 
   $query = "SELECT gateway1.value AS instructions, gateway2.value AS name 
   FROM tblinvoices 
   left join tblpaymentgateways gateway1 ON gateway1.gateway = tblinvoices.paymentmethod && gateway1.setting = 'instructions' 
   left join tblpaymentgateways gateway2 ON gateway2.gateway = tblinvoices.paymentmethod && gateway2.setting = 'name' 
   WHERE 
   ( 
       tblinvoices.invoicenum = '".$invoicenum."' 
       OR  
       tblinvoices.id = '".$invoicenum."' 
   )"; 
   $result = mysql_query($query); 
   while ($data = mysql_fetch_assoc($result))  
   { 
       $gatewayName            = $data['name'];         
       $gatewayInstructions    = $data['instructions']; 
   } 
       $paymentGateways  = "Payment: ".$gatewayName."\n"; 
       $paymentGateways .= $gatewayInstructions; 
       $pdf->SetTextColor(0); 
       $pdf->SetFont('Arial','',; 
       $gatewayinfo = explode("\n", $paymentGateways); 
       $ordinate     = 90; 
       $abscissa     = 90; 
       $linebreaks = 3; 
       for ( $i = 0; $i <= count($gatewayinfo); $i += 1)  
       { 
           $pdf->SetXY($abscissa,$ordinate); 
//            $pdf->Write(5,trim($gatewayinfo[$i])); 
           $pdf->Cell(58,6,trim($gatewayinfo[$i]),0,1,'L','0'); 
           $ordinate = $ordinate + $linebreaks; 
       } 
}  

//////----Wire Transfer 

# Einde wijziging 11-06-2008


//get the VAT from this customer 
if($clientsdetails['email']=='') {
  $m=$clientsdetails['id']; 
} else {
  $m=$clientsdetails['email']; 
  $myVATNumber=myVATNumber($m); 
}
if ($myVATNumber) {
  $pdf->SetFont('Arial','',;
  $pdf->SetXY(150,68);
  $pdf->Cell(58,6,"BTW/VAT nr.: ".$myVATNumber,0,1,'L','1');
}

# Clients Details
$pdf->SetXY(20,50);
$pdf->SetFont('Arial','',11);
if ($clientsdetails["companyname"]) {
       $pdf->Cell(0,4,$clientsdetails["companyname"],0,2,'L');
       $pdf->Cell(0,4,$_LANG["invoicesattn"]." ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,2,'L');
} else {
       $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,2,'L');
}

$pdf->SetFont('Arial','',11);
$pdf->Cell(0,4,$clientsdetails["address1"],0,2,'L');
if ($clientsdetails["address2"]) {
       $pdf->Cell(0,4,$clientsdetails["address2"],0,2,'L');
}
$pdf->SetFont('Arial','',11);
$pdf->Cell(0,4,$clientsdetails["postcode"]."  ".$clientsdetails["city"],0,2,'L');

# do not print country if customer is in the same country as your company
if ($clientsdetails["country"] != "Netherlands") {
       $pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');
}
$pdf->Ln(45);

$pdf->SetDrawColor(200);

$pdf->SetFont('Arial','B',10);
$pdf->SetFillColor(239);
$pdf->Cell(148,7,$_LANG["invoicesdescription"],1,0,'C','1');
$pdf->Cell(40,7,$_LANG["invoicesamount"],1,0,'C','1');
$pdf->Ln();

$pdf->SetFont('Arial','',9);

foreach ($invoiceitems AS $item) {
if (strlen($item["description"])>90) {
	$pdf->Cell(148,6,substr($item["description"],0,90),1);
	$pdf->Cell(40,6,$currencysymbol." ".$item["amount"]." ",1,0,'R');
	$pdf->Ln();
	$pdf->Cell(148,6,substr($item["description"],90),1);
	$pdf->Cell(40,6,"",1,0,'C');
} else {
	$pdf->Cell(148,6,$item["description"],1);
	$pdf->Cell(40,6,$currencysymbol." ".$item["amount"]." ",1,0,'R');
}
$pdf->Ln();
}

$pdf->SetFont('Arial','B',9);

$pdf->Cell(148,7,$_LANG["invoicessubtotal"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." ".$subtotal." ",1,0,'R','1');
$pdf->Ln();

if ($CONFIG["TaxEnabled"]) {
$pdf->Cell(148,7,$taxrate."% ".$_LANG["invoicestax"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." ".$tax." ",1,0,'R','1');
$pdf->Ln();
}

$pdf->Cell(148,7,$_LANG["invoicescredit"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." - ".$credit." ",1,0,'R','1');
$pdf->Ln();

$pdf->Cell(148,7,$_LANG["invoicestotal"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." ".$total." ",1,0,'R','1');
$pdf->Ln();

$pdf->Ln();

if ($notes) {
$pdf->SetFont('Arial','',;
$pdf->MultiCell(188,5,$_LANG["invoicesnotes"].": $notes");
}

if ($status=="Cancelled") {
$pdf->SetXY(80,75);
$statustext = $_LANG["invoicescancelled"];
} elseif ($status=="Unpaid") {
$pdf->SetXY(120,75);
$statustext = $_LANG["invoicesunpaid"];
} elseif ($status=="Paid") {
$pdf->SetXY(120,75);
$statustext = $_LANG["invoicespaid"];
}
$pdf->SetFont('Arial','B',20);
$pdf->SetTextColor(240);
$pdf->Write(5,strtoupper($statustext));

# Footer
$pdf->SetMargins(15, 27, 15); // left, top, right
$pdf->SetAutoPageBreak(TRUE, 5); // TRUE, margin down
$pdf->SetFooterMargin(5);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

// Factuur footer
$pdf->SetXY(15,-15); # Set Location
//Set font
$pdf->SetFont('Arial', '', 6.5); # Use 6.5pt Text
$pdf->SetTextColor(128);

//Centered text in a framed 80*5 mm cell and line break
$pdf->MultiCell(180, 3, "DutchNet - Bilderdijklaan 112 A - 3723 DG Bilthoven\nKvK xxxxxxx - BTW nr: XX.xxxxxxxxx.X.xx - Postbank xxxxxxx - SWIFT / BIC code XXXXXXXX - IBAN XX xx XXXX xxxx xxxx xx\nOur Terms and Conditions always apply to all our quotes, products and/or services, these are always available on-line on http://www.dutch-net.nl", 0, 'C');

?>

 

Please read the code before you copy all or parts of it

Link to comment
Share on other sites

This pdfconfig.php copy gives you all you might want/need:

 

1- The Customer VAT number if entered in the Custom Fields

2- The payment details for several payment methods (like Bank Transfer)

3- Put your company legal details like IBAN/SWIFT, bank account number, your VAT number, your Chamber of Commerce number, disclaimer and link to your home page in your invoice footer.

 

before you try this make a copy of your original includes/pdfconfig.php file

 


<?php
function myVATNumber($myclientemail){ 
//$myclientemail can contain the user id or the user email; 
   global $db_name,$db_host, $db_username,$db_password; 
   $myVAT = ""; 

   if(!$myclientemail) return ""; 

   $link = mysql_connect($db_host, $db_username,$db_password) or  die('Could not connect: ' . mysql_error()); 
   mysql_select_db($db_name, $link) or die('Could not select database.'); 

   $sql="SELECT B.value from tblclients A, tblcustomfieldsvalues B WHERE B.fieldid=2 and B.relid=A.id and (A.email='$myclientemail' or A.id='$myclientemail')"; 
   $result = mysql_query($sql) or   die('Invalid query: ' . mysql_error()); 
   if(mysql_num_rows($result)>0) 
   { 
       $row = mysql_fetch_array($result); 
       if(strlen($row['value'])>0)    $myVAT = $row['value']; 
   } 

   mysql_close($link); 

   return $myVAT; 
}  
# Wijziging 11-06-2008
$ShowOnPayed = "1"; // 1 Shows the bankinformation even if the invoice is payed || 0 Shows the bankinformation only if the invoice isn't payed 

function wire_analize($payed, $status) { 
   if($status=="Cancelled" OR $status=="Paid") { 
       $InvoiceActive = 0; 
   } else { $InvoiceActive = 1; } 

   if ($payed==1)  
   { 
       return true; // true 
   } 
   elseif ($InvoiceActive==0 && $payed==0)  
   { 
       return false; // false 
   } 
   elseif ($InvoiceActive==1 && $payed==0)  
   { 
       return true; // false 
   }  
}
# einde wijziging 11-06-2008
$pdf->SetAuthor('DutchNet Bilthoven');
$pdf->SetCreator('DutchNet Bilthoven');
$pdf->SetAuthor('DutchNet'); 
$pdf->SetSubject('Invoice for hosting and domainname');

# Logo
$pdf->Image(ROOTDIR.'/images/logo.jpg',15,10,50);

# Company Details
$pdf->SetFont('Arial','',;
$Y=10;
for ( $i = 0; $i <= 4; $i += 1) {
       $pdf->SetXY(170,$Y);
$pdf->Cell(40,4,trim($companyaddress[$i]),0,1,'R');
$Y=$Y+4;
}
$pdf->Ln(5);

# Header Bar
$invoiceprefix = $_LANG["invoicenumber"];
/*
** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice **/
if ($status!="Paid") {
$invoiceprefix = $_LANG["proformainvoicenumber"];
}
$pdf->SetTitle($invoiceprefix.' : '.$invoicenum);

$pdf->SetXY(150,50);
$pdf->SetFillColor(239);
$pdf->SetFont('Arial','',;
$pdf->SetX(150);
$pdf->Cell(58,6,$_LANG["invoicesdatecreated"].' : '.$datecreated.'',0,1,'L','1');
$pdf->SetX(150);
$pdf->Cell(58,6,$invoiceprefix.' : '.$invoicenum,0,1,'L','1');
$pdf->SetX(150);
$pdf->Cell(58,6,$_LANG["invoicesdatedue"].' : '.$duedate.'',0,1,'L','1');

$pdf->SetX(150);

# Start wijziging 11-06-2008
///////----Wire transfer 
if(wire_analize($ShowOnPayed, $status)) 
{ 
   $query = "SELECT gateway1.value AS instructions, gateway2.value AS name 
   FROM tblinvoices 
   left join tblpaymentgateways gateway1 ON gateway1.gateway = tblinvoices.paymentmethod && gateway1.setting = 'instructions' 
   left join tblpaymentgateways gateway2 ON gateway2.gateway = tblinvoices.paymentmethod && gateway2.setting = 'name' 
   WHERE 
   ( 
       tblinvoices.invoicenum = '".$invoicenum."' 
       OR  
       tblinvoices.id = '".$invoicenum."' 
   )"; 
   $result = mysql_query($query); 
   while ($data = mysql_fetch_assoc($result))  
   { 
       $gatewayName            = $data['name'];         
       $gatewayInstructions    = $data['instructions']; 
   } 
       $paymentGateways  = "Payment: ".$gatewayName."\n"; 
       $paymentGateways .= $gatewayInstructions; 
       $pdf->SetTextColor(0); 
       $pdf->SetFont('Arial','',; 
       $gatewayinfo = explode("\n", $paymentGateways); 
       $ordinate     = 90; 
       $abscissa     = 90; 
       $linebreaks = 3; 
       for ( $i = 0; $i <= count($gatewayinfo); $i += 1)  
       { 
           $pdf->SetXY($abscissa,$ordinate); 
//            $pdf->Write(5,trim($gatewayinfo[$i])); 
           $pdf->Cell(58,6,trim($gatewayinfo[$i]),0,1,'L','0'); 
           $ordinate = $ordinate + $linebreaks; 
       } 
}  

//////----Wire Transfer 

# Einde wijziging 11-06-2008


//get the VAT from this customer 
if($clientsdetails['email']=='') {
  $m=$clientsdetails['id']; 
} else {
  $m=$clientsdetails['email']; 
  $myVATNumber=myVATNumber($m); 
}
if ($myVATNumber) {
  $pdf->SetFont('Arial','',;
  $pdf->SetXY(150,68);
  $pdf->Cell(58,6,"BTW/VAT nr.: ".$myVATNumber,0,1,'L','1');
}

# Clients Details
$pdf->SetXY(20,50);
$pdf->SetFont('Arial','',11);
if ($clientsdetails["companyname"]) {
       $pdf->Cell(0,4,$clientsdetails["companyname"],0,2,'L');
       $pdf->Cell(0,4,$_LANG["invoicesattn"]." ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,2,'L');
} else {
       $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,2,'L');
}

$pdf->SetFont('Arial','',11);
$pdf->Cell(0,4,$clientsdetails["address1"],0,2,'L');
if ($clientsdetails["address2"]) {
       $pdf->Cell(0,4,$clientsdetails["address2"],0,2,'L');
}
$pdf->SetFont('Arial','',11);
$pdf->Cell(0,4,$clientsdetails["postcode"]."  ".$clientsdetails["city"],0,2,'L');

# do not print country if customer is in the same country as your company
if ($clientsdetails["country"] != "Netherlands") {
       $pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');
}
$pdf->Ln(45);

$pdf->SetDrawColor(200);

$pdf->SetFont('Arial','B',10);
$pdf->SetFillColor(239);
$pdf->Cell(148,7,$_LANG["invoicesdescription"],1,0,'C','1');
$pdf->Cell(40,7,$_LANG["invoicesamount"],1,0,'C','1');
$pdf->Ln();

$pdf->SetFont('Arial','',9);

foreach ($invoiceitems AS $item) {
if (strlen($item["description"])>90) {
	$pdf->Cell(148,6,substr($item["description"],0,90),1);
	$pdf->Cell(40,6,$currencysymbol." ".$item["amount"]." ",1,0,'R');
	$pdf->Ln();
	$pdf->Cell(148,6,substr($item["description"],90),1);
	$pdf->Cell(40,6,"",1,0,'C');
} else {
	$pdf->Cell(148,6,$item["description"],1);
	$pdf->Cell(40,6,$currencysymbol." ".$item["amount"]." ",1,0,'R');
}
$pdf->Ln();
}

$pdf->SetFont('Arial','B',9);

$pdf->Cell(148,7,$_LANG["invoicessubtotal"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." ".$subtotal." ",1,0,'R','1');
$pdf->Ln();

if ($CONFIG["TaxEnabled"]) {
$pdf->Cell(148,7,$taxrate."% ".$_LANG["invoicestax"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." ".$tax." ",1,0,'R','1');
$pdf->Ln();
}

$pdf->Cell(148,7,$_LANG["invoicescredit"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." - ".$credit." ",1,0,'R','1');
$pdf->Ln();

$pdf->Cell(148,7,$_LANG["invoicestotal"].":",1,0,'R','1');
$pdf->Cell(40,7,$currencysymbol." ".$total." ",1,0,'R','1');
$pdf->Ln();

$pdf->Ln();

if ($notes) {
$pdf->SetFont('Arial','',;
$pdf->MultiCell(188,5,$_LANG["invoicesnotes"].": $notes");
}

if ($status=="Cancelled") {
$pdf->SetXY(80,75);
$statustext = $_LANG["invoicescancelled"];
} elseif ($status=="Unpaid") {
$pdf->SetXY(120,75);
$statustext = $_LANG["invoicesunpaid"];
} elseif ($status=="Paid") {
$pdf->SetXY(120,75);
$statustext = $_LANG["invoicespaid"];
}
$pdf->SetFont('Arial','B',20);
$pdf->SetTextColor(240);
$pdf->Write(5,strtoupper($statustext));

# Footer
$pdf->SetMargins(15, 27, 15); // left, top, right
$pdf->SetAutoPageBreak(TRUE, 5); // TRUE, margin down
$pdf->SetFooterMargin(5);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

// Factuur footer
$pdf->SetXY(15,-15); # Set Location
//Set font
$pdf->SetFont('Arial', '', 6.5); # Use 6.5pt Text
$pdf->SetTextColor(128);

//Centered text in a framed 80*5 mm cell and line break
$pdf->MultiCell(180, 3, "DutchNet - Bilderdijklaan 112 A - 3723 DG Bilthoven\nKvK xxxxxxx - BTW nr: XX.xxxxxxxxx.X.xx - Postbank xxxxxxx - SWIFT / BIC code XXXXXXXX - IBAN XX xx XXXX xxxx xxxx xx\nOur Terms and Conditions always apply to all our quotes, products and/or services, these are always available on-line on http://www.dutch-net.nl", 0, 'C');

?>

 

Please read the code before you copy all or parts of it

 

 

Very nice but it's not working in v6.3.2.

When the client has placed an order, he doesn't receive the PDF invoice email or the Order Confirmation email.

Once I removed the following line, everything worked fine:

 

//get the VAT from this customer

if($clientsdetails['email']=='') {

$m=$clientsdetails['id'];

} else {

$m=$clientsdetails['email'];

$myVATNumber=myVATNumber($m);

}

if ($myVATNumber) {

$pdf->SetFont('Arial','',8);

$pdf->SetXY(150,68);

$pdf->Cell(58,6,"BTW/VAT nr.: ".$myVATNumber,0,1,'L','1');

}

 

 

Any ideas why??

Link to comment
Share on other sites

we are using 3.6.2 as well and have no problems with downloadin the pdf files.

Silly thing is e-mail invoices were not generated with these line in, Matt thought it had something to do with available memory to PHP.

So we increased (tripled) the memory available to PHP but it did not help.

 

I will have a look what happens if I remove these lines and get back to you asap.

Link to comment
Share on other sites

Hmm I tried using it, filled in my own details where necessairy but when I upload it and tried opening an invoice PDF with my foxit PDF reader it says that either it isn't a pdf or that it is corrupt.

 

I even tried it without the VAT piece mentioned earlier having problems but doesn't work too then. Or doesn't it work with 3.6.0? As I still need to update my template files first before I can update to 3.6.2.

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
The address is configured in Configuration > General Configuration > Invoices > Address

 

Hi Matt

 

I am very very pleased with WHMCS and have recommended it everywhere.

 

One thing I would love to see is a general note area on the PDF invoice so we can put Bank Details, Association details etc.

 

A textarea in General Settings/Invoices and the appropriate code in pdfconfig.php to display it. may have to restrict it to a certain amount of lines or characters to fit on invoice.

 

Kind regards

Tony

Link to comment
Share on other sites

Hi Tony

 

I think everyone has different requirements for their invoice format.

 

For static info such as bank details why not just add it into the pdfconfig.php?

 

$pdf->SetXY(15,-15); #Set Location
$pdf->SetFont('Arial', '', 6.5); #6.5pt
$pdf->SetTextColor(128); #Grey
$pdf->MultiCell(180, 3, "My Text Line1\nMy Text Line2", 0, 'C'); #C=Centered

 

You may have to experiment with positioning (SetXY), font, alignment etc...

 

Hope this helps!

Link to comment
Share on other sites

Hi Tony

 

I think everyone has different requirements for their invoice format.

 

For static info such as bank details why not just add it into the pdfconfig.php?

 

You may have to experiment with positioning (SetXY), font, alignment etc...

 

Hope this helps!

 

Thanks for the code Matt I will use it, but wouldn't it be easier to add this into the code permanently as on most updates it is removed.

 

Also individuals who do not want a footer note can leave it blank.

 

This Textarea would also allow Specials to be advertised in the invoice or other technical or maintenance notes to be sent. Lots of reasons why we could use it. Why is it not possible please.

 

Kind regards

Tony

 

PS. Not having this won't make much difference but it may help. WHMCS still is the best most comprehensive system and I love it!

Link to comment
Share on other sites

Done!

But I noticed that the PDF invoice is different to the printable version in WHMCS.

Customer has made a part payment but it isn't showing on the PDF version. It does show on the printable version.

Invoiced for $220.00, paid $200.00.

 

Is this a feature or oversight?

 

Tony

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Someone solve this issue?

//get the VAT from this customer 
if($clientsdetails['email']=='') {
  $m=$clientsdetails['id']; 
} else {
  $m=$clientsdetails['email']; 
  $myVATNumber=myVATNumber($m); 
}
if ($myVATNumber) {
  $pdf->SetFont('Arial','',;
  $pdf->SetXY(150,68);
  $pdf->Cell(58,6,"BTW/VAT nr.: ".$myVATNumber,0,1,'L','1');
}

When I put it in pgdconfig.php does not send the e-mails with the order and invoice in pdf

 

This $clientsdetails["customfields3"] not work for me. Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated