Jump to content
  • 0

Änderung des Standard-Rechnungsformulars von PrestaShop 1.6


JrDeline

Question

Da diese Diskussion am falschen Topic hing, habe ich daraus mal einen eigenen gemacht.

eleazar

 

Ich bin gerade beim umgestalten des PDF Rechnungstemplates und stehe momentan bei einem Problem. Meine Prestashop version ist 1.6.1.9 und ich habe aus der PDF Rechnung den Discount Preis aus der invoice.product-tab.tpl entfernt, da ich diesen nicht benötige. Jetzt passt aber die Breite der Produktdetails nicht mehr, wenn sich ein Produkt mit einem discount in der Rechnung befindet. Wenn nur Produkte mit regulären Preisen enthalten sind, passt die Breite der Produktdetails.

 

Wie bekomme ich es hin das die Artikelbeschreibung um den Platzhalter des DiscountPreises erweitert wird und alle anderen Spalten danach nach rechts rücken? Weiters würde ich dann auch gerne die Spaltenbreite der MwSt und Menge verkleiner. Habe aber auch hier nichts gefunden :(

 

invoice.jpg

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

5 answers to this question

Recommended Posts

  • 0

Wie bekomme ich es hin das die Artikelbeschreibung um den Platzhalter des DiscountPreises erweitert wird und alle anderen Spalten danach nach rechts rücken?

Da hast du offenbar wahlweise zu wenig oder zu viel entfernt. Es gibt wohl einen Bereich, der das Discount-Feld nur einfügt, wenn ein Discount vorhanden ist (mit if-Anweisungen umschlossen), der dann komplett weg muß.

Link to comment
Share on other sites

  • 0

Folgendes (rot markiert) habe ich entfernt. Hab ich was vergessen, oder zuviel entfernt?

 

 

    <thead>
    <tr>
        <th class="product header small" width="{$layout.reference.width}%">{l s='Reference' pdf='true'}</th>
        <th class="product header small" width="{$layout.product.width}%">{l s='Product' pdf='true'}</th>
        <th class="product header small" width="{$layout.tax_code.width}%">{l s='Tax Rate' pdf='true'}</th>
<!--
        {if isset($layout.before_discount)}
            <th class="product header small" width="{$layout.unit_price_tax_excl.width}%">{l s='Base price' pdf='true'} <br /> {l s='(Tax incl.)' pdf='true'}</th>
        {/if}
-->

        <th class="product header-right small" width="{$layout.unit_price_tax_excl.width}%">{l s='Unit Price' pdf='true'} <br /> {l s='(Tax incl.)' pdf='true'}</th>
        <th class="product header small" width="{$layout.quantity.width}%">{l s='Qty' pdf='true'}</th>
        <th class="product header-right small" width="{$layout.total_tax_excl.width}%">{l s='Total' pdf='true'} <br /> {l s='(Tax incl.)' pdf='true'}</th>
    </tr>
    </thead>

    <tbody>

    <!-- PRODUCTS -->
    {foreach $order_details as $order_detail}
        {cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
        <tr class="product {$bgcolor_class}">

            <td class="product center">
                {$order_detail.product_reference}
            </td>
            <td class="product left">
                {if $display_product_images}
                    <table width="100%">
                        <tr>
                            <td width="15%">
                                {if isset($order_detail.image) && $order_detail.image->id}
                                    {$order_detail.image_tag}
                                {/if}
                            </td>
                            <td width="5%"> </td>
                            <td width="80%">
                                {$order_detail.product_name}
                            </td>
                        </tr>
                    </table>
                {else}
                    {$order_detail.product_name}
                {/if}

            </td>
            <td class="product center">
                {$order_detail.order_detail_tax_label}
            </td>
<!--
            {if isset($layout.before_discount)}
                <td class="product center">
                    {if isset($order_detail.unit_price_tax_incl_before_specific_price)}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl_before_specific_price}
                    {else}
                        --
                    {/if}
                </td>
            {/if}
-->

            <td class="product right">
                {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl_including_ecotax}
                {if $order_detail.ecotax_tax_incl > 0}
                    <br>
                    <small>[spam-filter]displayPrice currency=$order->id_currency price=$order_detail.ecotax_tax_incl}|string_format:{l s='ecotax: %s' pdf='true'[spam-filter]</small>
                {/if}
            </td>
            <td class="product center">
                {$order_detail.product_quantity}
            </td>
            <td  class="product right">
                {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl_including_ecotax}
            </td>
        </tr>

        {foreach $order_detail.customizedDatas as $customizationPerAddress}
            {foreach $customizationPerAddress as $customizationId => $customization}
                <tr class="customization_data {$bgcolor_class}">
                    <td class="center">  </td>

                    <td>
                        {if isset($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) && count($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) > 0}
                            <table style="width: 100%;">
                                {foreach $customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_] as $customization_infos}
                                    <tr>
                                        <td style="width: 30%;">
                                            {$customization_infos.name|string_format:{l s='%s:' pdf='true'[spam-filter]
                                        </td>
                                        <td>{$customization_infos.value}</td>
                                    </tr>
                                {/foreach}
                            </table>
                        {/if}

                        {if isset($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) && count($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) > 0}
                            <table style="width: 100%;">
                                <tr>
                                    <td style="width: 70%;">{l s='image(s):' pdf='true'}</td>
                                    <td>{count($customization.datas[$smarty.const._CUSTOMIZE_FILE_])}</td>
                                </tr>
                            </table>
                        {/if}
                    </td>

                    <td class="center">
                        ({if $customization.quantity == 0}1{else}{$customization.quantity}{/if})
                    </td>

                    {assign var=end value=($layout._colCount-3)}
                    {for $var=0 to $end}
                        <td class="center">
                            --
                        </td>
                    {/for}

                </tr>
                <!--if !$smarty.foreach.custo_foreach.last-->
            {/foreach}
        {/foreach}
    {/foreach}
    <!-- END PRODUCTS -->

    <!-- CART RULES -->

    {assign var="shipping_discount_tax_incl" value="0"}
    {foreach from=$cart_rules item=cart_rule name="cart_rules_loop"}
        {if $smarty.foreach.cart_rules_loop.first}
        <tr class="discount">
            <th class="header" colspan="{$layout._colCount}">
                {l s='Discounts' pdf='true'}
            </th>
        </tr>
        {/if}
        <tr class="discount">
            <td class="white right" colspan="{$layout._colCount - 1}">
                {$cart_rule.name}
            </td>
            <td class="right white">
                - {displayPrice currency=$order->id_currency price=$cart_rule.value_tax_excl}
            </td>
        </tr>
    {/foreach}

    </tbody>

</table>


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

  • 0

Habe es gelöst und zwar muss man dann noch unter classes/pdf in der HTMLTemplateInvoice.php folgende Zeilen (108-114) auskommentieren

 

 

/**
        if (isset($params['has_discount']) && $params['has_discount']) {
            $layout['before_discount'] = array('width' => 0);
            $layout['product']['width'] -= 7;
            $layout['reference']['width'] -= 3;
        }
*/

 

Dort kann man dann auch die Spaltenbreiten anpassen ;)

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...