mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'fix-small-issue' into 'master'
fix wizard and item select issue See merge request mohit.panjvani/crater-web!2
This commit is contained in:
@ -79,7 +79,7 @@ class ItemsController extends Controller
|
||||
foreach ($request->taxes as $tax) {
|
||||
$item->taxes()->updateOrCreate(
|
||||
['tax_type_id' => $tax['tax_type_id']],
|
||||
['amount' => $tax['amount'], 'percent' => $tax['percent'], 'percent' => $tax['name']]
|
||||
['amount' => $tax['amount'], 'percent' => $tax['percent'], 'name' => $tax['name']]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -680,6 +680,7 @@ export default {
|
||||
username: 'Username',
|
||||
next: 'Next',
|
||||
continue: 'Continue',
|
||||
skip: 'Skip',
|
||||
database: {
|
||||
database: 'Site URL & Database',
|
||||
connection: 'Database Connection',
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
@select="onSelectItem"
|
||||
@deselect="deselectItem"
|
||||
@onDesriptionInput="$v.item.description.$touch()"
|
||||
@onSelectItem="isSelected = true"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
@ -193,13 +194,17 @@ export default {
|
||||
prefix: '$ ',
|
||||
precision: 2,
|
||||
masked: false
|
||||
}
|
||||
},
|
||||
isSelected: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('item', [
|
||||
'items'
|
||||
]),
|
||||
...mapGetters('modal', [
|
||||
'modalActive'
|
||||
]),
|
||||
...mapGetters('currency', [
|
||||
'defaultCurrencyForInput'
|
||||
]),
|
||||
@ -284,6 +289,11 @@ export default {
|
||||
if (this.item.discount_type === 'percentage') {
|
||||
this.item.discount_val = (this.item.discount * newValue) / 100
|
||||
}
|
||||
},
|
||||
modalActive (val) {
|
||||
if (!val) {
|
||||
this.isSelected = false
|
||||
}
|
||||
}
|
||||
},
|
||||
validations () {
|
||||
@ -313,7 +323,11 @@ export default {
|
||||
},
|
||||
created () {
|
||||
window.hub.$on('checkItems', this.validateItem)
|
||||
window.hub.$on('newItem', this.onSelectItem)
|
||||
window.hub.$on('newItem', (val) => {
|
||||
if (!this.item.item_id && this.modalActive && this.isSelected) {
|
||||
this.onSelectItem(val)
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
updateTax (data) {
|
||||
|
||||
@ -126,6 +126,7 @@ export default {
|
||||
this.$emit('search', val)
|
||||
},
|
||||
openItemModal () {
|
||||
this.$emit('onSelectItem')
|
||||
this.openModal({
|
||||
'title': 'Add Item',
|
||||
'componentName': 'ItemModal'
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
@select="onSelectItem"
|
||||
@deselect="deselectItem"
|
||||
@onDesriptionInput="$v.item.description.$touch()"
|
||||
@onSelectItem="isSelected = true"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
@ -194,13 +195,17 @@ export default {
|
||||
prefix: '$ ',
|
||||
precision: 2,
|
||||
masked: false
|
||||
}
|
||||
},
|
||||
isSelected: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('item', [
|
||||
'items'
|
||||
]),
|
||||
...mapGetters('modal', [
|
||||
'modalActive'
|
||||
]),
|
||||
...mapGetters('currency', [
|
||||
'defaultCurrencyForInput'
|
||||
]),
|
||||
@ -285,6 +290,11 @@ export default {
|
||||
if (this.item.discount_type === 'percentage') {
|
||||
this.item.discount_val = (this.item.discount * newValue) / 100
|
||||
}
|
||||
},
|
||||
modalActive (val) {
|
||||
if (!val) {
|
||||
this.isSelected = false
|
||||
}
|
||||
}
|
||||
},
|
||||
validations () {
|
||||
@ -314,7 +324,11 @@ export default {
|
||||
},
|
||||
created () {
|
||||
window.hub.$on('checkItems', this.validateItem)
|
||||
window.hub.$on('newItem', this.onSelectItem)
|
||||
window.hub.$on('newItem', (val) => {
|
||||
if (!this.item.item_id && this.modalActive && this.isSelected) {
|
||||
this.onSelectItem(val)
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
updateTax (data) {
|
||||
|
||||
@ -115,6 +115,7 @@ export default {
|
||||
this.$emit('search', val)
|
||||
},
|
||||
openItemModal () {
|
||||
this.$emit('onSelectItem')
|
||||
this.openModal({
|
||||
'title': 'Add Item',
|
||||
'componentName': 'ItemModal'
|
||||
|
||||
@ -109,15 +109,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<base-button
|
||||
:loading="loading"
|
||||
class="pull-right mt-5"
|
||||
icon="save"
|
||||
color="theme"
|
||||
type="submit"
|
||||
>
|
||||
{{ $t('wizard.save_cont') }}
|
||||
</base-button>
|
||||
<div class="row mt-5">
|
||||
<base-button
|
||||
:loading="loading"
|
||||
class="pull-right"
|
||||
icon="save"
|
||||
color="theme"
|
||||
type="submit"
|
||||
>
|
||||
{{ $t('wizard.save_cont') }}
|
||||
</base-button>
|
||||
<base-button
|
||||
:loading="loading"
|
||||
class="pull-right ml-4"
|
||||
outline
|
||||
color="theme"
|
||||
@click="$emit('next')"
|
||||
>
|
||||
{{ $t('wizard.skip') }}
|
||||
</base-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
@ -137,10 +148,10 @@ export default {
|
||||
mailConfigData: {
|
||||
mail_driver: 'smtp',
|
||||
mail_host: 'mailtrap.io',
|
||||
mail_port: 2525,
|
||||
mail_username: 'cc3c64516febd4',
|
||||
mail_password: 'e6a0176301f587',
|
||||
mail_encryption: 'tls'
|
||||
mail_port: null,
|
||||
mail_username: null,
|
||||
mail_password: null,
|
||||
mail_encryption: null
|
||||
},
|
||||
loading: false,
|
||||
mail_drivers: []
|
||||
|
||||
Reference in New Issue
Block a user