Added load/dump methods which work similarly to those found in
simplejson. Tests seem to work so far. Still need to figure out how to get data into the records in some easy way.
This commit is contained in:
parent
a32feb79ed
commit
068f1bbae4
4 changed files with 118 additions and 34 deletions
29
record.py
29
record.py
|
@ -1,8 +1,14 @@
|
|||
from fields import *
|
||||
import model
|
||||
from fields import *
|
||||
|
||||
__all__ = ['SubmitterRecord', 'EmployerRecord',
|
||||
'EmployeeWageRecord', 'OptionalEmployeeWageRecord',
|
||||
'TotalRecord', 'OptionalTotalRecord',
|
||||
'StateTotalRecord', 'FinalRecord',]
|
||||
|
||||
class SubmitterRecord(model.Model):
|
||||
record_identifier = StaticField(value='ra')
|
||||
record_identifier = 'RA'
|
||||
|
||||
submitter_ein = NumericField(max_length=9)
|
||||
user_id = TextField(max_length=8)
|
||||
software_vendor = TextField(max_length=4)
|
||||
|
@ -44,7 +50,8 @@ class SubmitterRecord(model.Model):
|
|||
blank6 = BlankField(max_length=12)
|
||||
|
||||
class EmployerRecord(model.Model):
|
||||
record_identifier = StaticField(value='re')
|
||||
record_identifier = 'RE'
|
||||
|
||||
tax_year = NumericField(max_length=4)
|
||||
agent_indicator = NumericField(max_length=1)
|
||||
employer_ein = TextField(max_length=9)
|
||||
|
@ -69,7 +76,8 @@ class EmployerRecord(model.Model):
|
|||
blank2 = BlankField(max_length=291)
|
||||
|
||||
class EmployeeWageRecord(model.Model):
|
||||
record_identifier = StaticField(value='rw')
|
||||
record_identifier = 'RW'
|
||||
|
||||
ssn = NumericField(max_length=9, required=False)
|
||||
employee_first_name = TextField(max_length=15)
|
||||
employee_middle_name = TextField(max_length=15)
|
||||
|
@ -119,7 +127,8 @@ class EmployeeWageRecord(model.Model):
|
|||
|
||||
|
||||
class OptionalEmployeeWageRecord(model.Model):
|
||||
record_identifier = StaticField(value='ro')
|
||||
record_identifier = 'RO'
|
||||
|
||||
blank1 = BlankField(max_length=9)
|
||||
allocated_tips = NumericField(max_length=11)
|
||||
uncollected_tax_on_tips = NumericField(max_length=11)
|
||||
|
@ -145,10 +154,11 @@ class OptionalEmployeeWageRecord(model.Model):
|
|||
|
||||
|
||||
class TotalRecord(model.Model):
|
||||
record_identifier = StaticField(value='rt')
|
||||
record_identifier = 'RT'
|
||||
|
||||
class OptionalTotalRecord(model.Model):
|
||||
record_identifier = StaticField(value='ru')
|
||||
record_identifier = 'RU'
|
||||
|
||||
number_of_ro_records = NumericField(max_length=7)
|
||||
allocated_tips = NumericField(max_length=15)
|
||||
uncollected_tax_on_tips = NumericField(max_length=15)
|
||||
|
@ -173,11 +183,12 @@ class OptionalTotalRecord(model.Model):
|
|||
|
||||
|
||||
class StateTotalRecord(model.Model):
|
||||
record_identifier = StaticField(value='rv')
|
||||
record_identifier = 'RV'
|
||||
supplemental_data = TextField(max_length=510)
|
||||
|
||||
class FinalRecord(model.Model):
|
||||
record_identifier = StaticField(value='rf')
|
||||
record_identifier = 'RF'
|
||||
|
||||
blank1 = BlankField(max_length=5)
|
||||
number_of_rw_records = NumericField(max_length=9)
|
||||
blank2 = BlankField(max_length=496)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue