<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
-from beancounter.models import Category, BankAccount, AccountTransfer, Person, Entry
 from django.contrib import admin
-from django.utils.translation import ugettext_lazy as _
+
+from beancounter.models import (Category, BankAccount, AccountTransfer,
+                                Person, Entry, Employee, Project, ProjectTime)
 
 class CategoryOptions(admin.ModelAdmin):
     fieldsets = (
@@ -20,6 +21,17 @@ class BankAccountOptions(admin.ModelAdmin):
 class PersonOptions(admin.ModelAdmin):
     list_display = ('name','phone','email')
 
+class EmployeeAdmin(admin.ModelAdmin):
+    list_display = ('name', 'gmt_offset', 'rate')
+    search_fields = ('name',)
+
+class ProjectAdmin(admin.ModelAdmin):
+    list_display = ('name','start_date')
+    
+class ProjectTimeAdmin(admin.ModelAdmin):
+    list_display = ('project', 'employee', 'hours', 'cost_converted')
+    list_filter = ('project', 'employee')
+
 class AccountTransferOptions(admin.ModelAdmin):
     list_display = ('date','amount','from_account','to_account')
     list_filter = ('to_account','from_account')
@@ -31,9 +43,13 @@ class EntryOptions(admin.ModelAdmin):
     search_fieldsets = ('name','memo')
     list_filter = ('category','name','bank_account')
 
+
 admin.site.register(Category, CategoryOptions)
 admin.site.register(BankAccount, BankAccountOptions)
 admin.site.register(Person, PersonOptions)
 admin.site.register(AccountTransfer, AccountTransferOptions)
 admin.site.register(Entry, EntryOptions)
+admin.site.register(Employee, EmployeeAdmin)
+admin.site.register(Project, ProjectAdmin)
+admin.site.register(ProjectTime, ProjectTimeAdmin)
 </diff>
      <filename>beancounter/admin.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,8 @@
+import datetime
+
 from django.db import models
 from django.contrib.localflavor.us.models import PhoneNumberField
+from tagging.fields import TagField
 
 TYPE_CHOICES = (
     ('INC', 'Income'),
@@ -63,16 +66,78 @@ class Person(models.Model):
     email = models.EmailField(null=True,blank=True)
     notes = models.CharField(max_length=100,null=True,blank=True)
     
-    def __str__(self):
-        return &quot;%s&quot; % (self.name)
+    def __unicode__(self):
+        return self.name
     
     class Meta:
         verbose_name_plural = 'People'
         ordering = ['name']
         
+        
+class Employee(Person):
+    PAYMENT_CHOICES = (
+        ('paypal', 'PayPal'),
+        ('check', 'Mail Check'),
+        ('wire', 'Wire Transfer'),
+        ('elance', 'Elance'),
+        ('other', 'Other'),
+    )
+    gmt_offset = models.DecimalField(max_digits=3, decimal_places=1)
+    skills = TagField()
+    payment_preference = models.CharField(blank=True, max_length=100, choices=PAYMENT_CHOICES)
+    payment_notes = models.TextField(blank=True)
+    contract = models.DateField(blank=True, null=True, help_text=&quot;Date contractor contract was signed and received.&quot;)
+    hourly_rate = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, help_text=&quot;If rate varies, enter average and note below.&quot;)
+    currency = models.CharField(default=&quot;USD&quot;, max_length=3)
+    rate_notes = models.TextField(blank=True, help_text=&quot;Additional notes regarding contractor rates.&quot;)
+
+
+    def timezone(self):
+        if self.gmt_offset == int(self.gmt_offset):
+            gmt_offset = int(self.gmt_offset)
+        else:
+            gmt_offset = self.gmt_offset
+        if gmt_offset &gt; 0:
+            gmt_offset = '+%s' % gmt_offset
+        return 'GMT%s' % gmt_offset
+
+    def under_contract(self):
+        if self.contract:
+            return True
+        return False
+    under_contract.boolean = True
+
+    def rate(self):
+        return &quot;%s %s&quot; % (self.hourly_rate, self.currency)
+
+class Project(models.Model):
+    name = models.CharField(max_length=100)
+    employees = models.ManyToManyField(Employee)
+    start_date = models.DateField()
+    #bid = models.DecimalField(max_digits=8, decimal_places=2)
+    active = models.BooleanField(default=True)
+
+    def __unicode__(self):
+        return self.name
+        
+        
+class ProjectTime(models.Model):
+    &quot;&quot;&quot;
+    Hours spent by an employee on a project
     
-    class Admin:
-        list_display = ('name','phone','email')
+    &quot;&quot;&quot;
+    
+    employee = models.ForeignKey(Employee)
+    project = models.ForeignKey(Project)
+    start_date = models.DateField(default=datetime.date.today())
+    end_date = models.DateField(default=datetime.date.today())
+    hours = models.DecimalField(max_digits=6, decimal_places=3)
+    cost = models.DecimalField(max_digits=9, decimal_places=2, blank=True, null=True, help_text=&quot;Leave blank to automatically calculate&quot;)
+    cost_converted = models.DecimalField(max_digits=9, decimal_places=2, blank=True, null=True, help_text=&quot;Cost converted to local currency&quot;)
+
+    def __unicode__(self):
+        return &quot;%s on %s (%s-%s)&quot; % (self.employee, self.project, self.start_date, self.end_date)
+
 
 class Entry(models.Model):
     category = models.ForeignKey(Category)</diff>
      <filename>beancounter/models.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b13309e1114595408aae42b9c4cd4e9184804a63</id>
    </parent>
  </parents>
  <author>
    <name>Peter Baumgartner</name>
    <email>pete@lincolnloop.com</email>
  </author>
  <url>http://github.com/lincolnloop/django-beancounter/commit/9d6640ef13f8d884d66657479d19b7d3fb239a70</url>
  <id>9d6640ef13f8d884d66657479d19b7d3fb239a70</id>
  <committed-date>2009-01-04T17:31:35-08:00</committed-date>
  <authored-date>2009-01-04T17:31:35-08:00</authored-date>
  <message>added project/employee tracking</message>
  <tree>df0ac3a134d5c5ebfc2a33369284eaafcb4e4925</tree>
  <committer>
    <name>Peter Baumgartner</name>
    <email>pete@lincolnloop.com</email>
  </committer>
</commit>
