*** empty log message ***
This commit is contained in:
parent
46a3f91c4e
commit
b5097ced2b
2 changed files with 14 additions and 20 deletions
|
|
@ -470,8 +470,8 @@ static void parse_number(mpz_t out, const std::string& number,
|
||||||
else {
|
else {
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
|
|
||||||
// The number is specified as the user desires, with the
|
// The number is specified as the user desires, with the commodity
|
||||||
// commodity telling us how to parse it.
|
// telling us how to parse it.
|
||||||
|
|
||||||
std::memset(buf, '0', 255);
|
std::memset(buf, '0', 255);
|
||||||
std::strncpy(buf, num, std::strlen(num));
|
std::strncpy(buf, num, std::strlen(num));
|
||||||
|
|
|
||||||
30
ledger.cc
30
ledger.cc
|
|
@ -44,12 +44,13 @@ void transaction::print(std::ostream& out, bool display_quantity,
|
||||||
|
|
||||||
if (cost && display_quantity) {
|
if (cost && display_quantity) {
|
||||||
out << " ";
|
out << " ";
|
||||||
out.width(10);
|
out.width(12);
|
||||||
|
|
||||||
std::string value = cost->as_str(true);
|
std::string value = cost->as_str(true);
|
||||||
if (! display_price) {
|
if (! display_price) {
|
||||||
int index = value.find('@');
|
int index = value.find('@');
|
||||||
value = std::string(value, index - 1);
|
if (index != -1)
|
||||||
|
value = std::string(value, 0, index - 1);
|
||||||
}
|
}
|
||||||
out << std::right << value;
|
out << std::right << value;
|
||||||
}
|
}
|
||||||
|
|
@ -71,29 +72,23 @@ void entry::print(std::ostream& out, bool shortcut) const
|
||||||
if (! code.empty())
|
if (! code.empty())
|
||||||
out << '(' << code << ") ";
|
out << '(' << code << ") ";
|
||||||
if (! desc.empty())
|
if (! desc.empty())
|
||||||
out << " " << desc;
|
out << desc;
|
||||||
|
|
||||||
out << std::endl;
|
out << std::endl;
|
||||||
|
|
||||||
// jww (2003-10-11): Unspecified virtual transactions should not
|
commodity * comm = NULL;
|
||||||
// factor into the size computation.
|
int size = 0;
|
||||||
|
|
||||||
commodity * comm = NULL;
|
|
||||||
int size = 0;
|
|
||||||
|
|
||||||
for (std::list<transaction *>::const_iterator x = xacts.begin();
|
for (std::list<transaction *>::const_iterator x = xacts.begin();
|
||||||
x != xacts.end();
|
x != xacts.end();
|
||||||
x++) {
|
x++) {
|
||||||
if ((*x)->is_virtual && ! (*x)->specified)
|
if ((*x)->is_virtual && ! (*x)->must_balance)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (! comm) {
|
if (! comm)
|
||||||
comm = (*x)->cost->commdty();
|
comm = (*x)->cost->commdty();
|
||||||
}
|
else if (comm != (*x)->cost->commdty())
|
||||||
else if (comm != (*x)->cost->commdty()) {
|
|
||||||
shortcut = false;
|
shortcut = false;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
size++;
|
size++;
|
||||||
}
|
}
|
||||||
|
|
@ -109,10 +104,9 @@ void entry::print(std::ostream& out, bool shortcut) const
|
||||||
|
|
||||||
out << " ";
|
out << " ";
|
||||||
|
|
||||||
// jww (2003-10-03): If we are shortcutting, don't print the
|
(*x)->print(out, (! shortcut || x == xacts.begin() ||
|
||||||
// "per-unit price" of a commodity, if it is not necessary.
|
((*x)->is_virtual && ! (*x)->must_balance)),
|
||||||
|
size != 2);
|
||||||
(*x)->print(out, ! shortcut || x == xacts.begin());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out << std::endl;
|
out << std::endl;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue