示例#1
0
  public ItemReceiptEntry calculateTax(Item item) {
    ValidationHelper.validateForNull(item, "item");
    BigDecimal totalTax = new BigDecimal("0.0");

    if (item.getItemType().getIsSalesTaxable()) {
      totalTax = totalTax.add(calculateSalesTax(item));
    }

    if (item.getItemOrigin().getIsImportDutyTaxable()) {
      totalTax = totalTax.add(calculateImportDuty(item));
    }
    BigDecimal roundedUpTax = roundUptoNearestPointFive(totalTax);
    return new ItemReceiptEntry(item, roundedUpTax);
  }
示例#2
0
 private BigDecimal calculateImportDuty(Item item) {
   return item.getItemPrice().getUnitValue().multiply(IMPORT_DUTY_RATE);
 }
示例#3
0
 private BigDecimal calculateSalesTax(Item item) {
   return item.getItemPrice().getUnitValue().multiply(SALES_TAX_RATE);
 }