# Indicating the billing period automatically on the invoice

**URL:** <https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131>\
**Category:** Financial modules\
**Created:** [December 9, 2022, 11:29am UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131 "2022-12-09T11:29:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dleigh](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/dleigh/32/5761_2.png) [@dleigh](https://www.dolibarr.org/forum/u/dleigh)\
**Post date:** [December 9, 2022, 11:29am UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/1 "2022-12-09T11:29:32Z")

</div>

This is perhaps big ask…  
I bill monthly for hourly work done in that month. I will either bill on the last day of the month or the last working day or the first day of the next month. My intent is always the same, to bill for the month just finished. I send the PDF invoices immediately to the clients.

A client has asked that I indicate on the invoice the month which this invoice is for. There has been some confusion in their Accounts Payable process and he hopes that could help. It’s a reasonable request. I would just like it to be an automatic process so that I’m not relying on my memory to make it happen.

Any ideas out there on how to do it in Dolibarr?  
Thanks!

---

<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:** [December 9, 2022, 11:46am UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/2 "2022-12-09T11:46:59Z")

</div>

Hello,

You can try with computed extrafields, and a bit of PHP.

Exemple :  
`(date("d") > 15) ? "Bill of the ".date("F") : "Bill of the ".date("F", strtotime("-1 month"))`  
not tested

---

<div class="post-metadata">

**Author:** ![dleigh](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/dleigh/32/5761_2.png) [@dleigh](https://www.dolibarr.org/forum/u/dleigh)\
**Post date:** [December 9, 2022, 1:22pm UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/3 "2022-12-09T13:22:45Z")

</div>

Great idea. I was not aware of “computed extra fields”. I’ll have to get myself up to speed on them. I suppose then, I somehow add them to my invoice model?

---

<div class="post-metadata">

**Author:** ![isamuse](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/i/e47774/32.png) [@isamuse](https://www.dolibarr.org/forum/u/isamuse)\
**Post date:** [December 19, 2022, 1:13pm UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/4 "2022-12-19T13:13:43Z")

</div>

@dleigh  
Did you try the computed extrafield?

As an alternative, for the same need as you, I use the module “timesheet”

> **[Timesheet (download on sourceforge)](https://www.dolistore.com/en/products-services-or-stock/419-Timesheet--download-on-sourceforge-.html)**
>
> Timesheet (download on sourceforge)

First you will need to edit a report from the module timesheet and from this report, you can prepare your invoice. The invoice will then indicate the period of time selected for your report.

You will also be able to download the timesheet in a nice pdf, if you need it.

---

<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:** [December 19, 2022, 1:41pm UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/5 "2022-12-19T13:41:48Z")

</div>

> [@dleigh](#):
>
> I somehow add them to my invoice model?

It’s automatic if you use sponge model

---

<div class="post-metadata">

**Author:** ![dleigh](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/dleigh/32/5761_2.png) [@dleigh](https://www.dolibarr.org/forum/u/dleigh)\
**Post date:** [December 20, 2022, 6:46am UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/6 "2022-12-20T06:46:24Z")

</div>

I usually copy in an Excel table in the public note of the invoice. It was “low-hanging fruit” to do it in Excel so I went that way. Currently I use Clockify to track my time. So it’s Clockify \>\> Excel via PowerQuery \>\> Dolibarr. The Excel to Dolibarr is the most disconnected part. I’m fairly invested in the Clockify and Excel parts (even did a write up of my process here: [https://david.leighweb.com/2021/05/27/clockify-power-query-excel-dolibarr/](https://david.leighweb.com/2021/05/27/clockify-power-query-excel-dolibarr/) ) But if I could do it all in Dolibarr, that does sound interesting. I’ll have to take a look at it. Thanks!

---

<div class="post-metadata">

**Author:** ![dleigh](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/dleigh/32/5761_2.png) [@dleigh](https://www.dolibarr.org/forum/u/dleigh)\
**Post date:** [December 20, 2022, 6:46am UTC](https://www.dolibarr.org/forum/t/indicating-the-billing-period-automatically-on-the-invoice/23131/7 "2022-12-20T06:46:59Z")

</div>

Thanks for the info!
