Answers:
解决方法如下:
编辑vendor/magento/module-sales/etc/webapi.xml
第112行:
- <route url="/V1/invoices/:id/void" method="POST">
+ <route url="/V1/invoices/:id/voidInvoice" method="POST">
编辑vendor/magento/module-sales/Block/Adminhtml/Order/Invoice/View.php
第242行:
- return $this->getUrl('sales/*/void', ['invoice_id' => $this->getInvoice()->getId()]);
+ return $this->getUrl('sales/*/voidInvoice', ['invoice_id' => $this->getInvoice()->getId()]);
编辑vendor/magento/module-sales/Block/Adminhtml/Order/Creditmemo/View.php
第183行:
- return $this->getUrl('sales/*/void', ['creditmemo_id' => $this->getCreditmemo()->getId()]);
+ return $this->getUrl('sales/*/voidCreditmemo', ['creditmemo_id' => $this->getCreditmemo()->getId()]);
编辑vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php
第9行:
- class Void extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice\View
+ class VoidInvoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice\View
编辑vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php
第10行:
- class Void extends \Magento\Backend\App\Action
+ class VoidCreditmemo extends \Magento\Backend\App\Action
改名
vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php
至
vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/VoidCreditmemo.php
改名
vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php
至
vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/VoidInvoice.php