Jump to content

how to change position "delivery address" in invoice template


Fertig

Recommended Posts

Hi,

 

anybody knows how can i change the position of deliver adress AND billing to adress?

 

fom --> company details --> deliver adress --> billing to adress

 

CHANGE TO (position chnage

 

deliver adress --> billing to adress --> company details

 

se attached picture

 

thanks for help

 

best reg

 

seb[

 

attachment=149147:unspecified.png]

post-865918-0-41792300-1463077917_thumb.png

Link to comment
Share on other sites

Simply reorder the <td>s in /pdf/invoice.addresses-tab.tpl (or in a copy of it to /themes/xxx/pdf/).

Hey erouvier29,

 

thanks for your answer, can you write detail, cause i am not sure what you mean.

 

thank you so much

 

regards

 

seb

Link to comment
Share on other sites

Original file /pdf/invoice.addresses-tab.tpl should contain:

<table id="addresses-tab" cellspacing="0" cellpadding="0">
    <tr>
        <td width="33%"><span class="bold"> </span><br/><br/>
            {if isset($order_invoice)}{$order_invoice->shop_address}{/if}
        </td>
        <td width="33%">{if $delivery_address}<span class="bold">{l s='Delivery Address' pdf='true'}</span><br/><br/>
                {$delivery_address}
            {/if}
        </td>
        <td width="33%"><span class="bold">{l s='Billing Address' pdf='true'}</span><br/><br/>
            {$invoice_address}
        </td>
    </tr>
</table>
Change it with:
<table id="addresses-tab" cellspacing="0" cellpadding="0">
    <tr>
        <td width="33%">{if $delivery_address}<span class="bold">{l s='Delivery Address' pdf='true'}</span><br/><br/>
                {$delivery_address}
            {/if}
        </td>
        <td width="33%"><span class="bold">{l s='Billing Address' pdf='true'}</span><br/><br/>
                 {$invoice_address}
        </td>
        <td width="33%"><span class="bold"> </span><br/><br/>
            {if isset($order_invoice)}{$order_invoice->shop_address}{/if}
        </td>
    </tr>
</table>

 

Link to comment
Share on other sites

wow cool ! thanks.

 

and whats about the position, so the deliver adress position must be approx 5cm from left border and the billing to adress border right begins in the middle of the paper/template.

the company adress must be at the right end. like i make a screenshot from the positions in the first post.

Link to comment
Share on other sites

Not really clean, but you can adjust the horizontal positions like this for example:

<table id="addresses-tab" cellspacing="0" cellpadding="0">    <tr>
        <td width="15%"></td>
        <td width="30%">
            {if $delivery_address}
                <span class="bold">{l s='Delivery Address' pdf='true'}</span><br/><br/>
                {$delivery_address}
            {/if}
        </td>
        <td width="30%">
            <span class="bold">{l s='Billing Address' pdf='true'}</span><br/><br/>
            {$invoice_address}
        </td>
        <td width="25%" style="text-align:right">
            <span class="bold"> </span><br/><br/>
            {if isset($order_invoice)}{$order_invoice->shop_address}{/if}
        </td>
    </tr>
</table>

Shop address elements are right justified

Sum of widths shall be 100%

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hey,

 

thanks for your answer, that woks !! 

 

is it possible making the deliver adress and billing to like in the picture "NEW.png" ?

 

best regards from Lucerne

 

post-865918-0-86458600-1463858446_thumb.pngpost-865918-0-87745700-1463858447_thumb.png

 

Not really clean, but you can adjust the horizontal positions like this for example:

<table id="addresses-tab" cellspacing="0" cellpadding="0">    <tr>
        <td width="15%"></td>
        <td width="30%">
            {if $delivery_address}
                <span class="bold">{l s='Delivery Address' pdf='true'}</span><br/><br/>
                {$delivery_address}
            {/if}
[attachment=149664:NEW.png]

        </td>
        <td width="30%">
            <span class="bold">{l s='Billing Address' pdf='true'}</span><br/><br/>
            {$invoice_address}
        </td>
        <td width="25%" style="text-align:right">
            <span class="bold"> </span><br/><br/>
            {if isset($order_invoice)}{$order_invoice->shop_address}{/if}
        </td>
    </tr>
</table>

Shop address elements are right justified

Sum of widths shall be 100%

 

Link to comment
Share on other sites

Yes:

1. Decrease the size of left margin block and increase the one of delivery block

2. Remove label "Delivery address"

3. Insert "Suisii GmbH..." with desired formatting

<table id="addresses-tab" cellspacing="0" cellpadding="0">
    <tr>
        <td width="5%"></td>
        <td width="40%">
            {if $delivery_address}
                <span class="bold"> </span><br/>
                <span style="font-size:0.8em;color:#CCC;text-decoration:underline">Suissi GmbH...</span><br/>
                {$delivery_address}
            {/if}
        </td>
        <td width="30%">
            <span class="bold">{l s='Billing Address' pdf='true'}</span><br/>
            <span style="font-size:0.8em"></span><br/>
            {$invoice_address}
        </td>
        <td width="25%" style="text-align:right">
            <span class="bold"> </span><br/>
            <span style="font-size:0.8em"> </span><br/>
            {if isset($order_invoice)}{$order_invoice->shop_address}{/if}
        </td>
    </tr>
</table>
  • Like 1
Link to comment
Share on other sites

that looks very cool, but i think now i have a problem...

 

since i use your code, i cant chance any adressen?! ...

 

everytime when i get a order all customers have the same adresse. when i change the adress, he dont change the adress to a new adress :-(

 

 

 

Yes:

1. Decrease the size of left margin block and increase the one of delivery block

2. Remove label "Delivery address"

3. Insert "Suisii GmbH..." with desired formatting

<table id="addresses-tab" cellspacing="0" cellpadding="0">
    <tr>
        <td width="5%"></td>
        <td width="40%">
            {if $delivery_address}
                <span class="bold"> </span><br/>
                <span style="font-size:0.8em;color:#CCC;text-decoration:underline">Suissi GmbH...</span><br/>
                {$delivery_address}
            {/if}
        </td>
        <td width="30%">
            <span class="bold">{l s='Billing Address' pdf='true'}</span><br/>
            <span style="font-size:0.8em"></span><br/>
            {$invoice_address}
        </td>
        <td width="25%" style="text-align:right">
            <span class="bold"> </span><br/>
            <span style="font-size:0.8em"> </span><br/>
            {if isset($order_invoice)}{$order_invoice->shop_address}{/if}
        </td>
    </tr>
</table>

 

Link to comment
Share on other sites

Addresses remain the same, just as they have been set for the order. Only the label "Delivery address" has been removed from the template. But the address itself is still the one attached to the order, and will differ from one order to another.

 

I just assumed that the line "Suissi GmbH..." is fixed, but maybe it's not the case. What is actually this line for? Is it relative to the order or globally defined? Is it stored somewhere into the database?

Edited by erouvier29 (see edit history)
Link to comment
Share on other sites

another writes maybe its a template issue with overrides, dont know why.

 

my experiences in database its like a child and fire, not good :D ... i have no idea from database, php and html a little bit...

Link to comment
Share on other sites

  • 3 weeks later...

Hello KerAwen,

 

thanks for your fast and good support. sorry, i had a little bit work here so i cant write back. ...

 

so now works after a update and looks very close the that design of invoice i want :-D

Link to comment
Share on other sites

Hi guys,

 

instead of trial and error in percentage of the table you can easily adjust the margins precisely with a small override of function writePage of /classes/pdf/PDFgenerator.php. Just modify the left margin value in the following code and save it as override/classes/pdf/PDFgenerator.php

<?php

class PDFGenerator extends PDFGeneratorCore
{
public function writePage()

{
$this->SetHeaderMargin(5);
$this->SetFooterMargin(18);
$this->setMargins(10, 40, 10);
$this->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);

$this->AddPage();

$this->writeHTML($this->content, true, false, true, false, '');
}

}
Link to comment
Share on other sites

  • 9 months later...

I want to change few thing in the invoice that customer received and we received as a order confirmation

 

{if !empty($delivery_address)}
<table style="width: 100%">
<tr>
<td style="width: 50%">
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Delivery Address' pdf='true'}</span><br />
{$delivery_address}
</td>
<td style="width: 50%">
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Senders Address' pdf='true'}</span><br />
{$invoice_address}
</td>
</tr>
</table>​​

 

 

So basically I dont know where $delivery_address and $invoice_address are coming from.

 

I want to change the way display $invoice_address

i.e. I just want to just show client name and phone number

 

$delivery_address i just want to delivery person name and address and phone.

 

Can someone help me that how and where I can change the code.

 

Thank you

Link to comment
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
×
×
  • Create New...