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

feat: stock return #682

Merged
merged 9 commits into from Aug 18, 2023
Merged

feat: stock return #682

merged 9 commits into from Aug 18, 2023

Conversation

akshayitzme
Copy link
Contributor

@akshayitzme akshayitzme commented Jul 1, 2023

This PR adds the functionality for Shipment Return & Purchase Reciept Return

Shipment Return

Purchase Receipt Return

Shipment, Purchase Receipt Return Statuses

Status Description
Return Return Doc is Submitted
Return Issued When a Return Doc is submitted against Shipment / Purchase Receipt

Shows Return Balance Item Qty

Screen Capture
2023-07-03.11-31-18.mp4
  1. Consider a Scenario where the following Shipment Entry is created.

    # Item Qty
    1 Jacket 2
  2. then the Customer returns one qty of the Item.

    # Item Qty isReturn
    1 Jacket -1 true
  3. If the Customer again returns one qty of the same Item, only the remaining Qty left to return (-1) is shown in the Shipment Form.

    # Item Qty isReturn
    1 Jacket -1 true

@18alantom
Copy link
Member

@akshayitzme if this is a rewrite of #636 you can close it

@akshayitzme akshayitzme mentioned this pull request Jul 1, 2023
4 tasks
@akshayitzme akshayitzme marked this pull request as ready for review July 3, 2023 06:30
@akshayitzme
Copy link
Contributor Author

@18alantom could you review this PR when you get time?

models/helpers.ts Outdated Show resolved Hide resolved
@@ -1,4 +1,4 @@
export type InvoiceStatus = 'Draft' | 'Saved' | 'Unpaid' | 'Cancelled' | 'Paid';
export type InvoiceStatus = 'Draft' | 'Saved' | 'Unpaid' | 'Cancelled' | 'Paid' | 'Return' | 'ReturnIssued';
Copy link
Member

Choose a reason for hiding this comment

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

Too many possible statuses they should be broken in to different groups. Will do it later.

Copy link
Member

@18alantom 18alantom left a comment

Choose a reason for hiding this comment

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

@akshayitzme along with all 29 review changes I need you to add the following two tests.

  1. Using Batches:

    1. Create Shipment with two item rows
    2. Both should have the same item but different batches and different quantities
    3. Create its Shipment Return
    4. Ensure that quantities for both batches have been updated correctly
  2. Using Serial Numbers:

    1. Create Purchase Receipt with an item row
    2. Item row should have more than one serial number
    3. Create its Purchase Receipt Return
    4. Ensure that quantities for both the Serial Numbers have been updated correctly
    5. Ensure that statuses for both Serial Numbers have been updated correctly

I need you to add these because this Stock Return PR doesn't take into account Batches and Serial Numbers and when one is returning Items using either of these it'll lead to unexpected bugs.

And so for the tests to pass you'll have to fix the handling of both in returns.

models/inventory/StockTransfer.ts Outdated Show resolved Hide resolved
src/components/StatusPill.vue Outdated Show resolved Hide resolved
src/components/StatusPill.vue Outdated Show resolved Hide resolved
src/components/StatusPill.vue Outdated Show resolved Hide resolved
src/components/StatusPill.vue Outdated Show resolved Hide resolved
models/inventory/StockTransfer.ts Outdated Show resolved Hide resolved
models/inventory/StockTransfer.ts Outdated Show resolved Hide resolved
models/inventory/StockTransfer.ts Outdated Show resolved Hide resolved
models/inventory/StockTransfer.ts Outdated Show resolved Hide resolved
models/inventory/StockTransfer.ts Outdated Show resolved Hide resolved
@akshayitzme akshayitzme mentioned this pull request Jul 18, 2023
8 tasks
@akshayitzme akshayitzme marked this pull request as draft July 18, 2023 08:50
@akshayitzme akshayitzme marked this pull request as ready for review August 1, 2023 06:29
@18alantom
Copy link
Member

Looks mostly fine, minor seemingly non feature threatening issues, merging.

@18alantom 18alantom merged commit 1a93ab0 into frappe:master Aug 18, 2023
4 checks passed
@akshayitzme akshayitzme mentioned this pull request Aug 19, 2023
4 tasks
18alantom added a commit that referenced this pull request Aug 21, 2023
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.

None yet

2 participants