mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-31 21:51:10 -04:00
Merge branch 'master' of https://gitlab.com/mohit.panjvani/crater-web into sweetalert-on-action
This commit is contained in:
@ -688,7 +688,7 @@ export default {
|
||||
isValid = false
|
||||
}
|
||||
})
|
||||
if (this.$v.newEstimate.$invalid === false && isValid === true) {
|
||||
if (!this.$v.selectedCustomer.$invalid && this.$v.newEstimate.$invalid === false && isValid === true) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
@ -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'
|
||||
|
||||
Reference in New Issue
Block a user