Repository: kartoza/prj.app

Issue:
Sponsorship period should also include the amount sponsored for that period
It could be that the sponsor gives more than the minimum amount for that sponsorship level, so we should also record the exact amount given.



Discussion:

Resolving patch:
diff --git a/django_project/changes/forms.py b/django_project/changes/forms.py
--- a/django_project/changes/forms.py
+++ b/django_project/changes/forms.py
@@ -253,7 +253,9 @@ class Meta:
             'sponsor',
             'sponsorship_level',
             'start_date',
-            'end_date'
+            'end_date',
+            'amount_sponsored',
+            'currency'
         )
 
     def __init__(self, *args, **kwargs):
@@ -270,6 +272,8 @@ def __init__(self, *args, **kwargs):
                     css_class='form-control chosen-select'),
                 Field('start_date', css_class='form-control'),
                 Field('end_date', css_class='form-control'),
+                Field('amount_sponsored', css_class='form-control'),
+                Field('currency', css_class='form-control'),
                 css_id='project-form')
         )
         self.helper.layout = layout
diff --git a/django_project/changes/migrations/0007_auto_20170922_1040.py b/django_project/changes/migrations/0007_auto_20170922_1040.py
new file mode 100644
--- /dev/null
+++ b/django_project/changes/migrations/0007_auto_20170922_1040.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('changes', '0006_auto_20160718_0804'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='sponsorshipperiod',
+            name='amount_sponsored',
+            field=models.DecimalField(decimal_places=2, max_digits=30, blank=True, help_text='The actual amount sponsored for this period.', null=True, verbose_name='Amount Sponsored'),
+        ),
+        migrations.AddField(
+            model_name='sponsorshipperiod',
+            name='currency',
+            field=models.CharField(help_text='The currency that is used for sponsorship payment.', max_length=50, null=True, blank=True, default='EUR'),
+        ),
+    ]
diff --git a/django_project/changes/models/sponsorship_period.py b/django_project/changes/models/sponsorship_period.py
--- a/django_project/changes/models/sponsorship_period.py
+++ b/django_project/changes/models/sponsorship_period.py
@@ -49,6 +49,23 @@ class SponsorshipPeriod(models.Model):
         help_text='End date of sponsorship period',
         default=timezone.now)
 
+    amount_sponsored = models.DecimalField(
+        _('Amount Sponsored'),
+        help_text=_('The actual amount sponsored for this period.'),
+        decimal_places=2,
+        max_digits=30,
+        null=True,
+        blank=True,
+    )
+
+    currency = models.CharField(
+        help_text=_('The currency that is used for sponsorship payment.'),
+        max_length=50,
+        null=True,
+        blank=True,
+        default='EUR'
+    )
+
     approved = models.BooleanField(
         help_text=_(
             'Whether this sponsorship period has been approved for use by '


Test patch: