Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: functionality which allows users to manually close purchase order items when they receive them. (#212) #258

Merged
merged 16 commits into from
Oct 20, 2023

Conversation

amansinghbais
Copy link
Contributor

Related Issues

Closes #212

Short Description and Why It's Useful

Users can currently only receive inventory for purchase orders; there is no manual control for users to close the PO items. When the promise date arrives, the PO automatically expires. Here implemented a feature where users can close all or some shipments at once.

  • Created a footer for purchase order page with two buttons "Receive" and "Receive and Close"
    - Receive button create shipments for the items whom quantities are changed.
    - Receive and Close button create shipments and then close the items which are selected from the "closePurchaseOrder" modal.
  • Created a modal "closePurchaseOrder" modal which allows users to select the items they want to close or select all the items at once.
  • Created a new alert for close purchase order items.
  • Implemented an api "changeOrderItemStatus" in OrderService which is called to close shipment items or purchase order. It takes some item details as payload.

Screenshots of Visual Changes before/after (If There Are Any)

Before
Screenshot from 2023-08-29 12-25-55

After

Screenshot from 2023-08-29 12-26-35
Screenshot from 2023-08-29 12-31-57
Screenshot from 2023-08-29 12-27-06
Screenshot from 2023-08-29 12-27-12
Screenshot from 2023-08-29 12-27-36

IMPORTANT NOTICE - Remember to add changelog entry

Contribution and Currently Important Rules Acceptance

@amansinghbais amansinghbais changed the title Implemented: functionality which allows users to manually close purchase order items when they receive them. (#212) [WIP] Implemented: functionality which allows users to manually close purchase order items when they receive them. (#212) Aug 29, 2023
src/views/closePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/closePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/closePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/closePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/closePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/closePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/PurchaseOrderDetail.vue Outdated Show resolved Hide resolved
@amansinghbais amansinghbais changed the title [WIP] Implemented: functionality which allows users to manually close purchase order items when they receive them. (#212) Implemented: functionality which allows users to manually close purchase order items when they receive them. (#212) Sep 8, 2023
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/PurchaseOrderDetail.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/PurchaseOrderDetail.vue Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
src/views/ClosePurchaseOrderModal.vue Outdated Show resolved Hide resolved
import { defineComponent } from 'vue';
import { mapGetters, useStore } from 'vuex'
import { OrderService } from "@/services/OrderService";
import { productHelpers, showToast } from '@/utils';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unwanted imports.

<ion-list-header>{{ $t("To close the purchase order, select all.") }}</ion-list-header>
</ion-item>
<ion-list>
<ion-item :button="!isPOItemStatusPending(item) ? false : true" v-for="(item, index) in getPOItems()" :key="index" @click="item.isChecked = !item.isChecked">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for ternary operator, as isPOItemStatusPending will return boolean only.

src/components/ClosePurchaseOrderModal.vue Show resolved Hide resolved
async updatePOItemStatus() {
// Shipment can only be created if quantity is specified for atleast one PO item.
if(this.isEligibileForCreatingShipment) {
const eligibleItemsForCreatingShipment = this.order.items.filter((item: any) => item.quantityAccepted > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const eligibleItemsForCreatingShipment = this.order.items.filter((item: any) => item.quantityAccepted > 0)
const eligibleItemsForShipment = this.order.items.filter((item: any) => item.quantityAccepted > 0)

@ravilodhi ravilodhi merged commit e90e189 into hotwax:main Oct 20, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to close purchase orders when they receive them
4 participants