Example of Use (SC Quoting Plugin)
Compensation Value
Get an estimated compensation value by using this method:
/** * Calculate estimated compensation value for each line item in quote, include: Max Compensation Estimate and Actual Compensation Estimate.
* - Max Compensation Estimate: calculated based on Recommended Price
* - Actual Compensation Estimate: calculated based on negotiated/invoice price
* @param customerId - customerId
* @param productId - productId
* @param effectiveDate - effectiveDate from Quote
* @param quoteCreator - quoteCreator(login username) from Quote
* @param recommendedPrice - recommended price (should be recommended revenue = recommended Price * Quantity)
* @param invoicePrice - invoice price (should be invoice revenue = unit Price * Quantity)
* @param switchMonth - switch Month of current year, value as: Jan=0, Feb=1, Mar=2,...,Dec=11
* @return Map [maxCompensation:<BigDecimal>,
* actualCompensation:<BigDecimal>]
*/
Map getSalesCompensationEstimation(String customerId,
String productId,
Date effectiveDate,
String quoteCreator,
BigDecimal recommendedPrice,
BigDecimal invoicePrice,
Integer switchMonth)
This method is in the package SC_QuotingPluginLib.SalesCompensationEstimation.
Example:
return libs.SC_QuotingPluginLib.SalesCompensationEstimation.getSalesCompensationEstimation("CD-0001",
"MB-0002",
"2022-01-01",
"vinh",
100,
80,
4)
ResultGauge
Show ResultGauge in a quote line item by using this method:
/**
* Show a line score chart, Actual Compensation Estimate for the line expressed as % from Max Compensation Estimate
* With Actual Compensation Estimate and Max Compensation Estimate got from SalesCompensationEstimation.getSalesCompensationEstimation
* Chart setting read from configuration PP
* @param maxCompensation - max compensation
* @param actualCompensation - actual compensation
* @return ResultGauge chart
*/
ResultGauge createCompensationLineScore(BigDecimal maxCompensation, BigDecimal actualCompensation)
This method is in the package SC_QuotingPluginLib.ChartUtils.
Example:
return libs.SC_QuotingPluginLib.ChartUtils.createCompensationLineScore(100,50)
Pie HighChart
Show Pie HighChart in a quote header by using this method:
This method is in the package SC_QuotingPluginLib.ChartUtils.
Example:
Â