FAQ Custom reporting script EN
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...")
The standard reporting in Dolibarr did not suit my needs so I created a custom one using a bash script.
- !/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.