Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

<style>
    .imei-net-margin-container {
        font-size: 13px;
        padding: 12px;
    }

    .imei-net-margin-container .header-block {
        background: #e3f2fd;
        padding: 10px 12px;
        border-radius: 4px;
        margin-bottom: 12px;
    }

    .imei-net-margin-container .header-block .imei-label {
        font-weight: 600;
        color: #1565c0;
        font-size: 14px;
    }

    .imei-net-margin-container .header-block .sub-meta {
        font-size: 12px;
        color: #555;
        margin-top: 4px;
    }

    .imei-net-margin-container .model-row {
        background: #f8f9fa;
        padding: 8px 12px;
        border-radius: 4px;
        margin-bottom: 10px;
        font-size: 13px;
    }

    .imei-net-margin-container .model-row .model-name {
        font-weight: 600;
        color: #333;
    }

    .imei-net-margin-container .table {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .imei-net-margin-container .table th {
        background-color: #f5f5f5;
        font-size: 11px;
        padding: 6px 8px;
    }

    .imei-net-margin-container .table td {
        padding: 5px 8px;
    }

    .imei-net-margin-container .totals-strip {
        background: #f8f9fa;
        padding: 8px 12px;
        border-radius: 4px;
        margin-top: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
        font-size: 12px;
    }

    .imei-net-margin-container .totals-strip .cell label {
        color: #666;
        margin-right: 4px;
    }

    .imei-net-margin-container .net-margin {
        font-size: 15px;
        font-weight: 700;
        color: #28a745;
        text-align: right;
        margin-top: 10px;
        padding: 8px 12px;
        background: #e8f5e9;
        border-radius: 4px;
    }

    .imei-net-margin-container .error-msg {
        padding: 18px;
        text-align: center;
        color: #a94442;
        background: #f2dede;
        border-radius: 4px;
    }

    .imei-net-margin-container .price-block {
        background: #fff;
        border: 1px solid #e6e6e6;
        padding: 8px 12px;
        border-radius: 4px;
        margin-bottom: 10px;
        font-size: 12px;
    }

    .imei-net-margin-container .billing-date-note {
        background: #fff8e1;
        border-left: 3px solid #f0ad4e;
        padding: 6px 10px;
        border-radius: 3px;
        font-size: 11px;
        color: #6c5400;
        margin-bottom: 10px;
    }

    .imei-net-margin-container .billing-date-note .fa {
        margin-right: 4px;
    }

    .imei-net-margin-container .price-block label {
        color: #666;
        font-weight: 500;
        margin-right: 6px;
        margin-bottom: 0;
    }
</style>

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h4 class="modal-title">IMEI Scheme Margin</h4>
</div>

<div class="modal-body">
    <div class="imei-net-margin-container">
        #if($errorMessage)
            <div class="error-msg">$errorMessage</div>
        #else
            <div class="header-block">
                <div class="imei-label">IMEI: $imei</div>
                <div class="sub-meta">
                    Billed on: <b>$billedDate</b>
                    #if($invoiceNumber) &nbsp;|&nbsp; Invoice: <b>$invoiceNumber</b> #end
                </div>
            </div>

            <div class="model-row">
                <span class="model-name">$modelName</span>
            </div>

            <div class="billing-date-note">
                <i class="fa fa-info-circle"></i>
                Schemes are paid as applicable on the billing date
                (<b>$billedDate</b>).
            </div>

            <div class="price-block">
                <div><label>Purchase price (at GRN):</label> <b>&#8377; $purchasePrice</b></div>
                #if($hasPriceDrop)
                    <div>
                        <label>Price drop:</label>
                        <b style="color:#a94442;">- &#8377; $priceDropAmount</b>
                        #if(!$priceDropImeis.isEmpty())
                            <a role="button" class="toggle-price-drop-detail"
                               style="color:#1565c0;font-size:11px;margin-left:6px;cursor:pointer;">
                                view drops
                            </a>
                        #end
                    </div>
                    #if(!$priceDropImeis.isEmpty())
                    <div class="price-drop-detail" style="display:none;margin-top:6px;">
                        <table class="table table-condensed" style="font-size:11px;margin-bottom:4px;">
                            <thead>
                            <tr>
                                <th>Date</th>
                                <th>Description</th>
                                <th style="text-align:right;">Amount (&#8377;)</th>
                                <th>Status</th>
                            </tr>
                            </thead>
                            <tbody>
                                #foreach($pdi in $priceDropImeis)
                                <tr>
                                    <td>
                                        #if($pdi.getCreditTimestamp())
                                            $pdi.getCreditTimestamp().toLocalDate()
                                        #elseif($pdi.getUpdateTimestamp())
                                            $pdi.getUpdateTimestamp().toLocalDate()
                                        #end
                                    </td>
                                    <td>
                                        #if($pdi.getPriceDrop())
                                            $!pdi.getPriceDrop().getDescription()
                                        #end
                                    </td>
                                    <td style="text-align:right;">
                                        #if($pdi.getPriceDrop())
                                            $pdi.getPriceDrop().getAmount()
                                        #end
                                    </td>
                                    <td>$pdi.getStatus()</td>
                                </tr>
                                #end
                            </tbody>
                        </table>
                    </div>
                    #end
                #end
                <div><label>Effective DP (used for margin):</label> <b>&#8377; $dp</b></div>
            </div>

            #if($noSchemes)
                <div class="alert alert-warning" style="padding:8px;font-size:12px;">
                    No schemes were active on $billedDate for this item.
                </div>
            #else
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>Scheme</th>
                        <th>Type</th>
                        <th style="text-align:right;">Rate</th>
                        <th style="text-align:right;">Contribution (&#8377;)</th>
                    </tr>
                    </thead>
                    <tbody>
                        #foreach($ssm in $schemeSummaryModels)
                        <tr>
                            <td>$ssm.getSchemeName()
                                #if($ssm.getDescription())
                                    <br><small style="color:#666;">$ssm.getDescription()</small>
                                #end
                            </td>
                            <td>$ssm.getSchemeType()</td>
                            <td style="text-align:right;">$!rateMap.get($ssm.getSchemeId())</td>
                            <td style="text-align:right;">$!contributionMap.get($ssm.getSchemeId())</td>
                        </tr>
                        #end
                    </tbody>
                </table>

                <div class="totals-strip">
                    <div class="cell"><label>Fixed:</label><b>&#8377; $fixedSchemeAmount</b></div>
                    <div class="cell"><label>Percentage sum:</label><b>$percentageSchemeAmount%</b></div>
                    <div class="cell"><label>NLC:</label><b>&#8377; $nlc</b></div>
                </div>
            #end

            <div class="net-margin">
                Net Scheme Margin: &#8377; $netMargin
            </div>
        #end
    </div>
</div>

<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>