feat : Update Sales Order and Sales Invoice #211
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature description
-Update Quotation,Sales Invoice and Sales Order.
Solution Description
1.Sales Order Validation with Quotation:
-A new server-side validation method validate_sales_order_amount_with_quotation ensures that the total amount of Sales Orders created against a Quotation does not exceed or fall short of the Quotation's total amount.
-The system also checks if the is_barter checkbox is checked in the Quotation. If it is, the system ensures that a corresponding Purchase Invoice exists for the same customer, using common party accounting logic to create and link a Supplier if necessary.
2.Customer Overdue Invoice Alert:
-When creating a Sales Order, the system now checks if the customer has any overdue Sales Invoices. If overdue invoices are found, a red alert is displayed on the Sales Order form with links to the corresponding overdue Sales Invoices.
3.Sales Type Filtering:
-The Sales Order form dynamically filters the available item_code options in the child table based on the selected sales_type.
-The form also sets the appropriate values for the include_in_ibf field depending on the sales_type, is_barter_invoice, and is_agent fields.
4.Agent-Based Customization:
-If a Sales Order is linked to a Quotation (via reference_id), the system checks if the customer is an agent by fetching the is_agent field from the Customer doctype. If the customer is an agent, the form enforces specific conditions such as making the actual_customer and include_in_ibf fields mandatory or read-only.
-The actual_customer field filters customers who are not agents when setting up the Sales Order.
5.Quotation Custom Buttons and Fields:
-The system also fetches the sales_type from the Item doctype and automatically fills it in the Quotation's item table, based on the selected item_code.
6.Sales Order Creation from Quotation:
-The form behavior is modified to automatically read-only the customer field when the Sales Order is created from a Quotation. This ensures that the linked customer remains unchanged.
Output
Is there any existing behavior change of other features due to this code change?
-No
Was this feature tested on the browsers?