Skip to content

allow to submit expense receipt as a pdf (64085) #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants