File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/code/Magento/Sales/Model/Order/Invoice/Plugin Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public function __construct(
33
33
34
34
/**
35
35
* @param \Magento\Sales\Model\ResourceModel\Order\Handler\Address $subject
36
+ * @param \Magento\Sales\Model\ResourceModel\Order\Handler\Address $result
36
37
* @param \Magento\Sales\Model\Order $order
37
38
* @return void
38
39
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -51,13 +52,13 @@ public function afterProcess(
51
52
foreach ($ order ->getInvoiceCollection ()->getItems () as $ invoice ) {
52
53
$ invoiceAttributesForSave = [];
53
54
54
- if (!$ invoice ->getBillingAddressId ()) {
55
+ if (!$ invoice ->getBillingAddressId () && $ billingAddress ) {
55
56
$ invoice ->setBillingAddressId ($ billingAddress ->getId ());
56
57
$ invoiceAttributesForSave [] = 'billing_address_id ' ;
57
58
$ orderInvoiceHasChanges = true ;
58
59
}
59
60
60
- if (!$ invoice ->getShippingAddressId ()) {
61
+ if (!$ invoice ->getShippingAddressId () && $ shippingAddress ) {
61
62
$ invoice ->setShippingAddressId ($ shippingAddress ->getId ());
62
63
$ invoiceAttributesForSave [] = 'shipping_address_id ' ;
63
64
$ orderInvoiceHasChanges = true ;
You can’t perform that action at this time.
0 commit comments