- if ($this->getCreditmemo()->canRefund()) {
- if ($this->getCreditmemo()->getInvoice() && $this->getCreditmemo()->getInvoice()->getTransactionId()) {
- $this->addChild(
- 'submit_button',
- 'Magento\Backend\Block\Widget\Button',
- [
- 'label' => __('Refund'),
- 'class' => 'save submit-button refund primary',
- 'onclick' => 'disableElements(\'submit-button\');submitCreditMemo()'
- ]
- );
- }
- $this->addChild(
- 'submit_offline',
- 'Magento\Backend\Block\Widget\Button',
- [
- 'label' => __('Refund Offline'),
- 'class' => 'save submit-button primary',
- 'onclick' => 'disableElements(\'submit-button\');submitCreditMemoOffline()'
- ]
- );
- } else {
- $this->addChild(
- 'submit_button',
- 'Magento\Backend\Block\Widget\Button',
- [
- 'label' => __('Refund Offline'),
- 'class' => 'save submit-button primary',
- 'onclick' => 'disableElements(\'submit-button\');submitCreditMemoOffline()'
- ]
- );
- }