Skip to content

Commit

Permalink
Merge branch 'master' of github.com:california-civic-data-coalition/d…
Browse files Browse the repository at this point in the history
…jango-calaccess-processed-data
  • Loading branch information
palewire committed Nov 14, 2017
2 parents 4292f5c + bbbb3fe commit fc3bd4b
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 12 deletions.
45 changes: 45 additions & 0 deletions calaccess_processed/migrations/0013_auto_20171114_1957.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-11-14 19:57
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('calaccess_processed', '0012_auto_20171110_2057'),
]

operations = [
migrations.AlterField(
model_name='form460scheduleaitem',
name='transaction_type',
field=models.CharField(help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)', max_length=50, verbose_name='transaction type'),
),
migrations.AlterField(
model_name='form460scheduleaitemversion',
name='transaction_type',
field=models.CharField(help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)', max_length=50, verbose_name='transaction type'),
),
migrations.AlterField(
model_name='form460schedulecitem',
name='transaction_type',
field=models.CharField(help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)', max_length=50, verbose_name='transaction type'),
),
migrations.AlterField(
model_name='form460schedulecitemversion',
name='transaction_type',
field=models.CharField(help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)', max_length=50, verbose_name='transaction type'),
),
migrations.AlterField(
model_name='form460scheduleiitem',
name='transaction_type',
field=models.CharField(help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)', max_length=50, verbose_name='transaction type'),
),
migrations.AlterField(
model_name='form460scheduleiitemversion',
name='transaction_type',
field=models.CharField(help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)', max_length=50, verbose_name='transaction type'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@ class CampaignContributionBase(CalAccessBaseModel):
help_text='End date for late contributions received over a range of '
'days (from RCPT_CD.DATE_THRU)',
)
TRANSACTION_TYPE_CHOICES = (
('F', 'Forgiven Loan'),
('I', 'Intermediary'),
('R', 'Returned (Negative Amount?)'),
('T', 'Third Party Repayment'),
('X', 'Transfer'),
)
transaction_type = models.CharField(
verbose_name='transaction type',
max_length=1,
choices=TRANSACTION_TYPE_CHOICES,
max_length=50,
help_text='Type of transaction (from RCPT_CD.TRAN_TYPE)',
)
transaction_id = models.CharField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ SELECT
rcpt."LINE_ITEM" AS line_item,
rcpt."RCPT_DATE" AS date_received,
rcpt."DATE_THRU" AS date_received_thru,
UPPER(rcpt."TRAN_TYPE") AS transaction_type,
CASE
WHEN UPPER(rcpt."TRAN_TYPE") = 'F' THEN 'Forgiven Loan'
WHEN UPPER(rcpt."TRAN_TYPE") = 'I' THEN 'Intermediary'
WHEN UPPER(rcpt."TRAN_TYPE") = 'R' THEN 'Returned'
WHEN UPPER(rcpt."TRAN_TYPE") = 'T' THEN 'Third Party Repayment'
WHEN UPPER(rcpt."TRAN_TYPE") = 'X' THEN 'Transfer'
ELSE ''
END AS transaction_type,
rcpt."TRAN_ID" AS transaction_id,
rcpt."MEMO_REFNO" AS memo_reference_number,
CASE rcpt."ENTITY_CD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ SELECT
rcpt."LINE_ITEM" AS line_item,
rcpt."RCPT_DATE" AS date_received,
rcpt."DATE_THRU" AS date_received_thru,
UPPER(rcpt."TRAN_TYPE") AS transaction_type,
CASE
WHEN UPPER(rcpt."TRAN_TYPE") = 'F' THEN 'Forgiven Loan'
WHEN UPPER(rcpt."TRAN_TYPE") = 'I' THEN 'Intermediary'
WHEN UPPER(rcpt."TRAN_TYPE") = 'R' THEN 'Returned'
WHEN UPPER(rcpt."TRAN_TYPE") = 'T' THEN 'Third Party Repayment'
WHEN UPPER(rcpt."TRAN_TYPE") = 'X' THEN 'Transfer'
ELSE ''
END AS transaction_type,
rcpt."TRAN_ID" AS transaction_id,
rcpt."MEMO_REFNO" AS memo_reference_number,
CASE rcpt."ENTITY_CD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ SELECT
rcpt."LINE_ITEM" AS line_item,
rcpt."RCPT_DATE" AS date_received,
rcpt."DATE_THRU" AS date_received_thru,
UPPER(rcpt."TRAN_TYPE") AS transaction_type,
CASE
WHEN UPPER(rcpt."TRAN_TYPE") = 'F' THEN 'Forgiven Loan'
WHEN UPPER(rcpt."TRAN_TYPE") = 'I' THEN 'Intermediary'
WHEN UPPER(rcpt."TRAN_TYPE") = 'R' THEN 'Returned'
WHEN UPPER(rcpt."TRAN_TYPE") = 'T' THEN 'Third Party Repayment'
WHEN UPPER(rcpt."TRAN_TYPE") = 'X' THEN 'Transfer'
ELSE ''
END AS transaction_type,
rcpt."TRAN_ID" AS transaction_id,
rcpt."MEMO_REFNO" AS memo_reference_number,
CASE rcpt."ENTITY_CD"
Expand Down

0 comments on commit fc3bd4b

Please sign in to comment.