Re: Bug in budget report?

2014-08-24 Thread Dave Wells
Was this patch rejected? I still get the error when putting in the test 
input above. Using Ledger 3.0.2-20140507 on OS X 10.9.4, installed via 
Homebrew.

Dave


On Thursday, November 3, 2011 8:35:27 PM UTC-7, Craig Earls wrote:

 John,
If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
 12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
 12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
 justify((get_at(total_expr, 1) ? 
  (100% * quantity(scrub(get_at(total_expr, 0 / 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
 5, -1, true, false),
 magenta if (color and get_at(total_expr, 1) and 
 (abs(quantity(scrub(get_at(total_expr, 0))) / 
  quantity(scrub(get_at(total_expr, 1 = 
 1
%(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.


 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com 
 javascript: wrote:
 
  Thanks!
 

 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com



-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug in budget report?

2014-08-24 Thread Craig Earls
I will check this evening.  I couldn't merge pull requests back then and
may not have sent that patch correctly.

On Sunday, August 24, 2014, Dave Wells shawki...@gmail.com wrote:

 Was this patch rejected? I still get the error when putting in the test
 input above. Using Ledger 3.0.2-20140507 on OS X 10.9.4, installed via
 Homebrew.

 Dave


 On Thursday, November 3, 2011 8:35:27 PM UTC-7, Craig Earls wrote:

 John,
If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
 12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
 12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
 justify((get_at(total_expr, 1) ? 
  (100% * quantity(scrub(get_at(total_expr, 0 / 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
 5, -1, true, false),
 magenta if (color and get_at(total_expr, 1) and 
 (abs(quantity(scrub(get_at(total_expr, 0))) / 
  quantity(scrub(get_at(total_expr, 1 =
 1
%(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.


 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com
 wrote:
 
  Thanks!
 

 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

 ---
 You received this message because you are subscribed to the Google Groups
 Ledger group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to ledger-cli+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','ledger-cli%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug in budget report?

2014-08-24 Thread Craig Earls
Wow, longest bug fix ever!  This patch never got merged back in 2011.  I
put it in tonight.


On Sun, Aug 24, 2014 at 2:37 PM, Craig Earls ender...@gmail.com wrote:

 I will check this evening.  I couldn't merge pull requests back then and
 may not have sent that patch correctly.


 On Sunday, August 24, 2014, Dave Wells shawki...@gmail.com wrote:

 Was this patch rejected? I still get the error when putting in the test
 input above. Using Ledger 3.0.2-20140507 on OS X 10.9.4, installed via
 Homebrew.

 Dave


 On Thursday, November 3, 2011 8:35:27 PM UTC-7, Craig Earls wrote:

 John,
If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
 12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
 12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
 justify((get_at(total_expr, 1) ? 
  (100% * quantity(scrub(get_at(total_expr, 0 /
 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
 5, -1, true, false),
 magenta if (color and get_at(total_expr, 1) and 
 (abs(quantity(scrub(get_at(total_expr, 0))) / 
  quantity(scrub(get_at(total_expr, 1
 = 1
%(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.


 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com
 wrote:
 
  Thanks!
 

 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

 ---
 You received this message because you are subscribed to the Google Groups
 Ledger group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to ledger-cli+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com




-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug in budget report?

2011-11-04 Thread John Rakestraw
Hi, Craig --

Thanks for the follow-up on this. I'll have a go this weekend.

--John

On Thu, 03 Nov 2011, Craig Earls wrote:
 John,
    If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
     12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
     12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
     justify((get_at(total_expr, 1) ? 
      (100% * quantity(scrub(get_at(total_expr, 0 / 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
     5, -1, true, false),
     magenta if (color and get_at(total_expr, 1) and 
     (abs(quantity(scrub(get_at(total_expr, 0))) / 
      quantity(scrub(get_at(total_expr, 1 = 
 1
    %(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.

 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com wrote:

 Thanks!


 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

-- 
John Rakestraw


Bug in budget report?

2011-11-03 Thread John Rakestraw
Hi, all --

With the following ledger file test:

~Monthly
Expenses:Allowance:me  $200.00
Assets

2011/11/01 Test entry 1
Expenses:Allowance:me$50.00
Liabilities:Checking

2011/11/02 Test entry 2
Expenses:Groceries$35.00
Expenses:Allowance:me

2011/11/03 Test entry 3
Expenses:Misc $15.00
Expenses:Allowance:me

The command 

ledger budget -f test reg -p 'this month' allowance:me 

fails with this error message:

--8---cut here---start-8---
While evaluating value expression:
  ansify_if(justify((get_at(total_expr, 1) ? (((100% * scrub(get_at(total_expr, 
0))) / (- scrub(get_at(total_expr, 1 : 0)), 5, -1, true, false), (((color  
get_at(total_expr, 1))  (abs((quantity(scrub(get_at(total_expr, 0))) / 
quantity(scrub(get_at(total_expr, 1) = 1)) ? (magenta : null)))
While multiplying 0 with 100%:
Error: Cannot multiply an amount with a balance
--8---cut here---end---8---

I realize that this is a bit of a corner case -- and therefore perhaps not
worth fixing. The entries above fit the scenario in which I discovered it.
My wife and I have monthly allowances. I take out $50.00 in cash, charged
to my allowance. However, then I use this cash instead for groceries and a
miscellaneous purchase, which brings my allowance spending for the month
back to $0.

-- 
John Rakestraw


Re: Bug in budget report?

2011-11-03 Thread Craig Earls
Looks like a bug to me.  I fixed it in report.h.  By changing the
divided terms into quantities.  I will file a bug report and send john
a pull request tonight.

On 2011-11-03, John Rakestraw jo...@johnrakestraw.com wrote:
 Hi, all --

 With the following ledger file test:

 ~Monthly
 Expenses:Allowance:me  $200.00
 Assets

 2011/11/01 Test entry 1
 Expenses:Allowance:me$50.00
 Liabilities:Checking

 2011/11/02 Test entry 2
 Expenses:Groceries$35.00
 Expenses:Allowance:me

 2011/11/03 Test entry 3
 Expenses:Misc $15.00
 Expenses:Allowance:me

 The command

 ledger budget -f test reg -p 'this month' allowance:me

 fails with this error message:

 --8---cut here---start-8---
 While evaluating value expression:
   ansify_if(justify((get_at(total_expr, 1) ? (((100% *
 scrub(get_at(total_expr, 0))) / (- scrub(get_at(total_expr, 1 : 0)), 5,
 -1, true, false), (((color  get_at(total_expr, 1)) 
 (abs((quantity(scrub(get_at(total_expr, 0))) /
 quantity(scrub(get_at(total_expr, 1) = 1)) ? (magenta : null)))
 While multiplying 0 with 100%:
 Error: Cannot multiply an amount with a balance
 --8---cut here---end---8---

 I realize that this is a bit of a corner case -- and therefore perhaps not
 worth fixing. The entries above fit the scenario in which I discovered it.
 My wife and I have monthly allowances. I take out $50.00 in cash, charged
 to my allowance. However, then I use this cash instead for groceries and a
 miscellaneous purchase, which brings my allowance spending for the month
 back to $0.

 --
 John Rakestraw



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com


Re: Bug in budget report?

2011-11-03 Thread Craig Earls
John,
   If you have the source for 3.0 and can't wait for a fix through the
normal channel, open up report.h and at line 437 replace the budget
format string with:

 %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
  %(justify(-scrub(get_at(total_expr, 1)), 12, 
    12 + 1 + 12, true, color))
  %(justify(scrub(get_at(total_expr, 1) + 
  get_at(total_expr, 0)), 12, 
    12 + 1 + 12 + 1 + 12, true, color))
  %(ansify_if(
    justify((get_at(total_expr, 1) ? 
     (100% * quantity(scrub(get_at(total_expr, 0 / 
  -quantity(scrub(get_at(total_expr, 1))) : 0), 
    5, -1, true, false),
    magenta if (color and get_at(total_expr, 1) and 
    (abs(quantity(scrub(get_at(total_expr, 0))) / 
     quantity(scrub(get_at(total_expr, 1 = 1
   %(!options.flat ? depth_spacer : \\)
 %-(ansify_if(partial_account(options.flat), blue if color))\n
 %/%$1 %$2 %$3 %$4\n%/
 %(prepend_width ? \ \ * prepend_width : \\)
    -\n

then rebuild the program (lengthy since many components are dependent
on this header)

I have entered a bug report and a pull request to incorporate the fix.


On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com wrote:

 Thanks!


--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com