Subversion Repositories SmartDukaan

Rev

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

<style>
    #order-items td {
        align-content: center;
    }
</style>
<script type="text/javascript">
    var cartItemIndex = 0;
    accessoriesDeals = $accessoriesDeals;
    pendingPOCustomer = $pendingPOCustomer;
    pendingPO = $pendingPO;
    console.log(typeof pendingPOCustomer)
    if (pendingPOCustomer != null) {
        $('input.search-phone').val(pendingPOCustomer.mobileNumber).change()
                .attr('readonly', true);
        var mobileNumber = $('.search-phone').val();
        console.log(mobileNumber)

        writeOldCustomerDetailsByMobileNumber(mobileNumber);
    }
    $(function () {
        var date = new Date();
        var currentMonth = date.getMonth();
        var currentDate = date.getDate();
        var currentYear = date.getFullYear();
        $('input[name="dateOfBirth"]').daterangepicker({
            maxDate: new Date(currentYear - 18, currentMonth, currentDate),
            startDate: new Date(currentYear - 18, currentMonth, currentDate),
            singleDatePicker: true
        });

        $('input[name="dgmfgdate"]').daterangepicker({
            minDate: new Date(currentYear, currentMonth - 6, currentDate),
            maxDate: new Date(currentYear, currentMonth, currentDate),
            singleDatePicker: true,
        }, function (start, end) {
            const mfgDate = start.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);

        });
        formLoaded();
    });
</script>

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header" style="position:relative">
                <i class="icon_table"></i>Order
                    #if($fofoStore.getCode().equals("DLSD135"))
                <span style="position:absolute;top:-55px;right:45%"><a class="digify-retailer-login-test" href="${rc.contextPath}/digify/register" target="_blank">  <img src="resources/images/Buyback-Mobile.png"> </a> </span>
                     #end
            </h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a
                        href="${rc.contextPath}/dashboard">Home</a></li>
                <li><i class="icon_table"></i>ORDER</li>
            </ol>
        </div>
    </div>
    <form id="cd">

    <div id="order-details" style="padding: 10px">
        #if($cartItems.size()==0)
            <div class="card row">
                <p>Your Cart is Empty.</p>
            </div>
        #else
            <div class="row">
                <div class="col-lg-9 container" style="background-color: white">
                    <div class="row">
                        <div class="col-lg-12">
                            <h4 class="modelHeaderCustom" style="font-size: 22px;">Product
                                Information</h4>
                            <table id="order-items" class="table table-condensed">
                                <tr>
                                    <th style="width: 25%">Description</th>
                                    <th style="width: 5%">Qty</th>
                                    <th style="width: 13%">Serial Number</th>
                                    <th style="width: 13%">Unit Price</th>
                                    <th style="widht:13%">Activation Discount</th>
                                    <th style="width: 17%">Mobile Insurance</th>
                                    <th style="width: 13%">Total Price</th>
                                    <th>Upgrade</th>
                                </tr>

                                #foreach ($cartItem in $cartItems) #set($mrp="MRP")
                                    #if($mopPriceMap.get($cartItem.getItemId()).getMrp()!=0)
                                        #set($mrp="$mopPriceMap.get($cartItem.getItemId()).getMrp()(MRP)")
                                    #end
                                    #set($placeHolder =
                                        "$mopPriceMap.get($cartItem.getItemId()).getPrice()(MOP) - $mrp")
                                    #set($dp = $mopPriceMap.get($cartItem.getItemId()).getPurchasePrice())
                                    #if($accessoriesDeals && $cartItem.getItemType() =="NON_SERIALIZED")
                                        #set($placeHolder =
                                            "$mopPriceMap.get($cartItem.getItemId()).getPurchasePrice()(DP) -
                                                $mopPriceMap.get($cartItem.getItemId()).getPrice()(MOP) - $mrp")
                                    #end
                                    #if($cartItem.getItemType() =="SERIALIZED") #set($start = 1)
                                        #set($end = $cartItem.getQuantity())
                                        #set($range = [$start..$end])
                                        #foreach ($index in $range)
                                            <tr>
                                                <td>$cartItem.getDisplayName()
                                                    #if($webOfferMap.size() > 0 || $offerItemMap.get($cartItem.getItemId()).size() > 0)
                                                        <a role="button" style="color:royalblue;font-size: 10px;"
                                                           class="upgrade-offer" data-toggle="modal"
                                                           data-target="#upgradeOfferModal"
                                                           data-itemid="$cartItem.getItemId()">
                                                            - view offer<i class="fas fa-arrow-circle-right"></i>
                                                        </a>
                                                    #end
                                                    #if($pinelabsOfferMap.get($cartItem.getItemId()))
                                                        #set($hasValidTenure = false)
                                                        #foreach($issuerEntry in $pinelabsOfferMap.get($cartItem.getItemId()).entrySet())
                                                            #foreach($tenure in $issuerEntry.value)
                                                                #if($tenure.getTenureValue() && $tenure.getTenureValue() > 0)
                                                                    #set($hasValidTenure = true)
                                                                #end
                                                            #end
                                                        #end
                                                        #if($hasValidTenure)
                                                        <br/><a role="button" style="color:green;font-size: 10px;"
                                                           class="pinelabs-offer-submit" data-toggle="modal"
                                                           data-target="#pinelabsOfferModal"
                                                           data-itemid="$cartItem.getItemId()">
                                                            - EMI offers<i class="fas fa-arrow-circle-right"></i>
                                                        </a>
                                                        #end
                                                    #end
                                                </td>
                                                <td class="table-align-center">1</td>
                                                <td class="table-align-center"><input readonly type="text"
                                                                                      itemId="$cartItem.getItemId()"
                                                                                      itemType="$cartItem.getItemType()"
                                                                                      name="serialNumber"
                                                                                      class="serialNumber input-sm form-control">
                                                    <input type="hidden" itemId="$cartItem.getItemId()"
                                                           name="customSerialNumber" itemType="$cartItem.getItemType()"
                                                           class="customSerialNumber form-control input-sm">
                                                    #if($itemIdAndPoiMap.containsKey($cartItem.getItemId()))
                                                        <input type="hidden" class="poiId"
                                                               value="$itemIdAndPoiMap.get($cartItem.getItemId()).getId()">
                                                    #else
                                                        <input type="hidden" value="0" class="poiId">
                                                    #end

                                                </td>
                                                <td class="table-align-center"><input type="number"
                                                                                      class="unitPrice form-control input-sm"
                                                                                      name="unitPrice"
                                                                                      quantity="1"
                                                                                      itemId="$cartItem.getItemId()"
                                                                                      mopPrice="$mopPriceMap.get($cartItem.getItemId()).getPrice()"
                                                                                      dp="$dp"
                                                                                      mrp="$mopPriceMap.get($cartItem.getItemId()).getMrp()"
                                                                                      isMop="$mopPriceMap.get($cartItem.getItemId()).isMop()"
                                                                                      placeholder="$placeHolder"></td>
                                                <td class="table-align-center"><input type="number"
                                                                                      class="discount form-control input-sm"
                                                                                      name="discount"
                                                    #if($mopPriceMap.get($cartItem.getItemId()).getMaxDiscountAmount() > 0)
                                                                                      data-maxdiscount="$mopPriceMap.get($cartItem.getItemId()).getMaxDiscountAmount()"
                                                                                      max="$mopPriceMap.get($cartItem.getItemId()).getMaxDiscountAmount()"
                                                                                      placeholder="Upto $mopPriceMap.get($cartItem.getItemId()).getMaxDiscountAmount()"
                                                                                      value="$mopPriceMap.get($cartItem.getItemId()).getMaxDiscountAmount()"
                                                    #else
                                                                                      readonly value="0"
                                                    #end
                                                ></td>
                                                <td class="table-align-center">
                                                    <div class="input-group">
                                                        <input type="number" itemId="$cartItem.getItemId()" value="0"
                                                               name="insuranceamount"
                                                               class="insuranceamount form-control input-sm" readonly>
                                                        <input type="hidden" itemId="$cartItem.getItemId()" value="0"
                                                               name="insuranceid" class="insuranceid">
                                                        <input type="hidden" itemId="$cartItem.getItemId()" value="0"
                                                               name="correlationid" class="correlationid">
                                                        <input
                                                            type="hidden" itemId="$cartItem.getItemId()" name="ram"
                                                            class="ram"> <input type="hidden"
                                                                                itemId="$cartItem.getItemId()"
                                                                                name="memory"
                                                                                class="memory">
                                                        <input type="hidden" itemId="$cartItem.getItemId()"
                                                               name="mfgdate" class="mfgdate">
                                                        <div class="input-group-btn">
                                                            <button type="button"
                                                                    class="btn btn-sm btn-default mk_check_plans"
                                                                    data-mop="$mopPriceMap.get($cartItem.getItemId()).getPrice()">
                                                                Check Plans
                                                            </button>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="table-align-center"><input name="totalPrice"
                                                                                      class="totalPrice input-sm  form-control"
                                                                                      itemId="$cartItem.getItemId()"
                                                                                      type="number" value="0" readonly>
                                                </td>

                                                <!--                                                upgrade offer td only in case of when offer is avaialable-->

                                                <td style="width:14%; text-align: center;">
                                                    #set($summary = $offerItemSummaryMap.get($cartItem.getItemId()))
                                                    #if($summary && $summary.offerTypeMap.size() > 0)
                                                        <div style="display: flex;">
                                                            <select name="offerSelect"
                                                                    class="form-control offerSelect input-sm"
                                                                    itemId="$cartItem.getItemId()">
                                                                <option value="">Select</option>
                                                                #foreach($entry in $summary.offerTypeMap.entrySet())
                                                                    #set($key = $entry.key)
                                                                    #set($data = $entry.value)
                                                                    <option
                                                                            value="$key"
                                                                            data-scheme-payout="$!data.totalSchemePayout"
                                                                            data-partner-payout="$!data.totalDealerPayout"
                                                                            data-customeroffer-ids="$!data.offerItemIds"
                                                                    >
                                                                        Offer Type: $!data.offerType.name() | Scheme:
                                                                        &#8377; $!data.totalSchemePayout | Dealer:
                                                                        &#8377; $!data.totalDealerPayout
                                                                    </option>
                                                                #end
                                                            </select>
                                                        </div>
                                                    #else
                                                        -
                                                    #end
                                                </td>


                                            </tr>
                                        #end
                                    #else
                                        <tr>
                                            <td>$cartItem.getDisplayName()</td>
                                            <td class="table-align-center">$cartItem.getQuantity()</td>
                                            <td class="table-align-center">
                                                <div class="input-group">
                                                    <input type="hidden" itemId="$cartItem.getItemId()"
                                                           name="serialNumber" itemType="$cartItem.getItemType()"
                                                           class="serialNumber form-control input-sm" readonly>
                                                    <input type="text" itemId="$cartItem.getItemId()"
                                                           name="customSerialNumber" itemType="$cartItem.getItemType()"
                                                           class="customSerialNumber form-control input-sm">
                                                    <span style="color:#FF000081;font-size: 10px;">Please add coma seprated serial value in this field</span>
                                                    #if($itemIdAndPoiMap.containsKey($cartItem.getItemId()))
                                                        <input type="hidden" class="poiId"
                                                               value="$itemIdAndPoiMap.get($cartItem.getItemId()).getId()">
                                                    #else
                                                        <input type="hidden" value="0" class="poiId">
                                                    #end
                                                </div>
                                            </td>
                                            <td class="table-align-center"><input type="number"
                                                                                  class="unitPrice input-sm form-control"
                                                                                  dp="$dp"
                                                                                  name="unitPrice"
                                                                                  quantity="$cartItem.getQuantity()"
                                                                                  itemId="$cartItem.getItemId()"
                                                                                  mopPrice="$mopPriceMap.get($cartItem.getItemId()).getPrice()"
                                                                                  isMop="$mopPriceMap.get($cartItem.getItemId()).isMop()"
                                                                                  placeholder="$placeHolder"/></td>
                                            <td>Not Applicable</td>
                                            <td>Not Applicable</td>
                                            <td class="table-align-center"><input name="totalPrice"
                                                                                  class="totalPrice input-sm form-control"
                                                                                  itemId="$cartItem.getItemId()"
                                                                                  type="number" value="0" readonly></td>
                                            <td>-</td>
                                        </tr>
                                    #end #end
                            </table>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3">
                            <h4 class="modelHeaderCustom" style="font-size: 22px;">Customer
                                Information</h4>
                        </div>
                        <div class="col-lg-3" style="margin-top: 15px">
                            <input placeholder="Search Mobile" type="number" name="mobile"
                                   class="form-control search-phone input-sm">
                        </div>
                    </div>
                    <div class="row customerinfo">
                        <div class="col-lg-2 form-group">
                            <input placeholder="Mobile Number" type="number" name="mobile"
                                   class="form-control phone input-sm" readonly>
                        </div>
                        <div class="col-lg-3 form-group">
                            <input placeholder="First Name" name="firstName" type="text"
                                   value="" class="form-control input-sm firstName" required>
                        </div>
                        <div class="col-lg-3 form-group">
                            <input placeholder="Last Name" name="lastName" type="text"
                                   value="" class="form-control input-sm lastName">
                        </div>
                        <div class="col-lg-2 form-group">
                            <input id="emailId" name="emailId" type="email" value=""
                                   class="form-control input-sm email"
                                   placeholder="Email(xyz@gmail.com)">
                        </div>
                        <div class="col-lg-2 form-group">
                            <button type="button"
                                    class="btn btn-block btn-primary mk_add_customer"
                                    style="display: none">Add customer
                            </button>
                            <button type="button"
                                    class="btn btn-block btn-primary mk_add_email"
                                    style="display: none">Update Customer
                            </button>
                        </div>
                    </div>

                    <div class="row billinginfo" style="display: none">
                        <div class="col-lg-12 row">
                            <div class="col-lg-3">
                                <h4 class="modelHeaderCustom" style="font-size: 22px;">Billing
                                    Address</h4>
                            </div>
                            <div class="col-lg-3">
                                <button type="button"
                                        class="btn btn-block btn-primary new-address-btn">New
                                    Address
                                </button>
                            </div>
                        </div>
                        <div class="row col-lg-12">
                            <div class="col-lg-3 form-group">
                                <input placeholder="GST Number" id="gstNumber" name="gstNumber"
                                       type="text" value="" class="form-control input-sm">
                            </div>
                        </div>
                        <div class="col-lg-12 row" id="customer-address">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>Name</th>
                                    <th>Address Lines</th>
                                    <th>City</th>
                                    <th>State</th>
                                    <th>Pin</th>
                                    <th>Mobile</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody id="address-body">
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="row mk_insurance_row" style="display: none">
                        <div class="col-lg-12">
                            <h4 class="modelHeaderCustom" style="font-size: 22px;">Insurance Information</h4>
                        </div>
                        <div class="col-lg-3 form-group">
                            <label for="gender">Gender</label> <select
                                class="form-control input-sm" id="gender" name="gender"
                                placeholder="Gender">
                            <option value="" disabled selected>Gender</option>
                            <option value="1" selected>Male</option>
                            <option value="2" selected>Female</option>
                        </select>
                        </div>
                        <div class="col-lg-3 form-group">
                            <label for="dateOfBirth">Date Of Birth</label> <input
                                placeholder="Date Of Birth" id="dateOfBirth"
                                type="date" value="" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div id="payment-details"
                         style="background: white; background-color: white;"
                         class="col-lg-12">
                        <h4 class="modelHeaderCustom" style="font-size: 22px;">Payment
                            Details</h4>
                        <div class="row">
                            <div class="col-lg-6">
                                <h4>Total Amount :</h4>
                            </div>
                            <div class="col-lg-5">
                                <input type="number"
                                       class="netPayableAmount form-control input-sm" name=""
                                       value="0" readonly>
                            </div>
                        </div>
                        <div id="payment-option-id-amount-container"
                             paymentOptionSize=$paymentOptions.size()>
                            #set($a = 0) #set($b = $paymentOptions.size() - 1) #set($range =
                        [$a..$b]) #foreach($index in $range)
                            <div class="row">
                                #set($paymentOption = $paymentOptions[$index])
                                #if($paymentOption.getName() == 'ONLINE')
                                    <div class="col-lg-6">
                                        <h5>$paymentOption.getName() :</h5>
                                    </div>
                                    <div class="col-lg-5">
                                        <input type="number" id="paymentOptionIdAmount${index}"
                                               name="paymentOptionIdAmount${index}"
                                               class="form-control paymentOptionAmount amount input-sm"
                                               value="$onlineSellingPrice"
                                               paymentOptionId="$paymentOption.getId()" readonly>
                                    </div>
                                #elseif($paymentOption.getName() == 'SAMSUNG UPGRADE')
                                    <div class="col-lg-6">
                                        <h5>$paymentOption.getName() :</h5>
                                    </div>
                                    <div class="col-lg-5">
                                        <input type="number" id="paymentOptionIdAmount${index}"
                                               name="paymentOptionIdAmount${index}"
                                               class="form-control paymentOptionAmount amount input-sm"
                                               value=""
                                               paymentOptionId="$paymentOption.getId()" readonly>
                                    </div>
                                #else
                                    <div class="col-lg-6">
                                        <h5>$paymentOption.getName() :</h5>
                                    </div>
                                    <div class="col-lg-5">
                                        <input type="number" id="paymentOptionIdAmount${index}"
                                               name="paymentOptionIdAmount${index}"
                                               class="form-control paymentOptionAmount amount input-sm"
                                               value="" paymentOptionId="$paymentOption.getId()">
                                    </div>
                                #end
                            </div>
                        #end
                        </div>
                        <div class="row">
                            <div class="form-group col-lg-10">
                                #if($pendingOrder.getId()) <input type="hidden"
                                                                  value="$pendingOrder.getId()" id="poid"/> <input
                                        type="hidden" value="$pendingOrderItem.getId()" id="poItemId"/>
                                #else <input type="hidden" value="0" id="poid"/> <input
                                        type="hidden" value="0" id="poItemId"/> #end
                                <div style="margin-bottom: 10px;">
                                    <label style="display: flex; align-items: center; cursor: pointer; font-weight: normal;">
                                        <input type="checkbox" id="sendInvoiceOnWhatsApp" checked
                                               style="margin-right: 8px; width: 18px; height: 18px;">
                                        Send Invoice on WhatsApp
                                    </label>
                                </div>
                                <button class="btn btn-block btn-primary order-checkout"
                                        type="submit">Create Order
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        #end
        </div>
    </form>
</section>
<div class="modal" id="mobilePlansModal" tabindex="-1"
     role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">Choose from plans</h4>
            </div>
            <div class="modal-body" style="overflow-y: auto;max-height: calc(100vh - 210px)">
                <div class="container-fluid itemdetails">
                    <div class="row">
                        <div class="col-lg-12">
                            <img src="/resources/images/ProtectPlusBanner.jpg"
                                 style="height:200px"/>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-4">
                            <div class="form-group">
                                <label for="usr">*Ram(GB):</label>
                                <input type="number" class="dgram form-control input-sm"
                                       name="ram" value="0">
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <label for="usr">*Memory(GB):</label>
                                <input type="number" class="dgmemory form-control input-sm"
                                       name="memory" value="0">
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <label for="usr">*Mfg Date:</label>
                                <input placeholder="Mfg Date" id="dgmfgdate" name="dgmfgdate"
                                       type="text" value="" class="form-control input-sm dgmfgdate">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12  insurancedetails">

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal" id="newaddressModal" tabindex="-1"
     role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">New Address</h4>
            </div>
            <div class="modal-body">
                <form id="newaddress">
                    <div class="row">
                        <div class="col-lg-4 form-group">
                            <input placeholder="First Name" id="firstName" name="firstName"
                                   type="text" value="" class="form-control input-sm">
                        </div>
                        <div class="col-lg-4 form-group">
                            <input placeholder="Last Name" id="lastName" name="lastName"
                                   type="text" value="" class="form-control input-sm">
                        </div>
                        <div class="col-lg-4 form-group">
                            <input placeholder="Mobile Number" id="alternatePhone"
                                   name="alternatePhone" type="text" value=""
                                   class="form-control input-sm">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-4 form-group">
                            <input placeholder="Address Line 1" id="line1" name="line1"
                                   type="text" size="50" value="" class="form-control input-sm">
                        </div>
                        <div class="col-lg-4 form-group">
                            <input placeholder="Address Line 2" id="line2" name="line2"
                                   type="text" value="" class="form-control input-sm">
                        </div>
                        <div class="col-lg-4 form-group">
                            <input placeholder="Landmark" id="landmark" name="landmark"
                                   type="text" value="" class="form-control input-sm">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 form-group">
                            <input placeholder="Pin Code" id="pinCode" name="pinCode"
                                   type="number" value="" class="form-control input-sm">
                        </div>
                        <div class="col-lg-3 form-group">
                            <input placeholder="City" id="city" name="city" type="text"
                                   value="" class="form-control input-sm">
                        </div>
                        <div class="col-lg-3 form-group">
                            <select class="form-control input-sm" id="state" name="state"
                                    placeholder="State">
                                <option value="" disabled selected>State</option>
                                #foreach($stateName in $stateNames) #if($retailerStateName ==
                                    $stateName)
                                    <option value="$stateName" selected>$stateName</option> #else
                                    <option value="$stateName">$stateName</option> #end #end

                            </select>
                        </div>
                    </div>
                    <div class="modal-footer" style="text-align: right;">
                        <button type="button" class="btn btn-primary btn-add-address">Add
                            Address
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- Upgrade offer Modal -->
<div id="upgradeOfferModal" class="modal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">

        </div>
    </div>
</div>

<!-- Pinelabs Offer Modal -->
<div id="pinelabsOfferModal" class="modal" role="dialog">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Pinelabs EMI Offers <small class="text-danger">All plans are showing on MOP basis</small></h4>
            </div>
            <div class="modal-body" id="pinelabsOfferModalBody" style="max-height:450px;overflow-y:auto;">
            </div>
        </div>
    </div>
</div>

## Pinelabs offer data rendered per item - grouped accordion by bank name
#if($pinelabsOfferMap && !$pinelabsOfferMap.isEmpty())
#foreach($entry in $pinelabsOfferMap.entrySet())
<div id="pinelabs-data-$entry.key" style="display:none;">
    <div class="panel-group" id="pinelabs-accordion-$entry.key">
        #foreach($issuerEntry in $entry.value.entrySet())
        <div class="panel panel-default">
            <div class="panel-heading" style="cursor:pointer;" data-toggle="collapse" data-parent="#pinelabs-accordion-$entry.key" data-target="#pinelabs-collapse-${entry.key}-${velocityCount}">
                <h4 class="panel-title">
                    <span class="glyphicon glyphicon-chevron-down" style="margin-right:8px;font-size:12px;"></span>
                    $!issuerEntry.key
                    <span class="badge" style="margin-left:8px;">$issuerEntry.value.size() offers</span>
                </h4>
            </div>
            <div id="pinelabs-collapse-${entry.key}-${velocityCount}" class="panel-collapse collapse#if($velocityCount == 1) in#end">
                <div class="panel-body" style="padding:0;">
                    <table class="table table-striped table-hover" style="margin-bottom:0;">
                        <thead>
                            <tr>
                                <th>Tenure</th>
                                <th>Monthly EMI</th>
                                <th>Interest Rate</th>
                                <th>EMI Type</th>
                            </tr>
                        </thead>
                        <tbody>
                        #foreach($tenure in $issuerEntry.value)
                            #if($tenure.getTenureValue() && $tenure.getTenureValue() > 0)
                            <tr>
                                <td>$!tenure.getTenureValue() months</td>
                                <td>#if($tenure.getMonthlyEmiAmount())$!tenure.getMonthlyEmiAmount().getValue() $!tenure.getMonthlyEmiAmount().getCurrency()#end</td>
                                <td>$!tenure.getInterestRatePercentage()%</td>
                                <td>$!tenure.getEmiType()</td>
                            </tr>
                            #end
                        #end
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        #end
    </div>
</div>
#end
#end

<script type="text/javascript">
    $(document).on('click', '.pinelabs-offer-submit', function() {
        var itemId = $(this).data('itemid');
        var content = $('#pinelabs-data-' + itemId).html();
        $('#pinelabsOfferModalBody').html(content || '<p>No offers available</p>');
    });
</script>