Selaa lähdekoodia

Fix error caused by negative percentages in fees

master
Immanuel Onyeka 1 vuosi sitten
vanhempi
commit
366647310f
5 muutettua tiedostoa jossa 20 lisäystä ja 10 poistoa
  1. +11
    -2
      components/app.vue
  2. +2
    -1
      components/estimates.vue
  3. +2
    -2
      migrations/0_29092022_setup_tables.sql
  4. +4
    -4
      migrations/seed.sql
  5. +1
    -1
      skouter.go

+ 11
- 2
components/app.vue Näytä tiedosto

@@ -11,8 +11,17 @@
</div>

<home :user="user" v-else-if="active == 1" />
<new-estimate :user="user" :fees="fees" :token="token" v-else-if="active == 2" />
<estimates :user="user" :fees="fees" v-else-if="active == 3" :token="token" />
<new-estimate
:user="user"
:fees="fees"
:token="token"
v-else-if="active == 2" />
<estimates
:user="user"
:fees="fees"
v-else-if="active == 3"
:token="token"
@addFeeTemp="(f) => fees.push(f)" />
<settings :user="user" v-else-if="active == 4" />
<sign-out :user="user" v-else-if="active == 5" />
</template>


+ 2
- 1
components/estimates.vue Näytä tiedosto

@@ -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'


+ 2
- 2
migrations/0_29092022_setup_tables.sql Näytä tiedosto

@@ -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 */


+ 4
- 4
migrations/seed.sql Näytä tiedosto

@@ -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,


+ 1
- 1
skouter.go Näytä tiedosto

@@ -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"`


Loading…
Peruuta
Tallenna