# \[SOLVED\] Dictionary referencing another dictionary

**URL:** <https://www.dolibarr.org/forum/t/solved-dictionary-referencing-another-dictionary/25302>\
**Category:** Developing for Dolibarr\
**Created:** [May 6, 2024, 6:23pm UTC](https://www.dolibarr.org/forum/t/solved-dictionary-referencing-another-dictionary/25302 "2024-05-06T18:23:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vstrecker](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/v/ed655f/32.png) [@vstrecker](https://www.dolibarr.org/forum/u/vstrecker)\
**Post date:** [May 6, 2024, 6:23pm UTC](https://www.dolibarr.org/forum/t/solved-dictionary-referencing-another-dictionary/25302/1 "2024-05-06T18:23:32Z")

</div>

I need to extend the c\_payment with some missing fields for cash discounts. E.g.

14 days 3% discount, 30 days net

which is a normal payment term here. The c\_payment\_term table is missing two fields for me, one for the cash discounts days and one for the cash discount percentage.

I can not figure out how to create a dictionary in module builder, which is linked to c\_payment\_term dict[12] adding these 2 fields by itself. It looks like the module builder dictionary is created to setup own dictionaries.

I also was not able to link a new object to the payment terms dictionary, which would have worked for me too.

Any help would be greatly appreciated. I do not want to change core, having all of my stuff in modules here. But dictionaries are different, they miss the class file to link it in a object.

Thank you.

---

<div class="post-metadata">

**Author:** ![vstrecker](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/v/ed655f/32.png) [@vstrecker](https://www.dolibarr.org/forum/u/vstrecker)\
**Post date:** [May 7, 2024, 3:42pm UTC](https://www.dolibarr.org/forum/t/solved-dictionary-referencing-another-dictionary/25302/2 "2024-05-07T15:42:11Z")

</div>

I solved this one by creating a module adding columns to c\_payment\_terms table and handling a hook updating the dict 12 arrays using global and changing the values there. The missing fields are now handled fully in dict.php id 12 after the module is enabled.

A problem is always the decimal , because only price and ^amount are handled as number format. So i named one field amountsk1poz and decimal point is now there too.
