Skip to main content

How to insert specific invoice items in sales_invoice_item Table?

Actually, I created a multi-vendor site. I did most of the things but now am stuck in invoice creation.
I filter the invoice items in the New Invoice page shown in the screenshot enter image description here

In this order, there are 4 Items but I already filter each vendor can see own items.
In this screenshort, you can see 2 items because the current login vendor has 2 items in this order.

My Problem is when I click on "submit invoice" button in this page it creates 4 records mean insert 4 items in sales_invoice_item table. I want to insert just those records that shown in New Invoice Page which I filtered . Others invoice item will be excluded.

How can I make restriction? please guide me. Thanks

HaFiz Umer
  • 1.7k
  • 1
  • 17
  • 39