Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Fix: Update Line Total Amount With Tax (#1812)
Browse files Browse the repository at this point in the history
* Fix: Update Line Total Amount With Tax

* Search Product List
  • Loading branch information
elsiosanchez authored Dec 29, 2023
1 parent b706dbd commit 23e48a2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
:disabled="isEmptyValue(selectProduct)"
@click="addProduct(selectProduct)"
/>
<el-button
:loading="isLoadingRecords"
type="success"
class="button-base-icon"
style="float: right;margin-left: 5px;"
icon="el-icon-refresh-right"
@click="refresh();"
/>
<el-button
type="danger"
class="button-base-icon"
Expand Down Expand Up @@ -149,6 +157,7 @@ export default defineComponent({
*/
const searchValue = ref('')
const isLoading = ref(false)
const isLoadingRecords = ref(false)
const pageSizeNumber = ref(15)
const selection = ref(0)
const selectProduct = ref({})
Expand Down Expand Up @@ -257,13 +266,27 @@ export default defineComponent({
}, 500)
}

function refresh() {
isLoading.value = true
isLoadingRecords.value = true
store.dispatch('searchProductList', {
searchValue: searchValue.value,
pageSize: pageSizeNumber.value
})
.finally(() => {
isLoading.value = false
isLoadingRecords.value = false
})
}

return {
// Ref
selection,
isLoading,
searchValue,
selectProduct,
pageSizeNumber,
isLoadingRecords,
// Computed
listProducto,
recordCount,
Expand All @@ -277,6 +300,7 @@ export default defineComponent({
searchProduct,
addProduct,
copyCode,
refresh,
close
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export default defineComponent({

function showPopever() {
show.value = true
store.dispatch('searchProductList', {
searchValue: searchProduct.value,
pageSize: 15
})
}

watch(productList, (newValue, oldValue) => {
Expand Down
6 changes: 6 additions & 0 deletions src/components/ADempiere/Form/VPOS2/MainOrder/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ export default defineComponent({
})
.then(updateLineResponse => {
currentLine.value.price = updateLineResponse.price
currentLine.value.total_amount_with_tax = updateLineResponse.total_amount_with_tax
isLoadingQty.value = false
currentLine.value.isEditCurrentPrice = false
})
Expand All @@ -299,6 +300,7 @@ export default defineComponent({
})
.then(updateLineResponse => {
currentLine.value.price = updateLineResponse.price
currentLine.value.total_amount_with_tax = updateLineResponse.total_amount_with_tax
isLoadingPrice.value = false
currentLine.value.isEditCurrentPrice = false
})
Expand All @@ -320,6 +322,7 @@ export default defineComponent({
})
.then(updateLineResponse => {
currentLine.value.quantity_ordered = updateLineResponse.quantity_ordered
currentLine.value.total_amount_with_tax = updateLineResponse.total_amount_with_tax
isLoadingQty.value = false
currentLine.value.isEditQtyEntered = false
})
Expand All @@ -341,6 +344,7 @@ export default defineComponent({
})
.then(updateLineResponse => {
currentLine.value.quantity_ordered = updateLineResponse.quantity_ordered
currentLine.value.total_amount_with_tax = updateLineResponse.total_amount_with_tax
isLoadingQty.value = false
currentLine.value.isEditQtyEntered = false
})
Expand All @@ -366,6 +370,7 @@ export default defineComponent({
})
.then(updateLineResponse => {
currentLine.value.discount_rate = updateLineResponse.discount_rate
currentLine.value.total_amount_with_tax = updateLineResponse.total_amount_with_tax
currentLine.value.isEditDiscount = false
isLoadingDiscount.value = false
})
Expand All @@ -387,6 +392,7 @@ export default defineComponent({
})
.then(updateLineResponse => {
currentLine.value.discount_rate = updateLineResponse.discount_rate
currentLine.value.total_amount_with_tax = updateLineResponse.total_amount_with_tax
currentLine.value.isEditDiscount = false
isLoadingDiscount.value = false
})
Expand Down

0 comments on commit 23e48a2

Please sign in to comment.