fix: checkbox 'fatura de cartão' auto-configura colunas corretas
Ao marcar 'Fatura de cartão', amount_column=3, description=1, skip_negative=true — elimina erro de coluna errada no CSV do banco. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { useImportStore, type CSVMapping } from '@/stores/import'
|
import { useImportStore, type CSVMapping } from '@/stores/import'
|
||||||
import NeonPanel from '@/components/NeonPanel.vue'
|
import NeonPanel from '@/components/NeonPanel.vue'
|
||||||
|
|
||||||
@@ -21,6 +21,20 @@ const csvMapping = ref<CSVMapping>({
|
|||||||
all_expenses: false,
|
all_expenses: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Quando "Fatura de cartão" é marcado, configura automaticamente as colunas corretas
|
||||||
|
watch(() => csvMapping.value.all_expenses, (isCard) => {
|
||||||
|
if (isCard) {
|
||||||
|
csvMapping.value.date_column = 0
|
||||||
|
csvMapping.value.description_column = 1
|
||||||
|
csvMapping.value.amount_column = 3
|
||||||
|
csvMapping.value.field_separator = ';'
|
||||||
|
csvMapping.value.decimal_separator = ','
|
||||||
|
csvMapping.value.date_format = '02/01/2006'
|
||||||
|
csvMapping.value.has_header = true
|
||||||
|
csvMapping.value.skip_negative = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
function onFileChange(e: Event) {
|
function onFileChange(e: Event) {
|
||||||
const input = e.target as HTMLInputElement
|
const input = e.target as HTMLInputElement
|
||||||
const file = input.files?.[0]
|
const file = input.files?.[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user