diff --git a/components/app.vue b/components/app.vue index de26d85..d4b689d 100644 --- a/components/app.vue +++ b/components/app.vue @@ -11,8 +11,17 @@ - - + + diff --git a/components/estimates.vue b/components/estimates.vue index 75c6e6b..6044b65 100644 --- a/components/estimates.vue +++ b/components/estimates.vue @@ -71,6 +71,7 @@ import FeeDialog from "./fee-dialog.vue" import { format } from "../helpers.js" const props = defineProps(['user', 'fees', 'token']) +const emit = defineEmits(['addFeeTemp']) let edit = ref(null) let estimates = ref([]) let estimate = ref() @@ -90,7 +91,7 @@ function newFee(fee, isDebit) { }, }).then(resp => { if (resp.ok && resp.status == 200) { - return + resp.json().then(r => emit('addFeeTemp', r)) } else { // resp.text().then(t => this.errors = [t]) // window.location.hash = 'new' diff --git a/migrations/0_29092022_setup_tables.sql b/migrations/0_29092022_setup_tables.sql index 795fca6..1e8ace7 100644 --- a/migrations/0_29092022_setup_tables.sql +++ b/migrations/0_29092022_setup_tables.sql @@ -123,7 +123,7 @@ CREATE TABLE fee ( loan_id INT, amount INT NOT NULL, perc SMALLINT, /* Percentage of sale price instead of amount */ - type ENUM('Goverment', 'Title', 'Required', 'Lender', 'Other'), + type ENUM('Government', 'Title', 'Required', 'Lender', 'Other'), notes VARCHAR(255), name VARCHAR(30), /* Group heading shown in report */ @@ -141,7 +141,7 @@ CREATE TABLE fee_template ( amount INT NOT NULL, perc SMALLINT NOT NULL, /* Percentage of sale price instead of amount */ - type ENUM('Goverment', 'Title', 'Required', 'Lender', 'Other'), + type ENUM('Government', 'Title', 'Required', 'Lender', 'Other'), notes VARCHAR(255) NOT NULL, name VARCHAR(30) NOT NULL, /* Group heading shown in report */ diff --git a/migrations/seed.sql b/migrations/seed.sql index be99c66..507b0cc 100644 --- a/migrations/seed.sql +++ b/migrations/seed.sql @@ -233,7 +233,7 @@ INSERT INTO loan ( (SELECT id FROM loan_type WHERE name="Conventional"), 3300000, 30, - 375, + 3.75, 88.00, 5.00, 0, @@ -244,7 +244,7 @@ INSERT INTO loan ( (SELECT id FROM loan_type WHERE name="FHA"), 2510000, 30, - 300, + 3, 90.00, 6.70, 0, @@ -254,7 +254,7 @@ INSERT INTO loan ( 3, (SELECT id FROM loan_type WHERE name="FHA"), 2510000, - 30, + 1.8, 300, 90.00, 6.70, @@ -265,7 +265,7 @@ INSERT INTO loan ( 2, (SELECT id FROM loan_type WHERE name="USDA"), 8000000, - 10, + 1.1, 125, 95.00, 4.90, diff --git a/skouter.go b/skouter.go index b9e8fb2..e2934c0 100644 --- a/skouter.go +++ b/skouter.go @@ -59,7 +59,7 @@ type FeeTemplate struct { User int `json:"user"` Branch int `json:"branch"` Amount int `json:"amount"` - Perc int `json:"perc"` + Perc float32 `json:"perc"` Type string `json:"type"` Notes string `json:"notes"` Name string `json:"name"`