public
Description: Django-beancounter is a simple app I built to track my income and expenses.
Homepage: http://github.com/lincolnloop/django-beancounter
Clone URL: git://github.com/lincolnloop/django-beancounter.git
remove bid field, add invoice model
lincolnloop (author)
Sun Jan 04 18:00:03 -0800 2009
commit  e4ceba0f2e7b7cb07b007110926bc02104c52120
tree    e4fbaa0e81156828ee856c1786361a1123a209fc
parent  3431c1032d66ef29e874b66482b590d1a25a1b48
...
1
2
3
4
 
 
5
6
7
...
25
26
27
 
 
 
28
29
 
30
31
32
...
1
2
3
 
4
5
6
7
8
...
26
27
28
29
30
31
32
33
34
35
36
37
0
@@ -1,7 +1,8 @@
0
 from django.contrib import admin
0
 
0
 from beancounter.models import (Category, BankAccount, AccountTransfer,
0
-                                Person, Entry, Employee, Project, ProjectTime)
0
+                                Person, Entry, Employee, Project, ProjectTime,
0
+                                ProjectInvoice)
0
 
0
 class CategoryOptions(admin.ModelAdmin):
0
     fieldsets = (
0
@@ -25,8 +26,12 @@ class EmployeeAdmin(admin.ModelAdmin):
0
     list_display = ('name', 'gmt_offset', 'rate')
0
     search_fields = ('name',)
0
 
0
+class ProjectInvoiceInline(admin.TabularInline):
0
+    model = ProjectInvoice
0
+
0
 class ProjectAdmin(admin.ModelAdmin):
0
     list_display = ('name','start_date')
0
+    inlines = [ProjectInvoiceInline,]
0
     
0
 class ProjectTimeAdmin(admin.ModelAdmin):
0
     list_display = ('project', 'employee', 'hours', 'cost_converted')
...
1
2
 
 
 
 
 
3
...
 
1
2
3
4
5
6
7
0
@@ -1 +1,5 @@
0
-SEQUENCE = ['add_bid',]
0
\ No newline at end of file
0
+SEQUENCE = [
0
+    'add_bid',
0
+    'blank_fields',
0
+    'delete_bid',
0
+]
0
\ No newline at end of file
...
82
83
84
85
 
86
87
88
...
114
115
116
117
118
119
120
121
 
 
 
 
 
 
 
 
 
 
 
 
122
123
124
...
82
83
84
 
85
86
87
88
...
114
115
116
 
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
0
@@ -82,7 +82,7 @@ class Employee(Person):
0
         ('elance', 'Elance'),
0
         ('other', 'Other'),
0
     )
0
-    gmt_offset = models.DecimalField(max_digits=3, decimal_places=1)
0
+    gmt_offset = models.DecimalField(max_digits=3, decimal_places=1, null=True, blank=True)
0
     skills = TagField()
0
     payment_preference = models.CharField(blank=True, max_length=100, choices=PAYMENT_CHOICES)
0
     payment_notes = models.TextField(blank=True)
0
@@ -114,11 +114,22 @@ class Project(models.Model):
0
     name = models.CharField(max_length=100)
0
     employees = models.ManyToManyField(Employee)
0
     start_date = models.DateField()
0
-    bid = models.DecimalField(max_digits=8, decimal_places=2)
0
     active = models.BooleanField(default=True)
0
 
0
     def __unicode__(self):
0
         return self.name
0
+
0
+class ProjectInvoice(models.Model):
0
+    """
0
+    Invoice sent for project
0
+    
0
+    """
0
+    project = models.ForeignKey(Project)
0
+    date = models.DateField(default=datetime.date.today())
0
+    amount = models.DecimalField(max_digits=8, decimal_places=2)
0
+    
0
+    def __unicode__(self):
0
+        return "$%s for %s on %s" % (self.amount, self.project, self.date)
0
         
0
         
0
 class ProjectTime(models.Model):

Comments