GithubHelp home page GithubHelp logo

swingtix / bookkeeper Goto Github PK

View Code? Open in Web Editor NEW
168.0 9.0 31.0 95 KB

A double-entry bookkeeping system developed for use at SwingTix.ca.

License: GNU Affero General Public License v3.0

Python 96.35% Makefile 3.65%

bookkeeper's Introduction

SwingTix Bookkeeper

A double-entry bookkeeping system originally developed for SwingTix.

Hello, World

You'll need a django project. If you don't have one handy, you can make an empty one following the first steps of the django tutorial. Afterwards, edit <yourproject>/settings.py to add "swingtix.bookkeeper" to INSTALLED_APPS and run:

$ python manage.py syncdb

Then you're ready to start exploring using the shell:

$ python manage.py shell

First, let's create a couple of accounts:

>>> from swingtix.bookkeeper.models import BookSet, Account

>>> book = BookSet(description="my book")
>>> book.save()

>>> revenue  = Account(bookset=book, name="revenue", positive_credit=True)
>>> revenue.save()
>>> bank     = Account(bookset=book, name="bank",    positive_credit=False)
>>> bank.save()
>>> expense  = Account(bookset=book, name="expense", positive_credit=False)
>>> expense.save()

Then you can use them:

>>> book = BookSet.objects.get(description="my book")
>>> revenue = book.get_account("revenue")
>>> bank    = book.get_account("bank")
>>> expense = book.get_account("expense")

#Someone pays you can advance.  Yay!
>>> bank.debit(120.00, revenue, "our first sale")
(<AccountEntry: 120 >, <AccountEntry: -120 >)

#but now you have to do some work.  The local coffee shop has free wifi..
>>> bank.credit(2.20, expense, "coffee")
(<AccountEntry: -2 >, <AccountEntry: 2 >)

>>> bank.balance()
Decimal('117.80')
>>> expense.balance()
Decimal('2.20')
>>> revenue.balance()
Decimal('120.00')

bookkeeper's People

Contributors

g-- avatar llazzaro avatar omarkhan avatar replay avatar shearichard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookkeeper's Issues

"RuntimeWarning: DateTimeField Transaction.t_stamp received a naive datetime"

I haven't had time to investigate what this means yet but I thought I would just ticket it quickly before I forget.

I'm just working my way through the demo transactions like this

>>> book = BookSet.objects.get(description="my book")
>>> revenue = book.get_account("revenue")
>>> bank    = book.get_account("bank")
>>> expense = book.get_account("expense")

#Someone pays you can advance.  Yay!
>>> bank.debit(120.00, revenue, "our first sale")
(<AccountEntry: 120 >, <AccountEntry: -120 >)

And when I get to that last bit I get a RuntimeWarning

>>> bank.debit(120.00, revenue, "our first sale")
/home/rshea/.virtualenvs/bookkpdemo/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:1278: RuntimeWarning: DateTimeField Transaction.t_stamp received a naive datetime (2014-11-22 04:23:43.055385) while time zone support is active.
  RuntimeWarning)

(<AccountEntry: 120 >, <AccountEntry: -120 >)
>>>

This is on Django 1.7.1 and bookkeeper 0.0.1.1 .

settings.TIME_ZONE is set to 'UTC' and the machine it's running on is set to NZDT

implementing debit/credit methods in Admin

Hi Geoff,
Are you planning any documentation about bookkeper?
It is not clear for me how to add the credit debit methods into admin interface.
From admin I can make accountEntry , creates accounts ,
but this method below i do not know where to put it .

bank.credit(2.20, expense, "coffee")

thanks for showing me the direction
Peter from Slovakia

makemigrations/runserver on Django 1.7 generate warning messages

I will fix this myself if I can but there are a couple of things in the current code which causes the Django system check to throw warnings.

Here's what it looks like in makemigrations during the initial installation .

(bookkpdemo)rshea@jaffa:~/dev/bookkpdmo/mysite> python manage.py makemigrations
/home/rshea/.virtualenvs/bookkpdemo/local/lib/python2.7/site-packages/swingtix/bookkeeper/account_api.py:155: RemovedInDjango18Warning: commit_on_success is deprecated in favor of atomic.
  def post(self, amount, other_account, description, self_memo="", other_memo="", datetime=None):

System check identified some issues:

WARNINGS:
bookkeeper.Account.positive_credit: (1_6.W002) BooleanField does not have a default value.
        HINT: Django 1.6 changed the default value of BooleanField from False to None. See https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield for more information.
No changes detected

It looks like both of those could be fixed in a manner which would be compatible with <= 1.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.