-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW add simple order list as email variable #25683
base: develop
Are you sure you want to change the base?
NEW add simple order list as email variable #25683
Conversation
|
||
$discountIsAvailable = false; | ||
|
||
foreach($object->lines as $order_position) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if object has no ->lines property ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy i included a condition if lines property is empty, but why the test is failing? https://app.travis-ci.com/github/Dolibarr/dolibarr/builds/265505646 - can you explain it? Where is Task::$price? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy i included a condition if lines property is empty, but why the test is failing? https://app.travis-ci.com/github/Dolibarr/dolibarr/builds/265505646 - can you explain it? Where is Task::$price? :)
This seems introduced by the new function line 10245.
When object is not an Order but Task. The field ->line->price does not exists ...
There is already a system to allow to include the lines of an order into odt templates. Not as easy to use than the preformated table, but a preformated table may return an expected string for your use case but will probably won't be ok for the use case of someone else.
Cant' you use the system to include lines of order in your odt (see examples default provided odt sample) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible in both variants in my thoughts. I dont't use ODT-Files - it is explicit a digital process. Nothing to print and no attachments. It would be a very nice feature to list the order in an email. I have seen that as order confirmation on many online shops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy is it ok for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy reminder :)
$discountIsAvailable = false; | ||
$orderPositionHasNoPrice = false; | ||
|
||
if(!property_exists($object->lines[0], "remise_percent") || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy here is my solution to ensure the right and "specific" object.
NEW|New simple order list as email variable
It renders a simple (position, description, amount, unit, price, total and discount) order list in an email.