From 13eb502c7628e5854e8e8a1f1baafd67fc8b4756 Mon Sep 17 00:00:00 2001 From: Enrique Barcelli Date: Thu, 29 Jun 2023 17:24:05 +0800 Subject: [PATCH] Improve README --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 17a813a..ff344f9 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,22 @@ This project attempts to extract data from Openbravo to generate a JSON to submi to the Banqup API of Unifiedpost. **Requirements** -* Python installed on the machine running this application -* Credentials for accessing an Openbravo 3+ instance running with the REST API enabled +* Python installed on the machine running this application. +* Credentials for accessing an Openbravo 3+ instance running with the REST API enabled. * The role in Openbravo used for the extraction/integration must have read access to 'Sales Invoices' and 'Product' via web services. * Credentials for accessing the Banqup API by Unifiedpost -* Add the businessPartner id to the 'Customer code' of the customer on the 'Customers & Suppliers' section of the Banqup portal - This is critical, this programs requires this field to extract some parameters that only exist in the Banqup platform +* Add the businessPartner id to the 'Customer code' of the customer on the 'Customers & Suppliers' section of the Banqup portal - This is critical, this programs requires this field to extract some parameters that only exist in the Banqup platform. **How to run this application** -* Copy the file `config-sample.py` to `config.py` -* Edit `config.py` with your credentials for Openbravo and Banqup -* Run `python3 extract_invoice.py ` - -Where `` is the human readable invoice number in Openbravo. +* Copy the file `config-sample.py` to `config.py`. +* Edit `config.py` with your credentials for Openbravo and Banqup. +* Run `python3 extract_invoice.py `, where `` is the human readable invoice number in Openbravo. +* The application will do the following: + * Fetch the invoice `` from Openbravo. + * Authenticate with Banqup using OAuth2, for which it will launch a webbrowser to complete the authentication. The browser will receive the response from the Banqup server including the authentication token. The user will need to 'Copy' and 'Paste' this response at the corresponding prompt in the terminal. + * Fetch the corresponding `businessPartner` from Banqup to verify its existence and correct setup. + * Build a json in compatible format with the Banqup API. + * Post the invoice to the Banqup API for the creation of the corresponding invoice in Banqup. + * Display the response from the Banqup API, confirming the success or failure of the request. + * The new invoice will be created as a 'Draft' in the Banqup portal, so that it could be further processed.