Skip to content

Commit

Permalink
Improved: code to disabled receive all and qty input if force scan is…
Browse files Browse the repository at this point in the history
… enabled (#325)
  • Loading branch information
amansinghbais committed Jul 16, 2024
1 parent 710cc0a commit 6ece9a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/views/PurchaseOrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@

<div class="product-count">
<ion-item>
<ion-input :label="translate('Qty')" label-placement="floating" type="number" value="0" min="0" v-model="item.quantityAccepted" />
<ion-input :label="translate('Qty')" label-placement="floating" type="number" value="0" min="0" v-model="item.quantityAccepted" :disabled="isForceScanEnabled" />
</ion-item>
</div>
</div>

<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 @click="receiveAll(item)" :disabled="isForceScanEnabled" slot="start" size="small" fill="outline">
{{ translate("Receive All") }}
</ion-button>
</div>
Expand Down Expand Up @@ -230,7 +230,8 @@ export default defineComponent({
getPOItemAccepted: 'order/getPOItemAccepted',
facilityLocationsByFacilityId: 'user/getFacilityLocationsByFacilityId',
currentFacility: 'user/getCurrentFacility',
productIdentificationPref: 'user/getProductIdentificationPref'
productIdentificationPref: 'user/getProductIdentificationPref',
isForceScanEnabled: 'util/isForceScanEnabled',
})
},
methods: {
Expand Down
7 changes: 4 additions & 3 deletions src/views/ReturnDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<div class="product-count">
<ion-item v-if="isReturnReceivable(current.statusId)">
<ion-input :label="translate('Qty')" label-placement="floating" type="number" min="0" v-model="item.quantityAccepted" />
<ion-input :label="translate('Qty')" :disabled="isForceScanEnabled" label-placement="floating" type="number" min="0" v-model="item.quantityAccepted" />
</ion-item>
<ion-item v-if="!isReturnReceivable(current.statusId)" lines="none">
<ion-label>{{ item.quantityAccepted }} {{ translate("received") }}</ion-label>
Expand All @@ -65,7 +65,7 @@
</div>

<ion-item lines="none" class="border-top" v-if="item.quantityOrdered > 0">
<ion-button v-if="isReturnReceivable(current.statusId)" @click="receiveAll(item)" slot="start" fill="outline">
<ion-button v-if="isReturnReceivable(current.statusId)" :disabled="isForceScanEnabled" @click="receiveAll(item)" slot="start" fill="outline">
{{ translate("Receive All") }}
</ion-button>
<ion-progress-bar :color="getRcvdToOrdrdFraction(item) === 1 ? 'success' : getRcvdToOrdrdFraction(item) > 1 ? 'danger' : 'primary'" :value="getRcvdToOrdrdFraction(item)" />
Expand Down Expand Up @@ -171,7 +171,8 @@ export default defineComponent({
returns: 'return/getReturns',
validStatusChange: 'return/isReturnReceivable',
isReturnReceivable: 'return/isReturnReceivable',
productIdentificationPref: 'user/getProductIdentificationPref'
productIdentificationPref: 'user/getProductIdentificationPref',
isForceScanEnabled: 'util/isForceScanEnabled',
}),
},
methods: {
Expand Down
7 changes: 4 additions & 3 deletions src/views/ShipmentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<div class="product-count">
<ion-item v-if="!isShipmentReceived()">
<ion-input :label="translate('Qty')" label-placement="floating" type="number" min="0" v-model="item.quantityAccepted" />
<ion-input :label="translate('Qty')" :disabled="isForceScanEnabled" label-placement="floating" type="number" min="0" v-model="item.quantityAccepted" />
</ion-item>
<div v-else>
<ion-item lines="none">
Expand All @@ -67,7 +67,7 @@
</div>

<ion-item lines="none" class="border-top" v-if="item.quantityOrdered > 0 && !isShipmentReceived()">
<ion-button @click="receiveAll(item)" slot="start" fill="outline">
<ion-button @click="receiveAll(item)" :disabled="isForceScanEnabled" slot="start" fill="outline">
{{ translate("Receive All") }}
</ion-button>

Expand Down Expand Up @@ -166,7 +166,8 @@ export default defineComponent({
getProduct: 'product/getProduct',
facilityLocationsByFacilityId: 'user/getFacilityLocationsByFacilityId',
currentFacility: 'user/getCurrentFacility',
productIdentificationPref: 'user/getProductIdentificationPref'
productIdentificationPref: 'user/getProductIdentificationPref',
isForceScanEnabled: 'util/isForceScanEnabled',
}),
},
methods: {
Expand Down

0 comments on commit 6ece9a4

Please sign in to comment.