ffbc.ContractsAmendmentServiceglobal with sharing class ContractsAmendmentService
This class provides services for automated amendments to active contracts. EnumsRoundingScaleThe scale to be used when rounding calculated values for price amendments. The exact numerical precision used during rounding will depend on a combination of the RoundingScale and other factors such as the line currency.
Methods
changeContractPricesByPercentageglobal static ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageResponse changeContractPricesByPercentage(ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageRequest request) Create change requests that will change the unit prices on the given contracts by a fixed percentage value, taking effect on the date given. This service will only create the change requests, they must be applied separately using ContractsService.applyChangeRequests. Exceptions Thrown
Return ValueResponse containing the IDs of the change requests that have been created, and may contain errors if AllowPartialSuccess flag is true in the Request. changeContractPricesByPercentageAsyncglobal static Id changeContractPricesByPercentageAsync(ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageRequest request) Using a background process, create change requests that will change the unit prices on the given contracts by a fixed percentage value, taking effect on the date given. The background process will only create the change requests, they must be applied separately using ContractsService.applyChangeRequests. Any warnings or errors will be written to the logs. Exceptions Thrown
Return ValueThe ID of the background process that is to change the prices on the given contracts. calculatePriceChargedFromDatesglobal static ffbc.ContractsAmendmentService.PriceChargedFromDatesResponse calculatePriceChargedFromDates(ffbc.ContractsAmendmentService.PriceChargedFromDatesRequest request) Given a list of contract line Ids and corresponding effective-from dates, calculate and return the dates at which price amendments will be charged from. Return ValueResponse containing a map of dates by the IDs of the contract line items. calculateNewPricesByPercentageIncreaseglobal static ffbc.ContractsAmendmentService.NewPriceByPercentageIncreaseResponse calculateNewPricesByPercentageIncrease(ffbc.ContractsAmendmentService.NewPriceByPercentageIncreaseRequest request) Given a list of contract line IDs and a percentage increase value, calculate the amended unit price for each line. Input Parameters
Return ValueResponse containing a map of new unit prices by the IDs of the contract line items. changeContractLinePricesglobal static ffbc.ContractsAmendmentService.ChangeContractLinePricesResponse changeContractLinePrices(List<ffbc.ContractsAmendmentService.ChangeContractLinePricesRequest> requests) Create change requests that will change the unit prices on the given contracts by given amounts for each line, taking effect on the date given. This service will only create the change requests, they must be applied separately using ContractsService.applyChangeRequests. Exceptions Thrown
Return ValueResponse containing the IDs of the change requests that have been created. ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageRequestglobal with sharing class ChangeContractPricesByPercentageRequest A request to amend contract prices by a certain percentage, used with changeContractPricesByPercentage. Properties
Methods
ChangeContractPricesByPercentageRequestglobal ChangeContractPricesByPercentageRequest() Creates a request with an empty set of contract IDs, a percentage change of 0, and an effective from date of tomorrow. ChangeContractPricesByPercentageRequestglobal ChangeContractPricesByPercentageRequest(Set<Id> contractIds, Decimal percentage, Date effectiveFromDate) Creates a request with the given contract IDs, percentage change, and effective from date. ffbc.ContractsAmendmentService.ChangeContractPricesResponseglobal virtual with sharing class ChangeContractPricesResponse extends Response The result of amending contract prices using changeContractPricesByPercentage or changeContractLinePrices. This class contains the data that is common to both the line and percentage amendment variants. The two variants then extend this class to provide their own responses. This class currently may report errors. If AllowPartialSuccess is false, errors when creating a change request for any contract will produce an exception. Can contain errors if AllowPartialSuccess is true and the object is a ChangeContractPricesByPercentageResponse This response may contain warnings. This class extends ffbc.Response Properties
Methods
ChangeContractPricesResponseglobal ChangeContractPricesResponse() Creates a response with no change request IDs. ChangeContractPricesResponseglobal ChangeContractPricesResponse(Map<Id, Id> changeRequestIdsByActiveContractId) Creates a response with the given change request IDs keyed by active contract ID. ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageResponseglobal with sharing class ChangeContractPricesByPercentageResponse extends ChangeContractPricesResponse The result of amending contract prices using changeContractPricesByPercentage. This class currently may report errors. If AllowPartialSuccess is false, errors when creating a change request for any contract will produce an exception. It can contain errors if AllowPartialSuccess is true This response may contain warnings. This class extends ffbc.ContractsAmendmentService.ChangeContractPricesResponse Methods
ChangeContractPricesByPercentageResponseglobal ChangeContractPricesByPercentageResponse() Creates a response with no change request IDs. ChangeContractPricesByPercentageResponseglobal ChangeContractPricesByPercentageResponse(Map<Id, Id> changeRequestIdsByActiveContractId) Creates a response with the given change request IDs keyed by active contract ID. ffbc.ContractsAmendmentService.ChangeContractLinePricesRequestglobal with sharing class ChangeContractLinePricesRequest A request to amend prices for a contract by given amounts for each line, used with changeContractLinePrices. Properties
Methods
ChangeContractLinePricesRequestglobal ChangeContractLinePricesRequest(Id contractId, Map<Id, ffbc.ContractsAmendmentService.ContractLinePriceInfo> linePrices) Creates a request with the given contract ID and line amendments. ffbc.ContractsAmendmentService.ContractLinePriceInfoglobal with sharing class ContractLinePriceInfo Contains new price information for a contract line item. Includes the new unit price and effective from date. Used with ChangeContractLinePricesRequest. Properties
Methods
ContractLinePriceInfoglobal ContractLinePriceInfo(Decimal unitPrice, Date effectiveFromDate) Creates an object with the given line unit price and effective from date ffbc.ContractsAmendmentService.ChangeContractLinePricesResponseglobal with sharing class ChangeContractLinePricesResponse extends ChangeContractPricesResponse The result of amending contract prices using changeContractLinePrices. This class currently will never report any errors. Errors in creating a change request for any contract will produce an exception. This response may contain warnings. This class extends ffbc.ContractsAmendmentService.ChangeContractPricesResponse Methods
ChangeContractLinePricesResponseglobal ChangeContractLinePricesResponse() Creates a response with no change request IDs. ChangeContractLinePricesResponseglobal ChangeContractLinePricesResponse(Map<Id, Id> changeRequestIdsByActiveContractId) Creates a response with the given change request IDs keyed by active contract ID. ffbc.ContractsAmendmentService.PriceChargedFromDatesRequestglobal with sharing class PriceChargedFromDatesRequest A request to calculate and return the dates at which price amendments will be charged from, used with calculatePriceChargedFromDates. Properties
MethodsPriceChargedFromDatesRequestglobal PriceChargedFromDatesRequest(Map<Id, Date> effectiveFromDatesByContractLineId) Creates a request with the given map of effective from dates by contract line id. ffbc.ContractsAmendmentService.PriceChargedFromDatesResponseglobal with sharing class PriceChargedFromDatesResponse The result of calculating dates at which price amendments will be charged from, using calculatePriceChargedFromDates. This class contains a map of charge dates by contract line id. Properties
Methods
PriceChargedFromDatesResponseglobal PriceChargedFromDatesResponse() Creates a response with an empty map of charge dates by contract id. PriceChargedFromDatesResponseglobal PriceChargedFromDatesResponse(Map<Id, Date> priceChargedFromDates) Creates a response with the given map of charge dates by contract id. ffbc.ContractsAmendmentService.NewPriceByPercentageIncreaseRequestglobal with sharing class NewPriceByPercentageIncreaseRequest A request to calculate new unit prices for contract line items after a percentage increase using calculateNewPricesByPercentageIncrease. Properties
MethodsNewPriceByPercentageIncreaseRequestglobal NewPriceByPercentageIncreaseRequest(Set<Id> lineIds, Decimal percentageIncrease) Creates a request with the lineIds and the percentage increase value. ffbc.ContractsAmendmentService.NewPriceByPercentageIncreaseResponseglobal with sharing class NewPriceByPercentageIncreaseResponse extends Response The result of calculating new unit prices for contract line items after a percentage increase using calculateNewPricesByPercentageIncrease. This class contains a map of new unit prices by contract line ID. This class extends ffbc.Response Properties
|