Subversion Repositories SmartDukaan

Rev

Rev 34314 | Rev 34616 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
33507 tejus.loha 1
<style>
2
    .border-red {
3
        border: 1px solid red;
4
    }
5
 
6
    .border-green {
7
        border: 1px solid green;
8
    }
9
 
10
    .hide-textarea {
11
        display: none
12
    }
13
 
14
    .show-textarea {
15
        display: block
16
    }
33577 tejus.loha 17
 
18
    .hide-model {
19
        display: none
20
    }
21
 
22
    .show-model {
23
        display: block
24
    }
25
 
34107 tejus.loha 26
    .form-control {
27
        border-radius: 8px; /* Adjust the value for more or less rounding */
28
        border: 1px solid #ccc; /* Optional: Add a border */
29
    }
30
 
33507 tejus.loha 31
</style>
32
<section class="wrapper">
33
    <div class="row">
34
        <div class="col-lg-12">
34107 tejus.loha 35
            ##            Header - LOI FORM
36
            <h3 class="page-header" style="text-align: center ;color:green">loi form</h3>
33507 tejus.loha 37
            <ol class="breadcrumb">
34107 tejus.loha 38
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard"></a></li>
33507 tejus.loha 39
                <li><i class="icon_document_alt"></i>LOI Form</li>
40
            </ol>
41
        </div>
42
    </div>
33658 tejus.loha 43
 
33507 tejus.loha 44
    <div class="col-md-12">
34107 tejus.loha 45
        ##        bg-success p-2 text-dark bg-opacity-10 - This is 10% opacity success background , colour - green
46
        <div class="container bg-success p-2 text-dark bg-opacity-10" style="border-radius: 25px">
33885 tejus.loha 47
            <form name="loi-form" id="loi-form" method="post" style="margin-top:40px;">
33507 tejus.loha 48
                <div class="row">
49
                    <div class="col-lg-3 form-group">
34107 tejus.loha 50
                        <label>Refer By(BGC Team)</label><span style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 51
                        <select class="form-control type" name="referId" required>
33658 tejus.loha 52
 
34310 tejus.loha 53
                            <option selected disabled>
54
                                Select BGC
55
                            </option>
56
                            <option value="0">NA</option>
57
                            #foreach($authUsers in $authUsersList)
58
                                <option value=$authUsers.getId()>$authUsers.getFullName() </option>
59
                            #end
60
                        </select>
33658 tejus.loha 61
 
33507 tejus.loha 62
                    </div>
63
                    <div class="col-lg-3 form-group">
34107 tejus.loha 64
                        <label>State Head</label><span style="color:red ;font-size: 140%">*</span>
65
                        <select class="form-control type" name="stateHead" required>
33658 tejus.loha 66
 
34107 tejus.loha 67
                            <option selected disabled>
68
                                Select State Head
69
                            </option>
70
                            <option value="0">NA</option>
71
                            #foreach($stateHead in $stateHeadList)
72
                                <option value=$stateHead.getId()>$stateHead.getFullName() </option>
33749 tejus.loha 73
                            #end
74
                        </select>
33658 tejus.loha 75
 
33507 tejus.loha 76
                    </div>
33582 tejus.loha 77
                    <div class="col-lg-3 form-group">
34107 tejus.loha 78
                        <label>BDM</label>
79
                        <span style="color:red ;font-size: 140%">*</span>
80
                        <select class="form-control type" name="bdm" required>
81
                            <option selected disabled>
82
                                Select BDM
83
                            </option>
84
                            <option value="0">NA</option>
85
                            #foreach($bdm in $bdmList)
86
                                <option value=$bdm.getId()>$bdm.getFullName() </option>
87
                            #end
88
                        </select>
33582 tejus.loha 89
 
90
                    </div>
33507 tejus.loha 91
                </div>
92
                <div>
93
                    <h4>Personal Details</h4>
94
                </div>
95
                <div class="row">
96
                    <div class="col-md-4">
97
                        <!-- Owner Name -->
98
                        <div class="form-group">
33577 tejus.loha 99
                            <label>First Name </label><span
100
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 101
                            <input type="text" class="form-control" required name="firstName"
102
                                   placeholder="Enter first name">
33658 tejus.loha 103
 
33507 tejus.loha 104
                        </div>
105
                    </div>
106
                    <div class="col-md-4">
107
                        <!-- Owner Name -->
108
                        <div class="form-group">
33577 tejus.loha 109
                            <label>Last Name </label><span
110
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 111
                            <input type="text" class="form-control" required name="lastName"
112
                                   placeholder="Enter last name">
33507 tejus.loha 113
                        </div>
114
                    </div>
115
                    <div class="col-md-4">
116
                        <!-- Mobile No -->
117
                        <div class="form-group">
33577 tejus.loha 118
                            <label>Mobile No. </label><span
119
                                style="color:red ;font-size: 140%">*</span>
33507 tejus.loha 120
 
33749 tejus.loha 121
                            <input type="tel" class="form-control" required name="mobile"
122
                                   placeholder="10-digit Mobile"
123
                                   maxlength="10"
124
                                   minlength="10"
125
                                   pattern="[0-9]"
126
                                   pla
127
                                   value="">
33507 tejus.loha 128
 
129
                        </div>
130
                    </div>
131
                </div>
132
                <div class="row">
133
                    <div class="col-md-4">
134
                        <!-- Landline No -->
135
                        <div class="form-group">
33577 tejus.loha 136
                            <label>Alternative Mobile No.</label>
33749 tejus.loha 137
                            <input type="tel" class="form-control" name="landline"
138
                                   maxlength="10"
139
                                   minlength="10"
140
                                   pattern="[0-9]"
141
                                   placeholder="Enter Alternative mobile"
142
                                   value="">
33507 tejus.loha 143
 
144
 
145
                        </div>
146
                    </div>
147
                    <div class="col-lg-4"><!-- Email ID -->
148
                        <div class="form-group">
149
                            <label>Email ID </label>
33577 tejus.loha 150
                            <span
151
                                    style="color:red ;font-size: 140%">*</span>
33658 tejus.loha 152
 
33749 tejus.loha 153
                            <input type="email" class="form-control" required name="email" placeholder="Enter Email"
154
                                   value="">
33507 tejus.loha 155
 
156
                        </div>
157
                    </div>
158
                    <div class="col-lg-4"> <!-- DOB -->
159
                        <div class="form-group">
160
                            <label>DOB </label>
33577 tejus.loha 161
                            <span
162
                                    style="color:red ;font-size: 140%">*</span>
33658 tejus.loha 163
 
33749 tejus.loha 164
                            <input type="date" class="form-control" required name="dob" placeholder="Enter DOB">
33658 tejus.loha 165
 
33507 tejus.loha 166
                        </div>
167
                    </div>
168
                </div>
169
                <div class="row">
33577 tejus.loha 170
                    <div class="col-lg-3"> <!-- PAN No-->
33507 tejus.loha 171
                        <div class="form-group">
33577 tejus.loha 172
                            <label>PAN No</label><span
173
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 174
                            <input type="text" class="form-control" required name="panNo" placeholder="enter Pan No"
175
                                   minlength="10"
176
                                   maxlength="10">
33507 tejus.loha 177
 
33658 tejus.loha 178
 
33507 tejus.loha 179
                        </div>
180
                    </div>
33577 tejus.loha 181
                    <div class="col-lg-3"> <!-- Aadhar No-->
33507 tejus.loha 182
                        <div class="form-group">
33577 tejus.loha 183
                            <label>Aadhar No</label><span
184
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 185
                            <input type="tel" class="form-control" required name="adharNo"
186
                                   placeholder="Adhar Number"
187
                                   maxlength="12"
188
                                   minlength="12"
189
                                   pattern="[0-9]{12}">
33507 tejus.loha 190
 
191
                        </div>
192
                    </div>
33577 tejus.loha 193
                    <div class="col-lg-3"><!-- ANNIV DT- -->
194
                        <div class="form-group">
195
                            <label>Marital Status</label>
196
                            <span
197
                                    style="color:red ;font-size: 140%">*</span>
198
                            <select class="form-control" name="maritalStatus"
199
                                    placeholder="Marital Status" required id="maritalStatus">
34107 tejus.loha 200
                                <option disabled selected>Select Marital Status</option>
33577 tejus.loha 201
                                <option value="0">Single</option>
202
                                <option value="1">Married</option>
203
                            </select>
204
                        </div>
205
                    </div>
206
                    <div class="loiAnniversaryDate hide-model">
207
                        <div class="col-lg-3"><!-- ANNIV DT- -->
208
                            <div class="form-group">
209
                                <label>Anniversary Date </label>
210
                                <span
211
                                        style="color:red ;font-size: 140%">*</span>
33507 tejus.loha 212
 
33658 tejus.loha 213
                                <input type="date" class="form-control" name="anniversaryDate"
33749 tejus.loha 214
                                       placeholder="Enter Anniversary date" value=" ">
33577 tejus.loha 215
 
216
                            </div>
217
                        </div>
218
                    </div>
219
 
220
 
33507 tejus.loha 221
                </div>
222
 
223
                <h4>Business Detail</h4>
224
                <!-- GST No-->
225
                <div class="row">
34107 tejus.loha 226
                    <div class="col-lg-3 form-group">
227
                        <label>Business type</label><span
228
                            style="color:red ;font-size: 140%">*</span>
229
 
230
                        <select class="form-control" name="businessType"
231
                                placeholder="Business type" required>
232
                            <option value="$businessTypes.get(0)" selected>$businessTypes.get(0)</option>
233
                            #foreach($businessType in $businessTypes)
234
                                <option value=$businessType>$businessType</option>
235
                            #end
236
                        </select>
237
 
238
                    </div>
239
                    <!--Acquired Date-->
240
                    <div class="col-lg-3 form-group">
241
                        <label>Acquired Date</label><span
242
                            style="color:red ;font-size: 140%">*</span>
243
                        <input type="date" name="acquiredDate" class="form-control">
244
 
245
                    </div>
246
                </div>
247
                <div class="row">
33507 tejus.loha 248
                    <div class="col-lg-6">
249
                        <div class="form-group">
250
                            <label>GST No </label>
33577 tejus.loha 251
                            <span
252
                                    style="color:red ;font-size: 140%">*</span>
33658 tejus.loha 253
 
254
                            <input
33749 tejus.loha 255
                                    type="text"
256
                                    class="form-control gstNo"
257
                                    id="gstValidate"
258
                                    required
259
                                    name="gstNo"
260
                                    placeholder="Enter GST Reg No."
261
                                    minlength="15"
262
                                    maxlength="15" value="">
33507 tejus.loha 263
 
264
                        </div>
265
                    </div>
266
 
267
 
268
                    <div class="col-lg-6">
269
                        <div class="form-group">
270
                            <label for="gstName">Company Name:</label>
33577 tejus.loha 271
                            <span
272
                                    style="color:red ;font-size: 140%">*</span>
33658 tejus.loha 273
 
274
                            <input type="text" class="form-control" id="CompanyName" name="companyName" required
33749 tejus.loha 275
                                   value="" readonly>
33507 tejus.loha 276
                        </div>
277
                    </div>
278
                </div>
279
                <!-- GST Address -->
280
                <div class="row">
281
                    <div class="col-lg-3">
33577 tejus.loha 282
                        ##                                        <label class="bold-details">PIN CODE</lebel>
33507 tejus.loha 283
 
33749 tejus.loha 284
                        <input
285
                                placeholder="Pin Code" id="gstPinCode"
286
                                name="gstPin" type="hidden" value=""
287
                                class="form-control input-sm" readonly>
33658 tejus.loha 288
 
33507 tejus.loha 289
                    </div>
290
 
291
                    <div class="col-lg-3">
292
                        <div class="form-group">
293
                            ##                                            <label for="gstState">State</label>
33658 tejus.loha 294
 
295
                            <input placeholder="State"
33749 tejus.loha 296
                                   id="gstState" name="gstState" type="hidden"
297
                                   value="" class="form-control input-sm"
298
                                   style="font-weight: bold;" readonly>
33658 tejus.loha 299
 
33507 tejus.loha 300
                        </div>
301
                    </div>
302
 
303
                    <div class="col-lg-3">
304
                        <div class="form-group">
33658 tejus.loha 305
                            ## <label>City :</label>
33749 tejus.loha 306
                            <input placeholder="State"
307
                                   id="gstCity" name="gstCity" type="hidden"
308
                                   value="" class="form-control input-sm"
309
                                   style="font-weight: bold;" readonly>
33507 tejus.loha 310
 
311
                        </div>
312
                    </div>
313
                    <div class="col-lg-3">
314
                        <div class="form-group">
315
                            ##                                            <label for="gstDistrict">District :</label>
33658 tejus.loha 316
 
317
                            <input id="gstDistrict" type="hidden" name="gstDistrict" class="form-control input-sm"
33749 tejus.loha 318
                                   value="" readonly>
33658 tejus.loha 319
 
33507 tejus.loha 320
                        </div>
321
                    </div>
322
                </div>
323
                <div><h4>Addition Place of Business</h4></div>
34310 tejus.loha 324
                <div class="row" id="autoAddress">
33507 tejus.loha 325
                    <div class="col-lg-6">
326
                        <div class="form-group">
327
                            <label>Select Address</label>
34310 tejus.loha 328
                            <span style="color:red ;font-size: 140%">*</span>
33507 tejus.loha 329
                            <div id="addlist"></div>
330
                        </div>
331
                    </div>
332
                </div>
34310 tejus.loha 333
                <div class="row" id="manualAddress">
334
                </div>
33507 tejus.loha 335
                <div><h4>Bank Details :</h4></div>
336
                <div class="row">
337
                    <!-- Bank name-->
338
                    <div class="col-lg-4">
339
                        <div class="form-group">
33577 tejus.loha 340
                            <label>Bank name :</label><span
341
                                style="color:red ;font-size: 140%">*</span>
33507 tejus.loha 342
 
33658 tejus.loha 343
                            <input type="text" class="form-control" required name="bankName" placeholder="Bank Name"
33749 tejus.loha 344
                                   value="">
33507 tejus.loha 345
                        </div>
346
                    </div>
347
 
348
                    <!-- IFSC Code-->
349
                    <div class="col-lg-4">
350
                        <div class="form-group">
33577 tejus.loha 351
                            <label>IFSC Code :</label><span
352
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 353
                            <input type="text" class="form-control" required name="ifscCode" placeholder="IFSC Code"
354
                                   value="">
33507 tejus.loha 355
 
356
                        </div>
357
                    </div>
358
 
359
                    <!-- Account No.-->
360
                    <div class="col-lg-4">
361
                        <div class="form-group">
33577 tejus.loha 362
                            <label>Account No :</label><span
363
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 364
                            <input type="number" class="form-control" required name="accountNo"
365
                                   placeholder="Account Number" value="">
33507 tejus.loha 366
                        </div>
367
                    </div>
368
                </div>
369
                <!-- Agreed Minimum Wallet value (INR) -->
370
                <div><h4>Store Details </h4></div>
371
                <div class="row">
33909 tejus.loha 372
                    <div class="col-lg-3">
33507 tejus.loha 373
                        <div class="form-group" style="text-align: left;">
33577 tejus.loha 374
                            <label>Minimum Wallet value :</label><span
375
                                style="color:red ;font-size: 140%">*</span>
33658 tejus.loha 376
 
377
                            <select class="form-control" name="agreeWalletValue" required>
33749 tejus.loha 378
                                <option value="600000">600000</option>
379
                                <option value="700000">700000</option>
380
                                <option value="800000">800000</option>
381
                                <option value="900000">900000</option>
382
                                <option value="1000000">1000000</option>
383
                                <option value="1100000">1100000</option>
384
                                <option value="1200000">1200000</option>
385
                                <option value="1500000">1500000</option>
386
                                <option value="2000000">2000000</option>
387
                                <option value="2500000">2500000</option>
388
                                <option value="3000000">3000000</option>
389
                            </select>
33507 tejus.loha 390
                        </div>
391
 
392
                    </div>
393
                    <!-- Store area (sq ft) -->
33909 tejus.loha 394
                    <div class="col-lg-3">
33507 tejus.loha 395
                        <div class="form-group">
33577 tejus.loha 396
                            <label>Store area </label><span
397
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 398
                            <input type="number" class="form-control" id="storeArea" required
399
                                   name="storeArea" placeholder="in square feet" value="">
33658 tejus.loha 400
 
33507 tejus.loha 401
                        </div>
402
                    </div>
33909 tejus.loha 403
                    <div class="col-lg-3">
33507 tejus.loha 404
                        <!-- Store Potential -->
405
                        <div class="form-group">
33577 tejus.loha 406
                            <label>Store Potential</label><span
407
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 408
                            <input type="number" class="form-control" required name="storePotential"
409
                                   min="400000" id="storePotential"
410
                                   placeholder="Store Potential" value="">
33507 tejus.loha 411
                        </div>
412
                    </div>
33909 tejus.loha 413
                    <div class="col-lg-3">
414
                        <!-- Finance Code -->
415
                        <div class="form-group">
416
                            <label>Finance Code</label>
417
                            <span style="color:red ;font-size: 140%"></span>
418
                            <input type="text" class="form-control" required name="finCode"
419
                                   id="mk_finance_Code"
420
                                   placeholder="Finance code" value="">
421
                        </div>
422
                    </div>
33507 tejus.loha 423
                </div>
424
                <h4>Brand Commitment</h4>
34310 tejus.loha 425
                <div id="loiBrandCommitment form-contro" class="row">
33658 tejus.loha 426
                    #foreach($brandCommit in $brandCommits)
34316 tejus.loha 427
                        <div class="col-lg-3">
428
                            <div class="form-group">
429
                                <label>$brandCommit.getBrand()</label><span
430
                                    style="color:red ;font-size: 140%">*</span>
431
                                <input type="number" class="form-control brand-commitment" required
432
                                       name="$brandCommit.getBrand()" value="">
33658 tejus.loha 433
                            </div>
34316 tejus.loha 434
                        </div>
33658 tejus.loha 435
                    #end
34310 tejus.loha 436
                    <div>
33658 tejus.loha 437
                        <div class="col-lg-3">
438
                            <div class="form-group">
439
                                <label>Accessories</label><span
440
                                    style="color:red ;font-size: 140%">*</span>
441
                                <input type="number" class="form-control brand-commitment" required
442
                                       name="Accessories" value="">
443
                            </div>
444
                        </div>
445
                        <div class="col-lg-3">
446
                            <div class="form-group">
447
                                <label>Other</label><span
448
                                    style="color:red ;font-size: 140%">*</span>
449
                                <input type="number" class="form-control brand-commitment" required
450
                                       name="Other" value="">
451
                            </div>
452
                        </div>
34310 tejus.loha 453
                        <div class="col-lg-3">
454
                            <div class="form-group">
455
                                <label>Total Commitment</label>
456
                                <span style="font-size: 140%"></span>
457
                                <input type="number" class="form-control " name="totaCommitmentAmount" id="totalAmount"
458
                                       readonly required
459
                                       placeholder="Total Commitment" value="">
460
                            </div>
461
                        </div>
33658 tejus.loha 462
                    </div>
463
                </div>
33507 tejus.loha 464
                <div class="row">
465
                    <div class="col-lg-4">
466
                        <div class="form-group hide-textarea" id="textArea">
33577 tejus.loha 467
                            <label>Reason for less Commit</label><span
468
                                style="color:red ;font-size: 140%">*</span>
33507 tejus.loha 469
                            <input type="text" class="form-control " name="lessCommitReason" id="lessCommitReason"
33525 tejus.loha 470
                                   placeholder="specify the reason"
33577 tejus.loha 471
                                   value="">
33507 tejus.loha 472
 
473
                        </div>
474
                    </div>
475
                </div>
476
                ##                Agreed Brand fees (INR)
477
                <div class="row">
33885 tejus.loha 478
                    <div class="col-lg-4">
33507 tejus.loha 479
                        <div class="form-group">
33577 tejus.loha 480
                            <label>Agreed Brand fees</label><span
481
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 482
                            <select name="agreedBrandFees" class="form-control">
34107 tejus.loha 483
                                <option selected disabled>Select Brand Fee</option>
33749 tejus.loha 484
                                #foreach($storeTypeFeePair in $storeTypeFeePairs)
485
                                    #set($storeType1 =$storeTypeFeePair.getKey())
486
                                    #set($brandFee = $storeTypeFeePair.getValue())
487
                                    #if($brandFee.getFeeByStoreType($storeType1)>0)
33507 tejus.loha 488
                                        <option value="$storeTypeFeePair.getKey()-$brandFee.getFeeByStoreType($storeType1)-$brandFee.getId()"> $storeType1
489
                                            ($brandFee.getFeeByStoreType($storeType1))
490
                                        </option>
491
                                    #end
33749 tejus.loha 492
                                #end
493
                            </select>
33507 tejus.loha 494
                        </div>
495
                    </div>
496
 
497
                    <!-- Brand fees collected (INR) -->
33885 tejus.loha 498
                    <div class="col-lg-4">
33507 tejus.loha 499
                        <div class="form-group">
33577 tejus.loha 500
                            <label>Brand fees collected</label><span
501
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 502
                            <input type="number" class="form-control " id="brandFeesCollected" required
503
                                   name="brandFeesCollected" placeholder="500000">
33507 tejus.loha 504
                        </div>
505
                    </div>
506
                    <!-- Mode of Payment Online/Cheque/IMPS/NEFT/RTGS/Wallet -->
33885 tejus.loha 507
                    <div class="col-lg-4">
33507 tejus.loha 508
                        <div class="form-group">
33577 tejus.loha 509
                            <label>Mode of Payment</label><span
510
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 511
                            <select class="form-control" name="paymentMode" required>
512
                                <option value="">Select mode</option>
513
                                <option value="UPI">UPI</option>
514
                                <option value="Cheque">Cheque</option>
515
                                <option value="IMPS">IMPS</option>
516
                                <option value="NEFT">NEFT</option>
517
                                <option value="RTGS">RTGS</option>
518
                            </select>
33507 tejus.loha 519
                        </div>
520
                    </div>
33885 tejus.loha 521
                </div>
34026 tejus.loha 522
                <!-- Payment reference no -->
33885 tejus.loha 523
                <div class="row">
524
                    <div class="col-lg-4">
33507 tejus.loha 525
                        <div class="form-group">
33577 tejus.loha 526
                            <label>Payment Reference No</label><span
527
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 528
                            <input type="text" class="form-control" id="paymentReferenceNo" required
529
                                   name="paymentReferenceNo" placeholder="">
33507 tejus.loha 530
                        </div>
531
                    </div>
33578 tejus.loha 532
                    <!-- fee collection date -->
33885 tejus.loha 533
                    <div class="col-lg-4">
33578 tejus.loha 534
                        <div class="form-group">
535
                            <label>Fee collecting Date</label><span
536
                                style="color:red ;font-size: 140%">*</span>
33749 tejus.loha 537
                            <input type="datetime-local" class="form-control " id="feeCollectingDate" required
538
                                   name="feeCollectingDate">
33578 tejus.loha 539
                        </div>
540
                    </div>
33885 tejus.loha 541
                    <div class="col-lg-4">
542
                        <div class="form-group">
543
                            <label>Attach Screenshot</label><span
544
                                style="color:red ;font-size: 140%">*</span>
545
                            <input type="hidden" id="payment-sc-docId" name="paymentAttachment">
546
                            <input type="file" class="form-control" id="payment-sc-doc" required>
547
                        </div>
548
                    </div>
33507 tejus.loha 549
                </div>
550
                <!-- Submit button-->
551
                <div class="form-group" style="text-align: center; margin-bottom:2px;">
33749 tejus.loha 552
                    <button type="button"
34107 tejus.loha 553
                            class="btn btn-success text-white font-semibold py-1 px-4 rounded background-red mk_submit_loi_form"
33749 tejus.loha 554
                            style="box-shadow:none;margin-bottom:2px;">
555
                        <span>Submit</span>
556
                    </button>
33507 tejus.loha 557
                </div>
558
            </form>
559
        </div>
560
    </div>
33658 tejus.loha 561
 
33507 tejus.loha 562
</section>
563
<script>
34085 tejus.loha 564
    $(document).on('blur', 'input[name="storePotential"]', function () {
34310 tejus.loha 565
        const walletValue = parseInt($('select[name="agreeWalletValue"]').val());
566
        const storePotantial = parseInt($('input[name="storePotential"]').val());
34314 tejus.loha 567
        if (walletValue > storePotantial) {
34085 tejus.loha 568
            alert("Store Potential must be greater than or equal to Wallet Value ")
569
            return false;
570
        }
33507 tejus.loha 571
 
34085 tejus.loha 572
    });
33507 tejus.loha 573
 
33658 tejus.loha 574
    $(".gstNo").change(function () {
575
        var inputGstNo = $(this).val();
576
        var gstinformat = new RegExp('^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$');
577
        if (gstinformat.test(inputGstNo)) {
578
            doGetAjaxRequestHandler(`${context}/gstValidate?gstNo=` + inputGstNo,
579
                    function (response) {
34316 tejus.loha 580
                        console.log("resType--", typeof response)
581
                        console.log("res----", response)
34310 tejus.loha 582
                        if (response) {
583
                            if (response.sts === "Active") {
34316 tejus.loha 584
                                $('#manualAddress').empty();
585
                                $('#manualAddress').hide();
34310 tejus.loha 586
                                $("#autoAddress").show();
587
                                $("#CompanyName").val(response.tradeNam);
588
                                $("#gstPinCode").val(response.pradr.addr.pncd);
589
                                $("#gstState").val(response.pradr.addr.stcd);
590
                                $("#gstCity").val(response.pradr.addr.loc);
591
                                $("#gstDistrict").val(response.pradr.addr.dst);
592
                                var selectOptions = [];
593
                                var addresses = response.adadr;
594
                                selectOptions.push(`<select id="billingAddress" name="billingAddress" class="form-control">`);
595
                                addresses.forEach((pradr) => {
596
                                    var addrString = getAddressString(pradr.addr);
597
                                    var addrStringify = JSON.stringify(pradr.addr);
598
                                    selectOptions.push(`<option value='${addrStringify}'>
33507 tejus.loha 599
                                      ${addrString}
600
                                </option>`);
34310 tejus.loha 601
                                });
602
                                selectOptions.push(`</select>`);
603
                                $('#addlist').html(selectOptions.join(''));
604
                            } else {
605
                                alert("GSTIN - " + inputGstNo + " is not Active")
34316 tejus.loha 606
                                $('#addlist').html("");
34310 tejus.loha 607
                            }
608
                        } else {
609
                            alert("Problem to fatching Details From GST , Please Enter manually")
34316 tejus.loha 610
                            $('#addlist').html("");
34310 tejus.loha 611
                            $("#CompanyName").removeAttr('readonly');
34316 tejus.loha 612
                            $("#CompanyName").val("");
34310 tejus.loha 613
                            const addrFieldData = {
614
                                "bno": "Building no",
615
                                "bnm": "Building Name",
616
                                "st": "Street",
617
                                "locality": "Locality",
618
                                "loc": "City",
619
                                "dst": "District",
620
                                "pncd": "Pincode",
621
                                "stcd": "State"
622
                            };
34316 tejus.loha 623
                            $('#manualAddress').show();
34310 tejus.loha 624
                            // Dynamically create input fields
625
                            Object.keys(addrFieldData).forEach(function (field) {
34316 tejus.loha 626
                                $('#manualAddress').append('<div class="address-field"><div class="col-md-3"><label for="' + field + '">' + addrFieldData[field] + ':</label><input class="form-control" id="' + field + '" name="' + field + '" placeholder="' + addrFieldData[field] + '"></div></div>');
34026 tejus.loha 627
                            });
34310 tejus.loha 628
 
34316 tejus.loha 629
 
34026 tejus.loha 630
                        }
33658 tejus.loha 631
                    });
632
        } else {
633
            alert('Please Enter Valid GSTIN Number');
634
            $(".gstNo").val('');
635
            $(".gstNo").focus();
636
        }
33507 tejus.loha 637
    });
638
 
33658 tejus.loha 639
 
33507 tejus.loha 640
    function getAddressString(addr) {
641
        addrFields = ["bno", "bnm", "st", "locality", "loc", "pncd", "stcd"];
642
        addresArr = [];
643
        for (let i = 0; i < addrFields.length; i++) {
644
            if (addr.hasOwnProperty(addrFields[i]) && addr[addrFields[i]] !== "") {
645
                addresArr.push(addr[addrFields[i]]);
646
            }
647
        }
648
        return addresArr.join(", ");
649
    }
650
 
33658 tejus.loha 651
    $(document).ready(function () {
34310 tejus.loha 652
        $("#autoAddress").hide();
33658 tejus.loha 653
        var brandCommitmentInputs = document.querySelectorAll(".brand-commitment");
654
        var totalCommitmentAmount = 0;
655
        brandCommitmentInputs[brandCommitmentInputs.length - 1].addEventListener("blur", function () {
656
            updateTotalCommitmentAmount();
657
        });
658
 
659
        function updateTotalCommitmentAmount() {
660
            // Recalculate the total commitment amount
661
            totalCommitmentAmount = 0;
662
            brandCommitmentInputs.forEach(function (input) {
663
                var commitmentValue = parseInt(input.value);
664
                if (!isNaN(commitmentValue)) {
665
                    totalCommitmentAmount += commitmentValue;
666
                }
667
            });
668
 
669
            var totalCommitmentInput = document.getElementById("totalAmount");
670
            totalCommitmentInput.value = totalCommitmentAmount;
671
 
672
            var storePotential = document.getElementById("storePotential").value;
673
            var minCommitLimit = storePotential * 0.7; // 70% of the store's potential
674
            if (totalCommitmentAmount >= minCommitLimit) {
675
                totalCommitmentInput.classList.remove('border-red');
676
                totalCommitmentInput.classList.add('border-green');
677
                document.getElementById("textArea").classList.remove('show-textarea');
678
                document.getElementById("textArea").classList.add('hide-textarea');
679
            } else {
680
                alert("Total commit amount should be greater than or equal to 70% of the store's potential. Specify the reason");
681
                totalCommitmentInput.classList.remove('border-green');
682
                totalCommitmentInput.classList.add('border-red');
683
                document.getElementById("textArea").classList.remove('hide-textarea');
684
                document.getElementById("textArea").classList.add('show-textarea');
685
                document.getElementById("textArea").focus();
686
            }
687
        }
688
    });
33507 tejus.loha 689
</script>