Subversion Repositories SmartDukaan

Rev

Rev 32348 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<section class="wrapper seller-setup">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i>Sellers &amp; Warehouses</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li><i class="icon_document_alt"></i> Sellers &amp; Warehouses</li>
            </ol>
        </div>
    </div>

    ## Sellers: one row per GST registration
    <div class="panel panel-default">
        <div class="panel-heading clearfix">
            <strong>Sellers</strong>
            <button type="button" class="btn btn-primary btn-sm pull-right" data-toggle="modal"
                    data-target="#new-seller-modal">New Seller
            </button>
        </div>
        <table class="table table-striped table-condensed">
            <thead>
            <tr>
                <th>Label</th>
                <th>GSTIN</th>
                <th>State</th>
                <th>Warehouses</th>
                <th></th>
            </tr>
            </thead>
            <tbody>
                #foreach($seller in $sellers)
                <tr>
                    <td>$seller.getLabel()</td>
                    <td>#if($seller.getGstin())$seller.getGstin()#end</td>
                    <td>#if($stateNames.get($seller.getStateId()))$stateNames.get($seller.getStateId())#end</td>
                    <td>#if($warehouseCounts.get($seller.getId()))$warehouseCounts.get($seller.getId())#else 0#end</td>
                    <td class="text-right">
                        <button type="button" class="btn btn-default btn-xs seller-open"
                                data-seller-id="$seller.getId()">Warehouses
                        </button>
                    </td>
                </tr>
                #end
            </tbody>
        </table>
    </div>

    <div class="warehouse-container"></div>

    ## Address masters: what a warehouse prints as the seller address
    <div class="panel panel-default">
        <div class="panel-heading clearfix">
            <strong>Addresses</strong>
            <small class="text-muted">&nbsp;Only active addresses can be assigned to a warehouse</small>
            <button type="button" class="btn btn-primary btn-sm pull-right" data-toggle="modal"
                    data-target="#new-address-modal">New Address
            </button>
        </div>
        <table class="table table-striped table-condensed">
            <thead>
            <tr>
                <th>#</th>
                <th>Address</th>
                <th>City</th>
                <th>Pin</th>
                <th>State</th>
                <th>Contact</th>
                <th>Used by</th>
                <th>Status</th>
            </tr>
            </thead>
            <tbody>
                #foreach($address in $addresses)
                <tr #if(!$address.isActive()) class="text-muted" #end>
                    <td>$address.getId()</td>
                    <td>$address.getAddress()</td>
                    <td>#if($address.getCity())$address.getCity()#end</td>
                    <td>$address.getPin()</td>
                    <td>#if($address.getStateName())$address.getStateName()#end</td>
                    <td>#if($address.getContactPerson())$address.getContactPerson()#end
                        #if($address.getContactNumber())<br><small>$address.getContactNumber()</small>#end</td>
                    <td>#foreach($warehouseId in $address.getUsedByWarehouseIds())$warehouseId#if($foreach.hasNext), #end#end</td>
                    <td>
                        <button type="button"
                                class="btn btn-xs address-active-toggle #if($address.isActive()) btn-success #else btn-default #end"
                                data-address-id="$address.getId()" data-active="$address.isActive()">
                            #if($address.isActive())Active#else Inactive#end
                        </button>
                    </td>
                </tr>
                #end
            </tbody>
        </table>
    </div>

    ## New seller
    <div id="new-seller-modal" class="modal fade" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">New Seller</h4>
                </div>
                <div class="modal-body">
                    <form id="new-seller-form" autocomplete="off">
                        <div class="form-group">
                            <label for="new-seller-label">Label</label>
                            <input type="text" class="form-control" id="new-seller-label" maxlength="31"
                                   placeholder="e.g. NSSPL-HR-GGN">
                        </div>
                        <div class="form-group">
                            <label for="new-seller-gstin">GSTIN</label>
                            <input type="text" class="form-control text-uppercase" id="new-seller-gstin" maxlength="15"
                                   placeholder="15 characters">
                            <p class="help-block" id="new-seller-gstin-hint">State and PAN are read from the GSTIN.</p>
                        </div>
                        <div class="form-group">
                            <label for="new-seller-address">Registered address</label>
                            <input type="text" class="form-control" id="new-seller-address" maxlength="255">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="button" class="btn btn-primary" id="new-seller-submit">Create seller</button>
                </div>
            </div>
        </div>
    </div>

    ## New address
    <div id="new-address-modal" class="modal fade" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">New Address</h4>
                </div>
                <div class="modal-body">
                    <form id="new-address-form" autocomplete="off">
                        <div class="form-group">
                            <label for="new-address-address">Address</label>
                            <input type="text" class="form-control address-preview-source" id="new-address-address"
                                   maxlength="230" placeholder="Building, plot, street, area">
                        </div>
                        <div class="row">
                            <div class="form-group col-sm-6">
                                <label for="new-address-city">City</label>
                                <input type="text" class="form-control address-preview-source" id="new-address-city"
                                       maxlength="50" placeholder="Printed as the city on invoices">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="new-address-pin">Pin</label>
                                <input type="text" class="form-control address-preview-source" id="new-address-pin"
                                       maxlength="6" inputmode="numeric" placeholder="6 digits">
                            </div>
                        </div>
                        <div class="row">
                            <div class="form-group col-sm-6">
                                <label for="new-address-state">State</label>
                                <select class="form-control address-preview-source" id="new-address-state">
                                    <option value="" selected disabled>Select state</option>
                                    #foreach($state in $states)
                                        <option value="$state.getId()">$state.getName()</option>
                                    #end
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="form-group col-sm-6">
                                <label for="new-address-contact-person">Contact person</label>
                                <input type="text" class="form-control" id="new-address-contact-person" maxlength="127">
                            </div>
                            <div class="form-group col-sm-6">
                                <label for="new-address-contact-number">Contact number</label>
                                <input type="text" class="form-control" id="new-address-contact-number" maxlength="15"
                                       inputmode="numeric" placeholder="10 to 15 digits, one number">
                            </div>
                        </div>
                        <div class="well well-sm">
                            <small class="text-muted">Invoice will print</small>
                            <div id="new-address-preview" class="text-muted">-</div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="button" class="btn btn-primary" id="new-address-submit">Create address</button>
                </div>
            </div>
        </div>
    </div>
</section>