Пример #1
0
  public static void allBooksSold() {
    List<BookOrder> orders =
        BookOrder.find(
                "select o from BookOrder o where o.status=?  order by o.orderDate DESC,o.id DESC",
                Status.DELIVERED)
            .fetch();
    Triplet<BigDecimal, BigDecimal, HashMap<Book, Integer>> triplet = createBookQuantityMap(orders);
    HashMap<Book, Integer> book_QuantityMap = triplet.getThird();
    BigDecimal totalPriceOfBooks = triplet.getFirst();
    BigDecimal totalAmountFromSales = triplet.getSecond();
    System.out.println("allBooksSold()::calling renderPdf on generateReports");
    // generateReport("allBooksSold",book_QuantityMap,totalPriceOfBooks,totalAmountFromSales);
    String title = "all Books Sold";
    // String currencySymbol =
    // play.libs.I18N.getCurrencySymbol(play.i18n.Messages.get("currencycode"));
    // System.out.println("currencycode="+play.i18n.Messages.get("currencycode"));
    // System.out.println("currencySymbol="+currencySymbol);
    render(
        "Admin/generateReport.html",
        title,
        book_QuantityMap,
        totalPriceOfBooks,
        totalAmountFromSales);
    // play.modules.pdf.PDF.renderPDF("Admin/generateReport.html",title,book_QuantityMap,totalPriceOfBooks,totalAmountFromSales);

  }
Пример #2
0
 public static void allDeliveredOrders() {
   List<BookOrder> deliveredOrders =
       BookOrder.find(
               "select o from BookOrder o where o.status=?  order by o.orderDate DESC,o.id DESC",
               Status.DELIVERED)
           .fetch();
   render(deliveredOrders);
 }
Пример #3
0
 public static void allApprovedOrders() {
   List<BookOrder> approvedOrders =
       BookOrder.find(
               "select o from BookOrder o where o.status=?  order by o.orderDate DESC,o.id DESC",
               Status.APPROVED)
           .fetch();
   render(approvedOrders);
 }
Пример #4
0
 public static void allConfirmedOrders() {
   List<BookOrder> confirmedOrders =
       BookOrder.find(
               "select o from BookOrder o where o.status=?  order by o.orderDate DESC,o.id DESC",
               Status.CONFIRMED)
           .fetch();
   render(confirmedOrders);
 }
Пример #5
0
 public static void allPendingOrders() {
   List<BookOrder> pendingOrders =
       BookOrder.find(
               "select o from BookOrder o where o.status=?  order by o.orderDate DESC,o.id DESC",
               Status.PENDING)
           .fetch();
   render(pendingOrders);
 }