Пример #1
0
 public String receiptToHtml(Receipt receipt) {
   StringBuffer receiptBuffer = new StringBuffer();
   for (TaxedItem taxedItem : receipt.getTaxedItems()) {
     receiptBuffer.append(taxService.taxedItemToString(taxedItem)).append("<br>");
   }
   receiptBuffer
       .append("Sales Taxes: ")
       .append(receipt.getTaxesTotal())
       .append("<br>Total: " + receipt.getReceiptTotal() + "<br>");
   return receiptBuffer.toString();
 }
Пример #2
0
 public void addBasketItemToReceipt(Receipt receipt, BasketItem basketItem) {
   addTaxedItemToReceipt(receipt, taxService.buildTaxedItem(basketItem));
 }
Пример #3
0
 public Receipt buildReceiptFromBasket(List<BasketItem> basketItems) {
   return buildReceiptFromTaxedBasket(taxService.buildTaxedBasket(basketItems));
 }