回答:
これを修正する方法は次のとおりです。
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