# Extra Fields in Expense report

**URL:** <https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737>\
**Category:** Other native modules\
**Created:** [July 13, 2019, 12:52pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737 "2019-07-13T12:52:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_A](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/c/cab0a1/32.png) [@Chris\_A](https://www.dolibarr.org/forum/u/Chris_A)\
**Post date:** [July 13, 2019, 12:52pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/1 "2019-07-13T12:52:11Z")

</div>

I am currently using Dolibar Version 10 on Ubuntu 19.04.

What I need: I need the ExtraFields module to allow me to modify the lines you add to the ExpenseReport.

What works right now: ExtraFields currently only updates the ExpenseReport fields NOT the lines.

What have I tried: I have attempted to modify the code and database to support my desired field types but I can’t get the “add” function to work correctly. I’m not a professional coder.

Any help would be greatly appreciated

Chris

---

<div class="post-metadata">

**Author:** ![Chris\_A](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/c/cab0a1/32.png) [@Chris\_A](https://www.dolibarr.org/forum/u/Chris_A)\
**Post date:** [July 15, 2019, 2:54pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/2 "2019-07-15T14:54:37Z")

</div>

Update:  
I have figured out how to “hard code” the changes in the card.php and expensereport.class.php files to allow me add data into the new database fields I have created.  
I think it would probably be much easier to use the “extrafields” module to accomplish this but at least I have it working now.  
I must now adjust the code for the PDF report generator to fit my new fields.

I am still interested in hearing if someone has implemented the extrafields module into the lines section of the Expense Report.

Chris

---

<div class="post-metadata">

**Author:** ![RiseValInfotech](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@RiseValInfotech](https://www.dolibarr.org/forum/u/RiseValInfotech)\
**Post date:** [May 13, 2021, 4:26am UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/3 "2021-05-13T04:26:40Z")

</div>

Dear Chris,

Can you please share the changes you did on the card.php and expensereport.class.php for the benefit of the forum. Also the PDF .ODT file please.

I am trying to add two fields (Database field from third parties as vendor) in the line item of expense reports.

Many thanks  
yesbee

---

<div class="post-metadata">

**Author:** ![rommelngo](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/r/779978/32.png) [@rommelngo](https://www.dolibarr.org/forum/u/rommelngo)\
**Post date:** [February 3, 2024, 9:41pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/4 "2024-02-03T21:41:52Z")

</div>

Hi Chris,

I wanted to ask you if you can share how you did the extra fields on expense report lines. I really need to add custom attributes on expense report lines. Wish Dolibarr would make it available soon.

Rommel

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [February 3, 2024, 10:16pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/5 "2024-02-03T22:16:46Z")

</div>

Try this place:

Home, Setup, Modules/Applications

search for expense, and click the cogwheel to go into settings.

Select tab number 3, named Complementary attributes, and make new in there.

---

<div class="post-metadata">

**Author:** ![rommelngo](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/r/779978/32.png) [@rommelngo](https://www.dolibarr.org/forum/u/rommelngo)\
**Post date:** [February 3, 2024, 10:28pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/6 "2024-02-03T22:28:22Z")

</div>

Thank you jon, however I need it on line items not on the Expense Report itself.

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [February 4, 2024, 10:30am UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/7 "2024-02-04T10:30:07Z")

</div>

okay. Other modules likes orders, proposals and invoices have that option, it is called Complementary attributes (lines). I don’t know if expense reports has that.

I do use expense reports, and I did add my own types in Home, Setup, Dictionaries, Expense report - Types of expense report lines

Maybe you can use that?

---

<div class="post-metadata">

**Author:** ![rommelngo](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/r/779978/32.png) [@rommelngo](https://www.dolibarr.org/forum/u/rommelngo)\
**Post date:** [February 4, 2024, 10:04pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/8 "2024-02-04T22:04:23Z")

</div>

Hi Jon,

Yes Jon thanks for your feedback. I do know those and I have used them. It’s just that the data I need is on Expense line item. I want to link it to vendor in such a way that one expense report can have multiple expense items with multiple vendors. I also want extra fields like the item bought, the purpose, etc… I just didn’t want to just chuck all of them in Description field which is easy to miss as that is free text.

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [February 5, 2024, 6:53pm UTC](https://www.dolibarr.org/forum/t/extra-fields-in-expense-report/17737/9 "2024-02-05T18:53:27Z")

</div>

> [@rommelngo](#):
>
> Yes Jon thanks for your feedback. I do know those and I have used them. It’s just that the data I need is on Expense line item. I want to link it to vendor in such a way that one expense report can have multiple expense items with multiple vendors. I also want extra fields like the item bought, the purpose, etc… I just didn’t want to just chuck all of them in Description field which is easy to miss as that is free text.

yeah that makes good sense 🙂
