Skip to content

Commit

Permalink
Fixed: issue in PO item receiving when the item is already fully rece…
Browse files Browse the repository at this point in the history
…ived by disabling the receive all button and improved calculation for progress bar value(#341)
  • Loading branch information
ymaheshwari1 committed Feb 29, 2024
1 parent 78428d9 commit e176fbe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/views/PurchaseOrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

<div class="action border-top" v-if="item.quantity > 0">
<div class="receive-all-qty">
<ion-button @click="receiveAll(item)" slot="start" size="small" fill="outline">
<ion-button :disabled="isItemReceivedInFull(item)" @click="receiveAll(item)" slot="start" size="small" fill="outline">
{{ translate("Receive All") }}
</ion-button>
</div>
Expand Down Expand Up @@ -237,8 +237,12 @@ export default defineComponent({
})
},
methods: {
getRcvdToOrderedFraction(item: any){
return (parseInt(item.quantityAccepted) + this.getPOItemAccepted(item.productId))/(item.quantity)
isItemReceivedInFull(item: any) {
const qtyAlreadyAccepted = this.getPOItemAccepted(item.productId)
return this.order.items.some((ele: any) => ele.productId == item.productId && qtyAlreadyAccepted >= ele.quantity)
},
getRcvdToOrderedFraction(item: any) {
return (parseInt(item.quantityAccepted || 0) + this.getPOItemAccepted(item.productId))/(item.quantity)
},
async openImage(imageUrl: string, productName: string) {
const imageModal = await modalController.create({
Expand Down

0 comments on commit e176fbe

Please sign in to comment.