Subversion Repositories SmartDukaan

Rev

Rev 34142 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23506 amit.gupta 1
<style>
34142 tejus.loha 2
    .pointer {
3
        cursor: pointer;
4
    }
5
 
6
    .btn:hover {
7
        color: grey;
8
        text-decoration: none;
9
    }
10
 
11
    .btn-primary:hover {
12
        color: grey;
13
        text-decoration: none;
14
    }
15
 
16
    .retailer-details {
17
        cursor: pointer;
18
    }
23506 amit.gupta 19
</style>
20
 
26320 tejbeer 21
<script type="text/javascript">
34142 tejus.loha 22
    // $("#partnerFofoId").typeahead({
23
    //     source: retailers,
24
    //     autoSelect: true,
25
    //     displayText: function (item) {
26
    //         return item.businessName + "-" + item.address.city;
27
    //     },
28
    //     afterSelect: function (currentItem) {
29
    //         currentFofoId = currentItem.partnerId;
30
    //         fofoId = currentItem.partnerId;
31
    //         doAjaxRequestHandler(context + "/return/inventory/" + currentFofoId, "GET", function (response) {
32
    //             inventoryTable.rows().remove().rows.add($(response)).draw(false);
33
    //         });
34
    //     }
35
    // });
36
 
26320 tejbeer 37
</script>
38
 
34142 tejus.loha 39
<section class="wrapper">
40
    <div class="row">
41
        <div class="col-lg-12">
42
            <h3 class="page-header"><i class="icon_document_alt"></i>View/Request Return</h3>
43
            <ol class="breadcrumb">
44
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
45
                <li><i class="icon_document_alt"></i>View Returnables</li>
46
            </ol>
47
        </div>
48
    </div>
49
 
23506 amit.gupta 50
    <div>
34142 tejus.loha 51
        <div class="row">
52
            <div class="col-lg-2 form-group">
53
                <select class="form-control input-sm" id="fofo-users" name="fofo-users" placeholder="Partners">
54
                    <option value="" disabled selected>Partners</option>
55
                    #foreach($fofoId in $customRetailersMap.keySet())
56
                        <option value="$fofoId"
34978 ranu 57
                                data-email="$customRetailersMap.get($fofoId).getEmail()">$customRetailersMap.get($fofoId).getBusinessName()
58
                            - $customRetailersMap.get($fofoId).getCode()</option>
34142 tejus.loha 59
                    #end
60
                </select>
61
            </div>
62
 
63
 
64
            <div class="col-lg-4" id="inventory-container">
65
                <table class="table table-striped table-condensed table-bordered">
66
                    <thead>
67
                    <tr>
68
                        <th>Item Id</th>
69
                        <th>Description</th>
70
                        <th>Qty</th>
71
                    </tr>
72
                    </thead>
73
                    <tbody id="inventory-body">
74
                    </tbody>
75
                </table>
76
            </div>
77
            <div class="col-lg-6" id="returnable-container">
78
                <table class="table table-striped table-condensed table-bordered">
79
                    <thead>
80
                    <tr>
81
                        <th>Serial Number</th>
82
                        <th>Unit Price</th>
83
                        <th>Scanned On</th>
84
                        <th>Status</th>
85
                    </tr>
86
                    </thead>
87
                    <tbody id="returnables-body">
88
                    </tbody>
89
                </table>
90
            </div>
91
        </div>
92
    </div>
23506 amit.gupta 93
</section>
94
<script type="text/javascript">
95
 
34142 tejus.loha 96
    $(document).on('change', 'select[name="fofo-users"]', function () {
97
        console.log("partner select");
98
        let fofoId = $('select[name="fofo-users"]').val();
99
        console.log("partner id -", fofoId);
100
        doAjaxRequestHandler(context + "/return/inventory/" + fofoId, "GET", function (response) {
101
            inventoryTable.rows().remove().rows.add($(response)).draw(false);
102
        });
103
    })
104
    /* Create an array with the values of all the input boxes in a column */
105
    $.fn.dataTable.ext.order['dom-text'] = function (settings, col) {
106
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
107
            return $('input', td).val();
108
        });
109
    }
110
 
111
    /* Create an array with the values of all the input boxes in a column, parsed as numbers */
112
    $.fn.dataTable.ext.order['dom-text-numeric'] = function (settings, col) {
113
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
114
            return $('input', td).val() * 1;
115
        });
116
    }
117
 
118
    /* Create an array with the values of all the select options in a column */
119
    $.fn.dataTable.ext.order['dom-select'] = function (settings, col) {
120
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
121
            return $('select', td).val();
122
        });
123
    }
124
 
125
    /* Create an array with the values of all the checkboxes in a column */
126
    $.fn.dataTable.ext.order['dom-checkbox'] = function (settings, col) {
127
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
128
            return $('input', td).prop('checked') ? '1' : '0';
129
        });
130
    }
131
 
132
    /* Initialise the table with the required column ordering data types */
133
    $(document).ready(function () {
134
        /*storesTable = $('#store-container').find('table').DataTable({"pageLength": 20});*/
135
        inventoryTable = $('#inventory-container').find('table').DataTable(
136
                {
137
                    "paging": true,
138
                    "searching": true
139
                }
140
        );
141
        returnsTable = $('#returnable-container').find('table').DataTable({
142
            "paging": true,
143
            "searching": true
144
        });
145
    });
146
 
147
 
148
    $(document).ready(function () {
149
        $('#fofo-users').multiselect({
150
            includeSelectAllOption: true,
151
            maxHeight: 200,
152
            multiple: true,
153
            buttonWidth: '180px',
154
            numberDisplayed: 1,
155
            nonSelectedText: 'Users',
156
            nSelectedText: ' - Users Selected',
157
            allSelectedText: 'All Users Selected',
158
            enableFiltering: true,
159
            enableCaseInsensitiveFiltering: true
160
        });
161
 
162
 
163
    });
164
 
165
 
23506 amit.gupta 166
</script>