DSM/ECM module don't show generated PDFs of billings


DOLIBARR ENVIRONMENT
Version: 20.0.2
Operating System: Linux x86_64
Web Server: Apache
PHP: 8.2.18
Database: 10.3.39-MariaDB-cll-lve
URL(s): /ecm/index_auto.php
-------------------------------------------------------------------------------------

Config parameters

$dolibarr_main_document_root=‘/public_html/dolibarr/htdocs’;
$dolibarr_main_document_root_alt=‘/public_html/dolibarr/documents’;
$dolibarr_main_data_root=‘/public_html/dolibarr/documents’;

When I generate a PDF that file doesn’t show in the DSM/ECM module, but in the old versions of Dolibarr (before 12) it was working well.

I have just generate the new FILE, but there is no one in the DSM/ECM section.

And also in the server there is not the right folder.

I tried to solve it by checking the system settings, the folder parameters (maybe there is a parameter they don’t know that does this).
If, in the settings, in the invoice module, I try to generate a PDF with the DRAFT function, it is saved correctly in the right folder on the server as SPECIMEN.pdf

Thank you in advance for your support!

Hi there,
I’m a bit confused about the folder structure you’ve shared:

  • First, you haven’t specified which directory this content belongs to… perhaps it’s /documents/facture ?
  • If that’s the case, I don’t think there should be a payments subdirectory there…

If my above observations aren’t related to your issue, I would suggest checking the PHP error log - you might find some PDF generation errors that could explain why the document isn’t being stored.

Additionally, it might be helpful to enable Dolibarr’s native DEBUG module. Once activated in its default configuration, it will start logging information to /documents/dolibarr.log

Best regards

YES, it is!

Hello, I try to DEBUG the events with the native Dolibarr module and I find this one:

2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT COUNT(ab.rowid) as nb FROM llx_accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice' AND ab.fk_doc = 409
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 Call getNextNumRef with FACTURE_ADDON = mod_facture_mercure, thirdparty=XYZ, type=TE_SMALL, mode=last
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 functions2::get_next_value mode=last
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT MAX(SUBSTRING(ref, 3, 3)) as val FROM llx_facture WHERE ref LIKE 'FA________' AND ref NOT LIKE '(PROV%)' AND entity IN (1) AND (SUBSTRING(ref, 7, 4) = '2024')
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 functions2::get_next_value mode=last
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT ref as ref FROM llx_facture WHERE ref LIKE 'FA024_____' AND ref NOT LIKE '%PROV%' AND entity IN (1) AND (SUBSTRING(ref, 7, 4) = '2024')
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 functions2::get_next_value return FA024/2024
2024-12-27 21:08:01 INFO    185.186.69.229  2065247   1004 files.lib.php::dol_dir_list path=/public_html/intranet/dolibarr/documents/facture/FA019_2024 types=files recursive=0 filter= excludefilter="(\\.meta|_preview.*.*\\.png)$"
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 /core/lib/function2.lib.php::getListOfModels
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT nom as id, nom as doc_template_name, libelle as label, description as description FROM llx_document_model WHERE type = 'invoice' AND entity IN (0,1) ORDER BY description DESC
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 Link::fetchAll
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT rowid, entity, datea, url, label, objecttype, objectid FROM llx_links WHERE objecttype = 'facture' AND objectid = 409 AND entity = 1
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 Link::fetchAll num=0
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT rowid, label, entity, filename, filepath, fullpath_orig, keywords, cover, gen_or_uploaded, extraparams, date_c, tms as date_m, fk_user_c, fk_user_m, acl, position, share FROM llx_ecm_files WHERE entity = 1 AND filepath = 'facture/FA019_2024'
2024-12-27 21:08:01 INFO    185.186.69.229  2065247   1004 list_of_documents We found a file called 'FA019_2024.pdf' not indexed into database. We add it
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 EcmFiles::create
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 sql=SELECT MAX(position) as maxposition FROM llx_ecm_files WHERE filepath ='facture/FA019_2024'
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 BEGIN Transaction
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004  sql=INSERT INTO llx_ecm_files(ref,label,share,entity,filename,filepath,fullpath_orig,description,keywords,cover,position,gen_or_uploaded,extraparams,date_c,tms,fk_user_c,fk_user_m,acl,src_object_type,src_object_id) VALUES ( '061e712570c165bc39f95a0c27ed697f',  '68b2db38f730bb2ddf0827a843c134c8', NULL, 1, 'FA019_2024.pdf', 'facture/FA019_2024', '/public_html/intranet/dolibarr/documents/facture/FA019_2024/FA019_2024.pdf', '', '', NULL, 1, 'unknown', NULL, '2024-12-27 21:08:01', '2024-12-27 21:08:01', 2, NULL, NULL, NULL, NULL)
2024-12-27 21:08:01 WARNING 185.186.69.229  2065247   1004  Interfaces::run_triggers action=ECMFILES_CREATE Launch old method run_trigger (rename your trigger into runTrigger) for file 'interface_85_modFacturefournIta_SaveFields.class.php'
2024-12-27 21:08:01 WARNING 185.186.69.229  2065247   1004  Interfaces::run_triggers action=ECMFILES_CREATE Launch old method run_trigger (rename your trigger into runTrigger) for file 'interface_90_modFacturefournIta_FactureFournRitenutaAcconto.class.php'
2024-12-27 21:08:01 DEBUG   185.186.69.229  2065247   1004 COMMIT Transaction

And in the Database I see this:
DATABASE

I don’t know why I can’t see the folder and the file.

Thank you in advance.

Bonjour,

Sincèrement, tout semble correct. C’est-à-dire, après avoir soigneusement examiné le LOG Dolibarr que vous avez partagé et sachant qu’il existe un enregistrement pour ce fichier dans la base de données… je dirais que le fichier existe bel et bien ! En fait, les lignes que vous avez montrées révèlent que le système a trouvé un fichier physique qui n’était pas reflété dans la liste des fichiers enregistrés dans la base de données… c’est la seule chose étrange, que je ne peux pas expliquer sans plus d’informations.

Vous ne pouvez toujours pas voir ce répertoire et ce fichier ? Ne serait-ce pas un problème de privilèges d’accès sur ce répertoire ? Pouvez-vous accéder à ce PDF depuis la fiche de la facture ? Et depuis l’interface du module ECM (Documents) également ?

Hello, thank you for your reply.
In the server folders, there is not the folder and not the file .pdf

In Dolibarr application front-end I see the PDF in the Billing section, but not in the ECM module.

I think Dolibarr try to create the file, but it don’t find the right route or it can’t create the folder, but I try to change also the folder permissions from:

to

But nothing changed.

Thank you in advance for your help!

What is the URL displayed when you hover “FA019_2024.pdf”?

My local Dolibarr shows like this: