Skip to content
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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

ultrasites
Copy link
Contributor

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.


$discountIsAvailable = false;

foreach($object->lines as $order_position) {
Copy link
Member

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 ?

Copy link
Contributor Author

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? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldy any ideas?

Copy link
Member

@eldy eldy Sep 2, 2023

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) ?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldy reminder :)

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Aug 26, 2023
@eldy eldy changed the title add simple order list as email variable NEW add simple order list as email variable Sep 11, 2023
$discountIsAvailable = false;
$orderPositionHasNoPrice = false;

if(!property_exists($object->lines[0], "remise_percent") ||
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants