Jump to content

upload invoice


dianamosilva

Recommended Posts

Hello everyone!

 

I have disabled prestashop invoices (1.6) because here in Portugal invoices have to be generated from a certified software who has a lot of rules.

I have that software installed on my computer and I want to manually generate each invoice, and than upload to the corresponding order. How can I do that?  :huh2:

 

Thank you!

Link to comment
Share on other sites

This question was already answered here: https://www.prestashop.com/forums/topic/575487-pdf-upload-to-user-profile/

 

Not possible to upload invoices and link them to a specific order. This needs a paid adaptation of the software.

 

For to create invoices, you have at least to use another service outside, like a stock management software with integrated accounting.

Link to comment
Share on other sites

  • 11 months later...
  • 2 years later...
9 minutes ago, Guest said:

I'm testing my new module.
I am adding the option to select the status of the order, when the own PDF invoice will be sent by email to the customer as an attachment.
The PDF invoice will also be visible in the customer's detail.

obrazek.thumb.png.8c4223c1bdba181d906c5e7aab787869.png

Hello  Tengler,

in fact what I would need is to upload the invoice via the webservice and not using the Dashboard.

We've an external tool that creates the invoice and we need to upload this invoice and link it to the order.

Thank you.

 

Regards,

Pasquale

Link to comment
Share on other sites

Hello,

our external software (has nothing to do with prestashop, but communicating with it via ps webservice) will generate a pdf invoice.

This software knows the order_id on prestashop and need to upload the previously generated pdf invoice to the prestashop.

The upload should be done without open any browser, our external software will make an HTTP POST (multipart/form-data) with the generated pdf. 

Edited by pakit10 (see edit history)
Link to comment
Share on other sites

Hello Tengler,

first of all thank you for your time.

Yes I understand that in order to develop something you need the exact interface our software is suppose to call to upload the pdf, but here I am more looking to understand the feasibility of doing that than asking you to develop something.  I would like to do it to acquire competence on prestashop.

So I will try to be more clear hoping you could help me.

Scenario:

  • I have the prestashop order_id 
  • I have on my pc a pdf document already generated (no matter how) and I want to upload it to prestashop and link it to the order with the giver order_id.

Do you think that is possible to extend the prestashop webservice in order to add an endpoint like :

(POST) /orders/{id}/invoices accepting a form data for instance?

More or less like is done to add an image to a product: https://devdocs.prestashop.com/1.7/webservice/tutorials/advanced-use/image-management/ ?
Basically I need to do what this module does https://prestamonster.com/en/demo?id=7, but via the webservice and not via the backoffice. This module does it only through the BackOffice.

I don't know how to add a new endpoint to the prestashop webservice that does so and I did not find any documentation. I only saw that you can create a new entity , register the hook 'addWebserviceResources' and then you have the CRUD for your entity, but here I am not looking at all to add a CRUD but just an endpoint that read a file in input , store it somewhere and link it to the order.

Thank you.

 

Regards

 

Link to comment
Share on other sites

Hello Tengler,

 

actually we bought a module that does so , but only via the BackOffice. When I access to the BackOffice order page I can upload a pdf that is automatically linked to the order and customer can download it without problems.

When from the dasboard I upload the file I see the following request is done: 

https://myurl/admin-dev/index.php?controller=AdminHsCustomInvoice&token=07059546d79997cfxxxxxxxxxxxxx&action=uploadInvoice&ajax=1&id_order=30&qqfile=LI000002.pdf

I tried to make a test with Postman calling the same url but , as expected, it did not work. So I was wondering if there is a way to create a custom endpoint accepting a form data from where I can then call th eAdminHsCustomInvoice controller.

Do yo think would it be possible?

Unfortunately I do not find doc on how to create custom endpoints.

Thank you

 

Edited by pakit10 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...