Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partner forms #3034

Open
wants to merge 38 commits into
base: epd
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
016462f
face forms alpha
roman-karpovich Jul 8, 2021
7e704ba
Merge branch 'epd' into eface-forms
roman-karpovich Jul 9, 2021
75b80a5
partner forms permissions backbone
roman-karpovich Jul 9, 2021
9d8371f
add form activity kind
roman-karpovich Jul 12, 2021
288464e
update form statuses according to clarified flow
roman-karpovich Jul 12, 2021
3eb2733
tests fix
roman-karpovich Jul 13, 2021
523bd5e
configure permissions matrix
roman-karpovich Jul 14, 2021
41bab72
add missing migration
roman-karpovich Jul 20, 2021
866b7cf
add activities list to form details
roman-karpovich Jul 20, 2021
7223075
add form totals;
roman-karpovich Jul 22, 2021
ba4a898
updated month/date format to use slash divider
roman-karpovich Jul 22, 2021
4da8add
update activities through form api
roman-karpovich Jul 22, 2021
d4d9e30
eface form admin panel
roman-karpovich Jul 22, 2021
4904c04
add user title to details
roman-karpovich Jul 22, 2021
7ec665c
updated form activities validation
roman-karpovich Jul 22, 2021
2fab25b
fixed required attribute on form activities
roman-karpovich Jul 23, 2021
8e9f2f0
fixed form actions list
roman-karpovich Jul 23, 2021
6c4b90a
fixed permissions for rejection/transaction rejection reason
roman-karpovich Jul 23, 2021
0082f29
add users list with titles
roman-karpovich Jul 26, 2021
f850010
Merge branch 'epd' into eface-forms
roman-karpovich Jul 26, 2021
e36879b
fix cancel action for partner user
roman-karpovich Jul 29, 2021
5c2ead9
fix import error
roman-karpovich Jul 29, 2021
a2e3fc5
remove title field and add currency
roman-karpovich Aug 3, 2021
43f0185
add intervention reference number to list
roman-karpovich Aug 3, 2021
08a3c70
add missing migration
roman-karpovich Aug 3, 2021
2ceb35c
add branch to ci
robertavram Aug 3, 2021
b117a4b
Merge branch 'epd' into eface-forms
robertavram Aug 4, 2021
042ea83
add submit action for partner if form in rejected status
roman-karpovich Aug 5, 2021
5c4b32f
Merge remote-tracking branch 'github/eface-forms' into eface-forms
roman-karpovich Aug 5, 2021
c04121f
Merge branch 'epd' into eface-forms
roman-karpovich Aug 6, 2021
add9524
Merge branch 'epd-update-08-26' into eface-forms
roman-karpovich Aug 27, 2021
6782ffd
Merge branch 'epd' into eface-forms
robertavram Apr 11, 2022
3084bd4
flake
robertavram Apr 11, 2022
76d74b3
fix syntax error
roman-karpovich Apr 11, 2022
d2e285d
fix urls
roman-karpovich Apr 11, 2022
62406bf
repath
robertavram Apr 11, 2022
e888d3e
Merge branch 'eface-forms' of https://github.com/unicef/etools into e…
robertavram Apr 11, 2022
aabde9a
Merge branch 'epd' into eface-forms
robertavram Sep 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
environment:
PGHOST: 127.0.0.1
DATABASE_URL: "postgis://postgres:postgres@localhost:5432/circle_test"
DEPLOY_BRANCHES: "develop|staging|master|ci-updates2|epd"
DEPLOY_BRANCHES: "develop|staging|master|ci-updates2|epd|eface-forms"
- image: cimg/postgres:12.9-postgis
environment:
POSTGRES_USER: postgres
Expand Down
1 change: 1 addition & 0 deletions src/etools/applications/core/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def import_permissions(model_name):
'Assessment': settings.PACKAGE_ROOT + '/applications/psea/permission_matrix/assessment_permissions.csv',
'MonitoringActivity': settings.PACKAGE_ROOT + '/applications/field_monitoring/planning/'
'activity_validation/permissions_matrix.csv',
'EFaceForm': settings.PACKAGE_ROOT + '/applications/eface/validation/permissions_matrix.csv',
'Trip': settings.PACKAGE_ROOT + '/applications/travel/permission_matrix/trip_permissions.csv',
}

Expand Down
Empty file.
14 changes: 14 additions & 0 deletions src/etools/applications/eface/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.contrib import admin

from etools.applications.eface.models import EFaceForm, FormActivity


class FormActivityAdmin(admin.StackedInline):
model = FormActivity


@admin.register(EFaceForm)
class EFaceFormAdmin(admin.ModelAdmin):
list_display = ('reference_number', 'request_type', 'status')
list_filter = ('status',)
search_fields = ('reference_number',)
12 changes: 12 additions & 0 deletions src/etools/applications/eface/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django_filters import rest_framework as filters

from etools.applications.eface.models import EFaceForm


class EFaceFormFilterSet(filters.FilterSet):
class Meta:
model = EFaceForm
fields = {
'created': ['gte', 'lte'],
'status': ['exact', 'in'],
}
74 changes: 74 additions & 0 deletions src/etools/applications/eface/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Generated by Django 2.2.20 on 2021-07-09 08:58

import datetime
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
from django.utils.timezone import utc
import django.utils.timezone
import django_fsm
import model_utils.fields
import unicef_djangolib.fields


class Migration(migrations.Migration):

initial = True

dependencies = [
('partners', '0086_intervention_accepted_on_behalf_of_partner'),
]

operations = [
migrations.CreateModel(
name='EFaceForm',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('deleted_at', models.DateTimeField(default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=utc), verbose_name='Deleted At')),
('reference_number_year', models.IntegerField()),
('reference_number', models.CharField(blank=True, max_length=64, null=True, unique=True, verbose_name='Reference Number')),
('title', models.CharField(max_length=255)),
('currency', unicef_djangolib.fields.CurrencyField(blank=True, choices=[('GIP', 'GIP'), ('KPW', 'KPW'), ('XEU', 'XEU'), ('BHD', 'BHD'), ('BIF', 'BIF'), ('BMD', 'BMD'), ('BSD', 'BSD'), ('AFN', 'AFN'), ('ALL', 'ALL'), ('AMD', 'AMD'), ('AUD', 'AUD'), ('AZN', 'AZN'), ('BAM', 'BAM'), ('BBD', 'BBD'), ('BDT', 'BDT'), ('BZD', 'BZD'), ('CUP1', 'CUP1'), ('BTN', 'BTN'), ('ZWL', 'ZWL'), ('AWG', 'AWG'), ('CUC', 'CUC'), ('VEF01', 'VEF01'), ('BND', 'BND'), ('BRL', 'BRL'), ('ARS', 'ARS'), ('ETB', 'ETB'), ('EUR', 'EUR'), ('FJD', 'FJD'), ('GBP', 'GBP'), ('GEL', 'GEL'), ('GHS', 'GHS'), ('GNF', 'GNF'), ('GTQ', 'GTQ'), ('GYD', 'GYD'), ('HNL', 'HNL'), ('CAD', 'CAD'), ('CDF', 'CDF'), ('CLP', 'CLP'), ('CNY', 'CNY'), ('COP', 'COP'), ('CRC', 'CRC'), ('CUP', 'CUP'), ('CVE', 'CVE'), ('DJF', 'DJF'), ('DKK', 'DKK'), ('DOP', 'DOP'), ('DZD', 'DZD'), ('EGP', 'EGP'), ('HRK', 'HRK'), ('LVL', 'LVL'), ('LYD', 'LYD'), ('MAD', 'MAD'), ('MGA', 'MGA'), ('MKD', 'MKD'), ('KWD', 'KWD'), ('KYD', 'KYD'), ('LBP', 'LBP'), ('LKR', 'LKR'), ('MDL', 'MDL'), ('KZT', 'KZT'), ('LRD', 'LRD'), ('BOB', 'BOB'), ('HKD', 'HKD'), ('CHF', 'CHF'), ('KES', 'KES'), ('MYR', 'MYR'), ('NGN', 'NGN'), ('KMF', 'KMF'), ('SCR', 'SCR'), ('SEK', 'SEK'), ('TTD', 'TTD'), ('PKR', 'PKR'), ('NIO', 'NIO'), ('RWF', 'RWF'), ('BWP', 'BWP'), ('JMD', 'JMD'), ('TJS', 'TJS'), ('UYU', 'UYU'), ('RON', 'RON'), ('PYG', 'PYG'), ('SYP', 'SYP'), ('LAK', 'LAK'), ('ERN', 'ERN'), ('SLL', 'SLL'), ('PLN', 'PLN'), ('JOD', 'JOD'), ('ILS', 'ILS'), ('AED', 'AED'), ('NPR', 'NPR'), ('NZD', 'NZD'), ('SGD', 'SGD'), ('JPY', 'JPY'), ('PAB', 'PAB'), ('ZMW', 'ZMW'), ('CZK', 'CZK'), ('SOS', 'SOS'), ('LTL', 'LTL'), ('KGS', 'KGS'), ('SHP', 'SHP'), ('BGN', 'BGN'), ('TOP', 'TOP'), ('MVR', 'MVR'), ('VEF02', 'VEF02'), ('TMT', 'TMT'), ('GMD', 'GMD'), ('MZN', 'MZN'), ('RSD', 'RSD'), ('MWK', 'MWK'), ('PGK', 'PGK'), ('MXN', 'MXN'), ('XAF', 'XAF'), ('VND', 'VND'), ('INR', 'INR'), ('NOK', 'NOK'), ('XPF', 'XPF'), ('SSP', 'SSP'), ('IQD', 'IQD'), ('SRD', 'SRD'), ('SAR', 'SAR'), ('XCD', 'XCD'), ('IRR', 'IRR'), ('KPW01', 'KPW01'), ('HTG', 'HTG'), ('IDR', 'IDR'), ('XOF', 'XOF'), ('ISK', 'ISK'), ('ANG', 'ANG'), ('NAD', 'NAD'), ('MMK', 'MMK'), ('STD', 'STD'), ('VUV', 'VUV'), ('LSL', 'LSL'), ('SVC', 'SVC'), ('KHR', 'KHR'), ('SZL', 'SZL'), ('RUB', 'RUB'), ('UAH', 'UAH'), ('UGX', 'UGX'), ('THB', 'THB'), ('AOA', 'AOA'), ('YER', 'YER'), ('USD', 'USD'), ('UZS', 'UZS'), ('OMR', 'OMR'), ('SBD', 'SBD'), ('TZS', 'TZS'), ('SDG', 'SDG'), ('WST', 'WST'), ('QAR', 'QAR'), ('MOP', 'MOP'), ('MRU', 'MRU'), ('VEF', 'VEF'), ('TRY', 'TRY'), ('ZAR', 'ZAR'), ('HUF', 'HUF'), ('MUR', 'MUR'), ('PHP', 'PHP'), ('BYN', 'BYN'), ('KRW', 'KRW'), ('TND', 'TND'), ('MNT', 'MNT'), ('PEN', 'PEN')], default='', max_length=5, verbose_name='Currency')),
('request_type', models.CharField(choices=[('dct', 'Direct Cash Transfer'), ('rmb', 'Reimbursement'), ('dp', 'Direct Payment')], max_length=3)),
('request_represents_expenditures', models.BooleanField(default=False)),
('expenditures_disbursed', models.BooleanField(default=False)),
('notes', models.TextField(blank=True)),
('authorized_amount_date', models.DateField(blank=True, null=True)),
('requested_amount_date', models.DateField(blank=True, null=True)),
('status', django_fsm.FSMField(choices=[('draft', 'Draft'), ('submitted', 'Submitted'), ('unicef_approved', 'UNICEF Approved'), ('finalized', 'Finalized'), ('cancelled', 'Cancelled')], default='draft', max_length=20, verbose_name='Status')),
('date_submitted', model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'b', 's', 'e', 't', 'u', 'd', 'm', 'i'})),
('date_unicef_approved', model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'p', '_', 'o', 'c', 'u', 'd', 'a', 'v', 'f', 'i', 'n', 'r'})),
('date_transaction_rejected', models.DateField(blank=True, null=True)),
('date_finalized', model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'z', 'd', 'a', 'f', 'i', 'n', 'l'})),
('date_cancelled', model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'a', 'n', 'c', 'l', 'd'})),
('rejection_reason', models.TextField(blank=True)),
('transaction_rejection_reason', models.TextField(blank=True)),
('cancel_reason', models.TextField(blank=True)),
('intervention', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='partners.Intervention', verbose_name='Intervention')),
],
options={
'abstract': False,
},
managers=[
('admin_objects', django.db.models.manager.Manager()),
],
),
migrations.CreateModel(
name='FormActivity',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.TextField()),
('coding', models.CharField(blank=True, max_length=100)),
('reporting_authorized_amount', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Authorized Amount')),
('reporting_actual_project_expenditure', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Actual Project Expenditure')),
('reporting_expenditures_accepted_by_agency', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Expenditures Accepted by Agency')),
('reporting_balance', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Balance')),
('requested_amount', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Requests - Amount')),
('requested_authorized_amount', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Requests - Authorized Amount')),
('requested_outstanding_authorized_amount', models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Requests Outstanding Authorized Amount')),
('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eface.EFaceForm')),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 2.2.20 on 2021-07-12 11:18

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('reports', '0036_merge_20210714_2201'),
('eface', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='formactivity',
name='eepm_kind',
field=models.CharField(blank=True, choices=[('in_country', 'In-country management and support staff prorated to their contribution to the programme (representation, planning, coordination, logistics, administration, finance)'), ('operational', 'Operational costs prorated to their contribution to the programme (office space, equipment, office supplies, maintenance)'), ('planning', 'Planning, monitoring, evaluation and communication, prorated to their contribution to the programme (venue, travels, etc.)')], max_length=15),
),
migrations.AddField(
model_name='formactivity',
name='kind',
field=models.CharField(choices=[('activity', 'Activity'), ('eepm', 'EEPM'), ('custom', 'Custom')], default='custom', max_length=8),
preserve_default=False,
),
migrations.AddField(
model_name='formactivity',
name='pd_activity',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='reports.InterventionActivity'),
),
migrations.AlterField(
model_name='formactivity',
name='description',
field=models.TextField(blank=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 2.2.20 on 2021-07-12 13:28

from django.db import migrations
import django.utils.timezone
import django_fsm
import model_utils.fields


class Migration(migrations.Migration):

dependencies = [
('eface', '0002_auto_20210712_1118'),
]

operations = [
migrations.RemoveField(
model_name='efaceform',
name='date_finalized',
),
migrations.RemoveField(
model_name='efaceform',
name='date_transaction_rejected',
),
migrations.RemoveField(
model_name='efaceform',
name='date_unicef_approved',
),
migrations.AddField(
model_name='efaceform',
name='date_approved',
field=model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'a', 'r', 'p', 'd', 'o', 'v'}),
),
migrations.AddField(
model_name='efaceform',
name='date_closed',
field=model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'l', 's', 'd', 'o', 'c'}),
),
migrations.AddField(
model_name='efaceform',
name='date_pending',
field=model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'n', 'i', 'p', 'g', 'd'}),
),
migrations.AddField(
model_name='efaceform',
name='date_rejected',
field=model_utils.fields.MonitorField(blank=True, default=django.utils.timezone.now, monitor='status', null=True, when={'e', 'j', 'r', 'd', 't', 'c'}),
),
migrations.AlterField(
model_name='efaceform',
name='status',
field=django_fsm.FSMField(choices=[('draft', 'Draft'), ('submitted', 'Submitted'), ('rejected', 'Rejected'), ('pending', 'Pending (in vision)'), ('approved', 'Approved'), ('closed', 'Closed (rejected)'), ('cancelled', 'Cancelled')], default='draft', max_length=20, verbose_name='Status'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 2.2.20 on 2021-07-14 08:54

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('eface', '0003_auto_20210712_1328'),
]

operations = [
migrations.RemoveField(
model_name='efaceform',
name='currency',
),
migrations.AddField(
model_name='efaceform',
name='submitted_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='efaceform',
name='submitted_by_unicef_date',
field=models.DateField(blank=True, null=True),
),
migrations.AlterField(
model_name='formactivity',
name='form',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='eface.EFaceForm'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Generated by Django 2.2.20 on 2021-07-22 08:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('eface', '0004_auto_20210714_0854'),
]

operations = [
migrations.RenameField(
model_name='efaceform',
old_name='authorized_amount_date',
new_name='authorized_amount_date_start',
),
migrations.RenameField(
model_name='efaceform',
old_name='requested_amount_date',
new_name='requested_amount_date_start',
),
migrations.AddField(
model_name='efaceform',
name='authorized_amount_date_end',
field=models.DateField(blank=True, null=True),
),
migrations.AddField(
model_name='efaceform',
name='reporting_actual_project_expenditure',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Actual Project Expenditure'),
),
migrations.AddField(
model_name='efaceform',
name='reporting_authorized_amount',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Authorized Amount'),
),
migrations.AddField(
model_name='efaceform',
name='reporting_balance',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Balance'),
),
migrations.AddField(
model_name='efaceform',
name='reporting_expenditures_accepted_by_agency',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Reporting - Expenditures Accepted by Agency'),
),
migrations.AddField(
model_name='efaceform',
name='requested_amount',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Requests - Amount'),
),
migrations.AddField(
model_name='efaceform',
name='requested_amount_date_end',
field=models.DateField(blank=True, null=True),
),
migrations.AddField(
model_name='efaceform',
name='requested_authorized_amount',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Requests - Authorized Amount'),
),
migrations.AddField(
model_name='efaceform',
name='requested_outstanding_authorized_amount',
field=models.DecimalField(decimal_places=2, default=0, max_digits=20, verbose_name='Requests Outstanding Authorized Amount'),
),
]
Loading