Subversion Repositories SmartDukaan

Rev

Rev 34329 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34329 Rev 35922
Line 100... Line 100...
100
                <label for="terms&Conditions">Terms & Conditions</label>
100
                <label for="terms&Conditions">Terms & Conditions</label>
101
                <input type="text" class="form-control" id="terms&Conditions" name="inputTermConditions"
101
                <input type="text" class="form-control" id="terms&Conditions" name="inputTermConditions"
102
                       placeholder="Terms & Conditions" value="$supplier.getTnc()">
102
                       placeholder="Terms & Conditions" value="$supplier.getTnc()">
103
            </div>
103
            </div>
104
            <div class="form-group col-md-6">
104
            <div class="form-group col-md-6">
105
                                 #if($warehouseCheckboxMap.get($wh.getId()).isWarehouse())
105
                <input type="checkbox" id="warehouseCheckbox" name="warehouseCheckbox" value=""
106
 
-
 
107
                                     <input type="checkbox" id="warehouseCheckbox" name="warehouseCheckbox" value="" checked>
106
                    #if($supplier.getInternalWarehouseId()) checked #end>
108
                                        <label for="warehouseCheckbox">Internal Warehouse</label><br>
107
                <label for="warehouseCheckbox">Internal Warehouse</label><br>
109
 
-
 
-
 
108
            </div>
110
                                   #else
109
            <div class="form-group col-md-6">
111
                                   <input type="checkbox" id="warehouseCheckbox" name="warehouseCheckbox" value="">
110
                <label for="warehouse">Warehouse Name</label>
112
                                        <label for="warehouseCheckbox">Internal Warehouse</label><br>
111
                <select class="form-control input-sm" id="internalWarehouseId" name="internalWarehouseId"
113
 
-
 
114
                                 #end
112
                        placeholder="Warehouse Name"
115
 
-
 
116
 
-
 
117
 
-
 
-
 
113
                    #if(!$supplier.getInternalWarehouseId()) disabled #end>
-
 
114
                    <option value="" disabled #if(!$supplier.getInternalWarehouseId()) selected #end>Warehouse Name
118
                        </div>
115
                    </option>
119
                        <div class="form-group col-md-6">
116
                    #foreach($warehouseEntry in $warehouseMap.entrySet())
120
                            <label for="warehouse">Warehouse Name</label>
117
                        <option value="$warehouseEntry.getKey()"
121
                            <select disabled class="form-control input-sm" id="warehouseId" name="warehouseId" placeholder="Warehouse Name">
118
                            #if($supplier.getInternalWarehouseId() && $supplier.getInternalWarehouseId() == $warehouseEntry.getKey())
122
 
-
 
123
                                <option value="" disabled selected>Warehouse Name</option>
119
                                selected #end>
124
                                #foreach($warehouseEntry in $warehouseMap.entrySet())
120
                            $warehouseEntry.getValue()
125
                                <option value="$warehouseEntry.getKey()">$warehouseEntry.getValue()</option>
121
                        </option>
126
                                #end
122
                    #end
127
                            </select>
123
                </select>
128
                        </div>
124
            </div>
129
 
125
 
130
            <div class="form-group col-md-6">
126
            <div class="form-group col-md-6">
131
                <label for="warehouseLocation">Warehouse Location</label>
127
                <label for="warehouseLocation">Warehouse Location</label>
132
                <select class="chosen-select" id="warehouseLocation" name="inputWarehouseLocation"
128
                <select class="chosen-select" id="warehouseLocation" name="inputWarehouseLocation"
133
                        data-placeholder="Warehouse Location" multiple style="width:500px;" tabindex="4">
129
                        data-placeholder="Warehouse Location" multiple style="width:500px;" tabindex="4">
Line 176... Line 172...
176
    $(document).ready(function () {
172
    $(document).ready(function () {
177
        $('.chosen-select').chosen({
173
        $('.chosen-select').chosen({
178
            search_contains: true
174
            search_contains: true
179
 
175
 
180
        });
176
        });
-
 
177
 
-
 
178
        // Handle internal warehouse checkbox toggle
-
 
179
        $('#warehouseCheckbox').on('change', function () {
-
 
180
            const warehouseSelect = $('#internalWarehouseId');
-
 
181
            if (this.checked) {
-
 
182
                warehouseSelect.prop('disabled', false);
-
 
183
            } else {
-
 
184
                warehouseSelect.prop('disabled', true);
-
 
185
                warehouseSelect.val('');
-
 
186
            }
-
 
187
        });
181
    });
188
    });
182
 
189
 
183
    function isValidGST(gstin) {
190
    function isValidGST(gstin) {
184
        const gstRegex = /^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[A-Z0-9]{1}[Z]{1}[A-Z0-9]{1}$/;
191
        const gstRegex = /^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[A-Z0-9]{1}[Z]{1}[A-Z0-9]{1}$/;
185
        return gstRegex.test(gstin);
192
        return gstRegex.test(gstin);