Writing a script to import bank's csv file

Tommy Trussell tommy.trussell at gmail.com
Mon Feb 10 17:39:14 EST 2014


On Mon, Feb 10, 2014 at 3:37 PM, Brendan S <
disposableemail at apps.opensourcelaw.biz> wrote:

> On 02/11/2014 12:35 AM, Mike or Penny Novack wrote:
> > Brendan S wrote:
>
> []
>
> Thank you for your response.
>
> > Not "confused" exactly but I am getting the sense that you haven't
> > yet grasped the fundamental concepts of "double entry bookkeeping".
>
> Yes.  I have actually done a course on it - but that was some time ago now.
>
> []
>
> > There are always (at least) TWO accounts associated with a
> > transaction, one on the debit side of the transaction and one on the
> > credit side. At the time invented many centuries ago, negative
> > numbers were not in common use, so in general you will always be
> > entering positive amounts << a negative balance for an account
> > simply means that the net balance is on the opposite side* of the
> > ledger than normal for that account.
>
> I am not entering them manually.  Rather, I'm importing them after
> pre-processing them.  When Gnucash does the import it puts the amount in a
> ledger depending on whether it is -ive or not.  (On import it automatically
> credits(?) the bank account so the transactions are always matched.)
>
> > a) If you get cash back when paying at the supermarket, yes that
> > would be a split transaction. You didn't say HOW you were paying: If
>
> EFTPOS from check acct.  eg: $150 =  $50 purchase and $100 cash out.
>
> At the moment I am recording this as two separate transactions -> $100 to
> cash and $50 to the expense account.  In the future (ie when I come back to
> review the accounts) will it matter if I've automatically separated this
> into two transactions before importing?  Or is it better to import it as a
> single transaction with a "split"?  (I've assumed it doesn't matter)
>
> > by credit card, that would be a credit to (Liabilities) Credit Card
> > and debits to (Expenses) Food and (Assets) Cash. b) Your individual
> > credit card transactions would all be credits to Credit Card and
> > debits to the appropriate expense. In neither case would these be
> > negative numbers, just on opposite sides of the transaction. c)
>
> > Checks would be a credits to (assets) Checking and debits to the
> > appropriate expense account.
>
> I'm also interested in how to process the transactions.   When I get the
> csv
> from the bank, it just says "check #x".  At the moment (when I run the
> script to automatically import them) I am parking them in Expenses:Checks
> Uncategorised and going to get out my check book and move them to an
> appropriate account manually.  This seems logical to me, but I'm wondering
> if there's a more sensible "accounting" way to do it.
>
> So a payment from my check account to my credit card account would be a
> debit to the credit card account and a credit to the check account?
>
> Brendan
>  <https://lists.gnucash.org/mailman/listinfo/gnucash-user>
>

In addition to the GnuCash documentation, you might find some of the
following helpful:

http://wiki.gnucash.org/wiki/FAQ#Accounting_Questions

As a rule of thumb, if you have a single transaction (such as you use a
debit card -- AKA EFTPOS -- and some of the money comes to you as cash and
some of it is spent on one or more different things) then you will need a
split transaction.

In the case of a debit card and getting cash in addition to a purchase, it
might look like this in your books (you'll have to imagine the debit and
credit columns as I'm not going to try to align them):

Looking in BigBank's account:

2/10/2014    Grocery Store
 memo line, if any, shows here
 ...............Expenses:Groceries      $50.00  [left/debit column]
 ...............Assets:Current Assets:Cash in Wallet:  $100.00 [left/debit]
 ...............Assets:Current Assets:BigBank  $150.00 [right/credit]

If you look in your "Cash in Wallet" account, you should see it increase by
$100. If you look in your Expenses:Groceries account, you should see it
increase by $50. If you look in BigBank's account, you should see it
decrease by $150. If any of these things are not true, you got your debit
vs credit confused.

If you write a check or create a single debit transaction for a single
purpose, then when you key it in you don't need to worry about splits.
Internally, however there is ALWAYS a split because the money in a
transaction has to come from somewhere and go somewhere else.

Enter a few transactions by hand and have a look at the different ways you
can view accounts when looking at a GnuCash register. View --> Double Line
and using the "Split" button on the toolbar or the Auto-Split Ledger, for
example.



> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>


More information about the gnucash-user mailing list