ptityop Posted September 6, 2022 Share Posted September 6, 2022 Hello, I have an invoice template that was customized and working fine on Presta 1.6 but is now causing me issues on 1.7, triggering theerror Invalid $number parameter: "" cannot be interpreted as a number [PrestaShop\PrestaShop\Core\Localization\Exception\LocalizationException 0] The code is pretty simple but I am not able to work out where the issue can come from even with th debug info ... I Im placing the invoice code and debug info here hoping someone can guide me to understand what can be causing the issue. Thanks in advance !! Modified invoice template code: <table style="width: 100%"> <tr ><tr > <br /> <table style="width: 100%"> <tr > <td style="width: 56%"> <span style="font-size: 28px;"> <br /> Suisse Technique SA<br /> [email protected]<br /> www.suissetechnique.ch<br /> </span> </td> <td style="width: 40%"> <br /><span style="font-size: 28px;"><br />{$invoice_address}</span> </td> </tr> </table> <br /> <br /> <br /> <!-- Tableau indications commande 1 Gil --> <table border="0" style="width: 100%"> <tr > <td width="35%" style="width: 35%"><span style="font-size: 8pt;"><br /> </span></td> <td width="65%" style="width: 65%"><h1><span style="font-size:50px; font-weight:600"> Facture</span><br /> </h1></td> </tr> </table> <tr > <tr > <table border="0" style="width: 100%"> <tr > <td width="35%" style="width: 35%"><span style="font-size: 8pt;"><br /> </span></td> <td width="65%" style="width: 65%"><table width="100%" border="1" cellspacing="0" cellpadding="6"> <tr > <td>{l s='Numéro de Facture: ' pdf='true'}<br /><strong>{$title|escape:'html':'UTF-8'}</strong></td> <td>{l s='Date de facture: ' pdf='true'}<br /><strong>{$date|escape:'html':'UTF-8'}</strong></td> <td>{l s='Numéro de client: ' pdf='true'}<br /><strong>{$order->id_customer}</strong></td> </tr> </table> <br /> <table width="100%" border="0.3" cellspacing="0" cellpadding="0"> <tr> <td>{l s=' Date de commande: ' pdf='true'}<strong>{dateFormat date=$order->date_add full=0}</strong></td> </tr> <tr> <td>{l s=' Référence de commande: ' pdf='true'}<strong>{$order->getUniqReference()}</strong></td> </tr> <tr> <td>{l s=' Votre référence: ' pdf='true'}</td> </tr> <tr> <td>{l s=' Notre N° de TVA: ' pdf='true'} <strong>CHE-230.482.509</strong></td> </tr> </table> </td> </tr> </table> <br /> <tr ><br /> <tr > <tr > <!-- / Tableau indications commande 1 Gil --> <!-- PRODUCTS TAB --> <table style="border: solid 1px black; width: 100%"> <tr> <!-- / CUSTOMER INFORMATION --> <td style="width: 100%"> <table style="border-bottom: solid 0px black; width: 100%; font-size: 9pt;"> <tr style="line-height:4px;"> <td style="border-bottom:0px solid black; text-align: left; font-weight: bold; width: 5%">{l s='Pos.' pdf='true'}</td> <td style="border-bottom: solid 0px black; text-align: left; color: black; padding-left: 10px; font-weight: bold; width:50%">{l s='Référence / Produit' pdf='true'}<br /></td> <td style="border-bottom: solid 0px black; color: black; text-align: center; font-weight: bold; width: 10%">{l s='Quantité' pdf='true'}</td> <td style="border-bottom: solid 0px black; color: black; text-align: right; font-weight: bold; width: 10%"> {l s='Prix unité HT *' pdf='true'} </td> <!-- RABAIS ENLEVE LIGNE 96 --> <td style="border-bottom: solid 0px black; color: black; text-align: right; font-weight: bold; width: 10%; white-space: nowrap;">{l s='' pdf='true'}</td> <td style="border-bottom: solid 0px black; border-left: solid 1px black; color: black; text-align: center; font-weight: bold; width: {if !$tax_excluded_display}15%{else}15%{/if}"> {l s='Valeur net CHF' pdf='true'} </td> </tr> <!-- PRODUCTS --> {foreach $order_details as $order_detail} <tr style="line-height:6px;"> <td style="border-bottom: solid 0px black; text-align: center; width: 5%">{counter}</td> <td style="border-bottom: solid 0px black; text-align: left; width:13%;"> <tr >{if isset($order_detail.product_reference) && !empty($order_detail.product_reference)} {$order_detail.product_reference}{/if} </tr> </td> <td style="border-bottom: solid 0px black; text-align: left; width:37%;"> <tr>{$order_detail.product_name} </tr> </td> <td style="border-bottom: solid 0px black; text-align: center; width: 10%">{$order_detail.product_quantity}x</td> <td style="border-bottom: solid 0px black; text-align: right; width: 10%; white-space: nowrap;"> {if isset($order_detail.unit_price_tax_excl_before_specific_price)} {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_including_ecotax} {else} {if $tax_excluded_display} {displayPrice price=$order_detail.unit_price_tax_excl} {else} {displayPrice price=$order_detail.unit_price_tax_excl} {/if} {/if} </td> <td style=" border-bottom: solid 0px black;text-align: right; width: 10%"> {if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)} -{displayPrice price=$order_detail.reduction_percent}% {elseif (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)} -{$order_detail.reduction_percent}% {else} {if ($order_detail.reduction_amount > 0)} {$order_detail.reduction_amount} {else} - {/if} {/if} </td> <td style="border-buttom: solid 0px black; border-left: solid 1px black; text-align: right;"> {displayPrice currency=$order->id_currency price=($order_detail.product_quantity * $order_detail.unit_price_tax_excl)} </td> </tr> {foreach $order_detail.customizedDatas as $customizationPerAddress} {foreach $customizationPerAddress as $customizationId => $customization} <tr style="color: black; border-left: solid 0px black; line-height:6px;"> <!-- aparait pas --> <td style="line-height:3px; text-align: left; width: 45%; vertical-align: top"> <blockquote> {if isset($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) && count($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) > 0} {foreach $customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_] as $customization_infos} {$customization_infos.name}: {$customization_infos.value} {if !$smarty.foreach.custo_foreach.last}<br /> {else} <div style="line-height:0.4pt"> </div> {/if} {/foreach} {/if} {if isset($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) && count($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) > 0} {count($customization.datas[$smarty.const._CUSTOMIZE_FILE_])} {l s='image(s)' pdf='true'} {/if} </blockquote> </td> {if !$tax_excluded_display} <td style="text-align: right;"></td> {/if} <td style="text-align: right; width: 10%"></td> <td style="text-align: center; width: 10%; vertical-align: top">({$customization.quantity})</td> <td style="width: 15%; text-align: right;"></td> </tr> {/foreach} {/foreach} {/foreach} <!-- END PRODUCTS --> <br/> <!-- CART RULES --> <!-- condition de paiement --> </table> <br/> <table style="min-height: 50px; width: 100%;"> <tr> <td style="width: 1%; text-align:left;"> </td> <td style="width: 60%; font-size: 28px; "> <br/> {foreach from=$order_invoice->getOrderPaymentCollection() item=payment} {if $payment->payment_method eq 'Facture'} {if $payment->amount eq $order_invoice->total_paid_tax_incl} <b>{l s='Conditions de paiement: ' pdf='true'}</b>Sans escompte jusqu'au {"+30 days"|date_format:"%d/%m/%Y"}<br/> {/if} {else} <b>{l s='Conditions de paiement: ' pdf='true'}</b>{$payment->payment_method} {/if} {/foreach} </td> <td style="width: 39%; text-align: right; font-size: 22px; font-weight: bold;"> {l s='Total HT ' pdf='true'} <!--{displayPrice currency=$order->id_currency price=($order_invoice->total_paid_tax_excl - $order_invoice->total_shipping_tax_excl)}<br/> {displayPrice currency=$order->id_currency price=$footer.products_before_discounts_tax_excl}-->{displayPrice currency=$order->id_currency price=$order_invoice->total_products}<br/> <br /> </td> <td style="width: 15%; text-align:right; font-size: 28px; font-weight: bold; "> </td> </tr> </table> <table style="border-top: solid 1px black; width: 100%" > <tr style=" line-height:4px; "> <!-- / Ligne de bas de tableau commande --> <td style="border-right: solid 1px black; color: black; text-align: left; font-size: 22px; font-weight: normal; width: 25%" >{l s='Forfait de livraison et manutention:' pdf='true'}<br />{if $order_invoice->total_shipping_tax_incl > 0} {if $order_invoice->total_discount_tax_excl == $order_invoice->total_shipping_tax_incl }{l s='Franco' pdf='true'} {else} {if $order_invoice->total_discount_tax_excl == $order_invoice->total_shipping_tax_excl } {l s='Franco' pdf='true'} {else} {displayPrice price=$order_invoice->total_shipping_tax_excl} {/if} {/if} {else} {l s='Franco' pdf='true'} {/if} </td> <td style="border-right: solid 1px black; color: black; text-align: left; font-size: 22px; font-weight: normal; width: 25%">{l s='TVA Produits:' pdf='true'}<br /> <!-- {displayPrice currency=$order->id_currency price=$line.total_tax_excl} {displayPrice price=$order_invoice->total_paid_tax_excl}--> <table id="tax-tab" width="100%"> <tbody> {assign var=has_line value=false} {foreach $tax_breakdowns as $label => $bd} {assign var=label_printed value=false} {foreach $bd as $line} {if $line.rate == 0} {continue} {/if} {assign var=has_line value=true} <tr> <td class="right white"> {if isset($is_order_slip) && $is_order_slip}- {/if} {if $label == 'product_tax'} {displayPrice currency=$order->id_currency price=$line.total_amount} {/if} </td> </tr> {/foreach} {/foreach} </tbody> </table> </td> <td style="border-right: solid 1px black; color: black; text-align: left; font-size: 22px; font-weight: normal; width: 25%">{l s='TVA Livraison:' pdf='true'}{assign var=has_line value=false}<br />{foreach $tax_breakdowns as $label => $bd}{assign var=label_printed value=false} {foreach $bd as $line} {if $line.rate == 0} {continue} {/if} {assign var=has_line value=true} {if isset($is_order_slip) && $is_order_slip}- {/if} {if $label == 'shipping_tax'} {displayPrice currency=$order->id_currency price=$line.total_amount} {/if} {/foreach} {/foreach} </td> <td style="border-bottom: solid 1px black; border-left: solid 1px black; color: black; text-align: right; font-size: 28px; font-weight: bold; width: 25%";> {l s='Total:' pdf='true'}<br />{displayPrice price=$order_invoice->total_paid_tax_incl} </td> </tr> </table> </td> </tr> </table> </div> <!-- / PRODUCTS TAB --><br /> <!-- Message client/commande --> <tr > <table style="width: 100%"> {foreach $messages as $message} <tr> <td style="width: 100%">{$message.message|nl2br}</td> </tr> {/foreach} </table> <!-- / Message client/commande --> <!-- Message bas de page --> <table style="width: 100%; "> <tr> <td style="font-size: 8pt; width: 100%"><br /> <p>Les prix "unité HT" sont affichés rabais inclus.<br /> Veuillez consulter sur notre site internet les conditions générales de vente et de livraison.<br /><br /> <b>Pour vos paiements veuillez utiliser uniquement le bulletin de versement ci-joint.</b><br /> <strong>Nous vous remercions de votre confiance.</strong> <br /> </p> </td> </tr> </table> <!-- / Message bas de page --> Debug info (1/1) ContextErrorException Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/cpanel/php/sessions/ea-php74) failed: Permission denied (13) in StrictSessionHandler.php line 101 at StrictSessionHandler->gc(1440) in SessionHandlerProxy.php line 83 at SessionHandlerProxy->gc(1440) at session_start() in NativeSessionStorage.php line 154 at NativeSessionStorage->start() in NativeSessionStorage.php line 321 at NativeSessionStorage->getBag('attributes') in Session.php line 256 at Session->getBag('attributes') in Session.php line 280 at Session->getAttributeBag() in Session.php line 73 at Session->get('_security_main') in ContextListener.php line 91 at ContextListener->handle(object(GetResponseEvent)) in WrappedListener.php line 46 at WrappedListener->handle(object(GetResponseEvent)) in TraceableFirewallListener.php line 35 at TraceableFirewallListener->handleRequest(object(GetResponseEvent), object(Generator)) in Firewall.php line 84 at Firewall->onKernelRequest(object(GetResponseEvent)) in FirewallListener.php line 48 at FirewallListener->onKernelRequest(object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher)) in WrappedListener.php line 115 at WrappedListener->__invoke(object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher)) in EventDispatcher.php line 214 at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.request', object(GetResponseEvent)) in EventDispatcher.php line 44 at EventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in TraceableEventDispatcher.php line 143 at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in HttpKernel.php line 127 at HttpKernel->handleRaw(object(Request), 1) in HttpKernel.php line 68 at HttpKernel->handle(object(Request), 1, false) in Kernel.php line 200 at Kernel->handle(object(Request), 1, false) in index.php line 82 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now