Subversion Repositories SmartDukaan

Rev

Rev 37823 | Blame | Compare with Previous | Last modification | View Log | RSS feed

## Physical warehouses of one seller: status and label (sellerwarehouse), and whether the pieces billing and movements
## need are in place.
<div class="panel panel-info seller-warehouses" data-seller-id="$seller.getId()">
    <div class="panel-heading clearfix">
        <strong>$seller.getLabel()</strong>
        &nbsp;#if($seller.getGstin())$seller.getGstin()#end
        &nbsp;#if($stateNames.get($seller.getStateId()))<span class="text-muted">$stateNames.get($seller.getStateId())</span>#end
        <button type="button" class="btn btn-primary btn-sm pull-right" data-toggle="modal"
                data-target="#new-warehouse-modal">New Warehouse
        </button>
    </div>
    <table class="table table-striped table-condensed">
        <thead>
        <tr>
            <th>Id</th>
            <th>Label</th>
            <th>Branch code</th>
            <th>Address</th>
            <th>Internal store</th>
            <th>Internal supplier</th>
            <th title="Dummy/GOOD warehouse for phantom allocation">Dummy</th>
            <th title="Last invoice / challan / credit note / debit note number">Inv / DC / CN / DN</th>
            <th style="width: 140px;">Status</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
            #foreach($warehouse in $warehouses)
            <tr #if($warehouse.getStatus().name() == "INACTIVE") class="text-muted" #end>
                <td>$warehouse.getWarehouseId()</td>
                <td>
                    <strong>#if($warehouse.getDisplayName())$warehouse.getDisplayName()#end</strong>
                    <button type="button" class="btn btn-link btn-xs warehouse-rename" title="Rename"
                            data-warehouse-id="$warehouse.getWarehouseId()"
                            data-display-name="#if($warehouse.getDisplayName())$warehouse.getDisplayName()#end">
                        <i class="fa fa-pencil"></i></button>
                    #if($warehouse.getName())<br><small class="text-muted">$warehouse.getName()</small>#end
                </td>
                <td>$warehouse.getPrefix()</td>
                <td>
                    #if($warehouse.getAddress())
                        #$warehouse.getAddress().getId() · #if($warehouse.getAddress().getCity())$warehouse.getAddress().getCity()#end
                        · $warehouse.getAddress().getPin()
                        #if(!$warehouse.getAddress().isActive())<span class="label label-default">inactive address</span>#end
                    #else
                        <span class="label label-danger">no address</span>
                    #end
                </td>
                <td>#if($warehouse.getInternalStores().isEmpty())<span class="label label-warning">none</span>#{else}#foreach($store in $warehouse.getInternalStores())$store#if($foreach.hasNext), #end#end#end</td>
                <td>#if($warehouse.getInternalSuppliers().isEmpty())<span class="label label-default">none</span>#{else}#foreach($supplier in $warehouse.getInternalSuppliers())$supplier#if($foreach.hasNext)<br>#end#end#end</td>
                <td>#if($warehouse.isHasDummy())<span class="text-success">&#10003;</span>#{else}<span class="label label-warning">missing</span>#end</td>
                <td>$warehouse.getInvoiceSequence() / $warehouse.getChallanSequence() / $warehouse.getCreditNoteSequence() / $warehouse.getDebitNoteSequence()</td>
                <td>
                    <select class="form-control input-sm warehouse-status" data-warehouse-id="$warehouse.getWarehouseId()"
                            data-current="$warehouse.getStatus()">
                        #foreach($status in $statuses)
                            <option value="$status" #if($status == $warehouse.getStatus()) selected #end>$status</option>
                        #end
                    </select>
                </td>
                <td>
                    <button type="button" class="btn btn-default btn-xs warehouse-remap-open"
                            data-warehouse-id="$warehouse.getWarehouseId()"
                            data-address-id="#if($warehouse.getAddress())$warehouse.getAddress().getId()#end">
                        Change address
                    </button>
                </td>
            </tr>
            #end
            #if($warehouses.isEmpty())
            <tr>
                <td colspan="10" class="text-muted">No warehouses yet</td>
            </tr>
            #end
        </tbody>
    </table>
</div>

## New physical warehouse for this seller
<div id="new-warehouse-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 Warehouse &middot; $seller.getLabel()</h4>
            </div>
            <div class="modal-body">
                <form id="new-warehouse-form" autocomplete="off">
                    <div class="form-group">
                        <label for="new-warehouse-name">Warehouse name</label>
                        <input type="text" class="form-control" id="new-warehouse-name" maxlength="64"
                               placeholder="e.g. HR-NSSPL/DL">
                    <p class="help-block">Also its label on dashboards and dropdowns; it can be renamed later. New
                        warehouses start active.</p>
                    </div>
                    <div class="form-group">
                        <label for="new-warehouse-prefix">Branch code</label>
                        <input type="text" class="form-control text-uppercase" id="new-warehouse-prefix" maxlength="7"
                               placeholder="2 to 7 letters, e.g. NSHRDL">
                        <p class="help-block">Starts every invoice, challan and note number. Cannot change once billed.</p>
                    </div>
                    <div class="form-group">
                        <label for="new-warehouse-address">Address</label>
                        <select class="form-control assignable-address" id="new-warehouse-address">
                            <option value="" selected disabled>Select address</option>
                            #foreach($address in $assignableAddresses)
                                <option value="$address.getId()">$address.getLabel()</option>
                            #end
                        </select>
                        <p class="help-block">Active addresses in the seller's state. Pin and state come from the address.</p>
                    </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-warehouse-submit">Create warehouse</button>
            </div>
        </div>
    </div>
</div>

## Point a warehouse at another address; its internal stores follow
<div id="remap-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">Change address &middot; warehouse <span id="remap-warehouse-id"></span></h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="remap-address">New address</label>
                    <select class="form-control assignable-address" id="remap-address">
                        <option value="" selected disabled>Select address</option>
                        #foreach($address in $assignableAddresses)
                            <option value="$address.getId()">$address.getLabel()</option>
                        #end
                    </select>
                </div>
                <p class="help-block">New invoices, e-way bills and notes print this address from now on, and the
                    warehouse's internal stores are moved to it. Already billed documents keep theirs.</p>
            </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="remap-address-submit">Change address</button>
            </div>
        </div>
    </div>
</div>