Services "start date and hour and end date and hour end" - main_use_hourmin_in_date_range

Hi all.

Need to print in pdf invoices, start date and time, and finish date and time of services.

Theres a variable: MAIN_USE_HOURMIN_IN_DATE_RANGE, but nothing chages in native PDF invoice models CRABE o SPONGE, when variable is set to 1.

¿Any help with that?, dont really know where more I could try to change something, but dont what to develop for this, since Im sure that is a native opction in PDF documents.

Regards

Hey!

The MAIN_USE_HOURMIN_IN_DATE_RANGE variable is a bit tricky because it doesn’t automatically work with all PDF templates. This variable mainly affects how date ranges are displayed in some forms and lists, but the native CRABE and SPONGE invoice templates don’t necessarily pick it up for service lines.

For services in invoices, you’ll need to check if your invoice lines actually have the start/end datetime fields populated. Go to your invoice and look at the service lines - make sure the date_start and date_end fields contain both date and time information, not just dates.

If that’s correct but still not showing, you might need to modify the PDF template files. The CRABE template files are in htdocs/core/modules/facture/doc/ and you’d need to edit how the service lines are displayed to include the time portion.

Another thing to check is the Setup > Display configuration to see if there are specific date/time format options that might affect this.

I think the cleanest solution would be to create a custom PDF template based on CRABE that specifically handles the datetime display for services, or check if there are any modules on DoliStore that enhance service datetime handling in PDFs.

Worth checking the GitHub issues too, as this might be a known limitation with a pending fix.

Clément Houde - Founder of Dolicraft

Thank you very much Clément, for responding so overwhelmingly complete.