Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
33617 tejus.loha 1
<link href="https://cdn.datatables.net/fixedcolumns/3.3.0/css/fixedColumns.bootstrap.css" rel="stylesheet"/>
2
 
33507 tejus.loha 3
<section class="wrapper">
4
    <style>
5
        #paymentDetail:hover {
33582 tejus.loha 6
            background-color: #9acfea;
33507 tejus.loha 7
        }
33525 tejus.loha 8
 
9
        #paymentDetail {
10
            background-color: gainsboro;
11
        }
33578 tejus.loha 12
 
13
        .padd-lr {
14
            padding-left: 10px;
15
            padding-right: 10px;
16
        }
33582 tejus.loha 17
 
18
        .mk_docVerified {
19
            width: 40px;
20
        }
21
 
22
        .mk_feeCompleted {
23
            width: 40px;
24
        }
33617 tejus.loha 25
 
26
        #allPendingLoiForm td, #allPendingLoiForm th {
27
            min-width: 95px;
28
        }
33507 tejus.loha 29
    </style>
33559 tejus.loha 30
    <div class="row ">
31
        <div class="col-lg-12">
32
            <h3 class="page-header"><i class="icon_document_alt"></i>PENDING LOI</h3>
33
            <ol class="breadcrumb">
34
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
35
                <li><i class="icon_document_alt"></i>Pending LOI Forms</li>
33711 tejus.loha 36
                #if($isAuthUser ||$isDocApprover)
33617 tejus.loha 37
                    <div style="float:right;margin-bottom: 1%">
38
                        From:
39
                        <input type="date" name="from" placeholder="Form">
40
                        To:
41
                        <input type="date" name="to" placeholder="To">
42
                        <button id="downloadAllLoiForm">
43
                            Downlod
44
                        </button>
45
                    </div>
46
                #end
33559 tejus.loha 47
            </ol>
48
        </div>
49
    </div>
33617 tejus.loha 50
    <div>
51
        <div class="col-lg-12">
52
            <table class="table table-border table-condensed table-bordered" id="allPendingLoiForm" style="width:100%">
53
                <thead class="row htable">
54
                <tr>
33845 tejus.loha 55
                    <th>Id</th>
56
                    <th>Company Name</th>
57
                    <th>Owner name</th>
58
                    <th>Mobile</th>
59
                    <th>Email</th>
33617 tejus.loha 60
                    <th>Filled By</th>
61
                    <th>Billing City</th>
62
                    <th>Total Commit</th>
63
                    <th>Brand Type</th>
64
                    <th>Brand Fee</th>
65
                    <th>Total collection</th>
33845 tejus.loha 66
                    <th>Status</th>
33617 tejus.loha 67
                    <th>Document Verified</th>
68
                    <th>Brand Fee Completed</th>
69
                    <th>Action</th>
70
                </tr>
71
                </thead>
72
                <tbody>
73
                    #foreach($data in $pendingFormList)
74
                    <tr>
75
                        <input type="hidden" value="$data.getId()">
33845 tejus.loha 76
                        <td>$data.getId()</td>
77
                        <td>$data.getCompanyName()</td>
78
                        <td>$data.getOwnerName()</td>
79
                        <td>$data.getMobile()</td>
80
                        <td>$data.getEmail()</td>
33617 tejus.loha 81
                        <td>$data.getLoiFormFilledBy()</td>
82
                        <td>$data.getCity()</td>
83
                        <td class="currency">$data.getTotalCommitment()</td>
84
                        <td>$data.getBrandType()</td>
33710 tejus.loha 85
                        #if($isAgreedBrandFeeChanger)
86
                            <td><input name="brandFee" value="$data.getBrandFee()">
87
                                <div align="right">
88
                                    <button type="button" class="save_agree_brand_fee btn-success"
89
                                            value="$data.getId()">Save
90
                                    </button>
91
                                </div>
92
                            </td>
93
 
94
                        #else
95
                            <td class="currency">$data.getBrandFee()</td>
96
                        #end
33617 tejus.loha 97
                        <td class="currency" class="btn btn-primary" id="paymentDetail"
98
                            onclick="getPaymentsDetails($data.getId())" data-toggle="modal"
99
                            data-target="#commonModalDiv"> $data.getTotalFeeCollection()
100
                        </td>
33845 tejus.loha 101
                        #if($data.isLoiOtpPresent() && $data.getBrandFee()==$data.getTotalFeeCollection())
102
                            <td>APPROVAL PENDING</td>
103
                        #else
104
                            <td>$data.getStatus()</td>
105
                        #end
106
 
33617 tejus.loha 107
                        #if($data.isDocVerified().equals(true))
108
                            <td style="background-color: #2ac845" class="mk_docVerified">Yes</td>
109
                        #elseif($data.isDocVerified().equals(false))
110
                            <td style="background-color: red" class="mk_docVerified">No</td>
111
                        #else
112
                            <td>--</td>
113
                        #end
114
                        #if($data.getBrandFee()==$data.getTotalFeeCollection())
115
                            <td style="background-color: #2ac845" class="mk_feeCompleted">Yes</td>
116
                        #else
117
                            <td style="background-color: red" class="mk_feeCompleted">No</td>
118
                        #end
33507 tejus.loha 119
 
33617 tejus.loha 120
                        #if(!$data.isPaymentApprover())
121
                            <td>
122
                                #if(!$data.isLoiOtpPresent() &&  $data.isDocVerified() && $data.getTotalFeeCollection()!=0.0 && !$data.isDocApprover())
123
                                    <button type="button" class="btn-primary generateLoi" value="$data.getId()">Generate
124
                                        LOI
125
                                    </button>
33712 tejus.loha 126
 
33617 tejus.loha 127
                                #else
128
                                    #if(!$data.isLoiOtpPresent() && !$data.isDocApprover())
129
                                        <button type="button" value="$data.getId()"
130
                                                onclick="alert('Once all documents and at least 1st payment verified then you able to generate LOI')">
131
                                            Generate LOI
132
                                        </button>
133
                                    #end
134
                                #end
33845 tejus.loha 135
                                ##                                #if($isAuthUser && !$data.isLoiOtpPresent())
136
                                ##                                    <button type="button" class="btn-danger cancel_loi" value="$data.getId()"
137
                                ##                                            data-company="$data.getCompanyName()">Cancel
138
                                ##                                    </button>
139
                                ##                                #end
140
                                #if(!($data.getLoiFillerEmail().equals($data.getLoginEmail())) && $data.isLoiOtpPresent() && $data.getBrandFee()==$data.getTotalFeeCollection())
141
                                    <button type="button" class="btn-danger mk-approve-loi" value="$data.getId()"
142
                                            data-company="$data.getCompanyName()" data-flag="0">Reject Loi
33712 tejus.loha 143
                                    </button>
33845 tejus.loha 144
                                    <button type="button" class="btn-success mk-approve-loi" value="$data.getId()"
145
                                            data-company="$data.getCompanyName()" data-flag="1">
146
                                        Approve Loi
147
                                    </button>
33712 tejus.loha 148
                                #end
33507 tejus.loha 149
 
33617 tejus.loha 150
                                #if($data.getBrandFee()>$data.getTotalFeeCollection() && !$data.isDocApprover())
151
                                    <button type="button" class="btn-primary payModelBtn" value="$data.getId()"
152
                                            data-toggle="modal" data-target="#brandFeeCollectionModel">Add payment
33525 tejus.loha 153
                                    </button>
154
                                #end
33658 tejus.loha 155
                                #if($data.getLoiDoc()==0 && $data.isSalesTeam() && !$data.isLoiOtpPresent() && !$data.isDocApprover())
156
                                    <button type="button" class="btn-primary updateLoiForm" value="$data.getId()"
157
                                            style="width: 100px">Update
158
                                    </button>
159
                                #end
33617 tejus.loha 160
                                #if(!$data.isDocVerified() && $data.isSalesTeam()&& !$data.isDocApprover())
33658 tejus.loha 161
                                    <button type="button" class="upload-document-form btn-primary"
162
                                            value="$data.getId()">Upload
33617 tejus.loha 163
                                        Document
164
                                    </button>
165
                                #else
166
                                    #if($data.isDocApprover())
167
                                        #if($data.isDocApprover() && !$data.isDocVerified())
168
                                            <button class="upload-document-form btn-primary" value="$data.getId()">
169
                                                Approve
170
                                                Document
171
                                            </button>
172
                                        #else
173
                                            <p>Document verified</p>
174
                                        #end
33577 tejus.loha 175
                                    #end
176
                                #end
33617 tejus.loha 177
                            </td>
178
                        #else
179
                            <td>
180
                                <button id="paymentDetail"
181
                                        onclick="getPaymentsDetails($data.getId())" data-toggle="modal"
182
                                        data-target="#commonModalDiv">View Payments
183
                                </button>
184
                            </td>
185
                        #end
186
                    </tr>
33525 tejus.loha 187
                    #end
33617 tejus.loha 188
                </tbody>
189
            </table>
190
        </div>
33507 tejus.loha 191
    </div>
192
 
193
 
194
    <div class="modal fade" id="brandFeeCollectionModel" role="dialog">
33578 tejus.loha 195
        <div class="modal-dialog modal-lg">
33507 tejus.loha 196
 
197
            <!-- Modal content-->
198
            <div class="modal-content">
199
                <div class="modal-header">
200
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
201
                    <h4 class="modal-title">Brand Fee Collection Form</h4>
202
                </div>
203
                <div class="modal-body" style="max-height: 500px;overflow-y: auto;">
204
                    <form name="brandFeeCollectionForm" id="brandFeeCollectionForm" style="align-content: center"
205
                          method="post">
206
                        <div class="row">
33578 tejus.loha 207
 
208
                            <div class="col-lg-2">
33507 tejus.loha 209
                                <div class="form-group">
33578 tejus.loha 210
                                    <label>Amount:</label>
33507 tejus.loha 211
                                    <input type="number" name="collectedAmount" class="form-control" required></div>
212
                            </div>
33578 tejus.loha 213
                            <div class="col-lg-2">
33507 tejus.loha 214
                                <div class="form-group">
33578 tejus.loha 215
                                    <label>Payment Mode:</label>
33507 tejus.loha 216
                                    <select class="form-control" name="paymentMode" required>
217
                                        <option selected>Select mode</option>
218
                                        <option value="UPI">UPI</option>
219
                                        <option value="Cheque">Cheque</option>
220
                                        <option value="IMPS">IMPS</option>
221
                                        <option value="NEFT">NEFT</option>
222
                                        <option value="RTGS">RTGS</option>
223
                                    </select>
224
                                </div>
225
                            </div>
33578 tejus.loha 226
                            <div class="col-lg-2">
33507 tejus.loha 227
                                <div class="form-group">
33578 tejus.loha 228
                                    <label>Reference No:</label>
33507 tejus.loha 229
                                    <input type="text" name="paymentReferenceNo" class="form-control" required>
230
                                </div>
231
                            </div>
33578 tejus.loha 232
                            <div class="col-lg-4">
33507 tejus.loha 233
                                <div class="form-group">
33578 tejus.loha 234
                                    <label>Collecting Date:</label>
235
                                    <input type="datetime-local" name="feeCollectingTimeStamp" class="form-control"
236
                                           required>
237
                                </div>
238
                            </div>
239
                            <div class="col-lg-2">
240
                                <div class="form-group">
33507 tejus.loha 241
                                    <button type="button" class="btn-primary " id="addBrandFeePayment" value=""
242
                                            data-dismiss="modal"
243
                                            style="margin-top:28px;">Add
244
                                    </button>
245
                                </div>
246
 
247
                            </div>
248
                        </div>
249
                    </form>
250
                </div>
251
                <div class="modal-footer">
252
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
253
                </div>
254
            </div>
255
 
256
        </div>
257
    </div>
258
    <div class="modal fade" id="commonModalDiv" role="dialog">
33658 tejus.loha 259
        <div class="modal-dialog modal-lg" style="width:1000px;">
33507 tejus.loha 260
 
261
            <!-- Modal content-->
262
            <div class="modal-content">
263
                <div class="modal-header">
264
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
265
                </div>
33658 tejus.loha 266
                <div class="modal-body" style="width: 100% ;align-items: center">
33507 tejus.loha 267
                    <div id="commonModalBody">
268
                        ## dynemic model bodies
269
                    </div>
270
                </div>
271
                <div class="modal-footer">
272
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
273
                </div>
274
            </div>
275
 
276
        </div>
277
    </div>
278
 
279
 
280
</section>
281
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script>
282
<script>
283
    $(document).ready(function () {
284
        $('.payModelBtn').click(function () {
285
            let loiId = $(this).val();
286
            addBrandFeePayment.value = loiId;
287
        });
288
    });
289
 
290
    function getPaymentsDetails(loiId) {
291
        doGetAjaxRequestHandler(`${context}/paymentsDetail?loiId=` + loiId, function (response) {
292
            //handle response here
293
            $('#commonModalDiv #commonModalBody').html(response);
294
        });
295
    }
296
 
33617 tejus.loha 297
    $(document).ready(function () {
298
        var dtable = $('#allPendingLoiForm').DataTable({
299
            "scrollX": true,
300
            "scrollY": "500px",
301
            scrollCollapse: true,
302
            "fixedHeader": true,
303
            fixedColumns: {
33845 tejus.loha 304
                leftColumns: 2
33617 tejus.loha 305
            }
33507 tejus.loha 306
 
33617 tejus.loha 307
        });
308
    });
309
 
33507 tejus.loha 310
</script>
311
<style>
312
    #paymentDetail.hover {
313
        color: #2b669a;
314
    }
315
</style>