Commit Graph

138 Commits

Author SHA1 Message Date
8a1f653127 Merge pull request #146 into master
fd23a93 container: src: lib_edit: add 'subscript' to case (Aaron Fiore)
2024-09-24 18:30:35 -07:00
5acbbfb799 container: src: lib_hledger: remove hledger version test
No longer needed because 1.40 is the minimum version provided by the
current build (courtesty of repo 'Dockerfiles/remote/hledger-suite').
2024-09-24 18:12:47 -07:00
da8488ebb0 container: src: lib_hledger: fork hledger-web, log print
Gives more convenient shell control for end-user.
2024-09-24 18:06:04 -07:00
8a8395e844 container: src: lib_hledger: pass hledger-{ui,web} args
These are currently within the subscript but should be a part of the
baseline command.
2024-09-24 18:06:04 -07:00
fd23a93b0b container: src: lib_edit: add 'subscript' to case
'shell' is the equivalent of 'subscript' (but 'subscript' was missing).
2024-09-24 00:31:01 -07:00
ea392ec360 container: remove ledger in place of hledger
As said before; `lib_ledger` was meant to be a general abstraction to
any underlying CLI ledger.

But, between C++ `ledger` and Ledger Hardware Wallet, this abstraction
has become too confusing and counterproductive.

Since `hledger` will be the underlying implementation for the forseeable
future, all doubt should now be removed.
2024-09-23 18:09:40 -07:00
1101fc81b4 container: rename lib_ledger to lib_hledger
As said before; `lib_ledger` was meant to be a general abstraction to
any underlying CLI ledger.

But, between C++ `ledger` and Ledger Hardware Wallet, this abstraction
has become too confusing and counterproductive.

Since `hledger` will be the underlying implementation for the forseeable
future, all doubt should now be removed.
2024-09-23 18:09:33 -07:00
52270ba0b3 container: rename $global_conf_shell -> $global_conf_subscript
Provides clarity, avoids confusion.
2024-09-23 17:31:11 -07:00
51bf587ceb client/container: rename 'subprofile' script to 'subscript'
- Provides clarity, avoids confusion (subprofile.bash -> subscript.bash)

- Changes filename in superscript source
  * End-user must update with client command `edit type=superscript`

- Changes filename in flow subprofile's docker-finance.d
  * Pre-existing subprofiles must manually rename their subscript file
2024-09-23 17:31:11 -07:00
0b2c76a813 container: finance: add dependency checks for modules
Since modules are included upon build type, if a build doesn't support
a feature then that feature's dependencies will not be available.

This commit will give notice of those missing dependencies.
2024-09-17 20:06:34 -07:00
7c46719ab1 container: finance: lib_fetch: fix Tor plugin (proxychains) check
This ensures that curl will only be executed if the Tor plugin
(proxychains) argument is enabled.
2024-09-16 21:10:49 -07:00
a16922f87a container: hledger-flow: add Vultr support
This addition is treading a fine line between finance and other
accounting, as Vultr cloud service is related to DevOps and is also not
a financial entity. However, financial information is provided; so this
addition is useful.

With this commit, a precedent is set for other cloud services to be
added to the repository (services that provide CSV financial accounting
data) and I believe that they could (should) be added as needed.

NOTE: there are several upstream CSV issues:

  - Only expenses are given
    * Transfers must be added manually (manual import or custom rules)

  - Sales tax is not included
    * Sales tax expenses must be added manually
2024-09-11 21:25:51 -07:00
afa2e368f1 container: finance: completion: add hledger commands 2024-09-11 21:17:58 -07:00
c65c31659c hledger-flow: electrum: fix calculating 'No Data'
If electrum-provided prices aren't available, 'No Data' will be given.
Attempts to calculate this string will result in 0.00 for fiat values.

Do not attempt to calculate this string. Instead, leave the column empty
(for bitcoin.tax calculations).
2024-09-09 20:20:53 -07:00
cff19f87d9 container: fetch: run linter 2024-09-07 18:59:04 -07:00
91bfc21f62 hledger-flow: algorand: add to Governance Rewards 2024-09-06 17:46:41 -07:00
520be13464 container: finance: lib_plugins: allow path depth
- Allows plugins to function within subdirectories
- Removes redundant arg checking
2024-09-04 18:16:08 -07:00
3be93d8e97 container: plugins: finance: timew_to_timeclock: print all tags 2024-08-29 16:45:09 -07:00
7f413d5351 hledger-flow: capital-one: bank: fix direction 2024-08-28 23:11:29 -07:00
29d2921dd8 container: lib_fetch: fix price parsing
- Fix check if price API is not set
- Fix check for invalid asset sequence
- Improve log messages
2024-08-21 20:21:28 -07:00
181ca4433f hledger-flow: capital-one: bank: add interest income 2024-08-19 16:12:13 -07:00
a0c257d3b0 container: plugins: implement 'timew_to_timeclock' plugin
- Converts exported `times` into hledger timeclock format
  * Exported format is underlying `timew` JSON schema
2024-08-19 15:43:10 -07:00
6aadc6f769 container: plugins: refactor example plugin
- Refactor instance
- Refactor main()
2024-08-17 23:25:50 -07:00
29cc6f615e container: fetch: price: refactor empty key type
Needed for bash lib_fetch's use of `yq`.
2024-08-17 23:19:57 -07:00
a3b889052b container: lib_fetch: refactor to use yq
Replaces `shyaml` dependency with `yq`.
2024-08-17 23:19:57 -07:00
77a8b21893 container: lib_fetch: implement Tor support
- Adds 'tor' option
- Uses `proxychains-ng`
- Expects docker-finance's Tor plugin
2024-08-15 21:31:54 -07:00
d7caec13e4 client/container: disable shellcheck warning for DOCKER_FINANCE_DEBUG
If it's not set or set to false, then it's expected to be not true.
2024-08-14 20:03:03 -07:00
563ca66d2d container: finance.bash: fix typo for ledger-ui 2024-08-14 19:53:31 -07:00
744181776f container: completion.bash: set xtrace if debug enabled 2024-08-14 19:40:55 -07:00
e9e2ed6d88 container: finance.bash: set xtrace if debug enabled 2024-08-14 19:40:55 -07:00
bf1d9dd212 container: completion: add hledger-vui
The custom visidata UI (not `hledger-ui`).
2024-08-14 19:36:53 -07:00
550110ffd1 container: finance.bash: add hledger-vui to usage help
The custom visidata UI (not `hledger-ui`).
2024-08-14 19:36:53 -07:00
7e75bb542b container: completion: add hledger family
Since inception, the intent was to abstract the "interface" to allow for
a general-purpose CLI accounting ledger. However, there appears to be
confusion about whether the underlying implementation is `ledger`
accounting software or `hledger` accounting software.

So, making it clearer that it's `hledger` accounting software (although,
will continue to keep the `ledger` command for backwards-compatibility).
2024-08-14 19:36:53 -07:00
d06c894acb container: finance.bash: clarify hledger (not ledger)
Since inception, the intent was to abstract the "interface" to allow for
a general-purpose CLI accounting ledger. However, there appears to be
confusion about whether the underlying implementation is `ledger`
accounting software or `hledger` accounting software.

So, making it clearer that it's `hledger` accounting software (although,
will continue to keep the `ledger` command for backwards-compatibility).
2024-08-14 19:36:52 -07:00
f14adfea35 container: root: move clang-format to container base path
File needs to be in parent directory of all C++ source files.
2024-08-12 18:59:51 -07:00
6e250c7282 container: root: add plugins support
- Implements support for docker-finance C++ plugins
- Adds shell command execution wrapper
- Refactors previous loader path
  * A './' path is unnecessary and will break calls to '/' path
2024-08-12 18:59:51 -07:00
f967faeb8a container: plugins: root: add examples 2024-08-12 18:59:51 -07:00
59272e8df7 container: completion: add plugins arg type support 2024-08-12 18:36:26 -07:00
a1d02016f3 container: lib_plugins: add plugins type support
- Adds plugin type support
  * Adds pseudo-paths to help usage
  * Adds arg parsing of given plugin name
    - Prepended pseudo-paths will use repo or custom plugin
2024-08-12 18:36:26 -07:00
01737d37bf client: lib_gen: new custom plugin layout, update example plugin
- Generates new custom plugin directory layout upon `gen`
  * Allows for drop-in client-side/container-side custom plugins

- Moved container plugin example into container's plugins
  * Plugin is no longer generated upon `gen` (it's available in-repo)

- Updates plugin example
    - Provides requisite lib_finance initialization
    - Refactored, added more checks
    - Expand example case
    - Linter fixes
2024-08-12 18:30:45 -07:00
5ef5d24f3b container: bash: completion: add times 2024-08-09 18:03:31 -07:00
5eac855acf container: bash: add times / lib_times 2024-08-09 18:03:31 -07:00
bbf96b0cc2 container: bash: completion: add plugins support 2024-08-08 16:08:54 -07:00
a4f9b401d3 container: bash: add plugins support / lib_plugins
- Executes plugins within profile/subprofile context
  * Hooks into the container's global environment
2024-08-08 16:08:49 -07:00
a81790108b container: add dfi alias
- `dfi` is now primary unified command (saves fingers)
  * `docker-finance` is still available, as this is only an addition
2024-08-06 02:15:38 -07:00
46112a9d43 container: add preliminary bash autocompletion 2024-08-05 16:22:19 -07:00
d7b25e0dae php: fetch: prices: base: catch unrecoverable CoinGecko error
Thrown when 'all' years are requested without paid-plan API key.
2024-07-30 22:54:04 -07:00
f222a5e654 php: fetch: prices: crypto: throw errors with nested status 2024-07-30 22:47:57 -07:00
5609704b25 bash: lib_fetch: create prices dir if nonexistent 2024-07-30 19:02:26 -07:00
731a8c9563 hledger-flow: changelly: cost-basis comments for bitcoin.tax
Issue #51 describes at least a few undocumented bitcoin.tax issues:

  - Bicoin.tax gives unexpected cost-basis results when `Fee` is given
    with `Total` (when `Total` is given in place of `Price`). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on `Total` when `Fee` is also given.

    However, bitcoin.tax *will* give expected cost-basis results if
    `Price` is given in place of `Total` (with `Fee` also given) *or* if
    `Total` is given *after* local cost-basis adjustments are made (but
    *without* `Fee` given).

    The rationale for why docker-finance doesn't use `Price`:

      * docker-finance has all of the `Total`s; so `Price` isn't
        necessary.

      * Local price information isn't available for most trades (and
        shouldn't be necessary since all `Total`s are available).

  - Additionally, when `Fee` is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  - Finally, if `FeeCurrency` *does* not match either `Symbol` or
    `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if `Total` is given). Local
    calculations cannot be done because `Fee` price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the `Fee` will subsequently
adjust the cost-basis of `Total` *and* dispose of the `Fee` in the
process (while also allowing `Total` to be used in place of `Price`),
the `Fee` (and `FeeCurrency`) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat `Fee` and/or a
`Fee`/`FeeCurrency` that matches one side of the trading pair.
2024-07-29 16:15:50 -07:00