Jump to content

Invoice layout, move clientdetails


redwood

Recommended Posts

I'd like to move the clientdetails on the invoice to somewhere on the right, we use envelopes with a window on the right.

 

But no mather what i change on the (what i believe is the) layout code. ie. 10,50) Those details just stay at the left. I've managed to change everything on the invoice except this. What am i doing wrong?

Link to comment
Share on other sites

You're not doing anything wrong other than the fact that you don't have enough knowledge of HTML (and crappy tables) to change it and have it work properly.

 

you just need to have it so it looks like this:

<table>

<tr>

<td width="50%"></td>

<td> ADDRESS HERE</td>

</tr>

</table>

[code]

 

You are editing viewinvoice.tpl, right?

Link to comment
Share on other sites

You should have specified that in your post. Just for future reference, if you do post asking for help, you need to make sure you do include specifics so when people help you, it's what you really need help with.

I'm very sorry, but like i said, i didn't even know there was another invoice then the pdf invoice! If i knew, i certainly asked help with the PDF invoice the first time! It won't happen again. pretty please forgive me! ;-)

Link to comment
Share on other sites

right. crystal clear!

But back on topic. Maybe you know how i can reposition the clientdetails in the pdfconfig.php? I know how to position, and i've repositioned somethings in the invoice. But it looks like the clientdetails won't move.

A rule looks like:

$pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else

Link to comment
Share on other sites

You would need to use a line such as

 

$pdf->SetXY(80,80);

 

(distance from left, distance from top)

 

I would also move the clients details section to the bottom that page.

 

I have not tried this, but can't see why it shouldn't work.

 

You may need to tweak the number of blank lines to move the bulk below up or down.

Link to comment
Share on other sites

Thnx to isdoo i found it out. Didn't know the SetXY code. what i've done is.

 

# Clients Details
$pdf->SetFont('Arial','',10);
if ($clientsdetails["companyname"]) {
$pdf->SetXY(140,70);
$pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
$pdf->SetXY(140,74);
$pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
}
$pdf->SetFont('Arial','',10);
$pdf->SetXY(140,78);
$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');
if ($clientsdetails["address2"]) {
$pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L');
}
$pdf->SetXY(140,82);
$pdf->Cell(0,4,$clientsdetails["postcode"].", ".$clientsdetails["city"]." ".$clientsdetails["state"],0,1,'L');
$pdf->SetXY(140,86);
$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L'); 
$pdf->Ln(10);

I don't know if this is the cleanest way, but it shure works!

Link to comment
Share on other sites

Hi,

 

This is our modification for the client details, mind you some data, like postal code and city have traded places to be more in line with the standard address layout in Holland.

 

 

# 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');

 

if ($clientsdetails["country"] != "Netherlands") {

$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');

}

 

Hope it helps

 

Oooooops you allready had it solved ;) ;)

 

regards

 

Erik

Link to comment
Share on other sites

  • 2 weeks later...

For anyone looking for something like this; we are using:

 

# Clients Details

$pdf->SetXY(21,65);

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

if ($clientsdetails["companyname"]) {

$pdf->Cell(4,4,$clientsdetails["companyname"],0,1,'L');

$pdf->SetXY(21,70);

$pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else {

$pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');

}

$pdf->SetXY(21,75);

$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');

 

if ($clientsdetails["address2"]) {

$pdf->SetXY(21,80);

$pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L');

}

$pdf->SetXY(21,85);

$pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L');

$pdf->SetXY(21,90);

$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');

 

$pdf->Ln(10);

Link to comment
Share on other sites

  • 2 weeks later...

We actually changed the above to use a margin around that code.

 

$pdf->SetMargins(25, 0, 0); // left, top, right
$pdf->Ln();
# Clients Details
$pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1);
$pdf->SetFont('Arial','B',10);
if ($clientsdetails["companyname"]) {
       $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
$pdf->SetFont('Arial','',9);
       $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else {
       $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
}
$pdf->SetFont('Arial','',9);
$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');
if ($clientsdetails["address2"]) {
       $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L');
}
$pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L');
$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');
$pdf->SetMargins(10, 0, 10); // left, top, right
$pdf->Ln(10);

 

Invoice looks like: http://www.aushosts.com.au/myfiles/5168.pdf

Link to comment
Share on other sites

Is anyone willing to share their pfdconfig file that's setup to use #10 window envelopes? I am more than willing to spend the time to set it up myself, but I have 6 invoice I need to print and mail to clients next week.

 

I appreciate any input!

 

Thanks,

Eric

Link to comment
Share on other sites

Try this mate...

 

$pdf->SetMargins(35, 0, 0); // left, top, right
$pdf->Ln();
# Clients Details
$pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1);
$pdf->SetFont('Arial','B',10);
if ($clientsdetails["companyname"]) {
       $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
$pdf->SetFont('Arial','',9);
       $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else {
       $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
}
$pdf->SetFont('Arial','',9);
$pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L');
if ($clientsdetails["address2"]) {
       $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L');
}
$pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L');
$pdf->Cell(0,4,$clientsdetails["country"],0,1,'L');
$pdf->SetMargins(10, 0, 10); // left, top, right
$pdf->Ln(10);

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