[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 514453b 1/2: Echo input ListBillDate to outpu
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 514453b 1/2: Echo input ListBillDate to output |
Date: |
Sun, 11 Jun 2017 10:13:58 -0400 (EDT) |
branch: master
commit 514453b1b0b6fe271fd0515b7e70aec15cb4ee91
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Echo input ListBillDate to output
Added ListBillDate as a group roster column.
The group roster, which is the only report to be used for list bills,
should show the input ListBillDate. It is not easy to show it as a
case invariant, because the roster operates like a *nix filter such as
'sed': it reads one cell at a time as input, processes it, emits output
pertaining to that single cell, and then discards the cell. This means
that it's not simple to ascertain a list bill's validity, which is
suspect if ListBillDate and ErMode are not the same for each cell (and,
thus, for its corresponding output row).
Of course, the group roster could be redesigned to preserve state, as
was done for group quotes. Given that the list bill is a specialized
use case, run only a few times a year, it seems that the cost of that
extra work would exceed the benefit. The tab-delimited output file is
certainly opened in a spreadsheet program, where it is trivial to
validate the consistency of values in a column of arbitrary length in
order to detect input errors.
---
ledger_text_formats.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ledger_text_formats.cpp b/ledger_text_formats.cpp
index 18d6367..1dc333f 100644
--- a/ledger_text_formats.cpp
+++ b/ledger_text_formats.cpp
@@ -720,6 +720,7 @@ void PrintRosterHeaders(std::string const& file_name)
,"ListBillPremium"
,"EeListBillPremium"
,"ErListBillPremium"
+ ,"ListBillDate"
,"EeMode"
,"ErMode"
,"CorpName"
@@ -807,6 +808,7 @@ void PrintRosterTabDelimited
<< Invar.value_str("ListBillPremium" ) << '\t'
<< Invar.value_str("EeListBillPremium" ) << '\t'
<< Invar.value_str("ErListBillPremium" ) << '\t'
+ << "'" << Invar.ListBillDate << "'\t"
<< Invar.EeMode [d] << '\t'
<< Invar.ErMode [d] << '\t'
<< Invar.value_str("CorpName" ) << '\t'