diff --git a/src/pages/05_quotation/QuotationFormInfo.vue b/src/pages/05_quotation/QuotationFormInfo.vue index 11ac889d..bddc4ebf 100644 --- a/src/pages/05_quotation/QuotationFormInfo.vue +++ b/src/pages/05_quotation/QuotationFormInfo.vue @@ -7,11 +7,13 @@ import { useI18n } from 'vue-i18n'; import { formatNumberDecimal } from 'stores/utils'; +import { useConfigStore } from 'stores/config'; import AppBox from 'components/app/AppBox.vue'; import DatePicker from 'src/components/shared/DatePicker.vue'; import SelectInput from 'src/components/shared/SelectInput.vue'; import useOptionStore from 'src/stores/options'; +import { storeToRefs } from 'pinia'; defineProps<{ readonly?: boolean; @@ -25,6 +27,8 @@ defineProps<{ }>(); const { t } = useI18n(); +const configStore = useConfigStore(); +const { data: config } = storeToRefs(configStore); const urgent = defineModel('urgent', { required: true, @@ -67,6 +71,7 @@ const summaryPrice = defineModel<{ const optionStore = useOptionStore(); +const finalDiscount = ref(0); const payTypeOpion = ref([ { value: 'Full', @@ -421,11 +426,21 @@ watch(
{{ $t('general.total') }} - {{ data?.total || 0 }} ฿ + + {{ + formatNumberDecimal( + summaryPrice.finalPrice + Number(finalDiscount), + 2, + ) || 0 + }} + ฿ +
- {{ $t('general.discount') }} - {{ data?.discount || 0 }} ฿ + {{ $t('quotation.discountList') }} + + {{ formatNumberDecimal(summaryPrice.totalDiscount, 2) || 0 }} ฿ +
{{ $t('general.totalAfterDiscount') }} @@ -436,15 +451,35 @@ watch( {{ data?.totalVatExcluded || 0 }} ฿
- {{ $t('general.totalVatIncluded') + ' 7%' }} + {{ $t('general.totalVatIncluded') }} {{ data?.totalVatIncluded || 0 }} ฿
+
+ {{ + $t('general.vat', { + msg: `${config && Math.round(config.vat * 100)}%`, + }) + }} + {{ data?.totalVatIncluded || 0 }} ฿ +
+
+ {{ $t('general.discountAfterVat') }} + + +
{{ $t('general.totalAmount') }} - {{ data?.totalVatIncluded || 0 }} ฿ + {{ formatNumberDecimal(Math.max(summaryPrice.finalPrice, 0), 2) || 0 }} + ฿
@@ -461,6 +496,13 @@ watch( border-radius: var(--radius-2); } +:deep(.price-tag .q-field__control) { + display: flex; + align-items: center; + width: 90px; + height: 25px; +} + .bg-color-orange { --_color: var(--yellow-7-hsl); color: white;