Prestashop 1.6:将订单状态更改为付款并未生成发票

时间:2016-10-03 14:09:48

标签: php pdo prestashop prestashop-1.6

我在客户Prestashop 1.6.1.6商店遇到问题,当我们将订单状态更改为接受付款或接受远程付款时,没有生成PDF发票。 这仅适用于模块银行或支票支付的订单。对于其他付款方式,PDF发票正常生成。 我在Order类方法setInvoice和其他许多函数中调试了很多函数,我在方法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对象不为空并返回数据,但在使用

保存时
$order_invoice->save();

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

1 个答案:

答案 0 :(得分:0)

这是与order_invoice表相关的数据库结构问题,我通过添加缺少的字段修复了问题,我认为这是一个更新问题。 Prestashop一键ugrade模块导致许多问题,希望它在nexte版本中稳定。

相关问题