ComerZia Posted September 26, 2013 Share Posted September 26, 2013 Hola buenas, después de "españolizar" la factura me he puesto ha hacer pedidos y facturas de prueba. Resulta que la tabla del producto, precio sin sin Iva, subtotal, iva,total,... todo está en orden pero la tabla del desglose del IVA me salen cosas extrañas. Es como si multiplicase toda la tabla por un número natural y que va descendiendo a medida que voy por haciendo pedidos del producto. Desglose de IVA % de IVA Total IVA inc. 21% IVAProductos 63.000 % 12,66 € 2,67 € Desglose de IVA % de IVA Total IVA inc. 21% IVAProductos 42.000 % 8,44 € 1,78 € Desglose de IVA % de IVA Total IVA inc. 21% IVAProductos 21.000 % 4,22 € 0,89 € Creo no equivocarme si digo que el número por el que se multiplica es la cantidad disponible del producto a la hora de hacer la compra. Link to comment Share on other sites More sharing options...
ComerZia Posted September 26, 2013 Author Share Posted September 26, 2013 Añado el códio del archivo por si alguien puede ayuda a encontar el fallo. <div style="font-size: 8pt; color: #444"><table> <tr><td> </td></tr></table><!-- ADDRESSES --><table style="width: 100%"> <tr> <td style="width: 30%; padding-left: 10pt"><span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">Expendedoras Asturianas S.L.</span><br/> CIF: B33888306<br/> C/ Daniel Cerra 5 Bajo<br/> 33213 - Gijón<br/> Asturias - España<br/> Tfno: 985 324 725</td> <td style="width: 70%"> {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='Billing Address' pdf='true'}</span><br /> {$invoice_address} </td> </tr> </table> {else} <table style="width: 100%"> <tr> <td style="width: 50%"> </td> <td style="width: 50%"><span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing & Delivery Address.' pdf='true'}</span><br /> {$invoice_address} </td> </tr> </table> {/if} </td> </tr></table><!-- / ADDRESSES --><div style="line-height: 1pt"> </div><!-- PRODUCTS TAB --><table style="width: 100%"> <tr> <td style="text-align: right"> <table style="width: 100%; font-size: 8pt;"> <tr style="line-height:4px;"> <td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 55%">{l s='Product / Reference' pdf='true'}</td> <!-- unit price tax excluded is mandatory --> {if !$tax_excluded_display} <td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: 10%">{l s='Unit Price' pdf='true'} <br />{l s='(Tax Excl.)' pdf='true'}</td> {/if} <td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 10%">{l s='Qty' pdf='true'}</td> <td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: 10%">{l s='Discount' pdf='true'}</td> <td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold; width: {if !$tax_excluded_display}15%{else}25%{/if}"> {l s='Total' pdf='true'} {if $tax_excluded_display} {l s='(Tax Excl.)' pdf='true'} {else} {l s='(Tax Excl.)' pdf='true'} {/if} </td> </tr> <!-- PRODUCTS --> {foreach $order_details as $order_detail} {cycle values='#FFF,#DDD' assign=bgcolor} <tr style="line-height:6px;background-color:{$bgcolor};"> <td style="text-align: left; width: 55%">{$order_detail.product_name}</td> <!-- unit price tax excluded is mandatory --> {if !$tax_excluded_display} <td style="text-align: right; width: 10%"> {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl} </td> {/if} <td style="text-align: center; width: 10%">{$order_detail.product_quantity}</td> <td style="text-align: right; width: 10%"> {if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)} -{displayPrice currency=$order->id_currency price=$order_detail.reduction_amount} {else if (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)} -{$order_detail.reduction_percent}% {else} -- {/if} </td> <td style="width: 15%; text-align: right; width: {if !$tax_excluded_display}15%{else}25%{/if}"> {if $tax_excluded_display} {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl} {else} {displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl} {/if} </td> </tr> {foreach $order_detail.customizedDatas as $customizationPerAddress} {foreach $customizationPerAddress as $customizationId => $customization} <tr style="line-height:6px;background-color:{$bgcolor}; "> <td style="line-height:3px; text-align: left; width: 60%; 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> <td style="text-align: right; width: 15%"></td> </tr> {/foreach} {/foreach} {/foreach} <!-- END PRODUCTS --> <!-- CART RULES --> {assign var="shipping_discount_tax_incl" value="0"} {foreach $cart_rules as $cart_rule} {cycle values='#FFF,#DDD' assign=bgcolor} <tr style="line-height:6px;background-color:{$bgcolor};" text-align="left"> <td colspan="{if !$tax_excluded_display}5{else}4{/if}">{$cart_rule.name}</td> <td> {if $cart_rule.free_shipping} {assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl} {/if} {if $tax_excluded_display} - {$cart_rule.value_tax_excl} {else} - {$cart_rule.value} {/if} </td> </tr> {/foreach} <!-- END CART RULES --> </table> <table style="width: 100%"> {if (($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl) > 0)} <tr style="line-height:5px;"> <td style="width: 80%; text-align: right; font-weight: bold">{l s='Product Total (Tax Excl.)' pdf='true'}</td> <td style="width: 20%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products}</td> </tr> {else} {/if} {if $order_invoice->total_discount_tax_incl > 0} <tr style="line-height:5px;"> <td style="text-align: right; font-weight: bold">{l s='Total Vouchers' pdf='true'}</td> <td style="width: 20%; text-align: right;">-{displayPrice currency=$order->id_currency price=($order_invoice->total_discount_tax_incl + $shipping_discount_tax_incl)}</td> </tr> {/if} {if $order_invoice->total_wrapping_tax_incl > 0} <tr style="line-height:5px;"> <td style="text-align: right; font-weight: bold">{l s='Wrapping Cost' pdf='true'}</td> <td style="width: 20%; text-align: right;"> {if $tax_excluded_display} {displayPrice currency=$order->id_currency price=$order_invoice->total_wrapping_tax_excl} {else} {displayPrice currency=$order->id_currency price=$order_invoice->total_wrapping_tax_incl} {/if} </td> </tr> {/if} {if $order_invoice->total_shipping_tax_incl > 0} <tr style="line-height:5px;"> <td style="text-align: right; font-weight: bold">{l s='Shipping Cost' pdf='true'}</td> <td style="width: 20%; text-align: right;"> {if $tax_excluded_display} {displayPrice currency=$order->id_currency price=$order_invoice->total_shipping_tax_excl} {else} {displayPrice currency=$order->id_currency price=$order_invoice->total_shipping_tax_incl} {/if} </td> </tr> {/if} {if ($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl) > 0} <tr style="line-height:5px;"> <td style="text-align: right; font-weight: bold">{l s='Total Tax' pdf='true'}</td> <td style="width: 20%; text-align: right;">{displayPrice currency=$order->id_currency price=($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl)}</td> </tr> {/if} <tr style="line-height:5px;"> <td style="text-align: right; font-weight: bold; font-size:14pt">{l s='Total' pdf='true'}</td> <td style="width: 20%; text-align: right; font-size: 14pt">{displayPrice currency=$order->id_currency price=$order_invoice->total_paid_tax_incl}</td> </tr> </table> </td> </tr></table><!-- / PRODUCTS TAB --><div style="line-height: 1pt"> </div>{$tax_tab}{if isset($order_invoice->note) && $order_invoice->note}<div style="line-height: 1pt"> </div><table style="width: 100%"> <tr> <td style="width: 15%"></td> <td style="width: 85%">{$order_invoice->note|nl2br}</td> </tr></table>{/if}{if isset($HOOK_DISPLAY_PDF)}<div style="line-height: 1pt"> </div><table style="width: 100%"> <tr> <td style="width: 15%"></td> <td style="width: 85%">{$HOOK_DISPLAY_PDF}</td> </tr></table>{/if}</div> Link to comment Share on other sites More sharing options...
tuk66 Posted September 27, 2013 Share Posted September 27, 2013 ¿Qué versión de PrestaShop se utilizan? El cálculo difiere de una versión a otra. Link to comment Share on other sites More sharing options...
ComerZia Posted September 27, 2013 Author Share Posted September 27, 2013 (edited) Tengo la versión 1.5.4. A partir de que llega al multiplo de 1 (cn el 21% de IVa) ya lo mantiene. Pero para empezar a contar desde 1 las facturas y los pedidos los eliminé en el sql. Entoces volví hacer pruebas y volvía hacer multiplicarse toda la tabla por un número natural (siempre n-1 cada vez que se hacía un nuevo pedido) hasta quedar multiplicada por 1 y aparecer el 21%. Esta vez sólamente eliminé las facturas (dejé ahí los pedidos de prueba) y hasta ahora sigue haciendolas bien. No es nada lógico, pero de momento fuciona, veremos si con el tiempo vuelve a chiflar Edited September 27, 2013 by ComerZia (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts