2013-07-05 93 views

回答

4

也许订单被取消,在完成/关闭状态。

也许它在付款审查举行或静止。

可能的项目没有数量的发票> 0或项目已锁定,发票......

我会建议把日志中的每个在下面显示的方法中的IF语句的类Mage_Sales_Model_Order

/** 
    * Retrieve order invoice availability 
    * 
    * @return bool 
    */ 
    public function canInvoice() 
    { 
     if ($this->canUnhold() || $this->isPaymentReview()) { 
      return false; 
     } 
     $state = $this->getState(); 
     if ($this->isCanceled() || $state === self::STATE_COMPLETE || $state === self::STATE_CLOSED) { 
      return false; 
     } 

     if ($this->getActionFlag(self::ACTION_FLAG_INVOICE) === false) { 
      return false; 
     } 

     foreach ($this->getAllItems() as $item) { 
      if ($item->getQtyToInvoice()>0 && !$item->getLockedDoInvoice()) { 
       return true; 
      } 
     } 
     return false; 
    }