Invoice question and ledger vs hledger issue

118 views
Skip to first unread message

Boyd Kelly

unread,
Jul 23, 2019, 1:19:19 PM7/23/19
to Ledger
I've been trying to find the right template for an invoice and i have this:

2019-03-14  Invoice Clienta ; :Invoice: 201901                                                                                                              
  ; Invoice: 201901                                                                                                                                        
  ; Period: 2019-02-01--2019-03-02                                                                                                                         
  Income:Consulting       11.00 h @ -$50.00  ; Rendered at x  ; Period: 2019-02-10--2019-02-16                                                 
  Income:Consulting       7.00 h  @  -$50.00  ; Rendered at x ; Period: 2019-02-17--2019-02-23                                                
  Income:Consulting       7.00 h @   -$50.00  ; Rendered at x ; Period: 2019-02-23--2019-03-02  
  Assets:Accounts Receivable:Clienta

hledger r and b commands work just fine.

 ~ ledger  hledger r Receiv -e 20190315
2019/03/14 Invoice Clienta                                             Assets:Accounts Receivable:Clienta                           $ 1,250.00    $ 1,250.00

But ledger is giving me this:

  ~ ledger  ledger r Receiv 
In file included from "/data/ledger/business/general.journal", line 3:
While parsing file "/data/ledger/business/invoices.journal", line 9:
While parsing posting:
  Income:Consulting                             11.00 h @ -$50.00  ; Rendered at ; Period: 2019-02-10--2019-02-16
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: A posting's cost may not be negative
 
As I understand Income account needs to be negative and it seems work.  But then why is ledger giving me this message?   What do I have to do to my file to keep it compatible?  Appreciate any answers and any ideas also as to the Invoice format.

Vanya Yani

unread,
Aug 16, 2019, 4:16:34 PM8/16/19
to Ledger
It's telling you that commodity can't have a negative pricing.

That would mean people pay you to take stuff from them. That would mean it's not you who are buying their services, it's them paying for your services.

So just rewrite this:

11.00 h @ -$50.00 

into this:

-11.00 h @ $50.00

But that wouldn't make sense either because I assume you're giving them your hours. They're giving you money.
So their account of hours is credited (added to), while their dollar account is debited (removed from).

That's how it should look like:

2019-03-14  Invoice Clienta ; :Invoice: 201901                                                                                                              
  ; Invoice: 201901                                                                                                                                        
  ; Period: 2019-02-01--2019-03-02                                                                                                                         
  Income:Consulting       11.00 h @ $50.00
  Income:Consulting       7.00 h  @  $50.00
  Income:Consulting       7.00 h @   $50.00
  Income:Consulting       -$1250.00
  Assets:Accounts

Or even better:

2019-03-14  Invoice Clienta ; :Invoice: 201901                                                                                                              
  ; Invoice: 201901                                                                                                                                        
  ; Period: 2019-02-01--2019-03-02                                                                                                                         
  Asset:Time:Consulting       11.00 h @ $50.00
  Asset:Time:Consulting       7.00 h  @  $50.00
  Asset:Time:Consulting       7.00 h @   $50.00
  Income:Consulting

The transaction above means that you're lending hours at a given price to the firm you're consulting.
So income account is credited (money are added to it)

After they pay your invoice you would have another transaction:

2019-03-15  Payday                                                                                                             
  Assets:Accounts:Cash     $1250.00
  Income:Consulting           -$1250.00

Here money are deducted from income account and your cash amount is increased.
Reply all
Reply to author
Forward
0 new messages