Ejemplo n.º 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();
 }
Ejemplo n.º 2
0
 public void addBasketItemToReceipt(Receipt receipt, BasketItem basketItem) {
   addTaxedItemToReceipt(receipt, taxService.buildTaxedItem(basketItem));
 }
Ejemplo n.º 3
0
 public Receipt buildReceiptFromBasket(List<BasketItem> basketItems) {
   return buildReceiptFromTaxedBasket(taxService.buildTaxedBasket(basketItems));
 }