File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
app/code/Magento/Sales/Model/Service Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ public function prepareInvoice(
153153 $ totalQty = 0 ;
154154 $ invoice = $ this ->orderConverter ->toInvoice ($ order );
155155 $ preparedItemsQty = $ this ->prepareItemsQty ($ order , $ orderItemsQtyToInvoice );
156+ $ originalEntityType = $ order ->getEntityType () ?? null ;
156157
157158 foreach ($ order ->getAllItems () as $ orderItem ) {
158159 if (!$ this ->canInvoiceItem ($ orderItem , $ preparedItemsQty )) {
@@ -177,6 +178,9 @@ public function prepareInvoice(
177178
178179 $ invoice ->setTotalQty ($ totalQty );
179180 $ invoice ->collectTotals ();
181+ if ($ originalEntityType ) {
182+ $ order ->setHistoryEntityName ($ originalEntityType );
183+ }
180184 $ order ->getInvoiceCollection ()->addItem ($ invoice );
181185
182186 return $ invoice ;
You can’t perform that action at this time.
0 commit comments