I want to save value in sales_invoice
table of custom attribute ("current_seller_id").
i want to know any event that fire before save the invoice in sales_invoice
table or use plugin of which method.
.
I already done like this functionality in sales_order table via using event sales_model_service_quote_submit_before
code is give below .
public function execute(\Magento\Framework\Event\Observer $observer)
{
$order = $observer->getData('order');
$quote = $observer->getData('quote');
$quoteItems = $quote->getItems();
foreach ($quoteItems as $quoteItem){
if ($quoteItem->getCurrentSellerId() != ""){
$items[]=$quoteItem->getCurrentSellerId();
}
}
$seller_ids=implode(',',$items);
$order->setCurrentSellerId($seller_ids);
return $this;
}
Same i want to do with sales_invoice
table.
Can anyone guide me ?