diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rwxr-xr-x | contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx | 3 | ||||
-rwxr-xr-x | contrib/non-profit-audit-reports/general-ledger-report.plx | 5 | ||||
-rwxr-xr-x | contrib/non-profit-audit-reports/summary-reports.plx | 14 | ||||
-rw-r--r-- | lisp/CMakeLists.txt | 38 | ||||
-rw-r--r-- | lisp/ledger-post.el | 11 | ||||
-rw-r--r-- | lisp/ledger-reconcile.el | 9 |
7 files changed, 45 insertions, 39 deletions
@@ -106,3 +106,7 @@ contrib/non-profit-audit-reports/tests/general-ledger.txt contrib/non-profit-audit-reports/tests/MANIFEST contrib/non-profit-audit-reports/general-ledger.zip /wiki/ +doc/ledger-mode.info +doc/ledger3.info-1 +doc/ledger3.info-2 +CTestTestfile.cmake diff --git a/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx b/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx index 6234542c..937d2a45 100755 --- a/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx +++ b/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx @@ -67,8 +67,7 @@ if (@ARGV < 2) { my($beginDate, $endDate, @otherLedgerOpts) = @ARGV; -my(@chartOfAccountsOpts) = ('-V', '-F', "%150A\n", '-w', '-s', - '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg'); +my(@chartOfAccountsOpts) = ('-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'accounts'); open(CHART_DATA, "-|", $LEDGER_CMD, @chartOfAccountsOpts) or die "Unable to run $LEDGER_CMD @chartOfAccountsOpts: $!"; diff --git a/contrib/non-profit-audit-reports/general-ledger-report.plx b/contrib/non-profit-audit-reports/general-ledger-report.plx index dce855b4..4a4f89cc 100755 --- a/contrib/non-profit-audit-reports/general-ledger-report.plx +++ b/contrib/non-profit-audit-reports/general-ledger-report.plx @@ -58,12 +58,11 @@ $formattedEndDate = $formattedEndDate->calc($oneDayLess); $formattedEndDate = $formattedEndDate->printf("%Y/%m/%d"); my $formattedBeginDate = new Date::Manip::Date; -die "badly formatted end date, $endDate" if $formattedBeginDate->parse($endDate); +die "badly formatted end date, $beginDate" if $formattedBeginDate->parse($beginDate); $formattedBeginDate = $formattedBeginDate->printf("%Y/%m/%d"); -my(@chartOfAccountsOpts) = ('-V', '-F', "%150A\n", '-w', '-s', - '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg'); +my(@chartOfAccountsOpts) = ('-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'accounts'); open(CHART_DATA, "-|", $LEDGER_CMD, @chartOfAccountsOpts) or die "Unable to run $LEDGER_CMD @chartOfAccountsOpts: $!"; diff --git a/contrib/non-profit-audit-reports/summary-reports.plx b/contrib/non-profit-audit-reports/summary-reports.plx index 53d205b3..ddc97737 100755 --- a/contrib/non-profit-audit-reports/summary-reports.plx +++ b/contrib/non-profit-audit-reports/summary-reports.plx @@ -98,7 +98,7 @@ die "Date calculation error on $startDate" if ($err); my %reportFields = ('Cash' => { args => [ '-e', $endDate, 'bal', '/^Assets/' ] }, 'Accounts Receivable' => {args => [ '-e', $endDate, 'bal', '/^Accrued:Accounts Receivable/' ]}, - 'Loans Receivable' => {args => [ '-e', $endDate, 'bal', '/^Accrued:Loans Receivable/' ]}, + 'Loans/Fraud Receivable' => {args => [ '-e', $endDate, 'bal', '/^Accrued:(Loans|Fraud) Receivable/' ]}, 'Accounts Payable' => {args => [ '-e', $endDate, 'bal', '/^Accrued.*Accounts Payable/' ]}, 'Accrued Expenses' => {args => [ '-e', $endDate, 'bal', '/^Accrued.*Expenses/' ]}, 'Liabilities, Credit Cards' => {args => [ '-e', $endDate, 'bal', '/^Liabilities:Credit Card/' ]}, @@ -161,7 +161,7 @@ print BALANCE_SHEET "\"BALANCE SHEET\"\n", my $formatStr = "\"\",\"%-42s\",\"\$%13s\"\n"; my $formatStrTotal = "\"\",\"%-45s\",\"\$%13s\"\n"; my $tot = $ZERO; -foreach my $item ('Cash', 'Accounts Receivable', 'Loans Receivable') { +foreach my $item ('Cash', 'Accounts Receivable', 'Loans/Fraud Receivable') { next if $reportFields{$item}{total} == $ZERO; print BALANCE_SHEET sprintf($formatStr, "$item:", Commify($reportFields{$item}{total})); $tot += $reportFields{$item}{total}; @@ -195,19 +195,19 @@ die "unable to write to balance-sheet.csv: $!" unless ($? == 0); die "Cash+accounts receivable total does not equal net assets and liabilities total" if (abs( ($reportFields{'Cash'}{total} + $reportFields{'Accounts Receivable'}{total} - + $reportFields{'Loans Receivable'}{total})) - + + $reportFields{'Loans/Fraud Receivable'}{total})) - abs($reportFields{'Accounts Payable'}{total} + $reportFields{'Accrued Expenses'}{total} + $reportFields{'Unearned Income, Conference Registration'}{total} + $reportFields{'Unearned Income, Other'}{total} + $reportFields{'Liabilities, Credit Cards'}{total} + $reportFields{'Liabilities, Other'}{total} + - $reportFields{'Total Net Assets'}{total}) > $ONE_PENNY); + $reportFields{'Total Net Assets'}{total}) > $TWO_CENTS); die "Total net assets doesn't equal sum of restricted and unrestricted ones!" if (abs($reportFields{'Total Net Assets'}{total}) - abs($reportFields{'Unrestricted Net Assets'}{total} + - $reportFields{'Temporarily Restricted Net Assets'}{total}) > $ONE_PENNY); + $reportFields{'Temporarily Restricted Net Assets'}{total}) > $TWO_CENTS); my %incomeGroups = ('INTEREST INCOME' => { args => ['/^Income.*Interest/' ] }, @@ -280,7 +280,7 @@ print INCOME "\n\n\n", sprintf($formatStrTotal, "OVERALL TOTAL:", Commify($overa close INCOME; die "unable to write to income.csv: $!" unless ($? == 0); die "calculated total of $overallTotal does equal $incomeGroups{TOTAL}{total}" - if (abs($overallTotal) - abs($incomeGroups{TOTAL}{total}) > $ONE_PENNY); + if (abs($overallTotal) - abs($incomeGroups{TOTAL}{total}) > $TWO_CENTS); print STDERR "\n"; @@ -380,7 +380,7 @@ die "GROUPS NOT INCLUDED : ", join(keys(%verifyAllGroups), ", "), "\n" unless (keys %verifyAllGroups == 0); die "calculated total of $overallTotal does *not* equal $firstTotal" - if (abs($overallTotal) - abs($firstTotal) > $ONE_PENNY); + if (abs($overallTotal) - abs($firstTotal) > $TWO_CENTS); print STDERR "\n"; diff --git a/lisp/CMakeLists.txt b/lisp/CMakeLists.txt index 2258fd5d..33fe6f14 100644 --- a/lisp/CMakeLists.txt +++ b/lisp/CMakeLists.txt @@ -1,23 +1,21 @@ set(EMACS_LISP_SOURCES - ldg-commodities.el - ldg-complete.el - ldg-exec.el - ldg-fonts.el - ldg-init.el - ldg-mode.el - ldg-new.el - ldg-occur.el - ldg-post.el - ldg-reconcile.el - ldg-regex.el - ldg-report.el - ldg-sort.el - ldg-state.el - ldg-test.el - ldg-texi.el - ldg-xact.el - ldg-context.el - ldg-schedule.el) + ledger-commodities.el + ledger-complete.el + ledger-exec.el + ledger-fonts.el + ledger-init.el + ledger-mode.el + ledger-occur.el + ledger-post.el + ledger-reconcile.el + ledger-regex.el + ledger-report.el + ledger-schedule.el + ledger-sort.el + ledger-state.el + ledger-test.el + ledger-texi.el + ledger-xact.el) # find emacs and complain if not found find_program(EMACS_EXECUTABLE emacs) @@ -30,7 +28,7 @@ macro(add_emacs_lisp_target el) OUTPUT ${el}c COMMAND ${EMACS_EXECUTABLE} -L ${CMAKE_CURRENT_BINARY_DIR} - -l ${CMAKE_CURRENT_BINARY_DIR}/ldg-regex.el + -l ${CMAKE_CURRENT_BINARY_DIR}/ledger-regex.el -batch -f batch-byte-compile ${CMAKE_CURRENT_BINARY_DIR}/${el} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el} diff --git a/lisp/ledger-post.el b/lisp/ledger-post.el index 447a34f8..5d30e954 100644 --- a/lisp/ledger-post.el +++ b/lisp/ledger-post.el @@ -117,11 +117,12 @@ to choose from." Return the width of the amount field as an integer and leave point at beginning of the commodity." ;;(beginning-of-line) - (when (re-search-forward ledger-amount-regex end t) - (goto-char (match-beginning 0)) - (skip-syntax-forward " ") - (- (or (match-end 4) - (match-end 3)) (point)))) + (let ((case-fold-search nil)) + (when (re-search-forward ledger-amount-regex end t) + (goto-char (match-beginning 0)) + (skip-syntax-forward " ") + (- (or (match-end 4) + (match-end 3)) (point))))) (defun ledger-next-account (&optional end) diff --git a/lisp/ledger-reconcile.el b/lisp/ledger-reconcile.el index 4725c6e4..8ca78dbc 100644 --- a/lisp/ledger-reconcile.el +++ b/lisp/ledger-reconcile.el @@ -72,8 +72,10 @@ reconcile-finish will mark all pending posting cleared." :type 'string :group 'ledger-reconcile) -(defvar ledger-reconcile-sort-key "(date)" - "Default key for sorting reconcile buffer") +(defcustom ledger-reconcile-sort-key "(date)" + "Default key for sorting reconcile buffer. For no sorting by default, use '(0)'." + :type 'string + :group 'ledger-reconcile) (defun ledger-reconcile-get-cleared-or-pending-balance (buffer account) "Calculate the cleared or pending balance of the account." @@ -447,6 +449,8 @@ moved and recentered. If they aren't strange things happen." (define-key map [?q] 'ledger-reconcile-quit) (define-key map [?b] 'ledger-display-balance) + (define-key map [(control ?c) (control ?o)] (ledger-reconcile-change-sort-key-and-refresh "(0)")) + (define-key map [(control ?c) (control ?a)] (ledger-reconcile-change-sort-key-and-refresh "(amount)")) (define-key map [(control ?c) (control ?d)] (ledger-reconcile-change-sort-key-and-refresh "(date)")) @@ -465,6 +469,7 @@ moved and recentered. If they aren't strange things happen." (define-key map [menu-bar ledger-recon-menu add] '("Add Entry" . ledger-reconcile-add)) (define-key map [menu-bar ledger-recon-menu tog] '("Toggle Entry" . ledger-reconcile-toggle)) (define-key map [menu-bar ledger-recon-menu sep3] '("--")) + (define-key map [menu-bar ledger-recon-menu sort-orig] `("Sort by file order" . ,(ledger-reconcile-change-sort-key-and-refresh "(0)"))) (define-key map [menu-bar ledger-recon-menu sort-amt] `("Sort by amount" . ,(ledger-reconcile-change-sort-key-and-refresh "(amount)"))) (define-key map [menu-bar ledger-recon-menu sort-pay] `("Sort by date" . ,(ledger-reconcile-change-sort-key-and-refresh "(date)"))) (define-key map [menu-bar ledger-recon-menu sort-dat] `("Sort by payee" . ,(ledger-reconcile-change-sort-key-and-refresh "(payee)"))) |