zaviagodev / frappe

MIT License
0 stars 1 forks source link

Enhance ERPNext Shipping Rules with Item Quantity and City Restriction #178

Open John-zaviago opened 10 months ago

John-zaviago commented 10 months ago

Issue Title: Enhance ERPNext Shipping Rules with Item Quantity and City Restriction

Issue Description: To provide more flexibility and customization in shipping rules within ERPNext, we need to introduce additional features that allow users to set shipping rates based on item quantity in sales invoices and restrict shipping rules to specific cities.

New Features:

  1. Item Quantity-Based Shipping Rates:

    • Enhance the Shipping Rule Conditions to include Item Quantity as a parameter.
    • Allow users to set quantity ranges (e.g., 1-20 items, 20-40 items) and define corresponding shipping rates for each range.
    • Users should be able to add multiple conditions for different quantity ranges within a single Shipping Rule.
  2. City-Based Shipping Rules:

    • Introduce a new section for City Restrictions within Shipping Rules.
    • Allow users to specify cities for which the shipping rule will be applicable.
    • By default, the shipping rule will still be globally applicable unless specific cities are selected.

Implementation Steps:

  1. Item Quantity-Based Shipping Rates:

    • Modify the Shipping Rule Conditions interface to include Item Quantity as a selectable parameter.
    • Implement the ability to set quantity ranges and define shipping rates for each range.
    • Ensure users can add multiple conditions for different quantity ranges within a single Shipping Rule.
  2. City-Based Shipping Rules:

    • Implement a new section for City Restrictions within Shipping Rules.
    • Allow users to add and select cities for which the shipping rule will be applicable.
    • Ensure that by default, the shipping rule remains globally applicable unless specific cities are chosen.

Expected Outcome:

Additional Information:


Action Plan:

  1. Assign the issue to a team member specializing in ERPNext development and shipping rules.
  2. Modify the Shipping Rule Conditions interface to include Item Quantity as a selectable parameter.
  3. Implement the ability to set quantity ranges and define shipping rates for each range.
  4. Allow users to add multiple conditions for different quantity ranges within a single Shipping Rule.
  5. Implement a new section for City Restrictions within Shipping Rules.
  6. Allow users to add and select cities for which the shipping rule will be applicable.
  7. Ensure that by default, the shipping rule remains globally applicable unless specific cities are chosen.
  8. Test the implemented features across various scenarios to ensure reliability.
  9. Update documentation to inform users about the new shipping rule enhancements.
  10. Communicate updates to the team and stakeholders.
  11. Document the implementation details for future reference.

How to Test:

John-zaviago commented 9 months ago

@Muzmal What is expected MVP and the time to from dev to test for this tasks.

Muzmal commented 9 months ago

https://github.com/Muzmal/upgrade_shipping_rule You can test now

chomchuen commented 9 months ago

Shipping Rules can calculate from item quantity and City of customer.✅ Test on Shipping Rules Setting (tmp site).

Image

example: Image

chomchuen commented 9 months ago

1) Is it possible to move 'Quantity Based' option to 'Calculation based on' field? if it possible, please move 'Quantity Based' to 'Calculation based on' field. Image

2) "Shipping Amount" will Mandatory/Display depends on 'Fixed' condition only. Image

3) From-To value must be 'Int' instead of 'float'. Image

4) 'Restrict to...' Table.

4.1 Change City to state. 4.2 To prevent confusion, we will let users use only our custom table. Image 4.3 Before selecting state, need to select Country first. (example is in the previous comment.) 4.4 Remove 'Shipping Rule' from table. Image

chomchuen commented 9 months ago

Waiting for Umer to push a new version to tmp.

chomchuen commented 8 months ago

@Muzmal Did really Umer update the code yet? I can't see any changes about Restrict shipping area🤔.

Image

chomchuen commented 8 months ago

@Muzmal I can't use this shipping rule due to this warning.

Image

Muzmal commented 8 months ago

Yes this is correct functionality. Now it is same as country table. If Bamyan State is selected then any customer with other than selected state, will get this message.