source: treasury/vouchers/models.py @ 8fc315a

client
Last change on this file since 8fc315a was 31bd056, checked in by Alex Dehnert <adehnert@…>, 16 years ago

Add voucher support (WIP WIP WIP)

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[719e4bb]1from django.db import models
[13a23ce]2import settings
[f468e6d]3from finance_core.models import BudgetArea, BudgetTerm
[f186a0e]4
[93e2ab9]5import datetime
6
[f186a0e]7
[13a23ce]8class ReimbursementRequest(models.Model):
9    submitter = models.CharField(max_length=10) # MIT username of submitter
[a96d938]10    check_to_name = models.CharField(max_length=50, verbose_name="check recipient's name")
11    check_to_email = models.EmailField(verbose_name="email address for check pickup")
12    check_to_addr = models.TextField(blank=True, verbose_name="address for check mailing", help_text="For most requests, this should be blank for pickup in SAO (W20-549)")
[6b8d891]13    amount = models.DecimalField(max_digits=7, decimal_places=2, help_text='Do not include "$"')
[31bd056]14    budget_area = models.ForeignKey(BudgetArea, related_name='as_budget_area')
[13a23ce]15    budget_term = models.ForeignKey(BudgetTerm)
[31bd056]16    expense_area = models.ForeignKey(BudgetArea, related_name='as_expense_area') # ~GL
[6a867b3]17    request_time = models.DateTimeField(default=datetime.datetime.now)
[6b8d891]18    approval_time = models.DateTimeField(blank=True, null=True,)
19    printing_time = models.DateTimeField(blank=True, null=True,)
20    name = models.CharField(max_length=50, verbose_name='short description', )
21    description = models.TextField(blank=True, verbose_name='long description', )
[d7e325a]22
23    def __unicode__(self, ):
[3235c66]24        return "%s: %s (%s) (by %s) for $%s in %s during %s" % (
25            self.name,
[d7e325a]26            self.check_to_name,
27            self.check_to_email,
28            self.submitter,
29            self.amount,
30            self.budget_area.name,
31            self.budget_term.name,
32        )
[31bd056]33
34
35class Voucher(models.Model):
36    group_name = models.CharField(max_length=10)
37    account = models.IntegerField()
38    signatory = models.CharField(max_length=50)
39    first_name = models.CharField(max_length=20)
40    last_name = models.CharField(max_length=20)
41    email_address = models.EmailField(max_length=50)
42    mailing_address = models.TextField()
43    amount = models.DecimalField(max_digits=7, decimal_places=2,)
44    description = models.TextField()
45    gl = models.IntegerField()
Note: See TracBrowser for help on using the repository browser.