Skip to content

Commit

Permalink
Merge pull request #351 from ymaheshwari1/#341
Browse files Browse the repository at this point in the history
Fixed: issue in PO item receiving when the item is already fully received by disabling the receive all button and improved calculation for progress bar value(#341)
  • Loading branch information
ymaheshwari1 authored Jul 18, 2024
2 parents c702aee + e4f2d45 commit c430e54
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 @@ -75,7 +75,7 @@

<div class="action border-top" v-if="item.quantity > 0">
<div class="receive-all-qty">
<ion-button @click="receiveAll(item)" :disabled="isForceScanEnabled" slot="start" size="small" fill="outline">
<ion-button @click="receiveAll(item)" :disabled="isForceScanEnabled || isItemReceivedInFull(item)" slot="start" size="small" fill="outline">
{{ translate("Receive All") }}
</ion-button>
</div>
Expand Down Expand Up @@ -235,8 +235,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 c430e54

Please sign in to comment.