diff --git a/blocnote/apps/budgetSimulator/views.py b/blocnote/apps/budgetSimulator/views.py
index 2dddb394a082e27e8b5dba7ea5c444383f21e7c6..62eeb252642ef4af830f0d7896bdc43eb7bc1fcf 100644
--- a/blocnote/apps/budgetSimulator/views.py
+++ b/blocnote/apps/budgetSimulator/views.py
@@ -67,14 +67,8 @@ class Budget(View):
err_var_list.append('Anticipated commissioning date')
if not customer_preference:
err_var_list.append('Customer preference')
- if not raw_income_statement:
- err_var_list.append('Income statements')
if not growth_rate:
err_var_list.append('Growth rate')
- if not cash_balance:
- err_var_list.append('Cash balance')
- if not loan_options:
- err_var_list.append('Loan options')
if err_var_list:
err_var = ",".join(err_var_list)
return JsonResponse({'error': err_var + 'not filled.'}, status=400)
diff --git a/blocnote/apps/financialInputs/migrations/0006_auto_20170627_1902.py b/blocnote/apps/financialInputs/migrations/0006_auto_20170627_1902.py
new file mode 100644
index 0000000000000000000000000000000000000000..8bb344d120920e685b1287dfcfc946716efdc831
--- /dev/null
+++ b/blocnote/apps/financialInputs/migrations/0006_auto_20170627_1902.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.6 on 2017-06-27 19:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('financialInputs', '0005_auto_20170522_1842'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='customerpreference',
+ name='downpayment',
+ field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True),
+ ),
+ migrations.AlterField(
+ model_name='customerpreference',
+ name='expected_net_noi_dscr',
+ field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
+ ),
+ migrations.AlterField(
+ model_name='customerpreference',
+ name='expected_payback',
+ field=models.DecimalField(blank=True, decimal_places=0, max_digits=3, null=True),
+ ),
+ ]
diff --git a/blocnote/apps/financialInputs/models.py b/blocnote/apps/financialInputs/models.py
index 7a994e3cd140fc005bbd8bad6e2ab529bde953fa..8f572ae749a69a8f8fd8a1fdf3d1a262bd92038e 100644
--- a/blocnote/apps/financialInputs/models.py
+++ b/blocnote/apps/financialInputs/models.py
@@ -68,9 +68,9 @@ class CustomerPreference(models.Model):
"""Store customer preferences on payment."""
building_id = models.IntegerField()
- downpayment = models.DecimalField(max_digits=10, decimal_places=2)
- expected_payback = models.DecimalField(max_digits=3, decimal_places=0)
- expected_net_noi_dscr = models.DecimalField(max_digits=5, decimal_places=2)
+ downpayment = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
+ expected_payback = models.DecimalField(max_digits=3, decimal_places=0, blank=True, null=True)
+ expected_net_noi_dscr = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
class Liabilities(models.Model):
diff --git a/blocnote/apps/financialInputs/static/financialInputs/scripts/customerPreference.js b/blocnote/apps/financialInputs/static/financialInputs/scripts/customerPreference.js
index d4011be5f8ef6138508be8dba8f92527603f88ac..eea84c0e9874bb37454f09df3d50539d0dae5f42 100644
--- a/blocnote/apps/financialInputs/static/financialInputs/scripts/customerPreference.js
+++ b/blocnote/apps/financialInputs/static/financialInputs/scripts/customerPreference.js
@@ -24,7 +24,7 @@ function customerPreferenceForm(form) {
const formData = new FormData(form);
let result = {};
for (const [key, value] of formData.entries()) {
- result[key] = value;
+ result[key] = value ? value : null;
}
request('customer-preference/', {
method: 'PUT',
@@ -60,9 +60,10 @@ function customerPreferenceForm(form) {
*/
function createCustomerPreferenceTable(instance) {
let customerPreferenceForm = document.querySelector('#Customer-Preference');
- let downpayment = 0;
- let expectedPayback = 999;
- let expectedNetNOIDSCR = 1.15;
+ let downpayment = '';
+ let expectedPayback = '';
+ let expectedNetNOIDSCR = '';
+ const msg = '(If value is not known, please leave it blank)';
if (instance) {
downpayment = instance['downpayment'];
@@ -74,14 +75,14 @@ function createCustomerPreferenceTable(instance) {
Preference
- Value
+ Value ${msg}