bug fixes

This commit is contained in:
Peter Papp
2021-05-14 10:29:46 +02:00
parent b4e6561134
commit 722eceb0c1
23 changed files with 172 additions and 137 deletions
+18 -18
View File
@@ -16,14 +16,14 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_logo') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="logo" v-slot="{ errors }">
<ImageInput @input="$updateImage('/invoices/profile', 'logo', profile.logo)" :image="$getImage(profile.logo)" v-model="profile.logo" :error="errors[0]" />
<ImageInput @input="$updateImage('/v1/invoicing/profile', 'logo', profile.logo)" :image="$getImage(profile.logo)" v-model="profile.logo" :error="errors[0]" />
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in.form.company_name') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="company" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'company', profile.company)" v-model="profile.company" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'company', profile.company)" v-model="profile.company" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -35,7 +35,7 @@
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="registration_notes" rules="required" v-slot="{ errors }">
<textarea
rows="2"
@input="$updateText('/invoices/profile', 'registration_notes', profile.registration_notes)"
@input="$updateText('/v1/invoicing/profile', 'registration_notes', profile.registration_notes)"
v-model="profile.registration_notes"
placeholder=""
:class="{'is-error': errors[0]}"
@@ -55,7 +55,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.ico') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="ico" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'ico', profile.ico)" v-model="profile.ico" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'ico', profile.ico)" v-model="profile.ico" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -64,7 +64,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.dic') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="dic" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'dic', profile.dic)" v-model="profile.dic" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'dic', profile.dic)" v-model="profile.dic" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -73,7 +73,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.ic_dph') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="ic_dph" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'ic_dph', profile.ic_dph)" v-model="profile.ic_dph" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'ic_dph', profile.ic_dph)" v-model="profile.ic_dph" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -87,7 +87,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_address') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="address" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'address', profile.address)" v-model="profile.address" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'address', profile.address)" v-model="profile.address" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -97,7 +97,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_city') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="city" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'city', profile.city)" v-model="profile.city" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'city', profile.city)" v-model="profile.city" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -106,7 +106,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_postal_code') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="postal_code" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'postal_code', profile.postal_code)" v-model="profile.postal_code" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'postal_code', profile.postal_code)" v-model="profile.postal_code" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -116,7 +116,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_country') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="country" rules="required" v-slot="{ errors }">
<SelectInput @input="$updateText('/invoices/profile', 'country', profile.country)" v-model="profile.country" :default="profile.country" :options="countries" placeholder="" :isError="errors[0]"/>
<SelectInput @input="$updateText('/v1/invoicing/profile', 'country', profile.country)" v-model="profile.country" :default="profile.country" :options="countries" placeholder="" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
@@ -129,7 +129,7 @@
<div class="block-wrapper">
<label>{{ $t('in.form.bank_name') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="bank" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'bank', profile.bank)" v-model="profile.bank" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'bank', profile.bank)" v-model="profile.bank" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -138,7 +138,7 @@
<div class="block-wrapper">
<label>{{ $t('in.form.iban') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="iban" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'iban', profile.iban)" v-model="profile.iban" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'iban', profile.iban)" v-model="profile.iban" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -147,7 +147,7 @@
<div class="block-wrapper">
<label>{{ $t('in.form.swift_code') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="swift" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'swift', profile.swift)" v-model="profile.swift" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'swift', profile.swift)" v-model="profile.swift" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -161,7 +161,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_phone') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="phone" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'phone', profile.phone)" v-model="profile.phone" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'phone', profile.phone)" v-model="profile.phone" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -170,7 +170,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_email') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="email" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'email', profile.email)" v-model="profile.email" placeholder="" type="email"
<input @input="$updateText('/v1/invoicing/profile', 'email', profile.email)" v-model="profile.email" placeholder="" type="email"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -179,7 +179,7 @@
<div class="block-wrapper">
<label>{{ $t('in.form.author_name') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="author" rules="required" v-slot="{ errors }">
<input @input="$updateText('/invoices/profile', 'author', profile.author)" v-model="profile.author" placeholder="" type="text"
<input @input="$updateText('/v1/invoicing/profile', 'author', profile.author)" v-model="profile.author" placeholder="" type="text"
:class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -188,7 +188,7 @@
<div class="block-wrapper">
<label>{{ $t('in.form.stamp') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="stamp" v-slot="{ errors }">
<ImageInput @input="$updateImage('/invoices/profile', 'stamp', profile.stamp)" :image="$getImage(profile.stamp)" v-model="profile.stamp" :error="errors[0]" />
<ImageInput @input="$updateImage('/v1/invoicing/profile', 'stamp', profile.stamp)" :image="$getImage(profile.stamp)" v-model="profile.stamp" :error="errors[0]" />
</ValidationProvider>
</div>
</div>
@@ -265,7 +265,7 @@
},
methods: {},
created() {
axios.get('/api/invoices/profile')
axios.get('/api/v1/invoicing/profile')
.then(response => {
this.profile = response.data.data.attributes
})
@@ -156,7 +156,7 @@
<p>{{ $t('in.form.some_issues') }}</p>
</InfoBox>
<div class="block-wrapper">
<ButtonBase @click.native="createBillingProfile" :disabled="isLoading" :loading="isLoading" button-style="theme" type="submit" style="margin-bottom: 35px">
<ButtonBase @click.native="createBillingProfile" :disabled="isLoading" :loading="isLoading" button-style="theme" class="submit-button" type="submit" style="margin-bottom: 35px">
{{ $t('in.button.store_bill_profile') }}
</ButtonBase>
</div>
@@ -260,7 +260,7 @@
// Send request to get user token
axios
.post('/api/invoices/profile', formData, {
.post('/api/v1/invoicing/profile', formData, {
headers: {
'Content-Type': 'multipart/form-data',
}
@@ -273,7 +273,7 @@
})
this.$store.dispatch('getAppData')
this.$router.push({name: 'BillingProfile'})
this.$goToInvoice()
})
.catch(error => {
this.isError = true
@@ -310,4 +310,10 @@
max-width: 100%;
}
@media only screen and (max-width: 960px) {
.submit-button {
width: 100%;
}
}
</style>
@@ -74,7 +74,7 @@
},
methods: {
fetchUser() {
axios.get(`/api/clients/${this.$route.params.id}`)
axios.get(`/api/v1/invoicing/clients/${this.$route.params.id}`)
.then(response => {
this.client = response.data
})
@@ -97,8 +97,6 @@
display: flex;
align-items: center;
cursor: pointer;
padding-bottom: 10px;
padding-top: 15px;
.avatar {
margin-right: 20px;
@@ -209,7 +209,7 @@
// Send request to get user token
axios
.post('/api/oasis/clients', formData, {
.post('/api/v1/invoicing/clients', formData, {
headers: {
'Content-Type': 'multipart/form-data',
}
@@ -5,13 +5,13 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_logo') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="avatar" v-slot="{ errors }">
<ImageInput @input="$updateImage(`/clients/${client.id}`, 'avatar', client.avatar)" v-model="client.avatar" :image="client.avatar" :error="errors[0]" />
<ImageInput @input="$updateImage(`/v1/invoicing/clients/${client.id}`, 'avatar', client.avatar)" v-model="client.avatar" :image="client.avatar" :error="errors[0]" />
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.company_name') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="name" rules="required" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'name', client.name)" v-model="client.name" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'name', client.name)" v-model="client.name" :placeholder="$t('in_editor.plac.client_company')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
@@ -21,21 +21,21 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.ico') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="ico" rules="required" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'ico', client.ico)" v-model="client.ico" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'ico', client.ico)" v-model="client.ico" :placeholder="$t('in_editor.plac.client_ico')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.dic') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="dic" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'dic', client.dic)" v-model="client.dic" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'dic', client.dic)" v-model="client.dic" :placeholder="$t('in_editor.plac.client_dic')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.ic_dph') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="ic_dph" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'ic_dph', client.ic_dph)" v-model="client.ic_dph" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'ic_dph', client.ic_dph, true)" v-model="client.ic_dph" :placeholder="$t('in_editor.plac.client_ic_dph')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
@@ -45,28 +45,28 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_address') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="address" rules="required" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'address', client.address)" v-model="client.address" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'address', client.address)" v-model="client.address" :placeholder="$t('in_editor.plac.client_address')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.client_city') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="city" rules="required" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'city', client.city)" v-model="client.city" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'city', client.city)" v-model="client.city" :placeholder="$t('in_editor.plac.client_city')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.client_postal_code') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="postal_code" rules="required" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'postal_code', client.postal_code)" v-model="client.postal_code" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'postal_code', client.postal_code)" v-model="client.postal_code" :placeholder="$t('in_editor.plac.client_postal_code')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.client_country') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="country" rules="required" v-slot="{ errors }">
<SelectInput @input="$updateText(`/clients/${client.id}`, 'country', client.country)" v-model="client.country" :default="client.country" :options="countries" placeholder="" :isError="errors[0]" />
<SelectInput @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'country', client.country)" v-model="client.country" :default="client.country" :options="countries" :placeholder="$t('in_editor.plac.client_country')" :isError="errors[0]" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
@@ -76,14 +76,14 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client_phone') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="phone_number" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'phone_number', client.phone_number)" v-model="client.phone_number" placeholder="" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'phone_number', client.phone_number, true)" v-model="client.phone_number" :placeholder="$t('in_editor.plac.client_phone')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>{{ $t('in_editor.client_email') }} ({{ $t('global.optional') }}):</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="email" v-slot="{ errors }">
<input @input="$updateText(`/clients/${client.id}`, 'email', client.email)" v-model="client.email" placeholder="" type="email" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<input @input="$updateText(`/v1/invoicing/clients/${client.id}`, 'email', client.email, true)" v-model="client.email" :placeholder="$t('in_editor.plac.client_email')" type="email" :class="{'is-error': errors[0]}" class="focus-border-theme" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
@@ -3,7 +3,7 @@
<PageTabGroup>
<DatatableWrapper
@init="isLoading = false"
:api="`/api/clients/${$route.params.id}/invoices`"
:api="`/api/v1/invoicing/clients/${$route.params.id}/invoices`"
:paginator="false"
:columns="columns"
class="table"
+4 -4
View File
@@ -18,7 +18,7 @@
<MobileNavigation />
<SidebarNavigation />
<div id="viewport">
<div id="viewport" :class="{'is-scaled-down': isScaledDown}">
<!--Sidebar navigation-->
<ContentSidebar>
@@ -60,7 +60,7 @@
</ContentGroup>
</ContentSidebar>
<router-view :class="{'is-scaled-down': isScaledDown}" />
<router-view />
</div>
</div>
</template>
@@ -150,7 +150,7 @@
events.$on('action:confirmed', data => {
if (data.operation === 'delete-invoice') {
axios.delete(`/api/invoices/${data.id}`)
axios.delete(`/api/v1/invoicing/invoices/${data.id}`)
.then(() => this.goTo(this.currentFolder.location))
.catch(() => this.$isSomethingWrong())
}
@@ -159,7 +159,7 @@
events.$on('action:confirmed', data => {
if (data.operation === 'delete-client') {
axios.delete(`/api/clients/${data.id}`)
axios.delete(`/api/v1/invoicing/clients/${data.id}`)
.then(() => this.goTo(this.currentFolder.location))
.catch(() => this.$isSomethingWrong())
}
@@ -308,7 +308,7 @@
</div>
</div>
<ButtonBase :disabled="isLoading" :loading="isLoading" @click.native="createInvoice" button-style="theme-solid" class="next-submit">
<ButtonBase :disabled="isLoading" :loading="isLoading" @click.native="createInvoice" button-style="theme" class="next-submit">
{{ $t('in_editor.submit') }}
</ButtonBase>
<p class="error-message" v-if="isError">
@@ -615,7 +615,7 @@
// Send request to get user token
axios
.post('/api/invoices', formData, {
.post('/api/v1/invoicing/invoices', formData, {
headers: {
'Content-Type': 'multipart/form-data',
}
@@ -690,7 +690,7 @@
mounted() {
this.invoice.invoice_type = this.$route.query.type
axios.get('/api/invoices/editor')
axios.get('/api/v1/invoicing/editor')
.then(response => {
this.isVatPayer = response.data.isVatPayer
this.clients = response.data.clients
@@ -50,7 +50,7 @@
<div class="block-wrapper">
<label>{{ $t('in_editor.client') }}:</label>
<div class="input-wrapper">
<input v-model.number="invoice.client['name']" type="text" disabled />
<input v-model.number="client['name']" type="text" disabled />
</div>
</div>
</PageTabGroup>
@@ -412,9 +412,6 @@
this.invoice.discount_type = null
}
},
'invoice.invoice_number': function (val) {
this.invoice.variable_number = val
},
},
data() {
return {
@@ -442,9 +439,9 @@
],
discount_type: undefined,
discount_rate: undefined,
client: '',
send_invoice: false,
},
client: '',
discountTypeList: [
{
label: this.$t('in_editor.discount_type_percent'),
@@ -493,25 +490,14 @@
// Start loading
this.isLoading = true
// Create form
let formData = new FormData()
let payload = this.invoice
// Append data to form
Object.keys(this.invoice).forEach(key => {
if (key === 'items') {
formData.append(key, JSON.stringify(this.invoice[key]))
} else {
if (this.invoice[key])
formData.append(key, this.invoice[key])
}
})
//payload.items = JSON.stringify(this.invoice.items)
// Send request to get user token
axios
.post(`/api/invoices/${this.$route.params.id}`, formData)
.put(`/api/v1/invoicing/invoices/${this.$route.params.id}`, payload)
.then(() => {
events.$emit('toaster', {
type: 'success',
message: this.$t('in_toaster.success_invoice_edition'),
@@ -560,12 +546,12 @@
}
},
mounted() {
axios.get('/api/invoices/editor')
axios.get('/api/v1/invoicing/editor')
.then(response => {
this.isVatPayer = response.data.isVatPayer
})
axios.get(`/api/invoices/${this.$route.params.id}`)
axios.get(`/api/v1/invoicing/invoices/${this.$route.params.id}`)
.then(response => {
this.invoice.invoice_number = response.data.data.attributes.invoice_number
this.invoice.variable_number = response.data.data.attributes.variable_number
@@ -574,7 +560,8 @@
this.invoice.items = response.data.data.attributes.items
this.invoice.discount_type = response.data.data.attributes.discount_type
this.invoice.discount_rate = response.data.data.attributes.discount_rate
this.invoice.client = response.data.data.attributes.client
this.client = response.data.data.attributes.client
if (this.invoice.discount_type && this.invoice.discount_rate) {
this.isDiscount = true
@@ -33,7 +33,7 @@
</div>
<!--Billing Profile Message-->
<div class="text-content" v-if="! hasBillingProfile">
<div class="text-content" v-if="! hasBillingProfile && ! isLoading">
<h1 class="title">
{{ $t('in.empty.bill_profile_title') }}
</h1>
@@ -12,10 +12,10 @@
>
<MobileToolbar />
<SearchBar v-model="query" @reset-query="query = ''" class="mobile-search" :placeholder="searchPlaceholder" />
<SearchBar v-if="hasBillingProfile" v-model="query" @reset-query="query = ''" class="mobile-search" :placeholder="searchPlaceholder" />
<!--Mobile Actions-->
<InvoiceActionsMobile />
<InvoiceActionsMobile v-if="hasBillingProfile" />
<!--Item previews list-->
<div class="file-list-wrapper">
@@ -95,6 +95,7 @@
'clipboard',
'isLoading',
'entries',
'user',
]),
searchPlaceholder() {
return this.currentFolder && ['regular-invoice', 'advance-invoice'].includes(this.currentFolder.location)
@@ -112,6 +113,9 @@
if (this.clipboard.includes(this.draggingId)) {
return this.clipboard
}
},
hasBillingProfile() {
return this.user && this.user.data.attributes.has_billing_profile
}
},
watch: {
@@ -86,7 +86,7 @@ export default {
// Send request to get share link
axios
.post(`/api/invoices/${this.pickedItem.id}/share`,
.post(`/api/v1/invoicing/invoices/${this.pickedItem.id}/share`,
this.shareOptions
)
.then(() => {