boring-admin/README.md

64 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2023-02-17 01:20:04 +02:00
# bank2invoice
2023-02-16 16:05:04 +02:00
created by and for TAMI admins,
to automate boring accounting chores.
2023-02-17 01:20:04 +02:00
### Purpose
---
2023-02-16 16:05:04 +02:00
for each payment in bank report,
creates a DONATION RECEIPT (type #405) entity in our account at "Heshbonit Yeruka" (AKA "morning")
2023-02-17 01:20:04 +02:00
### TODO
---
2023-02-17 08:33:48 +02:00
1. read directly the bank's report. currently the code is reading a Tab-Separated Value (tsv) which is downloaded from google, which is probably uploaded from the bank's excel, which is downloaded from the bank, had-gadya, had-gadya. Make the loop 1 step --- what's the first link we can attach to?
2023-02-16 16:05:04 +02:00
2023-02-17 08:33:48 +02:00
All other todo items are resolved yesterday 2023-02-16
2023-02-17 01:20:04 +02:00
### Install
---
2023-02-16 16:05:04 +02:00
2023-02-17 01:20:04 +02:00
adjust authentication and other params `bank2invoice.ini`
2023-02-16 16:05:04 +02:00
2023-02-17 01:20:04 +02:00
the project uses the [greeninvoice API](https://www.greeninvoice.co.il/api-docs), packed to a [pip](https://github.com/yanivps/green-invoice) by by yaniv (hi!),
think of him when you
2023-02-16 16:05:04 +02:00
2023-02-17 01:20:04 +02:00
`pip install green-invoice`
2023-02-16 16:05:04 +02:00
2023-02-17 01:20:04 +02:00
srsly now, tami automation team suggest to setup using python3.8[1]
```bash
git clone git@github.com:telavivmakers/boring-admin.git
cd boring-admin
python -m venv .venv
2023-02-17 01:23:11 +02:00
source ./.venv/scripts/activate #omit the source command on windows
2023-02-17 01:20:04 +02:00
./venv/scripts/pip install pip --update
pip install green_invoice requests
```
#### Windows Note:
The green_invoice module requires lxml v4.6.3, which is pain in the everything to install on Windows.
So I downloaded the `green_invoice-1.2.1-py3-none-any.whl` package, and changed the requiremnts from `==4.6.3` to by `>= 4.6.3`, hence my hacked `green_invoice.whl` is added to the repo. and the latest binary lxml for my Windows x python version.
## OpSec
---
working Api Tokens in `.ini` need to be provided
you should derive your own `.ini`, or get it from me, or from yair.
ini file must be at your home dir (details inside the code)
2023-02-16 16:05:04 +02:00
tested on current bank report in google sheets (private link)
2023-02-17 01:20:04 +02:00
---
[notes]
2023-02-17 08:33:48 +02:00
[1] when did python 3.x versions became as fickel as an osx architecture change?! - It's ok. Only the AttrDict might be tricky. And f'formatted{string}' was introduced only in 3.6. So we're safe with 3.8
[2] [shahar]( shaharr.info) rocks the night sky! kicked working code, out the door, before your very eyes