Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
34198 ranu 1
<section class="wrapper">
2
    <div class="row">
3
        <div class="col-lg-12">
4
            <h3 class="page-header"><i class="icon_document_alt"></i>Requested Allocations</h3>
5
            <ol class="breadcrumb">
6
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
7
                <li><i class="icon_document_alt"></i>Requested Allocations</li>
8
            </ol>
9
        </div>
10
    </div>
11
    <div class="row">
12
        <div class="col-lg-12">
13
            <ul class="nav nav-tabs">
14
                <li class="active"><a data-toggle="tab" href="#pending">Pending</a></li>
15
                <li><a data-toggle="tab" href="#approved">Approved</a></li>
16
            </ul>
17
            <div class="tab-content">
18
                <div id="pending" class="tab-pane fade in active">
34295 ranu 19
                    <table class="table table-bordered table-condensed pendingRequestedAllocationList"
34198 ranu 20
                           style="width:100%">
21
                        <thead class="row htable" style="background:#F5F5F5;">
22
                        <tr style="color:black;">
36080 aman 23
                            <th>Partner Id</th>
34198 ranu 24
                            <th>Partner Name</th>
25
                            <th>Catalog Id</th>
26
                            <th>Model Number</th>
27
                            <th>Brand</th>
36895 amit 28
                            <th>HID Qty</th>
29
                            <th>Bill/Act 5d</th>
30
                            <th>Current Qty</th>
31
                            <th>Excess/Short</th>
32
                            <th>Requested Qty</th>
33
                            <th>Requestor</th>
34
                            <th>Approver</th>
34198 ranu 35
                            <th>Action</th>
36
                        </tr>
37
                        </thead>
38
                        <tbody>
39
                            #foreach($model in $pendingRequestedHidAllocations)
40
                            <tr>
41
                                <td> $model.getFofoId() </td>
34304 ranu 42
                                <td> $userMap.get($model.getFofoId()).getName()
43
                                    - $fofoStoreMap.get($model.getFofoId()).getCode() </td>
34198 ranu 44
                                <td> $model.getCatalogId() </td>
45
                                <td> $model.getModelNumber() </td>
46
                                <td> $model.getBrand() </td>
36895 amit 47
                                <td> $hidQtyMap.get($model.getId()) </td>
48
                                <td> $billActMap.get($model.getId()) </td>
49
                                <td> $currentQtyMap.get($model.getId()) </td>
50
                                #set($es = $excessShortMap.get($model.getId()))
51
                                <td>#if($es > 0)<span style="color:red;">+$es</span>#elseif($es < 0)<span style="color:green;">$es</span>#else<span>0</span>#end</td>
34295 ranu 52
                                <td><input type="text" value="$model.getRequested_allocation()"
53
                                           class="reuested_allocation" disabled> <a role="button"> <i
54
                                        class="fa fa-edit edit-allocation"></i></a></td>
36895 amit 55
                                <td> $!model.getCreatedBy() </td>
56
                                <td> $!model.getApprovedBy() </td>
34198 ranu 57
                                <td>
58
                                    <button class="btn btn-sm btn-success allocation-request-approve-reject"
59
                                            data-id="$model.getId()" data-status="true">Approve
60
                                    </button>
61
                                    /
62
                                    <button class="btn btn-sm btn-danger allocation-request-approve-reject"
63
                                            data-id="$model.getId()" data-status="false">Reject
64
                                    </button>
34295 ranu 65
                                    /
66
                                    <button class="btn btn-sm btn-info allocation-request-edit"
67
                                            data-id="$model.getId()">Edit
68
                                    </button>
34198 ranu 69
                                </td>
70
                            </tr>
71
                            #end
72
                        </tbody>
73
                    </table>
74
                </div>
75
                <div id="approved" class="tab-pane fade">
34295 ranu 76
                    <table class="table table-bordered table-condensed approvedRequestedAllocationList"
34198 ranu 77
                           style="width:100%">
78
                        <thead class="row htable" style="background:#F5F5F5;">
79
                        <tr style="color:black;">
36080 aman 80
                            <th>Partner Id</th>
34198 ranu 81
                            <th>Partner Name</th>
82
                            <th>Catalog Id</th>
83
                            <th>Model Number</th>
84
                            <th>Brand</th>
36895 amit 85
                            <th>HID Qty</th>
86
                            <th>Bill/Act 5d</th>
87
                            <th>Current Qty</th>
88
                            <th>Excess/Short</th>
89
                            <th>Requested Qty</th>
90
                            <th>Requestor</th>
91
                            <th>Approver</th>
34198 ranu 92
                            <th>Action</th>
93
                        </tr>
94
                        </thead>
95
                        <tbody>
96
                            #foreach($model in $approvedRequestedHidAllocations)
97
                            <tr>
98
                                <td> $model.getFofoId() </td>
34305 ranu 99
                                <td> $userMap.get($model.getFofoId()).getName()
100
                                    - $fofoStoreMap.get($model.getFofoId()).getCode() </td>
34198 ranu 101
                                <td> $model.getCatalogId() </td>
102
                                <td> $model.getModelNumber() </td>
103
                                <td> $model.getBrand() </td>
36895 amit 104
                                <td> $hidQtyMap.get($model.getId()) </td>
105
                                <td> $billActMap.get($model.getId()) </td>
106
                                <td> $currentQtyMap.get($model.getId()) </td>
107
                                #set($es = $excessShortMap.get($model.getId()))
108
                                <td>#if($es > 0)<span style="color:red;">+$es</span>#elseif($es < 0)<span style="color:green;">$es</span>#else<span>0</span>#end</td>
34295 ranu 109
                                <td><input type="text" value="$model.getRequested_allocation()"
110
                                           class="reuested_allocation" disabled> <a role="button"> <i
111
                                        class="fa fa-edit edit-allocation"></i></a></td>
36895 amit 112
                                <td> $!model.getCreatedBy() </td>
113
                                <td> $!model.getApprovedBy() </td>
34198 ranu 114
                                <td>
115
                                    <button class="btn btn-sm btn-danger allocation-request-approve-reject"
116
                                            data-id="$model.getId()" data-status="false">Reject
117
                                    </button>
34295 ranu 118
                                    <button class="btn btn-sm btn-info allocation-request-edit"
119
                                            data-id="$model.getId()">Edit
120
                                    </button>
34198 ranu 121
                                </td>
122
                            </tr>
123
                            #end
124
                        </tbody>
125
                    </table>
126
                </div>
127
 
128
            </div>
129
        </div>
130
 
131
    </div>
132
 
133
</section>
134
 
135
<script>
136
 
137
    $(document).ready(function () {
138
        // Initialize first table
34295 ranu 139
        var sanctionTable = $('.pendingRequestedAllocationList').DataTable({
34198 ranu 140
            "scrollX": true,
141
            scrollCollapse: true,
142
            "fixedHeader": true,
143
            "order": [[0, "desc"]],
144
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
145
        });
146
 
147
        // Initialize second table
34295 ranu 148
        var sanctionTableApproved = $('.approvedRequestedAllocationList').DataTable({
34198 ranu 149
            "scrollX": true,
150
            scrollCollapse: true,
151
            "fixedHeader": true,
152
            "order": [[0, "desc"]],
153
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
154
        });
155
 
156
        // Adjust columns when tab changes
157
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
158
            // Wait for tab switch and then adjust columns
159
            setTimeout(function () {
160
                sanctionTable.columns.adjust().draw();
161
                sanctionTableApproved.columns.adjust().draw();
162
            }, 100); // Delay adjustment slightly to ensure tab switch is complete
163
        });
164
    });
165
 
166
</script>