/odoo-daily-pos-order-report

Odoo daily order report generator with Nodejs (useful for humans)

Primary LanguageCSS

Odoo daily POS report generator ✍

Well i have a very special clients... but here a tool for get reports from sales.

image

Features 👓

  • One click report generator 🔮
  • Filter by date (default set the current date) 📆
  • Clean print 🖨

Development 🧰

Install all dependencies

$ yarn install

ENV file

The env file contains a series of variables that modify the behavior of the api.

⚠️ You need to set up the AUTHORIZATION_KEY env var, this var is a simple "token" for allowing requests to the API.

How to set Token

For development

$ yarn dev

Build

For created a production version

$ yarn build

Run Production

Remember set the AUTHORIZATION_KEY How to set Token

$ yarn start

How to set token

  1. Go to .env and generate a random key and set this to AUTHORIZATION_KEY
  2. Go to http://localhost:5000/report
  3. In the browser open the developer console and go to application -> Local Storage and create a key token and set as value the AUTHORIZATION_KEY

Docker 🐳

Development

$ docker-compose -f docker-compose.dev.yml up --build

Production

$ docker-compose up -d

Web APP 💻

http://localhost:5000/report

Query string

Filters

between

For example for check createdAt from 2020-09-01 to 2020-09-30.

api/visits?createdAt=between:2020-09-01,2020-09-30

Like

For using like operator you can pass search query string var with where for indicate columns.

api/visits?search=some&where=reasonVisit

This search for some in reasonVisit column.

Limit and offset

You can use limit and offset for pagination.

api/visits?limit=10&page=2

This example returns the records between 11 to 20

Order

Use - sign for descending while + for ascending, by default if sign is not presented it will automatically set to + sign (ex: sort=-created_at or sort=+created_at). Value can be separated by a comma if multiple sort condition is needed (ex: sort=id,name).

api/visits?sort=-created_at

More information: https://github.com/perbert27/sequelize-querystring-converter