-
Notifications
You must be signed in to change notification settings - Fork 20
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
allow to submit expense receipt as a pdf (64085) #255
Conversation
Kagemaru
left a comment
There was a problem hiding this 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' |
There was a problem hiding this comment.
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
endThere was a problem hiding this comment.
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...
ef26473 to
89a062c
Compare
f9a705d to
97b1db1
Compare
cc406b3 to
e37c378
Compare
e37c378 to
34b27d0
Compare
No description provided.