fixed missing field, updated for 2012
This commit is contained in:
parent
717f929015
commit
6abfa5b345
4 changed files with 19 additions and 9 deletions
|
@ -16,9 +16,16 @@ RECORD_TYPES = [
|
|||
|
||||
def test():
|
||||
import record, model
|
||||
from fields import ValidationError
|
||||
for rname in RECORD_TYPES:
|
||||
inst = record.__dict__[rname]()
|
||||
print type(inst), inst.record_identifier, len(inst.output())
|
||||
try:
|
||||
output_length = len(inst.output())
|
||||
except ValidationError, e:
|
||||
print e.msg, type(inst), inst.record_identifier
|
||||
continue
|
||||
|
||||
print type(inst), inst.record_identifier, output_length
|
||||
|
||||
|
||||
def test_dump():
|
||||
|
|
|
@ -2,6 +2,7 @@ from fields import Field, ValidationError
|
|||
import copy
|
||||
import pdb
|
||||
|
||||
|
||||
class Model(object):
|
||||
record_identifier = ' '
|
||||
required = False
|
||||
|
@ -53,7 +54,7 @@ class Model(object):
|
|||
def output(self):
|
||||
result = ''.join([self.record_identifier] + [field.get_data() for field in self.get_sorted_fields()])
|
||||
if len(result) != 512:
|
||||
raise ValidationError("Record result length not equal to 512 bytes")
|
||||
raise ValidationError("Record result length not equal to 512 bytes (%d)" % len(result))
|
||||
return result
|
||||
|
||||
def read(self, fp):
|
||||
|
|
|
@ -151,6 +151,7 @@ class EmployeeWageRecord(model.Model):
|
|||
location_address = TextField(max_length=22)
|
||||
delivery_address = TextField(max_length=22)
|
||||
city = TextField(max_length=22)
|
||||
city = TextField(max_length=22)
|
||||
state = StateField()
|
||||
zipcode = TextField(max_length=5, required=False)
|
||||
zipcode_ext = TextField(max_length=4, required=False)
|
||||
|
@ -172,23 +173,24 @@ class EmployeeWageRecord(model.Model):
|
|||
deferred_compensation_408k = MoneyField(max_length=11, required=False)
|
||||
deferred_compensation_457b = MoneyField(max_length=11, required=False)
|
||||
deferred_compensation_501c = MoneyField(max_length=11, required=False)
|
||||
military_pay = MoneyField(max_length=11, required=False)
|
||||
blank2 = BlankField(max_length=11)
|
||||
non_qualified_457 = MoneyField(max_length=11, required=False)
|
||||
employer_contrib_to_hsa = MoneyField(max_length=11, required=False)
|
||||
non_qualified_not_457 = MoneyField(max_length=11, required=False)
|
||||
nontaxable_combat_pay = MoneyField(max_length=11, required=False)
|
||||
blank2 = BlankField(max_length=11)
|
||||
blank3 = BlankField(max_length=11)
|
||||
cost_of_premiums_for_insurance = MoneyField(max_length=11, required=False)
|
||||
income_nonstatutory_stock_opts = MoneyField(max_length=11, required=False)
|
||||
deferred_compensation_409a = MoneyField(max_length=11, required=False)
|
||||
designated_roth_contrib_401k = MoneyField(max_length=11, required=False)
|
||||
designated_roth_contrib_403b = MoneyField(max_length=11, required=False)
|
||||
blank3 = BlankField(max_length=12)
|
||||
employer_sponsored_health = MoneyField(max_length=11, required=False)
|
||||
blank4 = BlankField(max_length=12)
|
||||
statutory_employee_indicator = BooleanField()
|
||||
blank4 = BlankField(max_length=1)
|
||||
blank5 = BlankField(max_length=1)
|
||||
retirement_plan_indicator = BooleanField()
|
||||
third_party_sick_pay = BooleanField()
|
||||
blank5 = BlankField(max_length=23)
|
||||
blank6 = BlankField(max_length=23)
|
||||
|
||||
def validate_ssn(self, f):
|
||||
if str(f.value).startswith('666','9'):
|
||||
|
|
2
setup.py
2
setup.py
|
@ -1,6 +1,6 @@
|
|||
from distutils.core import setup
|
||||
setup(name='pyaccuwage',
|
||||
version='0.0.7',
|
||||
version='0.2012.0',
|
||||
packages=['pyaccuwage'],
|
||||
scripts=['scripts/pyaccuwage-parse', 'scripts/pyaccuwage-pdfparse'],
|
||||
zip_safe=True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue