This functionality is used at the vehicle offer creation step.
When creating a new offer, except from the vehicle line, there was a need for extra items to be added automatically, instead of manually. This is done via a few criteria that will be described below.
Entity
The entity is called IDMS_AUTODOCLINES
and the equivalent table name is @IDMS_AUTODOCLINES
.
Also, the IDMS_DOCUMENTITEM
was extended by adding a new field which contains the code of the automatic document item that is being added to an offer.
- Field:
U_IDMS_AutoItemCode
Setup
A new setup page was created which is used to manage the data for each automatic document item. The URL and Business Case are the following:
~/SetupEntities/List/SalesAndLeads/IDMS_AUTODOCLINES
- BC: 1971
The setup grid list page and form was created based on the generic setup XML forms and lists. The equivalent files are the following:
~/Files/SetupEntities/SalesAndLeads/IDMS_AUTODOCLINES_list.xml
~/Files/SetupEntities/SalesAndLeads/IDMS_AUTODOCLINES_form.xml
The creation or update action is implemented at the DocumentActionController
and the method CreateOrUpdateEntityAutoDocLine
.
Only one validation exists:
- Start Date must be before the End Date or vice versa
Process
Adding automatically when creating the Sales Offer
When creating a new offer, any automatic items that match the following criteria are added automatically as item lines in the offer.
The following criteria is applied:
- Make/Family/Model Filter matches:
- Make = Make from the Vehicle, Family = Family from the Vehicle, Model = Model from the Vehicle
Additional Items especially for the Family/Model - Or Make = Make from the Vehicle, Family = Family from the Vehicle, Model = Empty
General additional Items for the corresponding Make and Family - Or Make = Make from the Vehicle, Family = Empty, Model = Empty
General additional Items for the corresponding Make - Or Make = empty, Family = Empty, Model = Empty
General additional Items valid for all Makes of the Dealer
- Make = Make from the Vehicle, Family = Family from the Vehicle, Model = Model from the Vehicle
- Only additional Items should be selected where the Industry Group = empty or Industry Group = Industry Group from the Business Partner
- Only additional Items should be selected where Customer Group = empty or Customer Group = Customer Group from the Business Partner
- Only additional Items should be selected where Sales Type = empty or Sales Type = Sales Type from the Sales Lead
- Only additional Items should be selected where Vehicle Status = empty or Vehicle Status = Vehicle Status from the offered Vehicle
- Only additional Items with a valid Time Period (Offer Date must be between Start Date and End Date)
- Only additional Items should be selected where Model Year from / to = empty or Model Year of the Vehicle is between Model Year from and Model Year to from the Option Line.
This criteria are applied as an expression of type Func<IDMS_AUTODOCLINES, bool>
and is generated at the method AddAutomaticItemLines
which resides at the SalesDocumentOfferManager
. This method is called at the following places:
- Most notably the
CreateDefaultDocumentLines
(base and all inherited implementations) PreviewDocumentOffer
- This method is referring to the existing offer selection popup which invalidates existing automatic document lines and add the new ones
ValidateDocumentOfferLines
- This method is used for the validation step at the offer → order process
For more info on the process check Automatic Document Lines article.
Related Issues
AVGA-56 - Getting issue details... STATUS
AVGA-497 - Getting issue details... STATUS
0 Comments