Add first accounting implementation

This commit is contained in:
Skia
2016-01-28 16:53:37 +01:00
parent 2b999d87ba
commit f71ce2f7df
12 changed files with 245 additions and 4 deletions

View File

@ -1,5 +1,5 @@
from django.contrib import admin
from .models import User, Page, Group
from core.models import User, Page, Group
admin.site.register(User)

View File

@ -2,7 +2,10 @@ import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.conf import settings
from core.models import Group, User, Page, PageRev
from accounting.models import Customer, GeneralJournal, ProductType, Product
class Command(BaseCommand):
help = "Set up a new instance of the Sith AE"
@ -13,8 +16,9 @@ class Command(BaseCommand):
def handle(self, *args, **options):
try:
os.unlink(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))), 'db.sqlite3'))
except:
pass
os.mkdir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))+'/data')
except Exception as e:
print(e)
call_command('migrate')
u = User(username='root', last_name="", first_name="Bibou",
email="ae.info@utbm.fr",
@ -45,3 +49,11 @@ class Command(BaseCommand):
Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
""").save()
# Accounting test values:
Customer(user=s, account_id="6568j").save()
p = ProductType(name="Bières bouteilles")
p.save()
Product(name="Barbar", code="BARB", product_type=p, purchase_price="1.50", selling_price="1.7",
special_selling_price="1.6").save()
GeneralJournal(start_date="2015-06-12", name="A15").save()