<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -29,9 +29,12 @@ class EmployeeAdmin(admin.ModelAdmin):
 class ProjectInvoiceInline(admin.TabularInline):
     model = ProjectInvoice
 
+class ProjectTimeInline(admin.TabularInline):
+    model = ProjectTime
+
 class ProjectAdmin(admin.ModelAdmin):
     list_display = ('name', 'total_invoiced', 'total_cost', 'profit')
-    inlines = [ProjectInvoiceInline,]
+    inlines = [ProjectInvoiceInline, ProjectTimeInline]
     
 class ProjectTimeAdmin(admin.ModelAdmin):
     list_display = ('employee', 'start_date', 'project', 'hours', 'cost', 'cost_converted')</diff>
      <filename>beancounter/admin.py</filename>
    </modified>
    <modified>
      <diff>@@ -115,6 +115,9 @@ class Project(models.Model):
     name = models.CharField(max_length=100)
     active = models.BooleanField(default=True)
 
+    class Meta:
+        ordering = ['-active', 'name']
+
     def __unicode__(self):
         return self.name
         
@@ -129,7 +132,9 @@ class Project(models.Model):
         #TODO aggregate support
         total = decimal.Decimal(&quot;0.00&quot;)
         for time in self.projecttime_set.all():
-            total += time.cost_converted
+           #this test should be in the filter above 
+           if time.cost_converted:
+                total += time.cost_converted
         return total
     
     def profit(self):
@@ -163,6 +168,9 @@ class ProjectTime(models.Model):
     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;)
 
+    class Meta:
+        ordering = ['-start_date', 'project']
+
     def __unicode__(self):
         return &quot;%s on %s (%s-%s)&quot; % (self.employee, self.project, self.start_date, self.end_date)
     </diff>
      <filename>beancounter/models.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>13e5e7513eaea5b34ef9a14ffb97a40efd443c38</id>
    </parent>
  </parents>
  <author>
    <name>Peter Baumgartner</name>
    <email>pete@lincolnloop.com</email>
  </author>
  <url>http://github.com/lincolnloop/django-beancounter/commit/7d59c1280550ae4d5177498daf5ef7dea2985f19</url>
  <id>7d59c1280550ae4d5177498daf5ef7dea2985f19</id>
  <committed-date>2009-01-05T17:41:43-08:00</committed-date>
  <authored-date>2009-01-05T17:41:43-08:00</authored-date>
  <message>tweak admin display and ordering</message>
  <tree>297b5c9064f5898e187c46646cf8ad05d0af30ec</tree>
  <committer>
    <name>Peter Baumgartner</name>
    <email>pete@lincolnloop.com</email>
  </committer>
</commit>
