def fetch_objects(self):
        self.agreement_id = intor(self.agreement_id)
        self.agreement = get_object_or_404(Agreement.objects.all(), pk=self.agreement_id)

        self.campaign = self.agreement.campaign if self.agreement else None

        self.errors = []
예제 #2
0
    def fetch_objects(self):
        self.agreement_id = intor(self.agreement_id)
        self.agreement = get_object_or_404(Agreement.objects.all(),
                                           pk=self.agreement_id)

        self.campaign = self.agreement.campaign if self.agreement else None

        self.errors = []
예제 #3
0
    def run_mock_credit(self, request):
        from credit_file import CreditFile

        social = settings.SOCIAL_CIPHER.decrypt_long_encoded(request.social_data, request.social_data_key)

        name = ' '.join(filter(None, [self.first_name, self.last_name]))
        beacon = intor(social[-3:], 601)
        mock = CreditFile(applicant=self,
            person_id=self.person_id,
            name=name,
            last_4 = social[-4:],
            run_request=request,
            generated_date=datetime.now(),
            bureau='equifax',
            beacon=intor(social[-3:], 601),
            transaction_id='Mock Credit',
            transaction_status='Done'
        )

        mock.status_string = 'APPROVED' if beacon >= settings.CREDIT_APPROVED_BEACON else 'DCS'
        print "MOCK CREDIT: ", mock.__dict__
        mock.save()
예제 #4
0
    def __init__(self, line, updater):
        self.updater = updater
        print "In IL init, line is %r" % (line, )
        self.code = line.get('code')
        self.quantity = intor(line.get('quantity'))
        self.line_type = line.get('line_type', 'TOP').upper()

        self.product = updater.products.get(self.code)
        self.price = updater.prices.get(self.code)
        self.parent = None  # incoming lines from json never have a parent.

        if not self.code or self.quantity is None:
            errors.append('Invalid invoiceline update: %r' % (line, ))
        elif not self.product:
            errors.append('The product %s could not be found.' % line.code)
예제 #5
0
    def __init__(self, line, updater):
        self.updater = updater
        print "In IL init, line is %r" % (line,)
        self.code = line.get('code')
        self.quantity = intor(line.get('quantity'))
        self.line_type = line.get('line_type', 'TOP').upper()

        self.product = updater.products.get(self.code)
        self.price = updater.prices.get(self.code)
        self.parent = None  # incoming lines from json never have a parent.

        if not self.code or self.quantity is None:
            errors.append('Invalid invoiceline update: %r' % (line,))
        elif not self.product:
            errors.append('The product %s could not be found.' % line.code)