feat: allow attaching a PDF receipt from the phone in the HR mobile app

Problem

In the HR mobile app, the expense receipt can only be captured with the camera (Capacitor Camera.getPhoto), so users cannot attach a PDF already stored on their phone. Need raised by the CAE federation.

Root cause

ExpenseDetailsCamera.vue only exposed a camera button, and the receipt field was typed Attach Image. The rest of the chain was already PDF-ready: hrms.api.upload_base64_file accepts PDFs and the desk form (expense.js) already allows image/* + application/pdf with PDF preview.

Fix

  • Add a « Choisir un fichier » button next to the camera button, opening the native file picker (accept="image/*,application/pdf", aligned with the desk uploader); upload goes through the existing FileAttachment class.
  • For non-image receipts, replace the broken <img> preview with a clickable file chip opening FilePreviewModal (iframe preview). The replace action now offers both sources (camera or file).
  • Derive the camera photo extension from the actual MIME type instead of hardcoding photo.png.
  • Change the receipt fieldtype from Attach Image to Attach (same storage type, no patch needed).
  • Add the French translations for the new labels.

Verified: frontend build OK; bench migrate applies the fieldtype; a real PDF uploaded through hrms.api.upload_base64_file creates a private File attached to the right field. Manual check on a phone (native picker + preview) still welcome.

Merge request reports

Loading