2016-10-03 168 views
0

我在客户Prestashop 1.6.1.6商店遇到问题,当我们将订单状态更改为接受付款或接受远程付款时,没有生成PDF发票。 这仅适用于通过模块银行电汇或支票支付的订单。对于其他付款方式,PDF发票正常生成。 我在Order类方法setInvoice和许多其他与Prestashop 1.6:更改订单状态为付款没有生成发票

$order_invoice->save(); 
保存时调试许多功能,我发现在方法setInvoiceDetails

protected function setInvoiceDetails($order_invoice) 
{ 
    if (!$order_invoice || !is_object($order_invoice)) { 
     return; 
    } 

    $address = new Address((int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); 
    $carrier = new Carrier((int)$this->id_carrier); 
    $tax_calculator = $carrier->getTaxCalculator($address); 
    $order_invoice->total_discount_tax_excl = $this->total_discounts_tax_excl; 
    $order_invoice->total_discount_tax_incl = $this->total_discounts_tax_incl; 
    $order_invoice->total_paid_tax_excl = $this->total_paid_tax_excl; 
    $order_invoice->total_paid_tax_incl = $this->total_paid_tax_incl; 
    $order_invoice->total_products = $this->total_products; 
    $order_invoice->total_products_wt = $this->total_products_wt; 
    $order_invoice->total_shipping_tax_excl = $this->total_shipping_tax_excl; 
    $order_invoice->total_shipping_tax_incl = $this->total_shipping_tax_incl; 
    $order_invoice->shipping_tax_computation_method = $tax_calculator->computation_method; 
    $order_invoice->total_wrapping_tax_excl = $this->total_wrapping_tax_excl; 
    $order_invoice->total_wrapping_tax_incl = $this->total_wrapping_tax_incl; 
    $order_invoice->save(); 
    var_dump($order_invoice);exit; 
} 

的$ order_invoice对象不为空和返回数据的问题,但

保存返回false的方法, 对我来说很奇怪,是数据库保存问题,数据库已达到极限? 通常在保存之后,对象获得一个id,形成ObjectModel herited类。 任何帮助将得到appreicated谢谢。

+0

您是否检查过订单状态(s)配置? – sarcom

+0

是的,他们存在与默认定制 –

回答

0

这是与order_invoice表相关的数据库结构问题,我通过添加缺少的字段解决了问题,我认为这是一个更新问题。Prestashop一键升级模块引发了许多问题,希望它能在nexte发布中稳定下来。

+0

嗨tarek,我有同样的问题,但在我的情况似乎有所有需要的领域。你的案件中缺少的领域是什么?谢谢! –

+0

嗨克劳迪奥,我忘了你可以用新的prestashop安装表检查的字段 –

+0

谢谢,我终于发现我的问题是不同的。我正在使用MySQL 5.7,并且由prestashop发出的查询会引发错误。如果你有兴趣,我在这里报告错误:http://forge.prestashop.com/browse/PSCSX-8607。 谢谢无论如何:) –