Values derived by dates

Values derived by dates

Good Afternoon,

I wonder if someone could give their advice on how to achieve the following.

I wish to create a document 'due date' field derived from 3 other fields which are:-

1) Document date e.g. 19/09/11
2) Number of days e.g. 30
3) Terms e.g. from document date or from end of month.

So based on a document date of 19/09/11 some of the options could be 

1) Number of days 10, terms from document date would result in 29/09/11

2) Number of days 10, terms from end of month would result in 10/10/11

I have created the above in another database platform and also in excel but I am not sure where to start in Zoho.

Appreciate any help you can offer.

Many thanks.