Subversion Repositories SmartDukaan

Rev

Rev 34508 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i>#springMessage("reportspricedrop.pricedrops")
            </h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">#springMessage(
                    "reportspricedrop.home")</a></li>
                <li><i class="icon_document_alt"></i>#springMessage("reportspricedrop.pricedrops")
                </li>
            </ol>
        </div>
    </div>



    #if($isAdmin)
        #if($isRBM)
            <div style="padding: 5px 10px; margin-top: 2px"
                 class="col-lg-2 form-group">
                <select class="form-control input-sm" id="fofo-users" name="Item" placeholder="Partners">
                    <option value="" disabled selected>Partners</option>
                    #foreach($fofoId in $customRetailersMap.keySet())
                        <option value="$fofoId"
                                data-email="$customRetailersMap.get($fofoId).getEmail()">$customRetailersMap.get($fofoId).getBusinessName()</option>
                    #end
                </select>
            </div>
        #else
        <div class="row col-lg-12" style="float: right;">
            <div class="col-lg-2">
                <div class="input-group">
                    <input placeholder="Enter Partner Name" type="text" class="typeahead form-control"
                           id="typeaheadpartner"
                           name="Item" data-provide="typeahead" autocomplete="off"
                           style="margin-bottom: 10px;margin-left: 22px"> <input id="partnerId"
                                                                                 type="hidden">
                    <br>
                </div>
            </div>
        </div>
    #end
    #end
    <br>
    <div class="row col-lg-12" style="float: right;">
        #if(!$isAnalysis)
        #springMessage("reportspricedrop.from") <input type="date" id="startDate-price-drop-report" placeholder=""
                                                       name="" value="$startDate">

        #springMessage("reportspricedrop.to") <input type="date" id="endDate-price-drop-report" placeholder=""
                                                     value="$endDate">
        <button type="submit" class="price-drop-fetch-report">Fetch Report</button>
        <button type="submit" class="download-price-drop-report">#springMessage(
                "reportspricedrop.downloadreport") </button>
        #else
            #springMessage("reportspricedrop.from") <input type="date" id="analysis-startDate-price-drop-report"
                                                           placeholder=""
                                                           name="" value="$startDate">

            #springMessage("reportspricedrop.to") <input type="date" id="analysis-endDate-price-drop-report"
                                                         placeholder=""
                                                         value="$endDate">
            <button type="submit" class="analysis-price-drop-fetch-report" data-fofoid="$fofoId">Fetch Report</button>
            <button type="submit" class="analysis-download-price-drop-report" data-fofoid="$fofoId">#springMessage(
                "reportspricedrop.downloadreport") </button>
        #end

    </div>
    <div class="col-lg-12">
        <table class="table table-border table-condensed table-bordered" id="priceDropReportTbl" style="width:100%">

            <thead class="row htable" style="background:#F5F5F5;">
            <tr style="color:black;">

                <th>#springMessage("reportspricedrop.code")</th>
                <th>#springMessage("reportspricedrop.pricedropid")</th>
                <th>#springMessage("reportspricedrop.brand")</th>
                <th>#springMessage("reportspricedrop.modelname")</th>

                <th>#springMessage("reportspricedrop.modelnumber")</th>
                <th>#springMessage("reportspricedrop.affectedon")</th>
                <th>#springMessage("reportspricedrop.amount")</th>
                <th>Credit Date</th>

                <th>#springMessage("reportspricedrop.imei")</th>
                <th>#springMessage("reportspricedrop.status")</th>
                <th>Rejected date</th>
                <th>Rejected Reason</th>


            </tr>
            </thead>
            <tbody>
                #foreach($pdr in $priceDropReports )
                <tr>
                    <td>$pdr.getCode()</td>
                    <td>$pdr.getId()</td>
                    <td>$pdr.getBrand()</td>
                    <td>$pdr.getModelName()</td>

                    <td>$pdr.getModelNumber()</td>

                    <td>$pdr.getAffectedOn().format($dateFormatter)</td>
                    <td>$pdr.getAmount()</td>
                    #if($pdr.getCreditTimestamp())
                        <td>$pdr.getCreditTimestamp().format($dateTimeFormatter)</td>
                    #else
                        <td>--</td>
                    #end


                    <td>$pdr.getImei()</td>
                    <td>$pdr.getStatus()</td>


                    #if($pdr.getRejectedTimestamp())
                        <td>$pdr.getRejectedTimestamp().format($dateTimeFormatter)</td>
                    #else
                        <td>--</td>
                    #end

                    #if($pdr.getRejectionReason())
                        <td>$pdr.getRejectionReason()</td>

                    #else
                        <td>--</td>
                    #end

                </tr>
                #end

            </tbody>

        </table>
    </div>

</section>


<script>

    var dtable = $('#priceDropReportTbl').DataTable(
            {
                "scrollX": true,
                "bPaginate": true,
                "bLengthChange": true,
                "bFilter": true,
                "bInfo": false,
                "bAutoWidth": false,


            });


</script>
#if($isAdmin)
<script type="text/javascript">
    $(function () {
        getPartnerAheadOptions($("#typeaheadpartner"), function (selectedPartner) {
            partnerId = selectedPartner.partnerId;

            console.log(partnerId);
        });
    });
    $(function () {
        $('#fofo-users').on('change', function () {
            var selectedFofoId = $(this).val();
            if (selectedFofoId) {
                partnerId = selectedFofoId;
                console.log("Partner ID set to:", partnerId);
            } else {
                alert("Please select a valid Partner ID.");
            }
        });
    });
</script>
+#end