How to insert specific invoice items in sales_invoice_item Table?How to add custom attribute in Collection?Subtotal is doubled in the second attempt to invoiceHow can I display non-invoiced items in the invoice?PDF Invoice - content forcing new pageHow to queue “New Order” email before “New Invoice” email?Add custom field in onepage check out,order,invoice,salesHow to get shipping address by invoice number?Magento 1.9.2 coupon( discount) not appearing while creating invoiceMagento Edit Order Invoice PDF - Options on Single LineOrder items showing as invoiced even though invoice failedInvoice Items Collection
Not hide and seek
How can a new country break out from a developed country without war?
Sort with assumptions
I keep switching characters, how do I stop?
How do I lift the insulation blower into the attic?
Started in 1987 vs. Starting in 1987
Why didn’t Eve recognize the little cockroach as a living organism?
Why does the frost depth increase when the surface temperature warms up?
Taking the numerator and the denominator
Offset in split text content
How to test the sharpness of a knife?
Is divisi notation needed for brass or woodwind in an orchestra?
Would this string work as string?
Can a Knock spell open the door to Mordenkainen's Magnificent Mansion?
Why does a 97 / 92 key piano exist by Bosendorfer?
Derivative of an interpolated function
Why is participating in the European Parliamentary elections used as a threat?
Interpretation of rotating a quantum state
What is it called when someone votes for an option that's not their first choice?
Travelling in US for more than 90 days
Capacitor electron flow
Relations between homogeneous polynomials
What is the purpose of using a decision tree?
Trouble reading roman numeral notation with flats
How to insert specific invoice items in sales_invoice_item Table?
How to add custom attribute in Collection?Subtotal is doubled in the second attempt to invoiceHow can I display non-invoiced items in the invoice?PDF Invoice - content forcing new pageHow to queue “New Order” email before “New Invoice” email?Add custom field in onepage check out,order,invoice,salesHow to get shipping address by invoice number?Magento 1.9.2 coupon( discount) not appearing while creating invoiceMagento Edit Order Invoice PDF - Options on Single LineOrder items showing as invoiced even though invoice failedInvoice Items Collection
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
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
magento2 invoice create restriction
add a comment |
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
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
magento2 invoice create restriction
are you looking for to create multiple invoices for the same order for each vendor with their items?
– Rakesh Kumar Jakhar
17 hours ago
first i want to insert just filtered items insales_invoice_item
then i will discuss after .
– HaFiz Umer
17 hours ago
In my opinion it still would be better not to make changes that way but to use quantities as proposed in my answer to a former question magento.stackexchange.com/a/265960/76597 In that way you will not have any impact on order totals and everything would work as you need. If you dont't want to show some items in the form you should rather think about changing the form (i.e. hide rows with qty = 0) than changing the totals calculation.
– HelgeB
17 hours ago
Dear HelgeB ! i will try your this answer beforePrepareInvoice for filtering invoice item. I will give you feed back soon. Thank you
– HaFiz Umer
17 hours ago
add a comment |
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
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
magento2 invoice create restriction
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
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
magento2 invoice create restriction
magento2 invoice create restriction
edited 17 hours ago
magefms
1,8321425
1,8321425
asked 17 hours ago
HaFiz UmerHaFiz Umer
3439
3439
are you looking for to create multiple invoices for the same order for each vendor with their items?
– Rakesh Kumar Jakhar
17 hours ago
first i want to insert just filtered items insales_invoice_item
then i will discuss after .
– HaFiz Umer
17 hours ago
In my opinion it still would be better not to make changes that way but to use quantities as proposed in my answer to a former question magento.stackexchange.com/a/265960/76597 In that way you will not have any impact on order totals and everything would work as you need. If you dont't want to show some items in the form you should rather think about changing the form (i.e. hide rows with qty = 0) than changing the totals calculation.
– HelgeB
17 hours ago
Dear HelgeB ! i will try your this answer beforePrepareInvoice for filtering invoice item. I will give you feed back soon. Thank you
– HaFiz Umer
17 hours ago
add a comment |
are you looking for to create multiple invoices for the same order for each vendor with their items?
– Rakesh Kumar Jakhar
17 hours ago
first i want to insert just filtered items insales_invoice_item
then i will discuss after .
– HaFiz Umer
17 hours ago
In my opinion it still would be better not to make changes that way but to use quantities as proposed in my answer to a former question magento.stackexchange.com/a/265960/76597 In that way you will not have any impact on order totals and everything would work as you need. If you dont't want to show some items in the form you should rather think about changing the form (i.e. hide rows with qty = 0) than changing the totals calculation.
– HelgeB
17 hours ago
Dear HelgeB ! i will try your this answer beforePrepareInvoice for filtering invoice item. I will give you feed back soon. Thank you
– HaFiz Umer
17 hours ago
are you looking for to create multiple invoices for the same order for each vendor with their items?
– Rakesh Kumar Jakhar
17 hours ago
are you looking for to create multiple invoices for the same order for each vendor with their items?
– Rakesh Kumar Jakhar
17 hours ago
first i want to insert just filtered items in
sales_invoice_item
then i will discuss after .– HaFiz Umer
17 hours ago
first i want to insert just filtered items in
sales_invoice_item
then i will discuss after .– HaFiz Umer
17 hours ago
In my opinion it still would be better not to make changes that way but to use quantities as proposed in my answer to a former question magento.stackexchange.com/a/265960/76597 In that way you will not have any impact on order totals and everything would work as you need. If you dont't want to show some items in the form you should rather think about changing the form (i.e. hide rows with qty = 0) than changing the totals calculation.
– HelgeB
17 hours ago
In my opinion it still would be better not to make changes that way but to use quantities as proposed in my answer to a former question magento.stackexchange.com/a/265960/76597 In that way you will not have any impact on order totals and everything would work as you need. If you dont't want to show some items in the form you should rather think about changing the form (i.e. hide rows with qty = 0) than changing the totals calculation.
– HelgeB
17 hours ago
Dear HelgeB ! i will try your this answer beforePrepareInvoice for filtering invoice item. I will give you feed back soon. Thank you
– HaFiz Umer
17 hours ago
Dear HelgeB ! i will try your this answer beforePrepareInvoice for filtering invoice item. I will give you feed back soon. Thank you
– HaFiz Umer
17 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You have to override the controller which is generating the invoice for the order.
Following file is doing this
MagentoSalesControllerAdminhtmlOrderInvoiceSave.php
You have to modify the invoiceItems array according to the vendor items
$invoiceItems = isset($invoiceData['items']) ? $invoiceData['items'] : [];
Following line is processing the invoice
$invoice = $this->invoiceService->prepareInvoice($order, $invoiceItems);
How to override controller
https://www.dckap.com/blog/how-to-override-a-controller-in-magento-2/
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266469%2fhow-to-insert-specific-invoice-items-in-sales-invoice-item-table%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have to override the controller which is generating the invoice for the order.
Following file is doing this
MagentoSalesControllerAdminhtmlOrderInvoiceSave.php
You have to modify the invoiceItems array according to the vendor items
$invoiceItems = isset($invoiceData['items']) ? $invoiceData['items'] : [];
Following line is processing the invoice
$invoice = $this->invoiceService->prepareInvoice($order, $invoiceItems);
How to override controller
https://www.dckap.com/blog/how-to-override-a-controller-in-magento-2/
add a comment |
You have to override the controller which is generating the invoice for the order.
Following file is doing this
MagentoSalesControllerAdminhtmlOrderInvoiceSave.php
You have to modify the invoiceItems array according to the vendor items
$invoiceItems = isset($invoiceData['items']) ? $invoiceData['items'] : [];
Following line is processing the invoice
$invoice = $this->invoiceService->prepareInvoice($order, $invoiceItems);
How to override controller
https://www.dckap.com/blog/how-to-override-a-controller-in-magento-2/
add a comment |
You have to override the controller which is generating the invoice for the order.
Following file is doing this
MagentoSalesControllerAdminhtmlOrderInvoiceSave.php
You have to modify the invoiceItems array according to the vendor items
$invoiceItems = isset($invoiceData['items']) ? $invoiceData['items'] : [];
Following line is processing the invoice
$invoice = $this->invoiceService->prepareInvoice($order, $invoiceItems);
How to override controller
https://www.dckap.com/blog/how-to-override-a-controller-in-magento-2/
You have to override the controller which is generating the invoice for the order.
Following file is doing this
MagentoSalesControllerAdminhtmlOrderInvoiceSave.php
You have to modify the invoiceItems array according to the vendor items
$invoiceItems = isset($invoiceData['items']) ? $invoiceData['items'] : [];
Following line is processing the invoice
$invoice = $this->invoiceService->prepareInvoice($order, $invoiceItems);
How to override controller
https://www.dckap.com/blog/how-to-override-a-controller-in-magento-2/
answered 17 hours ago
Rakesh Kumar JakharRakesh Kumar Jakhar
1664
1664
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266469%2fhow-to-insert-specific-invoice-items-in-sales-invoice-item-table%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
are you looking for to create multiple invoices for the same order for each vendor with their items?
– Rakesh Kumar Jakhar
17 hours ago
first i want to insert just filtered items in
sales_invoice_item
then i will discuss after .– HaFiz Umer
17 hours ago
In my opinion it still would be better not to make changes that way but to use quantities as proposed in my answer to a former question magento.stackexchange.com/a/265960/76597 In that way you will not have any impact on order totals and everything would work as you need. If you dont't want to show some items in the form you should rather think about changing the form (i.e. hide rows with qty = 0) than changing the totals calculation.
– HelgeB
17 hours ago
Dear HelgeB ! i will try your this answer beforePrepareInvoice for filtering invoice item. I will give you feed back soon. Thank you
– HaFiz Umer
17 hours ago