add taxes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { formatIsk, percentFormater } from '@/formaters';
|
||||
import { MarketType, MarketTypeLabel } from "@/market";
|
||||
import { MarketType, MarketTypeLabel, TaxInput, useMarketTaxStore } from "@/market";
|
||||
import { SortableHeader, useSort } from '@/table';
|
||||
import { ShoppingCartIcon, TrashIcon } from '@heroicons/vue/24/outline';
|
||||
import { useStorage } from '@vueuse/core';
|
||||
@@ -33,6 +33,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
});
|
||||
defineEmits<Emits>();
|
||||
|
||||
const marketTaxStore = useMarketTaxStore();
|
||||
|
||||
const days = useStorage('market-scan-days', 365);
|
||||
const threshold = useStorage('market-scan-threshold', 10);
|
||||
const filter = ref("");
|
||||
@@ -50,7 +52,7 @@ const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
|
||||
q1: quartils.q1,
|
||||
mmedian: quartils.median,
|
||||
q3: quartils.q3,
|
||||
profit: (quartils.q3 / quartils.q1) -1
|
||||
profit: marketTaxStore.calculateProfit(quartils.q1, quartils.q3)
|
||||
};
|
||||
})), {
|
||||
defaultSortKey: 'name',
|
||||
@@ -71,6 +73,7 @@ const getLineColor = (result: Result) => {
|
||||
<template>
|
||||
<div class="flex">
|
||||
<div class="flex justify-self-end mb-2 mt-4 ms-auto">
|
||||
<TaxInput />
|
||||
<div class="end">
|
||||
<span>Profit Threshold: </span>
|
||||
<input type="number" min="0" max="1000" step="1" v-model="threshold" />
|
||||
|
||||
Reference in New Issue
Block a user