Switch bank account from First Republic to Citizens
This commit is contained in:
parent
4a45c90446
commit
39198db642
6 changed files with 17 additions and 16 deletions
|
@ -28,8 +28,7 @@ later. If you prefer, you can provide any/all of these explicitly:
|
||||||
|
|
||||||
You can test the output in Beancount by adding the following header entries to define the accounts:
|
You can test the output in Beancount by adding the following header entries to define the accounts:
|
||||||
|
|
||||||
2023-01-01 open Assets:FR:Check2721
|
2023-01-01 open Assets:Citizens:Check1273
|
||||||
2023-01-01 open Assets:FR:Check1345
|
|
||||||
2023-01-01 open Expenses:Payroll:Salary
|
2023-01-01 open Expenses:Payroll:Salary
|
||||||
2023-01-01 open Expenses:Payroll:Fees
|
2023-01-01 open Expenses:Payroll:Fees
|
||||||
2023-01-01 open Expenses:Payroll:Tax
|
2023-01-01 open Expenses:Payroll:Tax
|
||||||
|
|
1
TODO.md
1
TODO.md
|
@ -1,5 +1,6 @@
|
||||||
# To-do
|
# To-do
|
||||||
|
|
||||||
|
* Avoid hard-coding the bank account
|
||||||
* Add validation/error handling of required CLI arguments such as csv, date and period
|
* Add validation/error handling of required CLI arguments such as csv, date and period
|
||||||
* Potentially move employee-name->entity-tag into config
|
* Potentially move employee-name->entity-tag into config
|
||||||
* Potentially move cat->payroll-type into config
|
* Potentially move cat->payroll-type into config
|
||||||
|
|
|
@ -8,5 +8,6 @@
|
||||||
"openjdk@21"
|
"openjdk@21"
|
||||||
;; Works fine with clojure-tools from Guix.
|
;; Works fine with clojure-tools from Guix.
|
||||||
"clojure-tools"
|
"clojure-tools"
|
||||||
|
"clj-kondo"
|
||||||
"beancount"
|
"beancount"
|
||||||
))
|
))
|
||||||
|
|
|
@ -278,7 +278,7 @@
|
||||||
{:account "Expenses:Payroll:Fees"
|
{:account "Expenses:Payroll:Fees"
|
||||||
:amount fee :currency "USD"
|
:amount fee :currency "USD"
|
||||||
:meta (assoc-project projects name {:entity name})})
|
:meta (assoc-project projects name {:entity name})})
|
||||||
asset-postings [{:account "Assets:FR:Check2721"
|
asset-postings [{:account "Assets:Citizens:Check1273"
|
||||||
:amount (- total-fees) :currency "USD"}]
|
:amount (- total-fees) :currency "USD"}]
|
||||||
all-postings (concat expense-postings asset-postings)]
|
all-postings (concat expense-postings asset-postings)]
|
||||||
[(assoc template :postings all-postings)]))
|
[(assoc template :postings all-postings)]))
|
||||||
|
@ -300,7 +300,7 @@
|
||||||
:amount total-retirement :currency "USD"
|
:amount total-retirement :currency "USD"
|
||||||
:meta {:entity name}}))
|
:meta {:entity name}}))
|
||||||
total-liabilities (total liability-postings)
|
total-liabilities (total liability-postings)
|
||||||
asset-postings [{:account "Assets:FR:Check1345"
|
asset-postings [{:account "Assets:Citizens:Check1273"
|
||||||
:amount (- total-liabilities) :currency "USD"}]
|
:amount (- total-liabilities) :currency "USD"}]
|
||||||
all-postings (concat liability-postings asset-postings)]
|
all-postings (concat liability-postings asset-postings)]
|
||||||
[(assoc template :postings all-postings)]))
|
[(assoc template :postings all-postings)]))
|
||||||
|
@ -329,10 +329,10 @@
|
||||||
:meta (assoc-project projects name {:entity name})}])))
|
:meta (assoc-project projects name {:entity name})}])))
|
||||||
total-net-pay (total-by-type "Net Pay" records)
|
total-net-pay (total-by-type "Net Pay" records)
|
||||||
total-reimbursements (total-by-type "Reimbursement" records)
|
total-reimbursements (total-by-type "Reimbursement" records)
|
||||||
total-net-pay-posting {:account "Assets:FR:Check2721"
|
total-net-pay-posting {:account "Assets:Citizens:Check1273"
|
||||||
:amount (- (- total-net-pay total-reimbursements)) :currency "USD"
|
:amount (- (- total-net-pay total-reimbursements)) :currency "USD"
|
||||||
:meta {:entity "Paychex" :tax-implication "W2"}}
|
:meta {:entity "Paychex" :tax-implication "W2"}}
|
||||||
total-reimbursements-posting {:account "Assets:FR:Check2721"
|
total-reimbursements-posting {:account "Assets:Citizens:Check1273"
|
||||||
:amount (- total-reimbursements) :currency "USD"
|
:amount (- total-reimbursements) :currency "USD"
|
||||||
:meta {:entity "Paychex" :tax-implication "Reimbursement"}}
|
:meta {:entity "Paychex" :tax-implication "Reimbursement"}}
|
||||||
all-postings (concat employee-postings [total-net-pay-posting total-reimbursements-posting])]
|
all-postings (concat employee-postings [total-net-pay-posting total-reimbursements-posting])]
|
||||||
|
@ -372,7 +372,7 @@
|
||||||
{:account "Liabilities:Payable:Accounts"
|
{:account "Liabilities:Payable:Accounts"
|
||||||
:amount (- (total insurance-records)) :currency "USD"
|
:amount (- (total insurance-records)) :currency "USD"
|
||||||
:meta (assoc-project projects name {:entity name})}])))
|
:meta (assoc-project projects name {:entity name})}])))
|
||||||
asset-postings [{:account "Assets:FR:Check2721"
|
asset-postings [{:account "Assets:Citizens:Check1273"
|
||||||
:amount (- (+ total-liabilities total-unemploy (total withholding-liability-postings))) :currency "USD"
|
:amount (- (+ total-liabilities total-unemploy (total withholding-liability-postings))) :currency "USD"
|
||||||
:meta {:entity "Paychex" :tax-implication "Tax-Payment"}}]
|
:meta {:entity "Paychex" :tax-implication "Tax-Payment"}}]
|
||||||
all-postings (concat withholding-liability-postings liability-postings asset-postings)]
|
all-postings (concat withholding-liability-postings liability-postings asset-postings)]
|
||||||
|
|
|
@ -246,7 +246,7 @@
|
||||||
:amount 103.25M
|
:amount 103.25M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Citizen-Jill"}}
|
:meta {:entity "Citizen-Jill"}}
|
||||||
{:account "Assets:FR:Check2721" :amount -206.51 :currency "USD"})}]]
|
{:account "Assets:Citizens:Check1273" :amount -206.51 :currency "USD"})}]]
|
||||||
(is (= actual expected))))
|
(is (= actual expected))))
|
||||||
|
|
||||||
(deftest retirement
|
(deftest retirement
|
||||||
|
@ -272,7 +272,7 @@
|
||||||
:amount 820M
|
:amount 820M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Citizen-Jill"}}
|
:meta {:entity "Citizen-Jill"}}
|
||||||
{:account "Assets:FR:Check1345" :amount -1820M :currency "USD"})}]]
|
{:account "Assets:Citizens:Check1273" :amount -1820M :currency "USD"})}]]
|
||||||
(is (= actual expected))))
|
(is (= actual expected))))
|
||||||
|
|
||||||
(deftest net-pay-ach-debit
|
(deftest net-pay-ach-debit
|
||||||
|
@ -303,11 +303,11 @@
|
||||||
:amount 50M
|
:amount 50M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Citizen-Jill"}}
|
:meta {:entity "Citizen-Jill"}}
|
||||||
{:account "Assets:FR:Check2721"
|
{:account "Assets:Citizens:Check1273"
|
||||||
:amount -8481.88M
|
:amount -8481.88M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Paychex" :tax-implication "W2"}}
|
:meta {:entity "Paychex" :tax-implication "W2"}}
|
||||||
{:account "Assets:FR:Check2721"
|
{:account "Assets:Citizens:Check1273"
|
||||||
:amount -100M
|
:amount -100M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Paychex" :tax-implication "Reimbursement"}}]}]]
|
:meta {:entity "Paychex" :tax-implication "Reimbursement"}}]}]]
|
||||||
|
@ -343,7 +343,7 @@
|
||||||
:amount 988.08M
|
:amount 988.08M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Paychex"}}
|
:meta {:entity "Paychex"}}
|
||||||
{:account "Assets:FR:Check2721"
|
{:account "Assets:Citizens:Check1273"
|
||||||
:amount -3602.31M
|
:amount -3602.31M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Paychex" :tax-implication "Tax-Payment"}}]}]]
|
:meta {:entity "Paychex" :tax-implication "Tax-Payment"}}]}]]
|
||||||
|
@ -370,7 +370,7 @@
|
||||||
:amount 103.25M
|
:amount 103.25M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Citizen-Jill"}}
|
:meta {:entity "Citizen-Jill"}}
|
||||||
{:account "Assets:FR:Check2721" :amount -206.51M :currency "USD"})}
|
{:account "Assets:Citizens:Check1273" :amount -206.51M :currency "USD"})}
|
||||||
actual (import/render-transaction transaction)
|
actual (import/render-transaction transaction)
|
||||||
expected (str/triml "
|
expected (str/triml "
|
||||||
DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
||||||
|
@ -384,7 +384,7 @@ DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
||||||
entity: \"Citizen-Jack\"
|
entity: \"Citizen-Jack\"
|
||||||
Expenses:Payroll:Fees 103.25 USD
|
Expenses:Payroll:Fees 103.25 USD
|
||||||
entity: \"Citizen-Jill\"
|
entity: \"Citizen-Jill\"
|
||||||
Assets:FR:Check2721 -206.51 USD
|
Assets:Citizens:Check1273 -206.51 USD
|
||||||
")]
|
")]
|
||||||
(is (= actual expected))))
|
(is (= actual expected))))
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
||||||
entity: \"Citizen-Jack\"
|
entity: \"Citizen-Jack\"
|
||||||
Expenses:Payroll:Fees 103.25 USD
|
Expenses:Payroll:Fees 103.25 USD
|
||||||
entity: \"Citizen-Jill\"
|
entity: \"Citizen-Jill\"
|
||||||
Assets:FR:Check2721 -206.51 USD
|
Assets:Citizens:Check1273 -206.51 USD
|
||||||
")
|
")
|
||||||
expected '[{:date "DATE"
|
expected '[{:date "DATE"
|
||||||
:payee "Paychex"
|
:payee "Paychex"
|
||||||
|
@ -38,5 +38,5 @@ DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
||||||
:amount 103.25M
|
:amount 103.25M
|
||||||
:currency "USD"
|
:currency "USD"
|
||||||
:meta {:entity "Citizen-Jill"}}
|
:meta {:entity "Citizen-Jill"}}
|
||||||
{:account "Assets:FR:Check2721" :amount -206.51M :currency "USD"})}]]
|
{:account "Assets:Citizens:Check1273" :amount -206.51M :currency "USD"})}]]
|
||||||
(is (= (parse/parse transaction) expected))))
|
(is (= (parse/parse transaction) expected))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue