mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-07-17 22:35:19 +00:00
Now that the legacy v1 frontend (commit 064bdf53) is gone, the v2 directory is the only frontend and the v2 suffix is just noise. Renames resources/scripts-v2 to resources/scripts via git mv (so git records the move as renames, preserving blame and log --follow), then bulk-rewrites the 152 files that imported via @v2/... to use @/scripts/... instead. The existing @ alias (resources/) covers the new path with no extra config needed.
Drops the now-unused @v2 alias from vite.config.js and points the laravel-vite-plugin entry at resources/scripts/main.ts. Updates the only blade reference (resources/views/app.blade.php) to match. The package.json test script (eslint ./resources/scripts) automatically targets the right place after the rename without any edit.
Verified: npm run build exits clean and the Vite warning lines now reference resources/scripts/plugins/i18n.ts, confirming every import resolved through the new path. git log --follow on any moved file walks back through its scripts-v2 history.
111 lines
2.9 KiB
Vue
111 lines
2.9 KiB
Vue
<template>
|
|
<div class="grid grid-cols-12 gap-8 mt-6 mb-8">
|
|
<BaseCustomerSelectPopup
|
|
:valid="v.customer_id"
|
|
:content-loading="isLoading"
|
|
type="invoice"
|
|
class="col-span-12 lg:col-span-6 pr-0"
|
|
/>
|
|
|
|
<RecurringFields
|
|
v-if="isRecurring"
|
|
:is-loading="isLoading"
|
|
:is-edit="isEdit"
|
|
/>
|
|
|
|
<BaseInputGrid
|
|
v-else
|
|
class="col-span-12 lg:col-span-6 rounded-xl shadow border border-line-light bg-surface p-5"
|
|
>
|
|
<BaseInputGroup
|
|
:label="$t('invoices.invoice_date')"
|
|
:content-loading="isLoading"
|
|
required
|
|
:error="v.invoice_date.$error && v.invoice_date.$errors[0].$message"
|
|
>
|
|
<BaseDatePicker
|
|
v-model="invoiceStore.newInvoice.invoice_date"
|
|
:content-loading="isLoading"
|
|
:calendar-button="true"
|
|
calendar-button-icon="calendar"
|
|
:enable-time="enableTime"
|
|
:time24hr="time24h"
|
|
/>
|
|
</BaseInputGroup>
|
|
|
|
<BaseInputGroup
|
|
:label="$t('invoices.due_date')"
|
|
:content-loading="isLoading"
|
|
>
|
|
<BaseDatePicker
|
|
v-model="invoiceStore.newInvoice.due_date"
|
|
:content-loading="isLoading"
|
|
:calendar-button="true"
|
|
calendar-button-icon="calendar"
|
|
/>
|
|
</BaseInputGroup>
|
|
|
|
<BaseInputGroup
|
|
:label="$t('invoices.invoice_number')"
|
|
:content-loading="isLoading"
|
|
:error="v.invoice_number.$error && v.invoice_number.$errors[0].$message"
|
|
required
|
|
>
|
|
<BaseInput
|
|
v-model="invoiceStore.newInvoice.invoice_number"
|
|
:content-loading="isLoading"
|
|
@input="v.invoice_number.$touch()"
|
|
/>
|
|
</BaseInputGroup>
|
|
|
|
<ExchangeRateConverter
|
|
:store="invoiceStore"
|
|
store-prop="newInvoice"
|
|
:v="v"
|
|
:is-loading="isLoading"
|
|
:is-edit="isEdit"
|
|
:customer-currency="invoiceStore.newInvoice.currency_id"
|
|
/>
|
|
</BaseInputGrid>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { ExchangeRateConverter } from '../../../shared/document-form'
|
|
import { useInvoiceStore } from '../store'
|
|
import RecurringFields from './RecurringFields.vue'
|
|
|
|
interface ValidationField {
|
|
$error: boolean
|
|
$errors: Array<{ $message: string }>
|
|
$touch: () => void
|
|
}
|
|
|
|
interface Props {
|
|
v: Record<string, ValidationField>
|
|
isLoading?: boolean
|
|
isEdit?: boolean
|
|
isRecurring?: boolean
|
|
companySettings?: Record<string, string>
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
isLoading: false,
|
|
isEdit: false,
|
|
isRecurring: false,
|
|
companySettings: () => ({}),
|
|
})
|
|
|
|
const invoiceStore = useInvoiceStore()
|
|
|
|
const enableTime = computed<boolean>(() => {
|
|
return props.companySettings?.invoice_use_time === 'YES'
|
|
})
|
|
|
|
const time24h = computed<boolean>(() => {
|
|
const format = props.companySettings?.carbon_time_format ?? ''
|
|
return format.indexOf('H') > -1
|
|
})
|
|
</script>
|