Subversion Repositories SmartDukaan

Rev

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

Rev 32779 Rev 34329
Line 13... Line 13...
13
    </div>
13
    </div>
14
    <form id="new-supplier-create-form">
14
    <form id="new-supplier-create-form">
15
        <div class="form-row">
15
        <div class="form-row">
16
            <div class="form-group col-md-6">
16
            <div class="form-group col-md-6">
17
                <label for="name">Name</label>
17
                <label for="name">Name</label>
18
                <input type="text" class="form-control" id="name" name="inputName" placeholder="Name" value="$supplier.getName()">
18
                <input type="text" class="form-control" id="name" name="inputName" placeholder="Name"
-
 
19
                       value="$supplier.getName()" readonly>
19
            </div>
20
            </div>
20
 
21
 
21
            <div class="form-group col-md-6">
22
            <div class="form-group col-md-6">
22
                <label for="phone">Phone</label>
23
                <label for="phone">Phone</label>
23
                <input type="number" class="form-control" id="phone" name="inputPhone" placeholder="Phone" value="$supplier.getPhone()">
24
                <input type="number" class="form-control" id="phone" name="inputPhone" placeholder="Phone" value="$supplier.getPhone()">
24
            </div>
25
            </div>
25
 
26
 
26
            <div class="form-group col-md-6">
27
            <div class="form-group col-md-6">
27
                <label for="gst">GSTIN</label>
28
                <label for="gst">GSTIN</label>
28
                <input type="text" class="form-control" id="gst" name="inputGst" placeholder="GST" value="$supplier.getGst()">
29
                <input type="text" class="form-control" id="gst" name="inputGst" placeholder="GST"
-
 
30
                       value="$supplier.getGstin()">
29
            </div>
31
            </div>
30
            <div class="form-group col-md-6">
32
            <div class="form-group col-md-6">
31
                <label for="panNumber">PAN</label>
33
                <label for="panNumber">PAN</label>
32
                <input type="text" class="form-control" id="panNumber" name="inputPan" placeholder="pan" value="$supplier.getPan()">
34
                <input type="text" class="form-control" id="panNumber" name="inputPan" placeholder="pan"
-
 
35
                       value="$supplier.getPan()" readonly>
33
            </div>
36
            </div>
34
            <div class="form-group col-md-6">
37
            <div class="form-group col-md-6">
35
                <label for="Fax">Fax</label>
38
                <label for="Fax">Fax</label>
36
                <input type="text" class="form-control" id="Fax" name="inputFax" placeholder="Fax" value="$supplier.getFax()">
39
                <input type="text" class="form-control" id="Fax" name="inputFax" placeholder="Fax" value="$supplier.getFax()">
37
            </div>
40
            </div>
-
 
41
 
38
            <div class="form-group col-md-6">
42
            <div class="form-group col-md-6">
39
                <label for="headName">Head Name</label>
43
                <label for="headName">Head Name</label>
40
                <input type="text" class="form-control" id="headName" name="inputHeadName" placeholder="Head Name" value="$supplier.getHeadName()">
44
                <input type="text" class="form-control" id="headName" name="inputHeadName" placeholder="Head Name" value="$supplier.getHeadName()">
41
            </div>
45
            </div>
42
 
46
 
43
            <div class="form-group col-md-6">
47
            <div class="form-group col-md-6">
44
                <label for="headDesign">Head Designation</label>
48
                <label for="headDesign">Head Designation</label>
-
 
49
                #if($supplier.getHeadDesignation())
45
                <input type="text" class="form-control" id="headDesign" name="inputHeadDesign"
50
                    <input type="text" class="form-control" id="headDesign" name="inputHeadDesign"
46
                       placeholder="Head Designation" value="$supplier.getHeadDesignation()">
51
                           placeholder="Head Designation" value="$supplier.getHeadDesignation()">
-
 
52
                #else
-
 
53
                    <input type="text" class="form-control" id="headDesign" name="inputHeadDesign"
-
 
54
                           placeholder="Head Designation" value="">
-
 
55
                #end
-
 
56
 
47
            </div>
57
            </div>
48
            <div class="form-group col-md-6">
58
            <div class="form-group col-md-6">
49
                <label for="headEmail">Head Email</label>
59
                <label for="headEmail">Head Email</label>
50
                <input type="email" class="form-control" id="headEmail" name="inputHeadEmail" placeholder="Head Email" value="$supplier.getEmail()">
60
                <input type="email" class="form-control" id="headEmail" name="inputHeadEmail" placeholder="Head Email"
-
 
61
                       value="$supplier.getHeadEmail()">
51
            </div>
62
            </div>
52
            <div class="form-group col-md-6">
63
            <div class="form-group col-md-6">
53
                <label for="contactPerson">Contact Person</label>
64
                <label for="contactPerson">Contact Person</label>
54
                <input type="text" class="form-control" id="contactPerson" name="inputContactPerson"
65
                <input type="text" class="form-control" id="contactPerson" name="inputContactPerson"
55
                       placeholder="Contact Person" value="$supplier.getContactPerson()">
66
                       placeholder="Contact Person" value="$supplier.getContactName()">
56
            </div>
67
            </div>
57
            <div class="form-group col-md-6">
68
            <div class="form-group col-md-6">
58
                            <label for="contactPhone">Contact Phone</label>
69
                            <label for="contactPhone">Contact Phone</label>
59
                            <input type="number" class="form-control" id="contactPhone" name="inputContactPhone"
70
                            <input type="number" class="form-control" id="contactPhone" name="inputContactPhone"
60
                                   placeholder="Contact Phone" value="$supplier.getContactPhone()">
71
                                   placeholder="Contact Phone" value="$supplier.getContactPhone()">
Line 67... Line 78...
67
            <div class="form-group col-md-6">
78
            <div class="form-group col-md-6">
68
                                        <label for="document">Document</label>
79
                                        <label for="document">Document</label>
69
                                        <input type="file" id="document" name="inputDocument">
80
                                        <input type="file" id="document" name="inputDocument">
70
 
81
 
71
                         </div>
82
                         </div>
72
            <div class="form-group col-md-6">
83
            ##            <div class="form-group col-md-6">
73
                <label for="contactFax">Contact Fax</label>
84
            ##                <label for="contactFax">Contact Fax</label>
74
                <input type="text" class="form-control" id="contactFax" name="inputContactFax"
85
            ##                <input type="text" class="form-control" id="contactFax" name="inputContactFax"
75
                       placeholder="Contact Fax" value="$supplier.getContactFax()">
86
            ##                       placeholder="Contact Fax" value="$supplier.getContactFax()">
76
            </div>
87
            ##            </div>
77
 
88
 
78
            <div class="form-group col-md-6">
89
            <div class="form-group col-md-6">
79
                <label for="registeredAddress">Registered Address</label>
90
                <label for="registeredAddress">Registered Address</label>
80
                <input type="text" class="form-control" id="registeredAddress" name="inputRegisteredAddress"
91
                <input type="text" class="form-control" id="registeredAddress" name="inputRegisteredAddress"
81
                       placeholder="Registered Address" value="$supplier.getRegisteredAddress()">
92
                       placeholder="Registered Address" value="$supplier.getRegisteredAddress()" readonly>
82
            </div>
93
            </div>
83
            <div class="form-group col-md-6">
94
            <div class="form-group col-md-6">
84
                <label for="communicationAddress">Communication Address</label>
95
                <label for="communicationAddress">Communication Address</label>
85
                <input type="text" class="form-control" id="communicationAddress" name="inputCommunicationAddress"
96
                <input type="text" class="form-control" id="communicationAddress" name="inputCommunicationAddress"
86
                       placeholder="Communication Address" value="$supplier.getCommunicationAddress()">
97
                       placeholder="Communication Address" value="$supplier.getCommunicationAddress()">
87
            </div>
98
            </div>
88
            <div class="form-group col-md-6">
99
            <div class="form-group col-md-6">
89
                <label for="terms&Conditions">Terms & Conditions</label>
100
                <label for="terms&Conditions">Terms & Conditions</label>
90
                <input type="text" class="form-control" id="terms&Conditions" name="inputTermConditions"
101
                <input type="text" class="form-control" id="terms&Conditions" name="inputTermConditions"
91
                       placeholder="Terms & Conditions" value="$supplier.getTermConditions()">
102
                       placeholder="Terms & Conditions" value="$supplier.getTnc()">
92
            </div>
103
            </div>
93
            <div class="form-group col-md-6">
104
            <div class="form-group col-md-6">
94
                                 #if($warehouseCheckboxMap.get($wh.getId()).isWarehouse())
105
                                 #if($warehouseCheckboxMap.get($wh.getId()).isWarehouse())
95
 
106
 
96
                                     <input type="checkbox" id="warehouseCheckbox" name="warehouseCheckbox" value="" checked>
107
                                     <input type="checkbox" id="warehouseCheckbox" name="warehouseCheckbox" value="" checked>
Line 120... Line 131...
120
                <label for="warehouseLocation">Warehouse Location</label>
131
                <label for="warehouseLocation">Warehouse Location</label>
121
                <select class="chosen-select" id="warehouseLocation" name="inputWarehouseLocation"
132
                <select class="chosen-select" id="warehouseLocation" name="inputWarehouseLocation"
122
                        data-placeholder="Warehouse Location" multiple style="width:500px;" tabindex="4">
133
                        data-placeholder="Warehouse Location" multiple style="width:500px;" tabindex="4">
123
                    #foreach($warehouseIdAndStateEntry in $warehouseIdAndState.entrySet())
134
                    #foreach($warehouseIdAndStateEntry in $warehouseIdAndState.entrySet())
124
                        <option value="$warehouseIdAndStateEntry.getKey()"
135
                        <option value="$warehouseIdAndStateEntry.getKey()"
125
                        #if($warehouseIdAndStateEntry.getId() == $supplier.getwarehouseIds()) selected #end >
136
                            #if($supplierPhysicalWarehouseIds.contains($warehouseIdAndStateEntry.getKey()))
-
 
137
                                selected #end >
126
                        $warehouseIdAndStateEntry.getValue().getPrefix()
138
                        $warehouseIdAndStateEntry.getValue().getPrefix()
127
                            ($warehouseIdAndStateEntry.getValue().getStateName())
139
                            ($warehouseIdAndStateEntry.getValue().getStateName())
128
                        </option>
140
                        </option>
129
                    #end
141
                    #end
130
                </select>
142
                </select>
Line 134... Line 146...
134
            <div class="form-group col-md-6">
146
            <div class="form-group col-md-6">
135
                <label for="state">State</label>
147
                <label for="state">State</label>
136
                <select class="form-control input-sm" id="stateId" name="stateId" placeholder="State"
148
                <select class="form-control input-sm" id="stateId" name="stateId" placeholder="State"
137
                        >
149
                        >
138
                    <option value="" disabled>State </option>
150
                    <option value="" disabled>State </option>
139
                    #foreach($state in $states)
151
                    #foreach($stateName in $state)
140
                        <option value="$state.getId()"
152
                        <option value="$stateName.getId()"
141
                        #if($state.getId() == $supplier.getStateId()) selected #end
153
                            #if($stateName.getId() == $supplier.getStateId()) selected #end
142
                        >$state.getName()</option>
154
                        >$stateName.getName()</option>
143
                    #end
155
                    #end
144
                </select>
156
                </select>
145
            </div>
157
            </div>
146
 
158
 
147
            <div class="form-group col-md-6">
159
            <div class="form-group col-md-6">
148
                <label for="pOValidityLimit">PO Validity Days Limit</label>
160
                <label for="pOValidityLimit">PO Validity Days Limit</label>
149
                <input type="number" class="form-control" id="pOValidityLimit" name="inputPOValidityLimit"
161
                <input type="number" class="form-control" id="pOValidityLimit" name="inputPOValidityLimit"
150
                       placeholder="PO Validity Days Limit" value="$supplier.getPOValidityLimit()">
162
                       placeholder="PO Validity Days Limit" value="$supplier.getPoValidityLimit()">
151
            </div>
163
            </div>
152
 
-
 
153
            <div class="form-group col-md-6">
164
            <div class="form-group col-md-6">
154
                <button type="button" class="btn btn-primary submit-update" style="margin: 20px;" data-id="$supplier.getId()">Update
165
                <button type="button" class="btn btn-primary submit-supplier-edit " style="margin: 20px;"
-
 
166
                        data-dd="$supplier.getId()">Update
155
                </button>
167
                </button>
156
 
168
 
157
            </div>
169
            </div>
158
        </div>
170
        </div>
159
    </form>
171
    </form>
Line 166... Line 178...
166
            search_contains: true
178
            search_contains: true
167
 
179
 
168
        });
180
        });
169
    });
181
    });
170
 
182
 
-
 
183
    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}$/;
-
 
185
        return gstRegex.test(gstin);
-
 
186
    }
-
 
187
 
-
 
188
    // Check GST field on document ready
-
 
189
    $(document).ready(function () {
-
 
190
        const gstInput = $('#gst');
-
 
191
        const gstin = gstInput.val().trim();
-
 
192
 
-
 
193
        // Check if GST is valid
-
 
194
        if (gstin && isValidGST(gstin)) {
-
 
195
            gstInput.prop('readonly', true);
-
 
196
        } else {
-
 
197
            gstInput.prop('readonly', false);
-
 
198
        }
-
 
199
 
-
 
200
        // If GSTIN field changes, validate it dynamically
-
 
201
        gstInput.on('input', function () {
-
 
202
            const gstValue = $(this).val().trim();
-
 
203
            if (isValidGST(gstValue)) {
-
 
204
                $(this).prop('readonly', true);
-
 
205
            } else {
-
 
206
                $(this).prop('readonly', false);
-
 
207
            }
-
 
208
        });
-
 
209
    });
-
 
210
 
171
</script>
211
</script>
172
           
212
           
173
           
213
           
174
                          
214
                          
175
215