<form class="form-horizontal" role=form>
    <h2>Purchase Entries</h2>

    <div class="form-group">
        <label for="txtStartDate" class="col-md-2 control-label">Date</label>

        <div class="col-md-4">
            <div class="input-group">
                <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
                       ng-model="info.StartDate"/>
                <span class="input-group-btn">
                    <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
            </div>
        </div>
        <div class="col-md-4">
            <div class="input-group">
                <input type="text" id="txtFinishDate" class="form-control" datepicker-popup="dd-MMM-yyyy"
                       ng-model="info.FinishDate"/>
                <span class="input-group-btn">
                    <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
            </div>
        </div>
        <div class="col-md-2">
            <button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i></button>
        </div>
    </div>
    <table class="table table-condensed table-bordered table-striped">
        <thead>
        <tr>
            <th>Date</th>
            <th>Supplier</th>
            <th>Product</th>
            <th class="text-right">Quantity</th>
            <th class="text-right">Rate</th>
            <th class="text-right">Tax</th>
            <th class="text-right">Amount</th>
        </tr>
        </thead>
        <tbody ng-repeat="items in info.Body">
        <tr ng-repeat="item in items.Products">
            <td ng-if="$first" rowspan="{{items.Products.length}}" class="no-wrap">{{items.Date}}</td>
            <td ng-if="$first" rowspan="{{items.Products.length}}"><a href="{{items.Url}}">{{items.Supplier}}</a></td>
            <td>{{item.Product}}</td>
            <td class="text-right">{{item.Quantity | number:2}}</td>
            <td class="text-right">{{item.Rate | currency}}</td>
            <td class="text-right">{{item.Tax | percent}}</td>
            <td class="text-right">{{item.Amount | currency}}</td>
        </tr>
        </tbody>
    </table>
</form>
