Skip to content

Conversation

@svenwey
Copy link
Collaborator

@svenwey svenwey commented Apr 11, 2025

No description provided.

@svenwey svenwey self-assigned this Apr 11, 2025
@svenwey svenwey changed the title allow to submit expense with a pdf (64085) allow to submit expense receipt as a pdf (64085) Apr 11, 2025
Copy link
Member

@Kagemaru Kagemaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the converting to image solution is what Nicole intended.
I'd handle it as a PDF for as long as we can.
This has the option to download it as a PDF and is easily attachable to the generated PDF when we export it.

I'd put it on INT for now, then she can decide if she wants it like this.

.convert('jpg')
.loader(page: 0)
.call
if receipt_param.content_type == 'application/pdf'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick, that I'd split it in 2 methods and call them conditionally. If you want to prepare the path for further filetypes, you could do it something like this:

case receipt_param.content_type
when /image/ then attach_image
when 'application/pdf' then attach_pdf
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree with you, this isn't very clean.
However, the problem is that the pdf has to be inserted into the export of the expenses as pdf somehow. This is where it gets tricky with the pdfs. I guess maybe we could somehow just insert the pdf plainly after the page which is describing the expense...

@Kagemaru Kagemaru force-pushed the master branch 4 times, most recently from ef26473 to 89a062c Compare November 18, 2025 23:06
@anna-dev anna-dev force-pushed the feature/64085-allow_other_file_types_for_expenses branch from f9a705d to 97b1db1 Compare December 8, 2025 11:00
@anna-dev anna-dev self-assigned this Dec 9, 2025
@anna-dev anna-dev added enhancement ruby Pull requests that update ruby code labels Dec 9, 2025
@anna-dev anna-dev marked this pull request as ready for review December 9, 2025 07:38
@anna-dev anna-dev force-pushed the feature/64085-allow_other_file_types_for_expenses branch from cc406b3 to e37c378 Compare December 9, 2025 08:06
@anna-dev anna-dev force-pushed the feature/64085-allow_other_file_types_for_expenses branch from e37c378 to 34b27d0 Compare December 10, 2025 12:23
@anna-dev anna-dev requested a review from Kagemaru December 10, 2025 12:24
@Kagemaru Kagemaru merged commit 43fac0b into master Dec 18, 2025
3 checks passed
@Kagemaru Kagemaru deleted the feature/64085-allow_other_file_types_for_expenses branch December 18, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ruby Pull requests that update ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants