webpackJsonp([16],{

/***/ 1523:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRTransactionLogModule", function() { return TRTransactionLogModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_components_module__ = __webpack_require__(114);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist_pagination_ngx_pagination_module__ = __webpack_require__(91);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__trtransaction_log__ = __webpack_require__(1871);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_angular2_multiselect_dropdown_angular2_multiselect_dropdown__ = __webpack_require__(366);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/**
 * Created by dilshan on 6/11/18.
 */







var TRTransactionLogModule = /** @class */ (function () {
    function TRTransactionLogModule() {
    }
    TRTransactionLogModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [__WEBPACK_IMPORTED_MODULE_5__trtransaction_log__["a" /* TRTransactionLog */]],
            imports: [
                __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_2__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist_pagination_ngx_pagination_module__["a" /* NgxPaginationModule */],
                __WEBPACK_IMPORTED_MODULE_6_angular2_multiselect_dropdown_angular2_multiselect_dropdown__["a" /* AngularMultiSelectModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_5__trtransaction_log__["a" /* TRTransactionLog */]),
            ]
        })
    ], TRTransactionLogModule);
    return TRTransactionLogModule;
}());

//# sourceMappingURL=trtransaction.log.module.js.map

/***/ }),

/***/ 1871:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TRTransactionLog; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ngx_logger__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_app_events__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__providers_app_cache_service__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__providers_app_runtime_provider__ = __webpack_require__(57);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__providers_tracking_context__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__trtransactionlog_view_template__ = __webpack_require__(1872);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_TRUtils__ = __webpack_require__(225);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__providers_tr_log_service__ = __webpack_require__(74);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
/**
 * Created by dilshan on 6/11/18.
 */












var TRTransactionLog = /** @class */ (function () {
    function TRTransactionLog(logger, evntActLog, businessCtx, navParam, appCtx, appState, appCachePro, sharedSrv, tContext) {
        this.logger = logger;
        this.evntActLog = evntActLog;
        this.businessCtx = businessCtx;
        this.navParam = navParam;
        this.appCtx = appCtx;
        this.appState = appState;
        this.appCachePro = appCachePro;
        this.sharedSrv = sharedSrv;
        this.tContext = tContext;
        this.DATATYPE = 'activityLog';
        this.activityLogs = [];
        this.table_header = [];
        this.unwnat = [];
        this.others = [];
        this.p = 1;
        this.bctxLine1 = [0, 1, 2, 3, 4];
        this.bctxLine2 = [5, 6, 7, 8];
        this.dropdownSettings = {
            text: 'Event Type',
            enableSearchFilter: true,
            // singleSelection: true,
            selectAllText: 'Select All',
            classes: 'myclass custom-class',
            badgeShowLimit: 1,
        };
        this.dropdownList = [{ 'id': 0, 'itemName': 'add' }, { 'id': 1, 'itemName': 'undo' }];
        this.values = [];
        this.allData = [];
        this.indx = null;
        this.pageConf = this.navParam.get('conf');
        if (this.pageConf) {
            this.table_header = this.pageConf['table_header'];
            this.unwnat = this.pageConf['hide_data'];
            this.paramOne = this.pageConf['main_param'][0];
            this.paramTwo = this.pageConf['main_param'][1];
            if (this.pageConf['activity_name'] === 'station_act') {
                this.station_act = true;
            }
            else if (this.pageConf['activity_name'] === 'line_act') {
                this.line_act = true;
            }
            else if (this.pageConf['activity_name'] === 'summary_act') {
                this.summary_act = true;
            }
        }
        var subj = this.appCtx.getCurrentSubject();
        this.subject = subj.id;
        this.initEventListener();
    }
    TRTransactionLog.prototype.initEventListener = function () {
        var _this = this;
        this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_app_events__["b" /* APPEvents */].APP_SUBJECT_CHANGE, function (res) {
            _this.logger.trace('subject change header', res);
            var subj = res;
            _this.subject = subj.id;
        });
    };
    TRTransactionLog.prototype.setFilterers = function () {
        var _this = this;
        this.activityLogs = [];
        this.allData.forEach(function (at) {
            if (_this.values.length > 0) {
                _this.values.forEach(function (v) {
                    var valu = v['itemName'];
                    if (valu && at['actionType'] === valu) {
                        _this.activityLogs.push(at);
                    }
                });
            }
            else {
                _this.activityLogs = __WEBPACK_IMPORTED_MODULE_10__util_TRUtils__["a" /* MUtils */].getDeepCopy(_this.allData);
            }
        });
    };
    TRTransactionLog.prototype.ionViewWillEnter = function () {
        var cntxtCrnt = this.businessCtx.getCurrentContext();
        this.setCntxtShown(cntxtCrnt.ctx);
        this._getCurrentActivities();
    };
    TRTransactionLog.prototype._getCurrentActivities = function () {
        var _this = this;
        this.activityLogs = [];
        var subject = this.appCtx.getCurrentSubject().id;
        var shift = this.appCtx.getCurrentShift().id;
        var cutKey = shift + '_' + subject;
        var ctxId = this.tContext.getId();
        var tempActLog = [];
        var distinct = [];
        var distinctCounter = 0;
        tempActLog = this.evntActLog.getActivityLog('t');
        var bool = false;
        tempActLog.forEach(function (dt) {
            if (JSON.stringify(dt) !== '{}') {
                bool = true;
                _this.activityLogs.push(dt);
                _this.allData.push(dt);
                var actionType_1 = dt && dt['actionType'] ? dt['actionType'] : '';
                var index = distinct.findIndex(function (v) { return v['itemName'] === actionType_1; });
                if (index === -1 && actionType_1 !== '') {
                    distinct.push({ 'id': distinctCounter, itemName: actionType_1 });
                    distinctCounter++;
                }
                //  this.activityLogs.push( {eventType: 'test'});
            }
        });
        this.dropdownList = distinct;
        if (bool) {
            this.activityLogs.sort(function (a, b) {
                return b.datetime - a.datetime;
            });
        }
        else {
            this.activityLogs = [];
        }
    };
    /*
     set cntxt showing details
     */
    TRTransactionLog.prototype.setCntxtShown = function (cntxt) {
        var _this = this;
        try {
            if (cntxt) {
                cntxt.forEach(function (data, index) {
                    if (data.d.toLowerCase() === _this.paramOne.toLowerCase()) {
                        _this.pr1 = index;
                    }
                    else if (data.d.toLowerCase() === _this.paramTwo.toLowerCase()) {
                        _this.pr2 = index;
                    }
                    else if (_this.unwnat.indexOf(data.d.toLowerCase()) < 0) {
                        _this.others.push(index);
                    }
                });
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
     toggle bsns cntxt
     */
    TRTransactionLog.prototype.toggle = function (index) {
        if (index !== this.indx) {
            this.indx = index;
        }
        else {
            this.indx = null;
        }
    };
    /*
     undo for activity log
     */
    TRTransactionLog.prototype.undoclick = function () {
        this._getCurrentActivities();
    };
    TRTransactionLog = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'transaction-log-view',
            template: __WEBPACK_IMPORTED_MODULE_9__trtransactionlog_view_template__["a" /* TRANSACTION_LOG_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_11__providers_tr_log_service__["a" /* TRLogService */],
            __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */], __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__["d" /* ApplicationContext */],
            __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__["e" /* ApplicationService */], __WEBPACK_IMPORTED_MODULE_6__providers_app_cache_service__["a" /* TRAAppCacheService */],
            __WEBPACK_IMPORTED_MODULE_7__providers_app_runtime_provider__["a" /* TRAppRuntimeProvider */],
            __WEBPACK_IMPORTED_MODULE_8__providers_tracking_context__["a" /* TrackingContext */]])
    ], TRTransactionLog);
    return TRTransactionLog;
}());

//# sourceMappingURL=trtransaction.log.js.map

/***/ }),

/***/ 1872:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TRANSACTION_LOG_HTML; });
/**
 * Created by dilshan on 6/11/18.
 */
var TRANSACTION_LOG_HTML = "\n<ion-header >\n <common-main-header [title]=\"pageConf?.title\" [header_disabled]=\"pageConf?.subject_disable\"\n  [shift_disabled]=\"pageConf?.shift_disabled\"></common-main-header>\n</ion-header>\n<ion-content>\n  <ion-grid *ngIf=\"summary_act\" class=\"aql-pge-hdr\">\n        <ion-row *ngIf=\"activityLogs.length>0\">\n         <angular2-multiselect [data]=\"dropdownList\"\n                    [(ngModel)]=\"values\"\n                                                  [settings]=\"dropdownSettings\"\n                                                  (onSelect)=\"setFilterers()\"\n                                                  (onDeSelect)=\"setFilterers()\"\n                                                   (onSelectAll)=\"setFilterers()\"\n                                                   (onDeSelectAll)=\"setFilterers()\">\n                            </angular2-multiselect>\n    </ion-row>\n  </ion-grid>\n  <ion-grid *ngIf=\"summary_act\" class=\"aql-act-log\">\n    <ion-row class=\"hdr-row\">\n     <ion-col col-6 col-md-2>Date/Time</ion-col>\n     <ion-col col-6 col-md-2>Description</ion-col>\n     <ion-col>Type</ion-col>\n     <ion-col>Details</ion-col>\n     <ion-col col-5 >Event details</ion-col>\n    </ion-row>\n  <ion-grid *ngIf=\"activityLogs.length>0\" no-padding>\n  <ion-grid *ngFor=\"let activity of activityLogs | paginate: { itemsPerPage: 10, currentPage: p };let j = index \" no-padding>\n  <ion-row class=\"dom-content\">\n     <ion-col col-6 col-md-2 class=\"date-time-col bdr-btm\">\n     <div class=\"dt\"><ion-icon name=\"calendar\"></ion-icon> {{activity.datetime | date: 'dd-MM-yyyy'}}</div>\n        <div class=\"tim\"><ion-icon name=\"time\"></ion-icon> {{activity.datetime |  date: 'H:mm a'}}</div>\n     </ion-col>\n     <ion-col col-6 col-md-2 class=\"bdr-btm\">{{activity.description}}</ion-col>\n     <ion-col class=\"method bdr-btm\">{{activity.actionType}}</ion-col>\n     <ion-col class=\"bdr-btm\"> <div>QTY - <span class=\"qtyires-vlue\"><b>{{activity.qty}}</b></span></div> <!--<div>Received - <span class=\"qtyires-vlue\">\n     <b>{{activity.infoData.received_qty}}</b></span></div>--> </ion-col>\n     <ion-col col-12 col-md-5 class=\"bis-info-grid\">\n        <ion-grid no-padding>\n            <ion-row *ngIf=\"activity.bsnsCntxt\">\n                <ion-col>{{activity.bsnsCntxt[bctxLine1[0]][\"v\"]}}</ion-col>\n                <ion-col col-5 >{{activity.bsnsCntxt[bctxLine1[1]][\"v\"]}}</ion-col>\n                <ion-col>{{activity.bsnsCntxt[bctxLine1[2]][\"v\"]}}</ion-col>\n                <ion-col>{{activity.bsnsCntxt[bctxLine1[3]][\"v\"]}}</ion-col>\n                <ion-col>{{activity.bsnsCntxt[bctxLine1[4]][\"v\"]}}</ion-col>\n            </ion-row>\n            <ion-row *ngIf=\"activity.bsnsCntxt\">\n                <ion-col col-5><div class=\"grap-no\">{{activity.bsnsCntxt[bctxLine2[0]][\"v\"]}}</div></ion-col>\n                <ion-col><div class=\"cut-no\">{{activity.bsnsCntxt[bctxLine2[1]][\"v\"]}}</div></ion-col>\n                <ion-col><div class=\"bund-no\">{{activity.bsnsCntxt[bctxLine2[2]][\"v\"]}}</div></ion-col>\n                <ion-col>{{activity.bsnsCntxt[bctxLine2[3]][\"v\"]}}</ion-col>\n            </ion-row>\n        </ion-grid>\n     </ion-col>\n   </ion-row>\n  </ion-grid>\n  </ion-grid>\n  </ion-grid>\n</ion-content>\n<ion-footer>\n <pagination-controls (pageChange)=\"p = $event\"></pagination-controls>\n</ion-footer>\n";
//# sourceMappingURL=trtransactionlog-view-template.js.map

/***/ })

});
//# sourceMappingURL=16.js.map