<!doctype html>
<html lang="en">
<head>
    <base href="/" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/docs/4.0/assets/img/favicons/favicon.ico">
    <title>SSIS Warehouse</title>
    <link href="../Styles/css/bootstrap.min.css" rel="stylesheet">
    <link href="../Styles/css/offcanvas.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../Styles/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../Styles/css/util.css">    
</head>
<body class="bg-light">
    <div ng-show="loadingState">
        <div class="loading" id="loader"></div>
    </div>    
    <div class="scrollup">
        <a href="#" scrollable ng-click="ScrollTo()">▲</a>
    </div>  
    <style>
        .scrollup {
            position: fixed;
            bottom: 0;
            right: 30px;
            cursor: pointer;
            display: none;
            height: 40px;
            width: 40px;
            text-align: center;
            font-size: 20pt;
            line-height: 40px;
        }     
    .loading {
        position: fixed;
        z-index: 9999;
        margin: 0 auto;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background-position: center;
        background-repeat: no-repeat;
        background-color: #fff;
        background-image: url(EBSAjsN/Styles/images/icons/Zetek_logo_loading-final2.gif);
    }
    body {
        font-family: 'Open Sans', sans-serif;
    }
    .bg-dark1 {
        background: #8330ea;
        background: -webkit-linear-gradient(to right, #2818ad, #8330ea);
        background: linear-gradient(to right, #2818ad, #8330ea);
    }
    .bg-tek2 {
        background: #f6f6f6;
        border-bottom: 1px solid #ddd;
    }
    .box2 {
        position: relative;
        border-radius: 3px;
        background: #fff;
        margin-bottom: 20px;
        width: 100%;
        box-shadow: 0 1px 3px 0 #d4d4d5,0 0 0 1px #d4d4d5;
        padding: 10px 20px 20px 20px;
        color: #989898;
        height: 108px;
    }
        .box2 .box_head {
            color: #212529;
            padding: 5px;
            font-size: 18px;
            font-weight: 400;
            text-transform: uppercase;
        }
        .box2 .box_cont {
            float: left;
            color: #455a64;
            font-size: 30px;
            font-weight: 600;
        }
    .colors {
        background-color: #2881db;
    }
    .col-green {
        color: green;
    }
    .col-red {
        color: red;
    }
    .col-ico {
        color: #455a64;
    }
    .bg-gradient-danger {
        background: linear-gradient(to right, #ffbf96, #fe7096);
    }
    .card.card-img-holder .card-img-absolute {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
    }
    .card-body h2 span {
        font-size: 12px;
    }
    .card-body h2 {
        color: #001737;
    }
    .card-body h5 {
        color: #2818ad;
    }
    .cad-head-col {
        color: #2818ad;
    }
    .card-body h6 span {
        font-size: 11px;
        font-weight: 600;
        color: #57585F;
    }
    .card-body hr {
        margin-bottom: 10px;
        margin-top: 5px;
    }
    .card-body .wtxt {
        font-weight: 700;
    }
    .progress {
        border-radius: 3px;
        height: 8px;
    }
    .style {
        color: red;
        color: yellow;
        color: green;
    }
    .fix_pos {
        top: 55px;
    }
</style>
        <nav class="navbar navbar-expand-md fixed-top navbar-dark bg-dark1 ">
            <a class="navbar-brand" href="#">ZetekCastings</a>
            <button class="navbar-toggler p-0 border-0" type="button" data-toggle="offcanvas"><!--<span class="navbar-toggler-icon"></span>--></button>
            <div class="dtd">
                <style>
                    @media (max-width: 575.98px) {
                        .dtd {
                            display: none;
                        }
                </style>
                <div class="day">{{currentdate | date:"hh"}}:{{currentdate | date:"mm"}}<span>{{currentdate | date:"a"}}</span></div>
                <div class="day2">
                    <div class="">{{currentdate | date:"EEEE"}}</div>
                    <div class="">{{currentdate | date:"mediumDate"}}</div>
                </div>
            </div>
            <style>
                @media (max-width: 575.98px) {
                    #navbarsExampleDefault {
                        display: none;
                    }
            </style>
            <a class="navbar ml-auto text-white " id="navbarsExampleDefault">{{username}}</a>
            <a class="nav-link text-white" href="#" ng-click="logout()"><i class="fas fa-sign-out-alt"></i></a>
        </nav>
    <div class="bg-tek2 fixed-top fix_pos box-shadow" id="name">
        <style>
            @media (max-width: 575.98px) {
                #name {
                    display: none;
                }
        </style>
        <nav class="container nav nav-underline">
            <a class="nav-link active" href="#">Dashboard</a>
            <a class="nav-link" href="#" ng-click="receipt()">Receipt <span class="badge badge-pill bg-light align-text-bottom">{{count.Receipt}}</span></a>
            <a class="nav-link" href="#" ng-click="issue()">Issue <span class="badge badge-pill bg-light align-text-bottom">{{count.Issue}}</span></a>
            <span class="nav-link ml-auto text-dark" href="#">SSIS Warehouse</span>
        </nav>
    </div>
        <style>
            .dtd {
                position: absolute;
                margin-left: 40%;
                color: #fff;
                font-family: "Humanst521 Lt BT";
                font-family: 'Quicksand', sans-serif;
                margin-top: 3px;
            }
            .time {
                float: left;
                font-size: 16px;
            }
                .time span {
                    font-size: 15px;
                }
            .day {
                float: left;
                padding-left: 15px;
                display: block;
                line-height: 30px;
                font-size: 30px;
            }
                .day span {
                    font-size: 16px;
                }
            .day2 {
                float: left;
                padding-left: 15px;
                font-size: 12px;
                line-height: 15px;
            }
            .hi {
                text-align: center;
            }
        </style>
        <main role="main" class="container">
            <section class="my-3">
                <style>
                    .head_hi {
                        margin-top: 75px;
                    }
                    @media (max-width:441px) {                    
                        .head_hi {
                            margin-top: 20px;
                        }
                    }
                </style>
                <div class="row head_hi" style="position:inherit;">
                    <div class="col-lg-3 col-md-6 stretch-card grid-margin mb-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="height:166px">
                                <h5 class="font-weight-normal mb-2">Transit<i class="fa fa-ship float-right col-ico"></i> </h5>
                                <h2 class="mb-3 font-weight-bold">{{Transit | INR}}<span class="badge badge-pill badge-warning float-right">{{TransitPercent}}%</span> </h2>
                                <h6 class="card-text" style="font-size: 14px; font-weight: 600;">${{TransitValue | number}} <!--<i class="fa fa-angle-double-up col-green" aria-hidden="true"></i>-->  <span class="float-right">Average days {{AverageTransitDays}}</span></h6>
                                <h6 class="card-text" style="font-size: 14px; font-weight: 600;" ng-hide="hide">₹{{INRTransit | INR}} <!--<i class="fa fa-angle-double-up col-green" aria-hidden="true"></i>--> <span class="float-right">{{dispatchOn}}</span></h6>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6 stretch-card grid-margin mb-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="height:166px">
                                <h5 class="font-weight-normal mb-2">Issued<i class="fa fa-truck float-right col-ico"></i> </h5>
                                <h2 class="mb-3 font-weight-bold">{{Issued | INR}}<span class="badge badge-pill badge-success float-right">{{IssuedPercent}}%</span> </h2>
                                <h6 class="card-text" style="font-size: 14px; font-weight: 600;">${{IssuedValue | number}} <!--<i class="fa fa-angle-double-down col-red" aria-hidden="true"></i>-->  <span class="float-right">Average days {{AverageIssuedDays}}</span></h6>
                                <h6 class="card-text" style="font-size: 14px; font-weight: 600;" ng-hide="hide">₹{{INRIssued | INR}} <!--<i class="fa fa-angle-double-down col-red" aria-hidden="true"></i>--> <span class="float-right">{{issuedOn}}</span></h6>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6 stretch-card grid-margin mb-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="height:166px">
                                <h5 class="font-weight-normal mb-2">Stock<i class="fa fa-cubes float-right col-ico"></i> </h5>
                                <h2 class="mb-3 font-weight-bold">{{Stock | INR}}<span class="badge badge-pill badge-danger float-right">{{StockPercent}}%</span> </h2>
                                <h6 class="card-text" style="font-size: 14px; font-weight: 600;">${{StockValue | number}} <!--<i class="fa fa-caret-square-o-up" aria-hidden="true"></i>-->  <span class="float-right"></span></h6>
                                <h6 class="card-text" style="font-size: 14px; font-weight: 600;" ng-hide="hide">₹{{INRStock | INR}} <!--<i class="fa fa-caret-square-o-up" aria-hidden="true"></i>--> <span class="float-right">{{stockOn}}</span></h6>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6 stretch-card grid-margin mb-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="height:166px;">
                                <h6 class="font-weight-normal mb-2 cad-head-col">Based on Value(USD)</h6>
                                <div class="d-flex justify-content-between mt-1">
                                    <small>Transit</small><small>{{TransitValuePercent}}%</small>
                                </div>
                                <div class="progress progress mt-1">
                                    <div class="progress-bar bg-warning" role="progressbar" style="width: {{widthTransit}}%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                                <div class="d-flex justify-content-between mt-1">
                                    <small>Issued</small><small>{{IssuedValuePercent}}%</small>
                                </div>
                                <div class="progress progress mt-1">
                                    <div class="progress-bar bg-success" role="progressbar" style="width: {{widthIssued}}%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                                <div class="d-flex justify-content-between mt-1">
                                    <small>Stock</small><small>{{StockValuePercent}}%</small>
                                </div>
                                <div class="progress progress mt-1">
                                    <div class="progress-bar bg-danger" role="progressbar" style="width: {{widthStock}}%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <section class="my-3">
                <div class="row">
                    <div class="col-lg-8 col-md-12 stretch-card grid-margin mt-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="">
                                <style>
                                    @media (max-width: 575.98px) {
                                        #col {
                                            display: none;
                                        }
                                </style>
                                <h6 class="font-weight-normal mt-2 cad-head-col">Stock At SSIS<i class="fas fa-cubes float-right col-ico"></i> </h6>
                                <hr>
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                            <tr class="small">
                                                <th class="border-0 pt-0 pl-0" style="text-align:center;">S.No</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Ageing</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Quantity</th>
                                                <th id="col" class="border-0 pt-0" id="col" style="text-align:center;">In USD</th>
                                                <th id="col" class="border-0 pt-0" id="col" style="text-align:center;" ng-hide="hide">In INR</th>
                                            </tr>
                                        </thead>
                                        <tbody class="small" ng-init="total1=0;total2=0;total3=0">
                                            <tr ng-repeat="dayValue in dd">
                                                <td class="pl-0" style="text-align:center;">{{$index + 1}}</td>
                                                <td>{{dayValue.AgeingDays}}</td>
                                                <td style="text-align:right;">{{dayValue.Qty | INR}}</td>
                                                <td id="col" style="text-align:right;">${{dayValue.DollarValue | number}}</td>
                                                <td id="col" style="text-align:right;" ng-hide="hide">₹{{dayValue.InrValue | INR}}</td>
                                                <td style="text-align:right;" ng-init="$parent.tot1=$parent.tot1+dayValue.Qty; $parent.tot2=$parent.tot2+dayValue.DollarValue; $parent.tot3=$parent.tot3+dayValue.InrValue"></td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td style="text-align:center"><b>Total</b></td>
                                                <td style="text-align:right;"><b>{{tot1 | INR}}</b></td>
                                                <td id="col" style="text-align:right;"><b>${{tot2 | number}}</b></td>
                                                <td id="col" style="text-align:right;" ng-hide="hide"><b>₹{{tot3 | INR}}</b></td>
                                                <td></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-12 stretch-card grid-margin mt-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <style>
                                @media (min-width: 992px) and (max-width: 1199.98px) {
                                    .ch-height {
                                        height: 353px;
                                    }
                                }
                                @media (min-width: 1200px) {
                                    .ch-height {
                                        height: 353px;
                                    }
                                }
                            </style>
                            <div class="card-body ch-height">
                                <h6 class="font-weight-normal mt-2 cad-head-col">Ageing<i class="fas fa-pie-chart float-right col-ico"></i> </h6>
                                <hr />
                                <div class="table-responsive">
                                    <table class="table">
                                        <tr>
                                            <canvas id="pie" class="chart chart-pie" chart-data="diskDataJson.data" chart-labels="diskDataJson.labels" width="200" chart-colours="diskDataJson.colours" chart-options="diskDataJson.options"></canvas>
                                        </tr>                                        
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <section class="my-3">
                <div class="row">
                    <div class="col-lg-5 col-md-12 stretch-card grid-margin mt-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="">
                                <h6 class="font-weight-normal mt-2 cad-head-col">Month Wise Issued Parts<i class="fas fa-calendar float-right col-ico"></i> </h6>
                                <hr>
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                            <tr class="small">
                                                <th class="border-0 pt-0 pl-0" style="text-align:center;">S.No</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Month Name</th>
                                                <th id="col" class="border-0 pt-0" id="col" style="text-align:center;">Issue Quantity</th>
                                                <th class="border-0 pt-0" style="text-align:center;" ng-hide="hide">Value</th>
                                            </tr>
                                        </thead>
                                        <tbody class="small" ng-init="sum1=0;sum2=0">
                                            <tr ng-repeat="month in months">
                                                <td class="pl-0" style="text-align:center;">{{month.Sno}}</td>
                                                <td style="text-align:center;">{{month.MonthName}}</td>
                                                <td id="col" style="text-align:right;">{{month.Qty | INR}}</td>
                                                <td style="text-align:right;" ng-hide="hide">₹{{month.Value | INR}}</td>
                                                <td ng-init="$parent.sum1 = $parent.sum1 + month.Qty;$parent.sum2 = $parent.sum2 + month.Value"></td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td style="text-align:center;"><b>Total</b></td>
                                                <td id="col" style="text-align:right;"><b>{{sum1 | INR}}</b></td>
                                                <td style="text-align:right;" ng-hide="hide"><b>₹{{sum2 | INR}}</b></td>
                                                <td></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-7 col-md-12 stretch-card grid-margin mt-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <style>
                                @media (min-width: 1200px) {
                                    .ch-width {
                                        height: 441px;
                                    }
                                }
                            </style>
                            <div class="card-body ch-width" style="">
                                <div class="table-responsive">
                                    <table class="table">
                                        <tr>
                                            <canvas id="base" class="chart-bar" chart-data="data" chart-labels="labels" width="281%" chart-colors="colors" chart-options="options" chart-dataset-override="datasetOverride" style="margin-top:12%"></canvas>
                                        </tr>                                       
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <section class="my-3">
                <div class="row">
                    <div class="col-lg-5 col-md-12 stretch-card grid-margin mt-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body" style="height:353px;">
                                <style>
                                    .wrap {                                      
                                        white-space: nowrap;                                      
                                    }                                        
                                </style>
                                <h6 class="font-weight-normal mt-2 cad-head-col">Most Issued Parts<i class="fas fa-cubes float-right col-ico"></i> </h6>
                                <hr>
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                            <tr class="small">
                                                <th class="border-0 pt-0 pl-0" style="text-align:center;">S.No</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Part Name</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Quantity</th>
                                            </tr>
                                        </thead>
                                        <tbody class="small">
                                            <tr ng-repeat="part in parts">
                                                <td class="pl-0" style="text-align:center;">{{part.Sno}}</td>
                                                <td class="wrap">{{part.Partname}}</td>
                                                <td style="text-align:right;">{{part.Qty | INR}}</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-7 col-md-12 stretch-card grid-margin mt-2">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body">
                                <h6 class="font-weight-normal mt-2 cad-head-col">Recent Issues to Customer<i class="fas fa-truck float-right col-ico"></i> </h6>
                                <hr>
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                            <tr class="small">
                                                <th class="border-0 pt-0 pl-0" style="text-align:center;">S.No</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Packing List No</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Part Name</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Issued Date</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Quantity</th>
                                            </tr>
                                        </thead>
                                        <tbody class="small">
                                            <tr ng-repeat="issue in issues">
                                                <td class="pl-0" style="text-align:center;">{{$index + 1}}</td>
                                                <td style="text-align:center;">{{issue.PackingListno}}</td>
                                                <td id="col">{{issue.Partname}}</td>
                                                <td id="col" style="text-align:center;">{{issue.Issueddate}}</td>
                                                <td style="text-align:right;">{{issue.Qty | number}}</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12 col-md-12 stretch-card grid-margin mt-4">
                        <div class="card bg-gradient-danger1 card-img-holder text-gray">
                            <div class="card-body">
                                <h6 class="font-weight-normal mt-2 cad-head-col">Invoice Wise Status<i class="fas fa-archive float-right col-ico"></i> </h6>
                                <hr>
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                            <tr class="small">
                                                <th class="border-0 pt-0 pl-0" style="text-align:center;">S.No</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Invoice No</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Invoice Date</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Invoice Quantity</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Issue Quantity</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Stock Quantity</th>
                                                <th class="border-0 pt-0" id="col" style="text-align:center;">Stock Percent</th>
                                                <th class="border-0 pt-0" style="text-align:center;">Issued Percent</th>
                                            </tr>
                                        </thead>
                                        <tbody class="small" ng-init="total1=0;total2=0;total3=0">
                                            <tr ng-repeat="sum in summary">
                                                <td class="pl-0" style="text-align:center;">{{sum.Sno}}</td>
                                                <td style="text-align:center;">{{sum.Invoiceno}}</td>
                                                <td id="col" style="text-align:center;">{{sum.InvoiceDate}}</td>
                                                <td id="col" style="text-align:right;">{{sum.InvoiceQty | number}}</td>
                                                <td id="col" style="text-align:right;">{{sum.IssueQty | number}}</td>
                                                <td id="col" style="text-align:right;">{{sum.StockQty | number}}</td>
                                                <td id="col" style="text-align:right;">{{sum.StockPercent}}%</td>
                                                <td style="text-align:right;">
                                                    {{sum.IssuedStockPercent}}%
                                                    <div class="progress mt-1" style="height:3px; width:{{sum.IssuedStockPercent}}%;" ng-style="(sum.IssuedStockPercent>=0 && sum.IssuedStockPercent <=50.99) && {'background-color':'red'} ||
                                                                                    (sum.IssuedStockPercent>=51 && sum.IssuedStockPercent <=90.99) && {'background-color':'orange'} ||
                                                                                    (sum.IssuedStockPercent>=91) && {'background-color':'green'}">
                                                        <div class="progress-bar bg-white" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
                                                    </div>
                                                </td>
                                                <td ng-init="$parent.total2 = $parent.total2 + sum.IssueQty;$parent.total3 = $parent.total3 + sum.StockQty;$parent.total1 = $parent.total1 + sum.IssueQty + sum.StockQty"></td>
                                            </tr>
                                            <tr>
                                                <td id ="col"></tdid>
                                                <td id="col"></td>
                                                <td id="col" style="text-align:center;"><b>Total</b></td>
                                                <td id="col" style="text-align:right;"><b>{{total1 | INR}}</b></td>
                                                <td id="col" style="text-align:right;"><b>{{total2 | INR}}</b></td>
                                                <td id="col" style="text-align:right;"><b>{{total3 | INR}}</b></td>
                                                <td id="col"></td>
                                                <td id="col"></td>
                                                <td id="col"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </main>   
</body>
</html>
 
var user = JSON.parse($sessionStorage.SessionMessage.replace('[', '').replace(']', ''));    
user.username = user.username.substring(0, 1).toUpperCase() + user.username.substring(1, user.username.length);    
if (user.username.length > 6) {        
    user.username = user.username.substring(0, 1).toUpperCase() + user.username.substring(1, user.username.length - 1);    
}    
$scope.username = user.username;    
$scope.empid = user.empid;
$scope.currency = null;
    $scope.hide = false;
    $http.get(apiUrl + "/api/Warehouse/GetCurrency?EmpId=" + $scope.empid + "")
    .then(function (response) {
        $scope.currency = JSON.parse(response.data);
        $scope.currencyId = $scope.currency[0].CurrencyId;
        $scope.empId = $scope.currency[0].EmpId;
        if ($scope.currencyId == 2 && $scope.currencyId !== 1) {
            $scope.hide = true;
        }
    })