# Price ea on ODT ouput

**URL:** <https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744>\
**Category:** Using my Dolibarr\
**Created:** [July 14, 2019, 11:28pm UTC](https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744 "2019-07-14T23:28:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LHuthmann](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/l/59ef9b/32.png) [@LHuthmann](https://www.dolibarr.org/forum/u/LHuthmann)\
**Post date:** [July 14, 2019, 11:28pm UTC](https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744/1 "2019-07-14T23:28:56Z")

</div>

Hi Team,  
i have an problem and i hope you can help. I’m looking to have a “price ea” on our ODT template. All the given {line\_price\_htxx} and {object\_xx} are not working.

in example for proposal:  
SalesPrice for product is $100, manuell given Discount 10%, qty. 2

Needed ODT output  
Price ea $90, Price total $180

Any idea if there is a “smart” solution ?

Thanks for your help !

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [July 15, 2019, 8:23am UTC](https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744/2 "2019-07-15T08:23:00Z")

</div>

Hello,

What is a Price EA ?

The lists of TAGs are there : [https://wiki.dolibarr.org/index.php/Create\_an\_ODT\_document\_template](https://wiki.dolibarr.org/index.php/Create_an_ODT_document_template)

For lines you have : {line\_price\_ht} {line\_price\_ht\_locale}

---

<div class="post-metadata">

**Author:** ![LHuthmann](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/l/59ef9b/32.png) [@LHuthmann](https://www.dolibarr.org/forum/u/LHuthmann)\
**Post date:** [July 15, 2019, 12:21pm UTC](https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744/3 "2019-07-15T12:21:59Z")

</div>

Hi KSAR,  
thank you for your feedback.  
Price ea means Price each ( Selling price - discount ), because when i use the other line\_xx it always summarize the amount if qty. is more then 1.

I’ve attaced a screen how i need it.

![snip.png](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/7/76aa39e7f204da594d4538211646831f5886277a.png)

Best regards

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [July 15, 2019, 1:43pm UTC](https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744/4 "2019-07-15T13:43:40Z")

</div>

Hi,

Ok so you want a price per unit minus discount, this is not availlable by default.

Two choices :  
1 - Add your own ODT TAG (see Other personalized tags) : [https://wiki.dolibarr.org/index.php/Create\_an\_ODT\_document\_template](https://wiki.dolibarr.org/index.php/Create_an_ODT_document_template)  
2 - Create a calculated line extrafiled that does the needed calculation

THe second one is easier if you are not realy conformtable with php.

---

<div class="post-metadata">

**Author:** ![LHuthmann](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/l/59ef9b/32.png) [@LHuthmann](https://www.dolibarr.org/forum/u/LHuthmann)\
**Post date:** [July 15, 2019, 2:21pm UTC](https://www.dolibarr.org/forum/t/price-ea-on-odt-ouput/17744/5 "2019-07-15T14:21:52Z")

</div>

Hi,  
I’m not familar with PHP and my last test to try to add own ODT TAG wasn’t successfull therefore option2 would be the best option but i have no idea how to do that :unhappy:

I tried two different ways:  
a) to define a range/field with line\_price\_ht\_locale at the ODT template and text formel ( line\_price\_ht / line\_qty ) but it failed

b) an extra-field on product with Computed field but however it is not working on ODT output  
Product Complementary attributes

 ![snip1.png](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/4/44523db073968f639ed605b999d5e5aec4401352.png)

ODT Form

![snip2.png](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/0/028e9732417e40ba4c99d8b0886d477f4bb4880b.png)

ODT Output

![snip3.png](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/5/5c2e9e9985b9f382a72c4f387067ab09ce1d040c.png)

However, it do not show any ouput on first line ( where i expected the price ea ), and also the other lines are, maybe OK but instead of showing the name of entry it show only entry itself.

Any idea how i can get this field adopted right into our ODT ?

> Pièces jointes :
> 
> - [priceea.png](https://www.dolibarr.org/forum/uploads/short-url/zwyk7x4MU3BreoUZwJd5DQDz6tL.png) (8.85 KB)
