magento - 无法保存发票

标签 magento magento-1.5

将 magento 从 1.4.0.1 升级到 1.5.1.0 后,我无法提交发票。 当我将浏览器指向销售 -> 订单 -> [订单] 查看 -> 发票 并点击提交发票时,我收到错误消息 无法保存发票。

我已经检查了异常日志文件中发生的情况,这是错误:

exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100000001' for key 'UNQ_INCREMENT_ID'' in /home/misbhv/domains/*/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /home/misbhv/domains/*/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/misbhv/domains/*/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/misbhv/domains/*/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `sk...', Array)
#3 /home/misbhv/domains/*/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `sk...', Array)
#4 /home/misbhv/domains/*/public_html/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `sk...', Array)
#5 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(414): Zend_Db_Adapter_Abstract->insert('sklep_sales_fla...', Array)
#6 /home/misbhv/domains/*/public_html/app/code/core/Mage/Sales/Model/Mysql4/Order/Abstract.php(417): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Sales_Model_Order_Invoice))
#7 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Sales_Model_Mysql4_Order_Abstract->save(Object(Mage_Sales_Model_Order_Invoice))
#8 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(150): Mage_Core_Model_Abstract->save()
#9 /home/misbhv/domains/*/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(272): Mage_Core_Model_Resource_Transaction->save()
#10 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_Sales_Order_InvoiceController->saveAction()
#11 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('save')
#12 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /home/misbhv/domains/*/public_html/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#14 /home/misbhv/domains/*/public_html/app/Mage.php(627): Mage_Core_Model_App->run(Array)
#15 /home/misbhv/domains/*/public_html/index.php(80): Mage::run('', 'store')
#16 {main}

我不知道该怎么办,也无法通过谷歌搜索任何解决方案。任何帮助将不胜感激!

最佳答案

解决方案来自:http://www.magentocommerce.com/boards/v/viewthread/234665/#t335407有道理:

i had the same error code. the increment number and the last order number are not synchrone anymore. what we did is the following:

go to admin->sales-> orders and look up the highest order number (for each store view!)

after some help from a fooman post, we did this: \"Then look at your database. In the table eav_entity_type you will find all entity types listed. The one of interest to change is where the order number starts, ie. order sales/order. Remember the entity_type_id.\” (in my install it is 4)

\"Next go to the table eav_entity_store. Look up the entity_type_id. Now you can change the value of increment_last_id to your last actual order number. (That is, if you wanted to have your next orderId to be 15000 set increment_last_id to 14999.)\”

Hope that this helps.

关于magento - 无法保存发票,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9384646/

相关文章:

Magento 重复订单

magento - 将新 block 插入到product.info 不起作用

Magento Paypal Express 按钮不显示

php - 每个 Magento 模块 SQL 安装脚本不再运行

php - Magento - 重建索引过程存在问题 - 目录产品

web-services - 在 WS-I 合规性模式下生成 Web 服务客户端

magento - 为 Magento 新闻通讯设置 Google Analytics 目标

php - Magento Zend_Db_Adapter_Abstract::更新问题

php - Magento - 添加自定义批量操作 PDF

Magento - 如何创建 "decimal"属性类型