30 $this->gridPool = $gridPool;
41 public function afterProcess(
46 if (
$order->hasInvoices()) {
50 $orderInvoiceHasChanges =
false;
53 $invoiceAttributesForSave = [];
57 $invoiceAttributesForSave[] =
'billing_address_id';
58 $orderInvoiceHasChanges =
true;
63 $invoiceAttributesForSave[] =
'shipping_address_id';
64 $orderInvoiceHasChanges =
true;
67 if (!empty($invoiceAttributesForSave)) {
68 $this->attribute->saveAttribute(
$invoice, $invoiceAttributesForSave);
72 if ($orderInvoiceHasChanges) {
73 $this->gridPool->refreshByOrderId(
$order->getId());
__construct(\Magento\Sales\Model\ResourceModel\GridPool $gridPool, \Magento\Sales\Model\ResourceModel\Attribute $attribute)