Quick upload from Dashboard Module

As I’ve sent my product to the customer I upload a picture from the package itself wich customers really appreciate. It also allows them to check the condition of the package itself in origin.

At the moment to do so I need to go to IP > Access > Click Receipt Number > Scroll down to uploads > Attach file > Send Message to Customer.

I’d like to enable a simple icon beside the receipts to upload from Dashboard, and once the file it’s upload automatically notify the customer.

What would be best way to achieve that with the “dropzone” function used on IP?
I’m after something simple…

<td>
                                   <a href="<?php echo site_url('upload/upload_file/' . $invoice->client_id . '/' . $invoice->invoice_url_key) ?>"><i class="fa fa-camera"></i></a>
                                 </td>
1 Like

I think you customized something there, but ok…

Go to the invoice, the location where the images get uploaded.
In the source, of course.
You probably need to copy all of that Javascript to your new location where you want that upload

You at least want the dropzone part.
And since you want something simple, do you want to show that image that you uploaded?
And maybe delete it again?

After you’re done with the frontend you need to deal with the backend.
To which endpoint are you uploading?
Does the Upload class know this endpoint?

Keep looking at Invoices and Quotes how the uploads work there.

Same goes for storing the file that got uploaded.
Same goes for showing the stored file

This pull-request was needed very recently, sk then you can see how it works with moving the uploaded file.

Thanks @UnderDog what could I do without that.

Maybe “just” the dropzone script, but you still need something in Upload to deal with the uploaded file.

And since you’re emailing the photo to your customer… how does InvoicePlane know that the file you just uploaded belongs to that receipt?

  • I’m uploading 1 single file to a receipt
  • I’m storing that file somewhere on the server
  • Now i’m emailing that receipt and i want to email that stored file as attachment

I left 2 places for you to think about what you want to do.
Keep looking at how quotes and invoices did it.

Hope that “just” the dropzone script “just works”. And then?