Subversion Repositories SmartDukaan

Rev

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

Rev 33953 Rev 33991
Line 30... Line 30...
30
        }
30
        }
31
    </style>
31
    </style>
32
    <link href="../resources/css/brand-logo.css" rel="stylesheet"/>
32
    <link href="../resources/css/brand-logo.css" rel="stylesheet"/>
33
</head>
33
</head>
34
<body>
34
<body>
-
 
35
 
-
 
36
    #if($isGtEqL2)
35
<h3>RBM Wise Today's ARR (Basis Product Movement)</h3>
37
<h3>RBM Wise Today's ARR (Basis Product Movement)</h3>
36
    #parse("rbm-today-arr.vm")
38
    #parse("rbm-today-arr.vm")
37
<br>
39
<br>
38
#if($isGtEqL2)
-
 
39
<div class="container-fluid">
40
<div class="container-fluid">
40
    #foreach($brands in $brandParts)
41
    #foreach($brands in $brandParts)
41
        <table class="table table-bordered table-striped">
42
        <table class="table table-bordered table-striped">
42
            <thead>
43
            <thead>
43
            <tr>
44
            <tr>
Line 180... Line 181...
180
                $(ele).html(numberToComma($(ele).html()));
181
                $(ele).html(numberToComma($(ele).html()));
181
            }
182
            }
182
        });
183
        });
183
    })
184
    })
184
</script>
185
</script>
-
 
186
 
-
 
187
 
-
 
188
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
-
 
189
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
-
 
190
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
-
 
191
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
-
 
192
 
-
 
193
<script>
-
 
194
    // Initialize the date range picker
-
 
195
    $('input[name="rbmArrPeriod"]').daterangepicker({
-
 
196
        autoUpdateInput: false, // Prevent auto-filling the input with dates
-
 
197
        locale: {
-
 
198
            cancelLabel: 'Clear'
-
 
199
        }
-
 
200
    });
-
 
201
 
-
 
202
    // Update the input field when dates are selected
-
 
203
    $('input[name="rbmArrPeriod"]').on('apply.daterangepicker', function (ev, picker) {
-
 
204
        $(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
-
 
205
    });
-
 
206
 
-
 
207
    // Clear the input field when the user cancels
-
 
208
    $('input[name="rbmArrPeriod"]').on('cancel.daterangepicker', function (ev, picker) {
-
 
209
        $(this).val('');
-
 
210
    });
-
 
211
 
-
 
212
    // Function to get the dates from the picker
-
 
213
    function getDatesFromPicker(selector) {
-
 
214
        const pickerElement = $(selector).data('daterangepicker');
-
 
215
        if (!pickerElement) {
-
 
216
            console.error('Date Range Picker is not initialized.');
-
 
217
            return {startDate: null, endDate: null};
-
 
218
        }
-
 
219
        return {
-
 
220
            startDate: pickerElement.startDate.format('YYYY-MM-DD'),
-
 
221
            endDate: pickerElement.endDate.format('YYYY-MM-DD')
-
 
222
        };
-
 
223
    }
-
 
224
 
-
 
225
    // Button click event
-
 
226
    $(document).on('click', '.sold-catalog-report', function () {
-
 
227
        const dates = getDatesFromPicker('input[name="rbmArrPeriod"]');
-
 
228
        const startDate = dates.startDate;
-
 
229
        const endDate = dates.endDate;
-
 
230
 
-
 
231
        if (!startDate || !endDate) {
-
 
232
            alert("Start date and end date cannot be empty!!");
-
 
233
            return;
-
 
234
        }
-
 
235
 
-
 
236
        let endPoint = `/downloadSoldCatalogReport?startDate=${startDate}&endDate=${endDate}`;
-
 
237
        window.open(endPoint, '_blank');
-
 
238
        ;
-
 
239
    });
-
 
240
</script>
185
</body>
241
</body>
186
</html>
242
</html>
187
243