public class DefaultConsignmentAmountCalculationStrategy extends java.lang.Object implements ConsignmentAmountCalculationStrategy
ConsignmentAmountCalculationStrategy| Constructor and Description |
|---|
DefaultConsignmentAmountCalculationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
calculateAlreadyCapturedAmount(ConsignmentModel consignment)
Calculates the amount which has been already captured on the
OrderModel
of the given ConsignmentModel |
protected java.math.BigDecimal |
calculateAmountCaptured(ConsignmentModel consignment)
Calculates amount already captured for the given
ConsignmentModel |
protected java.math.BigDecimal |
calculateAmountToCapture(ConsignmentModel consignment,
java.math.BigDecimal alreadyCapturedAmount,
java.math.BigDecimal totalOrderAmount)
Calculates the amount to capture.
|
java.math.BigDecimal |
calculateCaptureAmount(ConsignmentModel consignment)
Calculates the amount to be captured for the given
ConsignmentModel |
protected java.math.BigDecimal |
calculateConsignmentAmount(ConsignmentModel consignment,
boolean includeTaxes)
Calculates the amount of the
ConsignmentModel based on the appropriate AbstractOrderEntryModel.TOTALPRICE |
java.math.BigDecimal |
calculateConsignmentEntryAmount(ConsignmentEntryModel consignmentEntry,
boolean includeTaxes)
Calculates amount for
ConsignmentEntryModel |
protected java.math.BigDecimal |
calculateConsignmentEntryTaxAmount(ConsignmentEntryModel consignmentEntry)
Calculates Tax amount for
ConsignmentEntryModel |
java.math.BigDecimal |
calculateDiscountAmount(ConsignmentModel consignment)
Calculates the discount amount for the
ConsignmentModel taking a part of AbstractOrderModel.TOTALDISCOUNTS |
protected java.math.BigDecimal |
calculateDiscountAmountForConsignment(ConsignmentModel consignment)
Calculates discount amount for
ConsignmentModel by taking a proportional part of
AbstractOrderModel.TOTALDISCOUNTS. |
protected java.math.BigDecimal |
calculateOrderAmountWithoutDeliveryCostAndDeliveryTax(ConsignmentModel consignment)
Calculates order amount without delivery cost and its corresponding tax
|
java.math.BigDecimal |
calculateTotalOrderAmount(ConsignmentModel consignment)
Calculates the order total of the given
ConsignmentModel |
protected boolean |
isOnlyOrLastConsignment(ConsignmentModel consignment)
Decides if this
ConsignmentModel is the only or last one to be captured |
public DefaultConsignmentAmountCalculationStrategy()
public java.math.BigDecimal calculateCaptureAmount(ConsignmentModel consignment)
ConsignmentAmountCalculationStrategyConsignmentModelcalculateCaptureAmount in interface ConsignmentAmountCalculationStrategyconsignment - given ConsignmentModelConsignmentModelpublic java.math.BigDecimal calculateAlreadyCapturedAmount(ConsignmentModel consignment)
ConsignmentAmountCalculationStrategyOrderModel
of the given ConsignmentModelcalculateAlreadyCapturedAmount in interface ConsignmentAmountCalculationStrategyconsignment - given ConsignmentModelBigDecimal the sum of all previously captured amountpublic java.math.BigDecimal calculateTotalOrderAmount(ConsignmentModel consignment)
ConsignmentAmountCalculationStrategyConsignmentModelcalculateTotalOrderAmount in interface ConsignmentAmountCalculationStrategyconsignment - given ConsignmentModelBigDecimal the order totalpublic java.math.BigDecimal calculateDiscountAmount(ConsignmentModel consignment)
ConsignmentAmountCalculationStrategyConsignmentModel taking a part of AbstractOrderModel.TOTALDISCOUNTScalculateDiscountAmount in interface ConsignmentAmountCalculationStrategyconsignment - given ConsignmentModelBigDecimal the discount for the give consignmentpublic java.math.BigDecimal calculateConsignmentEntryAmount(ConsignmentEntryModel consignmentEntry, boolean includeTaxes)
ConsignmentAmountCalculationStrategyConsignmentEntryModelcalculateConsignmentEntryAmount in interface ConsignmentAmountCalculationStrategyconsignmentEntry - given ConsignmentEntryModelincludeTaxes - if true returns the amount with taxes otherwise - without taxesBigDecimal amount of the consignment entryprotected java.math.BigDecimal calculateDiscountAmountForConsignment(ConsignmentModel consignment)
ConsignmentModel by taking a proportional part of
AbstractOrderModel.TOTALDISCOUNTS.
Returns the discount value without taking into account if it's the last consignmentconsignment - ConsignmentModel to calculate discountBigDecimal the discount amountprotected boolean isOnlyOrLastConsignment(ConsignmentModel consignment)
ConsignmentModel is the only or last one to be capturedconsignment - given ConsignmentModelConsignmentModel is the only one or the last one to be capturedprotected java.math.BigDecimal calculateAmountToCapture(ConsignmentModel consignment, java.math.BigDecimal alreadyCapturedAmount, java.math.BigDecimal totalOrderAmount)
consignment - given ConsignmentModelalreadyCapturedAmount - the amount which has been already capturedtotalOrderAmount - the order totalBigDecimal amount to be captured on this consignmentprotected java.math.BigDecimal calculateConsignmentAmount(ConsignmentModel consignment, boolean includeTaxes)
ConsignmentModel based on the appropriate AbstractOrderEntryModel.TOTALPRICEconsignment - given ConsignmentModelincludeTaxes - if true returns the amount with taxes otherwise - without taxesBigDecimal the cost of the consignmentprotected java.math.BigDecimal calculateConsignmentEntryTaxAmount(ConsignmentEntryModel consignmentEntry)
ConsignmentEntryModelconsignmentEntry - given ConsignmentEntryModelBigDecimal amount of the consignment entryprotected java.math.BigDecimal calculateAmountCaptured(ConsignmentModel consignment)
ConsignmentModelconsignment - the given ConsignmentModelBigDecimal amount captured for the consignmentprotected java.math.BigDecimal calculateOrderAmountWithoutDeliveryCostAndDeliveryTax(ConsignmentModel consignment)
consignment - BigDecimal order amount for the consignmentCopyright © 2018 SAP SE. All Rights Reserved.