Package org.broadleafcommerce.common.util

Examples of org.broadleafcommerce.common.util.TableCreator


    public void printOrder(Order order, Log log) {
        if (!log.isDebugEnabled()) {
            return;
        }
       
        TableCreator tc = new TableCreator(new TableCreator.Col[] {
            new TableCreator.Col("Order Item", 30),
            new TableCreator.Col("Qty"),
            new TableCreator.Col("Unit Price"),
            new TableCreator.Col("Avg Adj"),
            new TableCreator.Col("Total Adj"),
            new TableCreator.Col("Total Price")
        });

        for (OrderItem oi : order.getOrderItems()) {
            tc.addRow(new String[] {
                oi.getName(),
                String.valueOf(oi.getQuantity()),
                String.valueOf(oi.getPriceBeforeAdjustments(true)),
                String.valueOf(oi.getAverageAdjustmentValue()),
                String.valueOf(oi.getTotalAdjustmentValue()),
                String.valueOf(oi.getTotalPrice())
            });
        }
       
        tc.addSeparator()
            .withGlobalRowHeaderWidth(15)
            .addRow("Subtotal", order.getSubTotal())
            .addRow("Order Adj.", order.getOrderAdjustmentsValue())
            .addRow("Tax", order.getTotalTax())
            .addRow("Shipping", order.getTotalShipping())
            .addRow("Total", order.getTotal())
            .addSeparator();
       
        log.debug(tc.toString());
    }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.util.TableCreator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.