How to add a pay until date to invoice in Magento2?Attach invoice to shipment emailRemove shipping costs from pdf invoice (Symmetrics InvoicePdf)How to attach Invoice PDF in invoice emailadd to footer image in adminpage pdf invoiceHow to write a function of total priceInvoice pdf not updating magento 1.9.3.4display brand column invoice PDFMagento 2 : How to add horizontal lines to separate the line items in sales invoice PDF ?Magento2 : Remove shipping charge and credit cart type and number from order invoiceHow to edit Magento2 Invoice template
Second 100 amp breaker inside existing 200 amp residential panel for new detached garage
Non-misogynistic way to say “asshole”?
What is the "ls" directory in my home directory?
Did the CIA blow up a Siberian pipeline in 1982?
How do I remove this inheritance-related code smell?
Should the party get XP for a monster they never attacked?
Drawing a second weapon as part of an attack?
Can I change normal plug to a 15amp round pin plug?
Can the pre-order traversal of two different trees be the same even though they are different?
Greeting with "Ho"
Can you use one creature for both convoke and delve for Hogaak?
How do internally carried IR missiles acquire a lock?
What are Elsa's reasons for selecting the Holy Grail on behalf of Donovan?
In the US, can a former president run again?
Boss wants someone else to lead a project based on the idea I presented to him
What is the most suitable position for a bishop here?
How do I see debug logs for Change Data Capture triggers in Salesforce?
Does a proton have a binding energy?
Novel in which alien (Martian?) is trapped on Earth in prehistory
Is there official documentation on directories like ~/.config and ~/.cache?
What is the highest voltage from the power supply a Raspberry Pi 3 B can handle without getting damaged?
A word for delight at someone else's failure?
I just entered the USA without passport control at Atlanta airport
Find All Possible Unique Combinations of Letters in a Word
How to add a pay until date to invoice in Magento2?
Attach invoice to shipment emailRemove shipping costs from pdf invoice (Symmetrics InvoicePdf)How to attach Invoice PDF in invoice emailadd to footer image in adminpage pdf invoiceHow to write a function of total priceInvoice pdf not updating magento 1.9.3.4display brand column invoice PDFMagento 2 : How to add horizontal lines to separate the line items in sales invoice PDF ?Magento2 : Remove shipping charge and credit cart type and number from order invoiceHow to edit Magento2 Invoice template
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, or maybe I am missing something. I hope I am missing something!
In my country, every invoice has to mention the date when was created and a date by which the client has to make the payment. The fact that (from what I can tell) Magento doesn't automatically generate an invoice for each order placed, tells me that these dates should be attributes of the invoice, and not attributes of the order.
I have made a plugin using the following code:
app/code/ideologic/RoInvoice/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderPdfInvoice" type="ideologicRoInvoiceModelOrderPdfInvoice" />
<type name="MagentoSalesModelOrderInvoice">
<plugin sortOrder="1" name="setDueDate" type="ideologicRoInvoiceModelOrderInvoice" />
</type>
</config>
app/code/ideologic/RoInvoice/Model/Order/Invoice.php
<?php
/**
* Copyright © SC ideologic SRL, All rights reserved.
*/
namespace ideologicRoInvoiceModelOrder;
class Invoice
public function beforeSetCreatedAt(MagentoSalesModelOrderInvoice $invoice, $createdAt)
$invoice->addData(array('DueDateDelay'=>15));
return $createdAt;
But for some reason the addData() function call has no effect. When I am calling getData() from app/code/ideologic/RoInvoice/Model/Order/Pdf/Invoice.php I am getting a null value (or empty string).
From what I have read, I have to load the 'Model' before calling setData(). How do I do that? Any help will be appreciated!
magento2 model invoice plugin crud
New contributor
add a comment |
Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, or maybe I am missing something. I hope I am missing something!
In my country, every invoice has to mention the date when was created and a date by which the client has to make the payment. The fact that (from what I can tell) Magento doesn't automatically generate an invoice for each order placed, tells me that these dates should be attributes of the invoice, and not attributes of the order.
I have made a plugin using the following code:
app/code/ideologic/RoInvoice/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderPdfInvoice" type="ideologicRoInvoiceModelOrderPdfInvoice" />
<type name="MagentoSalesModelOrderInvoice">
<plugin sortOrder="1" name="setDueDate" type="ideologicRoInvoiceModelOrderInvoice" />
</type>
</config>
app/code/ideologic/RoInvoice/Model/Order/Invoice.php
<?php
/**
* Copyright © SC ideologic SRL, All rights reserved.
*/
namespace ideologicRoInvoiceModelOrder;
class Invoice
public function beforeSetCreatedAt(MagentoSalesModelOrderInvoice $invoice, $createdAt)
$invoice->addData(array('DueDateDelay'=>15));
return $createdAt;
But for some reason the addData() function call has no effect. When I am calling getData() from app/code/ideologic/RoInvoice/Model/Order/Pdf/Invoice.php I am getting a null value (or empty string).
From what I have read, I have to load the 'Model' before calling setData(). How do I do that? Any help will be appreciated!
magento2 model invoice plugin crud
New contributor
add a comment |
Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, or maybe I am missing something. I hope I am missing something!
In my country, every invoice has to mention the date when was created and a date by which the client has to make the payment. The fact that (from what I can tell) Magento doesn't automatically generate an invoice for each order placed, tells me that these dates should be attributes of the invoice, and not attributes of the order.
I have made a plugin using the following code:
app/code/ideologic/RoInvoice/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderPdfInvoice" type="ideologicRoInvoiceModelOrderPdfInvoice" />
<type name="MagentoSalesModelOrderInvoice">
<plugin sortOrder="1" name="setDueDate" type="ideologicRoInvoiceModelOrderInvoice" />
</type>
</config>
app/code/ideologic/RoInvoice/Model/Order/Invoice.php
<?php
/**
* Copyright © SC ideologic SRL, All rights reserved.
*/
namespace ideologicRoInvoiceModelOrder;
class Invoice
public function beforeSetCreatedAt(MagentoSalesModelOrderInvoice $invoice, $createdAt)
$invoice->addData(array('DueDateDelay'=>15));
return $createdAt;
But for some reason the addData() function call has no effect. When I am calling getData() from app/code/ideologic/RoInvoice/Model/Order/Pdf/Invoice.php I am getting a null value (or empty string).
From what I have read, I have to load the 'Model' before calling setData(). How do I do that? Any help will be appreciated!
magento2 model invoice plugin crud
New contributor
Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, or maybe I am missing something. I hope I am missing something!
In my country, every invoice has to mention the date when was created and a date by which the client has to make the payment. The fact that (from what I can tell) Magento doesn't automatically generate an invoice for each order placed, tells me that these dates should be attributes of the invoice, and not attributes of the order.
I have made a plugin using the following code:
app/code/ideologic/RoInvoice/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderPdfInvoice" type="ideologicRoInvoiceModelOrderPdfInvoice" />
<type name="MagentoSalesModelOrderInvoice">
<plugin sortOrder="1" name="setDueDate" type="ideologicRoInvoiceModelOrderInvoice" />
</type>
</config>
app/code/ideologic/RoInvoice/Model/Order/Invoice.php
<?php
/**
* Copyright © SC ideologic SRL, All rights reserved.
*/
namespace ideologicRoInvoiceModelOrder;
class Invoice
public function beforeSetCreatedAt(MagentoSalesModelOrderInvoice $invoice, $createdAt)
$invoice->addData(array('DueDateDelay'=>15));
return $createdAt;
But for some reason the addData() function call has no effect. When I am calling getData() from app/code/ideologic/RoInvoice/Model/Order/Pdf/Invoice.php I am getting a null value (or empty string).
From what I have read, I have to load the 'Model' before calling setData(). How do I do that? Any help will be appreciated!
magento2 model invoice plugin crud
magento2 model invoice plugin crud
New contributor
New contributor
New contributor
asked Jun 11 at 20:25
Radu MarinescuRadu Marinescu
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I know this doesn't directly answer your question but is a solution to one of your issues.
Certain payment methods wont invoice automatically. They need manual attention.
I put together this externsion to automatically invoices orders based on certain conditions.
https://github.com/DominicWatts/AutoInvoice
So solves that part
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
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
);
);
Radu Marinescu is a new contributor. Be nice, and check out our Code of Conduct.
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%2f278009%2fhow-to-add-a-pay-until-date-to-invoice-in-magento2%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
I know this doesn't directly answer your question but is a solution to one of your issues.
Certain payment methods wont invoice automatically. They need manual attention.
I put together this externsion to automatically invoices orders based on certain conditions.
https://github.com/DominicWatts/AutoInvoice
So solves that part
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
add a comment |
I know this doesn't directly answer your question but is a solution to one of your issues.
Certain payment methods wont invoice automatically. They need manual attention.
I put together this externsion to automatically invoices orders based on certain conditions.
https://github.com/DominicWatts/AutoInvoice
So solves that part
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
add a comment |
I know this doesn't directly answer your question but is a solution to one of your issues.
Certain payment methods wont invoice automatically. They need manual attention.
I put together this externsion to automatically invoices orders based on certain conditions.
https://github.com/DominicWatts/AutoInvoice
So solves that part
I know this doesn't directly answer your question but is a solution to one of your issues.
Certain payment methods wont invoice automatically. They need manual attention.
I put together this externsion to automatically invoices orders based on certain conditions.
https://github.com/DominicWatts/AutoInvoice
So solves that part
answered Jun 11 at 21:51
Dominic XigenDominic Xigen
1,7351311
1,7351311
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
add a comment |
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Thanks for the suggestion. I still want to add that that second date as an attribute of the invoice, and somehow, adding it to the order object seems wrong...
– Radu Marinescu
Jun 11 at 22:10
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
Have you been able to add column to sales_order table or sales_invoice table yet? Doesn't really matter which. Just need to make sure you update the new date column in either table after invoice generation . Will be easier to work with updating order. Do you want to use event like checkout success or run something on schedule?
– Dominic Xigen
Jun 12 at 0:15
add a comment |
Radu Marinescu is a new contributor. Be nice, and check out our Code of Conduct.
Radu Marinescu is a new contributor. Be nice, and check out our Code of Conduct.
Radu Marinescu is a new contributor. Be nice, and check out our Code of Conduct.
Radu Marinescu is a new contributor. Be nice, and check out our Code of Conduct.
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%2f278009%2fhow-to-add-a-pay-until-date-to-invoice-in-magento2%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