Merge pull request #226 into master
e3f50ddb container: hledger-flow: vultr: add credits support (Aaron Fiore)
This commit was merged in pull request #226.
This commit is contained in:
@@ -53,6 +53,12 @@ function parse()
|
||||
-v global_subaccount="$global_subaccount" \
|
||||
-v invoice="$_invoice" \
|
||||
'{
|
||||
# WARNING:
|
||||
#
|
||||
# Because upstream INVOICE DATE will be at beginning of the month,
|
||||
# any January invoices *MUST* also go into the previous year December,
|
||||
# in order to catch Sales Tax issued on the 1st for the previous month.
|
||||
|
||||
if ($2 !~ global_year)
|
||||
next
|
||||
|
||||
@@ -66,14 +72,14 @@ function parse()
|
||||
# Skip $4
|
||||
|
||||
printf $5 OFS # quantity
|
||||
|
||||
direction = ($6 ~ /^"-/ ? "IN" : "OUT")
|
||||
sub(/^"-/, "\"", $6)
|
||||
printf $6 OFS # amount
|
||||
|
||||
printf invoice OFS # invoice number
|
||||
|
||||
# NOTE: Vultr currently only provides expenses w/out sales tax
|
||||
direction="OUT"
|
||||
printf direction OFS
|
||||
|
||||
printf global_subaccount
|
||||
|
||||
printf "\n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
# Copyright (C) 2024-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -20,11 +20,16 @@ fields date,description,quantity,amount_,invoice,direction,subaccount
|
||||
date-format %Y-%m-%d %H:%M
|
||||
|
||||
account1 assets:vultr:%subaccount:USD
|
||||
amount -%amount_ USD
|
||||
amount %amount_ USD
|
||||
|
||||
comment invoice:%invoice, quantity:%quantity, direction:%direction
|
||||
|
||||
account2 expenses:vultr:%subaccount:USD
|
||||
if %direction ^IN$
|
||||
account2 income:vultr:%subaccount:credits:USD
|
||||
|
||||
if %direction ^OUT$
|
||||
amount -%amount_ USD
|
||||
account2 expenses:vultr:%subaccount:USD
|
||||
|
||||
if %description ^Sales Tax$
|
||||
account2 expenses:vultr:%subaccount:sales_tax:USD
|
||||
|
||||
Reference in New Issue
Block a user