From 8d70db6127296a3228ee5a30bdfe77d01e63861f 2013-04-29 20:20:05 From: Bradley M. Kuhn Date: 2013-04-29 20:20:05 Subject: [PATCH] Split out config-npo.ledger into four different files. I realized that it makes more sense, even if it does create extra files, for the accounts, commodities and tags declarations of the project to be carefully split into different files. It's definitely more didactic to have separate files for these declarations, to note that they are, in fact, separable. More to that point, users who cut-and-paste from this project into their own setup will likely be least interested in the chart of accounts, which is likely to be the longest file by far. The tags will probably be the most interesting, so it's important they are in a stand-alone file that can be easily found. --- diff --git a/accounts/config/config-accounts.ledger b/accounts/config/config-accounts.ledger new file mode 100644 index 0000000000000000000000000000000000000000..db3197d2e8cdabdd9c238db8a0e0455f2b59a501 --- /dev/null +++ b/accounts/config/config-accounts.ledger @@ -0,0 +1,66 @@ +; -*- ledger -*- +; -*- coding: utf-8 -*- +; +; config-accounts.ledger: The Ledger CLI accounts declarations for NPO use-case. +; +; Copyright © 2013, Bradley M. Kuhn. +; +; The copyright holders wish that this document could be placed into the +; public domain. However, should such a public domain dedication not be +; possible, the copyright holders grant a waiver and/or license under the +; terms of CC0-1.0, as published by Creative Commons, Inc. A copy of CC0-1.0 +; can be found in the same repository as this README.md file under the +; filename CC0-1.0.txt. If this document has been separated from the +; repository, a [copy of CC0-1.0 can be found on Creative Commons' website at +; http://creativecommons.org/publicdomain/zero/1.0/legalcode + +; ############################## GENERAL/SHARED ACCOUNTS ####################### + +; Shared Asset Accounts + +account Asset:Checking + note Checking account for entire organization + assert commodity == "$" + +; Shared Liabilities Accounts + +account Liabilities:Credit Card:Visa + note Visa Credit Card account for entire organization + assert commodity == "$" + + +; Organizational accrual accounts + + +; Organization Expense Accounts + +; NOTE: the payee =~ test is *not* included herein and must be cut-and-pasted +; to the assert in ever Expense account because of the following bug: +; http://bugs.ledger-cli.org/show_bug.cgi?id=953 + +define expenseChecker() = (tag("Receipt") !~ /^\s*$/ or tag("Invoice") !~ /^\s*$/ or tag("Statement") !~ /^\s*$/) +; or payee =~ /NEVER CHARGED/ + +account Expense:Main Org:Office Supplies + assert expenseChecker() or payee =~ /NEVER CHARGED/ + note Main Organization's Office Supplies and Sundries + +account Expense:Main Org:Payroll:Salary + assert expenseChecker() or payee =~ /NEVER CHARGED/ + note Main Organization's Staff Salaries + +account Expense:Main Org:Payroll:Benefits + assert expenseChecker() or payee =~ /NEVER CHARGED/ + note Main Organization's Staff Benefits + +account Expense:Main Org:Phones + assert expenseChecker() or payee =~ /NEVER CHARGED/ + note Main Organization's Phone Expenses + +account Expense:Main Org:Hosting + assert expenseChecker() or payee =~ /NEVER CHARGED/ + note Main Organization's Network Hosting Provider services + +account Expense:Main Org:Occupancy + assert expenseChecker() or payee =~ /NEVER CHARGED/ + note Main Organization's Occupancy for Office Space and the like diff --git a/accounts/config/config-commodities.ledger b/accounts/config/config-commodities.ledger new file mode 100644 index 0000000000000000000000000000000000000000..d89d085711175ee0f7872778b8de6bf06fdfacaa --- /dev/null +++ b/accounts/config/config-commodities.ledger @@ -0,0 +1,23 @@ +; -*- ledger -*- +; -*- coding: utf-8 -*- +; +; config-commodities.ledger: The Ledger CLI commodities declarations for NPO use-case. +; +; Copyright © 2013, Bradley M. Kuhn. +; +; The copyright holders wish that this document could be placed into the +; public domain. However, should such a public domain dedication not be +; possible, the copyright holders grant a waiver and/or license under the +; terms of CC0-1.0, as published by Creative Commons, Inc. A copy of CC0-1.0 +; can be found in the same repository as this README.md file under the +; filename CC0-1.0.txt. If this document has been separated from the +; repository, a [copy of CC0-1.0 can be found on Creative Commons' website at +; http://creativecommons.org/publicdomain/zero/1.0/legalcode + +; ############################## COMMODITIES ############################# + +commodity $ + note USD + format $1,000.00 + nomarket + diff --git a/accounts/config/config-npo.ledger b/accounts/config/config-npo.ledger index ff764e27ac4d76d693a3d03346f898218f599fbc..b3794864cfdc894877a2e98dbba23367d15bb8a9 100644 --- a/accounts/config/config-npo.ledger +++ b/accounts/config/config-npo.ledger @@ -12,79 +12,6 @@ ; repository, a [copy of CC0-1.0 can be found on Creative Commons' website at ; http://creativecommons.org/publicdomain/zero/1.0/legalcode -; ############################## COMMODITIES ############################# - -commodity $ - note USD - format $1,000.00 - nomarket - -; ################################# TAGS ################################ - -; The Statement, Receipt, and Invoice tags' values should always a be a -; relative path names. Note that we "check", but do not "assert" that the -; file name match a standard Unix-like path syntax, without spaces in the -; file name. - -tag Statement - assert value =~ /[^\/].+/ - check value =~ /[^\/][^ ]+(\/[^ ])+/ - -tag Receipt - assert value =~ /[^\/].+/ - check value =~ /[^\/][^ ]+(\/[^ ])+/ - -tag Invoice - assert value =~ /[^\/].+/ - check value =~ /[^\/][^ ]+(\/[^ ])+/ - -; ############################## GENERAL/SHARED ACCOUNTS ####################### - -; Shared Asset Accounts - -account Asset:Checking - note Checking account for entire organization - assert commodity == "$" - -; Shared Liabilities Accounts - -account Liabilities:Credit Card:Visa - note Visa Credit Card account for entire organization - assert commodity == "$" - - -; Organizational accrual accounts - - -; Organization Expense Accounts - -; NOTE: the payee =~ test is *not* included herein and must be cut-and-pasted -; to the assert in ever Expense account because of the following bug: -; http://bugs.ledger-cli.org/show_bug.cgi?id=953 - -define expenseChecker() = (tag("Receipt") !~ /^\s*$/ or tag("Invoice") !~ /^\s*$/ or tag("Statement") !~ /^\s*$/) -; or payee =~ /NEVER CHARGED/ - -account Expense:Main Org:Office Supplies - assert expenseChecker() or payee =~ /NEVER CHARGED/ - note Main Organization's Office Supplies and Sundries - -account Expense:Main Org:Payroll:Salary - assert expenseChecker() or payee =~ /NEVER CHARGED/ - note Main Organization's Staff Salaries - -account Expense:Main Org:Payroll:Benefits - assert expenseChecker() or payee =~ /NEVER CHARGED/ - note Main Organization's Staff Benefits - -account Expense:Main Org:Phones - assert expenseChecker() or payee =~ /NEVER CHARGED/ - note Main Organization's Phone Expenses - -account Expense:Main Org:Hosting - assert expenseChecker() or payee =~ /NEVER CHARGED/ - note Main Organization's Network Hosting Provider services - -account Expense:Main Org:Occupancy - assert expenseChecker() or payee =~ /NEVER CHARGED/ - note Main Organization's Occupancy for Office Space and the like +!include config-commodities.ledger +!include config-tags.ledger +!include config-accounts.ledger diff --git a/accounts/config/config-tags.ledger b/accounts/config/config-tags.ledger new file mode 100644 index 0000000000000000000000000000000000000000..e7ad1b82334ed943c6673a1bf3b434d7d037b746 --- /dev/null +++ b/accounts/config/config-tags.ledger @@ -0,0 +1,35 @@ +; -*- ledger -*- +; -*- coding: utf-8 -*- +; +; config-tags.ledger: The Ledger CLI tag declarations for NPO use-case. + +; Copyright © 2013, Bradley M. Kuhn. +; +; The copyright holders wish that this document could be placed into the +; public domain. However, should such a public domain dedication not be +; possible, the copyright holders grant a waiver and/or license under the +; terms of CC0-1.0, as published by Creative Commons, Inc. A copy of CC0-1.0 +; can be found in the same repository as this README.md file under the +; filename CC0-1.0.txt. If this document has been separated from the +; repository, a [copy of CC0-1.0 can be found on Creative Commons' website at +; http://creativecommons.org/publicdomain/zero/1.0/legalcode + +; ################################# TAGS ################################ + +; The Statement, Receipt, and Invoice tags' values should always a be a +; relative path names. Note that we "check", but do not "assert" that the +; file name match a standard Unix-like path syntax, without spaces in the +; file name. + +tag Statement + assert value =~ /[^\/].+/ + check value =~ /[^\/][^ ]+(\/[^ ])+/ + +tag Receipt + assert value =~ /[^\/].+/ + check value =~ /[^\/][^ ]+(\/[^ ])+/ + +tag Invoice + assert value =~ /[^\/].+/ + check value =~ /[^\/][^ ]+(\/[^ ])+/ +