Пример #1
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_433a()
     dsync = DataSync(self.client)
     for f in self.fields:
         value = dsync.get(f)
         if value:
             self.fields[f].initial = value
     pprocs_count, ccs_count, banks_count, accrec_count, busass_count = 0, 0, 0, 0, 0
     if self.instance.pk:
         pprocs_count = self.instance.paymentprocessors.count()
         ccs_count = self.instance.businessccs.count()
         banks_count = self.instance.businessbankaccs.count()
         accrec_count = self.instance.accountsreceivables.count()
         busass_count = self.instance.businessassets.count()
         self.fields['is_self_employed'].initial = True
     self.add_subform_checkbox('has_payment_processors', PaymentProcessorInfoForm.prefix,
                               reltype='1xn', count=pprocs_count, max_count=2)
     self.add_subform_checkbox('has_creditcards', BusinessCreditCardInfoForm.prefix,
                               reltype='1xn', count=ccs_count, max_count=3)
     self.add_subform_checkbox('has_bank_account', BusinessBankAccountInfoForm.prefix,
                               reltype='1xn', count=banks_count, max_count=2)
     self.add_subform_checkbox('has_accounts_receivable', AccountsReceivableInfoForm.prefix,
                               reltype='1xn', count=accrec_count, max_count=5)
     self.add_subform_checkbox('has_business_assets', BusinessAssetInfoForm.prefix,
                               reltype='1xn', count=busass_count, max_count=2)
     self.set_widget_class('total_cash_in_banks', 'showhidewith-chk-' + BusinessBankAccountInfoForm.prefix)
     self.set_widget_class('bank_balance_date', 'showhidewith-chk-' + BusinessBankAccountInfoForm.prefix)
     self.set_widget_class('outstanding_balance', 'showhidewith-chk-' + AccountsReceivableInfoForm.prefix)
     self.set_widget_class('total_equity', 'showhidewith-chk-' + BusinessAssetInfoForm.prefix)
     self.set_widget_class('business_zipcode', 'zip-field')
     self.reinit_widgets()
Пример #2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_656()
     dsync = DataSync(self.client, ignore='form656')
     income = dsync.get('net_difference', lambda: 0)()
     self.fields['income_info'].widget.html_text = '<span class="irsexpress_info">The Tax Payer’s available ' + \
         'monthly income is <span class="data">$%s</span></span>' % intcomma_force(income)
     self.fields['monthly_income'].initial = income
     self.fields['suggestion_lumpsum'].widget.html_text = \
         'The Taxpayer is <span class="decision"><span id="lumpsum_decision">NOT</span> eligible</span> ' + \
         'for an Offer in Compromise'
     chk_fields = [('lump_sum_cash', 'debt_total', 'assessed_date', 'monthly_income',
                    'statute_exp_date', 'statute_months_avail', 'can_pay', 'suggestion_lumpsum', 'suggested_amount',
                    'offer_amount_lumpsum', 'initial_payment', 'remaining_balance',
                    'payment_1', 'payment_2', 'payment_3', 'payment_4', 'payment_5', ),
                   ('periodic_payment', 'offer_amount_period', 'offer_included', 'monthly_payment', 'payment_day',
                    'pay_months', 'final_payment', 'final_payment_day', 'final_pay_month',),
                   ]
     for cf_elems in chk_fields:
         cf, *deps = cf_elems
         self.set_widget_class(cf, 'chk-radiogroup radiogroup-p5')
         self.fields[cf].widget.attrs.update({'data-radiogroup': 'radiogroup-p5'})
         self.fields[cf].widget.attrs.update({'data-dep_rows': ' '.join(("%s" % (d) for d in deps))})
         if not getattr(self.instance, cf):
             for d in deps:
                 self.set_widget_class(d, 'hidden')
     self.reinit_widgets()
Пример #3
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     dsync = DataSync(self.client, ignore='form656')
     for f in self.fields:
         self.fields[f].initial = dsync.get('business_%s' % f)
     self.fields['ein'].initial = dsync.get('ein')
     self.fields['phone'].initial = dsync.get('phone_work')
     self.set_widget_class('zipcode', 'zip-field')
Пример #4
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_9465()
     dsync = DataSync(self.client, ignore='form9465')
     for f in self.fields:
         self.fields[f].initial = dsync.get(f)
     self.set_widget_class('employer_zipcode', 'zip-field')
     self.set_widget_class('bank_zipcode', 'zip-field')
     self.reinit_widgets()
Пример #5
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     dsync = DataSync(self.client, ignore='form433a')
     for f in self.fields:
         v = dsync.get('spouse_%s' % f)
         if v:
             self.fields[f].initial = v
     self.fields['return_with'].initial = dsync.get('jointoffer')
     self.set_widget_class('ssn', 'ssn-field')
Пример #6
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     dsync = DataSync(self.client)
     home_location = {}
     for af in ('street', 'city', 'state_name', 'zipcode', 'county'):
         home_location["location_" + af] = dsync.get(af)
     if home_location['location_county']:
         home_location['location_county'] = home_location['location_county'].id
     self.fields['home_location'].initial = json.dumps(home_location)
     self.fields['market_value'].widget.set_class('pafmv_clb pamarket_value')
     self.fields['current_loan_balance'].widget.set_class('pafmv_clb pacurrent_loan_balance')
     self.set_widget_class('location_zipcode', 'zip-field')
     self.set_widget_class('home_location', 'home_location')
Пример #7
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_9465()
     dsync = DataSync(self.client, ignore='form9465')
     for f in self.fields:
         self.fields[f].initial = dsync.get(f)
     if self.instance.pk:
         self.fields['jointoffer_b'].initial = self.instance.jointoffer is not None
     else:
         self.fields['jointoffer_b'].initial = dsync.get('jointoffer')
     self.set_widget_class('ssn', 'ssn-field')
     self.set_widget_class('zipcode', 'zip-field')
     self.add_subform_checkbox('jointoffer_b', ClientSpouseForm.prefix)
     self.reinit_widgets()
Пример #8
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_8821()
     dsync = DataSync(self.client, ignore='form8821')
     for f in self.fields:
         self.fields[f].initial = dsync.get(f)
     self.set_widget_class('zipcode', 'zip-field')
     self.set_widget_class('ssn', 'ssn-field')
     # self.set_widget_class('app_zipcode', 'zip-field')
     # self.set_widget_class('app_caf', 'caf-field')
     # self.set_widget_class('app_ptin', 'ptin-field')
     self.add_subform_checkbox('specific_use_caf_recorded',
                               SpecificUseForm.prefix)
     self.reinit_widgets()
Пример #9
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_8821spouse()
     dsync = DataSync(self.client, ignore='form8821')
     for f in self.fields:
         self.fields[f].initial = dsync.get('spouse_' + f)
     # spouse's address might be the same as for taxpayer
     for f in ['apt', 'street', 'city', 'state_name', 'zipcode', 'county']:
         self.fields[f].initial = dsync.get(f)
     self.set_widget_class('zipcode', 'zip-field')
     self.set_widget_class('ssn', 'ssn-field')
     # self.set_widget_class('app_zipcode', 'zip-field')
     # self.set_widget_class('app_caf', 'caf-field')
     # self.set_widget_class('app_ptin', 'ptin-field')
     self.add_subform_checkbox('specific_use_caf_recorded',
                               SpecificUseSpouseForm.prefix)
     self.reinit_widgets()
Пример #10
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_656()
     dsync = DataSync(self.client, ignore='form656')
     for f in self.fields:
         self.fields[f].initial = dsync.get(f)
     self.set_widget_class('ssn', 'ssn-field')
     self.set_widget_class('zipcode', 'zip-field')
     if self.instance.pk:
         self.fields['jointoffer_b'].initial = self.instance.jointoffer is not None
         self.fields['has_business'].initial = self.instance.businessinfo is not None
     else:
         self.fields['jointoffer_b'].initial = dsync.get('jointoffer')
     self.add_subform_checkbox('jointoffer_b', ClientSpouseForm.prefix)
     self.add_subform_checkbox('has_mailaddr', MailingAddressForm.prefix)
     self.add_subform_checkbox('has_business', BusinessInformationForm.prefix)
     self.reinit_widgets()
Пример #11
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_9465()
     self.fields['married'].widget.attrs.update({
         'data-on-text': 'Married', 'data-off-text': 'Unmarried',
         'data-on-color': 'success', 'data-off-color': 'primary',
     })
     dsync = DataSync(self.client, ignore='form9465')
     self.fields['county'].initial = dsync.get('county')
     self.fields['married'].initial = dsync.get('married')
     self.fields['expenses_shared'].initial = dsync.get('jointoffer')
     self.fields['pay_period'].initial = dsync.get('pay_period')
     self.fields['spouse_pay_period'].initial = dsync.get('spouse_pay_period')
     self.fields['vehicles'].initial = dsync.get('vehicles_count')
     hh = dsync.get('health_insurance')
     if hh:
         self.fields['has_health_insurance'].initial = hh > 0
     # for f in self.fields:
     #     self.fields[f].initial = dsync.get(f)
     self.reinit_widgets()
Пример #12
0
def get_low_income_suggestion(client):
    dsync = DataSync(client)
    state_name = dsync.get('state_name')
    total_income = dsync.get('total_income', lambda: 0)()
    family_size = dsync.get('family_size', lambda: 0)()
    usestate = 0
    maxincome = 0
    if state_name == 'HI':  # Hawaii
        usestate = 1
    elif state_name == 'AK':  # Alaska
        usestate = 2
    if family_size <= 8:
        maxincome = MAX_INCOME[family_size][usestate]
    else:
        maxincome = MAX_INCOME[8][usestate] + MAX_INCOME[0][usestate] * (
            family_size - 8)
    decision = 'DO NOT'
    if total_income < maxincome:
        decision = 'DO'
    return decision, LOW_INCOME_SUGGEST_TPL.format(
        total_income=intcomma_force(total_income),
        family_size=family_size,
        state_name=STATE_CODE2NAME[state_name],
        decision=decision)
Пример #13
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.instance.form = self.client.get_form_433a()
     dsync = DataSync(self.client, ignore='form433a')
     for f in self.fields:
         v = dsync.get(f)
         if v:
             self.fields[f].initial = v
     self.fields['married'].widget.attrs.update({
         'data-on-text': 'Married', 'data-off-text': 'Unmarried',
         'data-on-color': 'success', 'data-off-color': 'primary',
     })
     dep_count = 0
     self.set_widget_class('ssn', 'ssn-field')
     self.set_widget_class('zipcode', 'zip-field')
     if self.instance.pk:
         dep_count = len(self.instance.dependents.all())
         self.fields['married'].initial = self.instance.spouse is not None
     else:
         self.fields['married'].initial = dsync.get('married', None) is not None
     self.add_subform_checkbox('married', ClientSpouseForm.prefix)
     self.add_subform_checkbox('has_deps', ClientDependentForm.prefix,
                               reltype='1xn', count=dep_count, max_count=30)
     self.reinit_widgets()
Пример #14
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     if self.client:
         dsync = DataSync(self.client)
         self.fields['pp_debt_total'].initial = dsync.get('debt_total',
                                                          0) or 15000
         income = dsync.get('net_difference', lambda: 0)()
         if income == 0:
             income = dsync.get('monthly_income', 0)
         self.fields['pp_monthly_income'].initial = income or 200
         self.fields['pp_assessed_date'].initial = dsync.get(
             'assessed_date') or timezone.datetime(2009, 2, 5)
         self.fields['pp_offer_amount'].initial = dsync.get(
             'offer_amount', 0)
Пример #15
0
 def __init__(self, *args, **kwargs):
     formpage2 = kwargs.get('formpage', None)
     super().__init__(*args, **kwargs)
     dsync = DataSync(self.client, ignore='form433a')
     if self.prefix == 'taxpayer':
         for f in self.fields:
             v = dsync.get('employer_%s' % f)
             if v:
                 self.fields[f].initial = v
         self.fields['employer_name'].initial = dsync.get('employer_name')
         self.fields['pay_period'].initial = dsync.get('pay_period')
         self.fields['phone_work'].initial = dsync.get('phone_work')
     elif self.prefix == 'spouse':
         self.fields['pay_period'].initial = dsync.get('spouse_pay_period')
     self.set_widget_class('zipcode', 'zip-field')
Пример #16
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.set_widget_class('ssn', 'ssn-field')
     dsync = DataSync(self.client, ignore='form9465')
     for f in self.fields:
         self.fields[f].initial = dsync.get('spouse_%s' % f)