feat: importação de fatura de cartão — strip R$, skip negativos, all_expenses
Parser limpa prefixo R$ e símbolos de moeda antes de parsear o valor. Flags SkipNegative e AllExpenses para CSV de fatura de cartão. UI: checkboxes "Fatura de cartão" e "Ignorar valores negativos". Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
@@ -24,6 +24,8 @@ export interface CSVMapping {
|
||||
has_header: boolean
|
||||
decimal_separator: string
|
||||
field_separator: string
|
||||
skip_negative: boolean
|
||||
all_expenses: boolean
|
||||
}
|
||||
|
||||
export const useImportStore = defineStore('import', () => {
|
||||
|
||||
@@ -17,6 +17,8 @@ const csvMapping = ref<CSVMapping>({
|
||||
has_header: true,
|
||||
decimal_separator: ',',
|
||||
field_separator: ';',
|
||||
skip_negative: false,
|
||||
all_expenses: false,
|
||||
})
|
||||
|
||||
function onFileChange(e: Event) {
|
||||
@@ -130,6 +132,14 @@ function fmt(amount: number) {
|
||||
<input type="checkbox" v-model="csvMapping.has_header" />
|
||||
Arquivo tem cabeçalho
|
||||
</label>
|
||||
<label class="fc-label fc-import-cfg__checkbox">
|
||||
<input type="checkbox" v-model="csvMapping.all_expenses" />
|
||||
Fatura de cartão (todos são despesas)
|
||||
</label>
|
||||
<label class="fc-label fc-import-cfg__checkbox">
|
||||
<input type="checkbox" v-model="csvMapping.skip_negative" />
|
||||
Ignorar valores negativos
|
||||
</label>
|
||||
</div>
|
||||
</NeonPanel>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user