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: subcontracting module #30955

Merged
merged 59 commits into from
Jul 8, 2022
Merged

feat: subcontracting module #30955

merged 59 commits into from
Jul 8, 2022

Conversation

s-aga-r
Copy link
Contributor

@s-aga-r s-aga-r commented May 10, 2022

Problem

Currently, the whole subcontracting flow is not intuitive and is sort of a work-around. It even takes a while to figure out the flow.

Possible Solution

Have an explicit flow for subcontracting:
image

For QA Team

Test site: https://subcontracting.frappe.cloud

There are two ways to subcontract the items in ERPNext:

1. Through Production Plan:

  • Create Items
  • Create BOMs
  • Create a Production Plan
  • Create Work Order and Purchase Order (Create > Work Order / Subcontract PO)
  • Follow the Manufacturing cycle (Submit the Work Order)
  • Set Service Item, Qty and Rate in Purchase Order and Submit it.
  • Create Subcontracting Order against the Purchase Order.
  • Transfer the raw materials to the Subcontractor.
  • Create Subcontracting Receipt against the Subcontracting Order.
  • Create the Purchase Receipt / Invoice (Optional) against the Purchase Order.
  • Complete the Manufacturing Cycle.

2. Directly create the Purchase Order:

  • Create Purchase Order (Select Service Item, Qty, Rate, Finished Good Item and Finished Good Item Qty).
  • Create Subcontracting Order against the Purchase Order.
  • Supply raw materials to the supplier.
  • Create Subcontracting Receipt.
  • Create Purchase Receipt / Invoice (Optional)

NOTE: Test data is already on the test site.

Possible Changes

DocType(s)

New

  • Subcontracting Order
  • Subcontracting Order Service Item (child)
  • Subcontracting Order Item (child)
  • Subcontracting Order Supplied Item (child)
  • Subcontracting Receipt
  • Subcontracting Receipt Item (child)
  • Subcontracting Receipt Supplied Item (child)

To Be Removed (Readonly for Now)

  • Purchase Order Item Supplied (child)

Master level

  • Mark Service item for subcontracting and then map Service Item with FG (BOM)
  • Add default subcontractor for the service item
  • Purchase Order (PO)
  • Mark PO for subcontracting
  • On selecting the service item (show the RMs and the cost of the RMs if the item mapping is done) or manually select a BOM for every service item
  • Option to create Subcontracting Order (SCO) from a submitted PO

Subcontracting Order (SCO)

  • Create from PO
  • Create independently (PO*)
  • Select supplier
  • Select FG items (if started from PO then populate basis service item mapping)
  • Add warehouse info for material transfer
  • Status: Draft/Open/Partially Received/Completed/Material transferred/Partial Material Transferred
  • Option to create a Stock entry (material transfer) on a submitted SCO
  • Option to create Subcontracting Receipt

Material Transfer

  • Create from submitted SCO
  • Independently create Stock Entry and provide a reference for SCO
  • Fetch all the RMs and the quantity
  • Provide From and To warehouse information
  • Transfer partially or full quantity
  • Transfer additional material
  • Update status of SCO basis of the material transferred.
  • Eway bill for transfer?

Subcontracting Receipt (SCR)

  • Create from SCO
  • Create independently and provide a reference for SCO (fetch all information)
  • Perform quality inspection (settings could be configured)
  • Partially receive -update SCO status
  • Complete receipt - update SCO status
  • Create return basis the quality inspection - update SCO status
  • Stock update

Create Purchase Receipt

  • From PO or SCO or independently by providing the reference for the PO
  • Update PO status.

@s-aga-r s-aga-r force-pushed the subcontracting branch 17 times, most recently from f1a3359 to 1bafea0 Compare May 13, 2022 07:12
@s-aga-r s-aga-r force-pushed the subcontracting branch 8 times, most recently from c5d1263 to 4ee985a Compare May 19, 2022 18:57
s-aga-r added 2 commits June 30, 2022 11:55
Removed this test case as the new POs will not have the Supplied Items table.
@s-aga-r s-aga-r requested a review from ruthra-kumar as a code owner June 30, 2022 11:21
@rohitwaghchaure
Copy link
Collaborator

@s-aga-r
Done with the testing, everything is working fine. Just found few minor issues which are as follows

  1. If purchase receipt created against purchase order with new flow then system throws an error "Supplier Warehouse" is mandatory. This field should be mandatory only if the purchase receipt made against the old flow purchase order

  2. Created Purchase Order (new flow) for 4 quantity and then created subcontracting order from purchase order. System has pulled items details from purchase order with quantity as 1. Ideally quantity should be 4, even system was not allowing to edit the quantity from 1 to 4.

  3. I can able to create n number of Subcontracting Purchase Orders against the main purchase order. The button "Create Subcontracting Order" should be hidden after creating of Subcontracting Purchase Orders

@s-aga-r
Copy link
Contributor Author

s-aga-r commented Jul 1, 2022

For the 2nd issue

There are two cases:

  1. When Service Item Qty and FG Item Qty are different.
Screen.Recording.2022-07-01.at.4.29.11.PM.mov
  1. When Service Item Qty and FG Item Qty are equal.
Screen.Recording.2022-07-01.at.4.30.03.PM.mov

@rohitwaghchaure
Copy link
Collaborator

@s-aga-r

While checking valuation I found one issue that the rate is different in Subcontracting PO, PR

Subcontracting PO :- Rate was set as 1000
Screenshot 2022-07-01 at 4 31 23 PM

Stock Transfer :- Rate was 1000
Screenshot 2022-07-01 at 4 32 25 PM

Subcontracting PR :- Rate set to 640,
Screenshot 2022-07-01 at 4 32 03 PM

If rate we are calculating as per FIFO then rate should be 400 (2*100 + 1000 = 1200 / 3) and not 640
Before subcontracting PR the Stock Queue was "[[2.0, 100.0], [3.0, 1000.0]]"
Screenshot 2022-07-01 at 4 35 42 PM

@rohitwaghchaure
Copy link
Collaborator

For the 2nd issue

There are two cases:

  1. When Service Item Qty and FG Item Qty are different.

Screen.Recording.2022-07-01.at.4.29.11.PM.mov
2. When Service Item Qty and FG Item Qty are equal.

Screen.Recording.2022-07-01.at.4.30.03.PM.mov

@s-aga-r Ok Understood
can we not set default qty as 1 and let user manually set the "Finished Good Item Qty"? or on change of Qty field can we set same qty to "Finished Good Item Qty" field? if user wants to change then they will change it manually.

@s-aga-r
Copy link
Contributor Author

s-aga-r commented Jul 1, 2022

For the 2nd issue

There are two cases:

  1. When Service Item Qty and FG Item Qty are different.

Screen.Recording.2022-07-01.at.4.29.11.PM.mov
2. When Service Item Qty and FG Item Qty are equal.
Screen.Recording.2022-07-01.at.4.30.03.PM.mov

@s-aga-r Ok Understood can we not set default qty as 1 and let user manually set the "Finished Good Item Qty"? or on change of Qty field can we set same qty to "Finished Good Item Qty" field? if user wants to change then they will change it manually.

Both Qty and FG Item Qty are by default 1.

Screen.Recording.2022-07-01.at.7.23.41.PM.mov

@ankush ankush removed their assignment Jul 5, 2022
@nabinhait nabinhait merged commit 8b69a3e into frappe:develop Jul 8, 2022
@s-aga-r s-aga-r deleted the subcontracting branch April 15, 2023 10:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

Subcontracting flow refactoring
4 participants