FAQ Custom reporting script EN

From Dolibarr ERP CRM Wiki
Revision as of 17:04, 20 March 2020 by Egils (talk | contribs) (Created page with "{{TemplateDocUser}} Category:FAQ EN The standard reporting in Dolibarr did not suit my needs so I created a custom one using a bash script. <code> #!/bin/bash...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The standard reporting in Dolibarr did not suit my needs so I created a custom one using a bash script.

  1. !/bin/bash

DATE="2019" DAT="19" PSQL="psql -d dolibarr -U dolibarr -t -c" c3000="select sum(credit) from llx_accounting_bookkeeping where code_journal = \ 'short_code_for_sell_journal' and numero_compte = '3000' and doc_date <= '12/31/$DAT' and doc_date >= '\ 01/01/$DAT'" echo Report for year $AAR echo echo -n "Total sales before taxes:" $PSQL "$c3000"

This outputs the total sale of year 2019 before taxes.

Adjust short_code_for_sell_journal (defaults to VT) and the DATE/DAT to the year you want.

This can be expanded very easily to output very long and detailed reports.