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

Bulk Consumable Checkout #13062

Merged

Conversation

ak-piracha
Copy link
Contributor

@ak-piracha ak-piracha commented May 21, 2023

Description

This PR implements the 'bulk checkout' feature for consumable items in the inventory management system. This feature allows users to check out multiple units of a consumable item at once, instead of checking out one item at a time. It addresses feature request #12892 and is motivated by the need to streamline and improve the efficiency of the checkout process. Screenshots are provided in the related issue thread.

Before:
image

After:
image

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

This feature has been tested manually, following these steps:

  1. Log in as a user who has permissions to check out consumable items.
  2. Navigate to the checkout page of a consumable item.
  3. Enter a quantity in the new 'Quantity' field and submit the form.
  4. Confirm that the quantity of the item in the inventory is decreased by the correct amount.
  5. Confirm that an error message is displayed when trying to checkout more of an item than is available.
  • Test A: Checkout a valid quantity of a consumable item.
  • Test B: Attempt to checkout more of a consumable item than is available.

Test Configuration:

  • PHP version: 8.0
  • MySQL version: 8.1.17
  • Webserver version: Apache/2.4.56 (Debian)
  • OS version: Mac OS

Checklist:

@ak-piracha ak-piracha requested a review from snipe as a code owner May 21, 2023 13:59
@welcome
Copy link

welcome bot commented May 21, 2023

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@what-the-diff
Copy link

what-the-diff bot commented May 21, 2023

PR Summary

  • New field added to checkout form
    A new field has been added to the checkout form specifically for consumable items.
  • Multiple item checkout now possible
    The checkout process has been updated to allow checking out multiple items at once, given that there's enough stock available.

@BlueNoob
Copy link

Yes, exactly, waiting for the approval of committing.

@Whitehawk29FR
Copy link

Hello, any new on this ? Really need too.

@tungpx1
Copy link

tungpx1 commented Sep 1, 2023

Hi @ak-piracha
This feature is likely to encounter a bug when you increase the quantity of consumables to several thousand and then attempt to check out between 5000-7000 of them, causing the system to hang when you click the checkout button on consumables with such a large quantity.

I suspect the issue lies in the way you handle the code. You seem to be using a for loop to check out from 1 to the quantity entered by the user.

@jayavman
Copy link

This also relates to my issue on #13587

We don't need to check out that many items but still in the 100's. I also suggested that Under the selection of user, put a Quantity you want to checkout. The quantity selector will only let you select up to the current quantity that is available.

@Joe2824
Copy link

Joe2824 commented Oct 5, 2023

This is a duplicate to pull request #10842.

@tiennv3011
Copy link

thanks

@JanAngelovic
Copy link

obrazek
Even AdminRemix is pointed to lack of bulk checkout in Snipe-It. :-/

@tiennv3011
Copy link

image
Can view this list in a single row with an additional column for QTY with item many checkout?

@snipe snipe merged commit 12e107a into snipe:develop May 29, 2024
1 check passed
$consumable->users()->attach($consumable->id, [
'consumable_id' => $consumable->id,
'user_id' => $admin_user->id,
'assigned_to' => e($request->input('assigned_to')),
'note' => $request->input('note'),
]);

}
event(new CheckoutableCheckedOut($consumable, $user, Auth::user(), $request->input('note')));
Copy link
Owner

Choose a reason for hiding this comment

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

We're not passing qty here here in the event though - it will show a checkout, but not the amount that was checked out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants