Scenario – adding a product
The user will click the ADD button to open the QUOTE LINE DIALOG.
The user enters a search value: "Glops"
The client calls the ERP connector
IQuoteConnector.FindProduct
("Glops").The ERP connector searches the ERP database and gets back a list of matching products.
The user selects a product from the result list. This gives us the ERP Product key of the product.
The client calls
IQuoteConnector.GetQuoteLineFromProduct( quoteContext, erpKey )
to get the full information for the product.The client updates the dialog with values from the new QuoteLine.
The user changes the QUANTITY from 1 to 10 and hits TAB
The system calls ERP Connector:
IQuoteConnector.OnQuoteLineChanged( quoteline, quotecontext )
with the quoteline amount = 10 rather than 1.The ERP connector receives a new discount from the ERP system: Assume now that the ERP system thinks 10% would be a good discount for this quote. So the QuoteLine.ERPDiscountPercent = 10.
The system calculates the other value: ERPDiscountAmount = 10% * UnitListPrice * Quantity.
Since the UserValueOverride = None, this means that the ERP connector shall copy the ERPDiscountAmount into the DiscountAmount field and the ERPDiscountPercent in the DiscountPercent field.
Then the connector calculates the TotalPrice, the Earning percent, and the Earning amount.
The system updates the GUI with the new values from the quote line.
The user changes the UnitListprice from 13.00 to 14.00
Again, the system calls ERP Connector:
IQuoteConnector.OnQuoteLineChanged
Assume now that the ERP connector returns with ERPDiscountPercent field updated to 12.
The system calculates the ERPDiscountAmount.
The system sees that the
UserValueOverride
is still none, so both ERP values are copied to the user discount fields.Then the connector calculates the TotalPrice, the Earning percent, and the Earning amount.
The system updates the GUI with the new values from the quote line.
The user changes the DISCOUNT PERCENT from 12% back to 10%
The system sets the Quoteline. UserValueOverride = DiscountPercent
Again the system calls ERP Connector:
IQuoteConnector.OnQuoteLineChanged
The system calculates the
ERPDiscountAmount
from the ERPDiscountPercent, but this time does not copy the ERP values to the user discount fields, since the user has entered a discount value (the UserValueOverride is not NONE).The system calculates the
QuoteLine.DiscountAmount
from the DiscountPercent value since the UserValueOverride field is PercentField. And then the TotalPrice, the Earning percent and the Earning amount.
The user clicks the SAVE button
The system calls the ERP Connector: IQuoteConnector.RecalculateAlternative()
to update all the quote alternative total.