fix floating errors

This commit is contained in:
Mohit Panjwani
2020-12-31 12:16:04 +05:30
parent 0f1d7627ea
commit b55f8e5391
11 changed files with 498 additions and 466 deletions

View File

@ -7,23 +7,23 @@
<sw-page-header :title="pageTitle">
<sw-breadcrumb slot="breadcrumbs">
<sw-breadcrumb-item
to="/admin/dashboard"
:title="$t('general.home')"
to="/admin/dashboard"
/>
<sw-breadcrumb-item
to="/admin/invoices"
:title="$tc('invoices.invoice', 2)"
to="/admin/invoices"
/>
<sw-breadcrumb-item
v-if="$route.name === 'invoice.edit'"
to="#"
:title="$t('invoices.edit_invoice')"
to="#"
active
/>
<sw-breadcrumb-item
v-else
to="#"
:title="$t('invoices.new_invoice')"
to="#"
active
/>
</sw-breadcrumb>
@ -32,8 +32,8 @@
<sw-button
v-if="$route.name === 'invoices.edit'"
:disabled="isLoading"
tag-name="a"
:href="`/invoices/pdf/${newInvoice.unique_hash}`"
tag-name="a"
variant="primary-outline"
class="mr-3"
target="_blank"
@ -58,9 +58,9 @@
<!-- Select Customer & Basic Fields -->
<div class="grid-cols-12 gap-8 mt-6 mb-8 lg:grid">
<customer-select
class="col-span-5 pr-0"
:valid="$v.selectedCustomer"
:customer-id="customerId"
class="col-span-5 pr-0"
/>
<div
@ -227,8 +227,8 @@
</div>
<div
class="grid gap-x-4 gap-y-2 md:gap-x-8 md:gap-y-4 grid-col-1 md:grid-cols-2"
v-if="customFields.length > 0"
class="grid gap-x-4 gap-y-2 md:gap-x-8 md:gap-y-4 grid-col-1 md:grid-cols-2"
>
<sw-input-group
v-for="(field, index) in customFields"
@ -239,7 +239,7 @@
<component
:type="field.type.label"
:field="field"
:isEdit="isEdit"
:is-edit="isEdit"
:is="field.type + 'Field'"
:invalid-fields="invalidFields"
@update="setCustomFieldValue"
@ -418,8 +418,6 @@ const {
} = require('vuelidate/lib/validators')
export default {
mixins: [CustomFieldsMixin],
components: {
InvoiceItem,
CustomerSelect,
@ -431,6 +429,7 @@ export default {
ShoppingCartIcon,
HashtagIcon,
},
mixins: [CustomFieldsMixin],
data() {
return {
@ -558,7 +557,7 @@ export default {
if (this.newInvoice.discount_type === 'percentage') {
this.newInvoice.discount_val = (this.subtotal * newValue) / 100
} else {
this.newInvoice.discount_val = newValue * 100
this.newInvoice.discount_val = Math.round(newValue * 100)
}
this.newInvoice.discount = newValue
@ -722,7 +721,7 @@ export default {
return
}
this.newInvoice.discount_val = this.newInvoice.discount * 100
this.newInvoice.discount_val = Math.round(this.newInvoice.discount * 100)
this.newInvoice.discount_type = 'fixed'
},