webpackJsonp([20],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransactionlogPageModule", function() { return TransactionlogPageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__transactionlog__ = __webpack_require__(1860);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_components_module__ = __webpack_require__(991);
/* 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_pagination_ngx_pagination_module__ = __webpack_require__(89);
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 TransactionlogPageModule = /** @class */ (function () {
    function TransactionlogPageModule() {
    }
    TransactionlogPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__transactionlog__["a" /* TransactionlogPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_3__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_pagination_ngx_pagination_module__["a" /* NgxPaginationModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__transactionlog__["a" /* TransactionlogPage */]),
            ],
        })
    ], TransactionlogPageModule);
    return TransactionlogPageModule;
}());

//# sourceMappingURL=transactionlog.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TransactionlogPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__transactionlog_template__ = __webpack_require__(1861);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_transactionlog_transaction_log__ = __webpack_require__(221);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__providers_shared_data_service_shared_data_service__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__providers_key_generator_key_generator__ = __webpack_require__(222);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__providers_application_cache_service_app_cache_service__ = __webpack_require__(148);
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);
};









/**
 * Generated class for the TransactionlogPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */
var TransactionlogPage = /** @class */ (function () {
    function TransactionlogPage(navParams, logger, _trLogSrv, _shrdDataSrv, businessCtx, alertCtrl, _keyGen, _appCache) {
        this.navParams = navParams;
        this.logger = logger;
        this._trLogSrv = _trLogSrv;
        this._shrdDataSrv = _shrdDataSrv;
        this.businessCtx = businessCtx;
        this.alertCtrl = alertCtrl;
        this._keyGen = _keyGen;
        this._appCache = _appCache;
        this.TRLOG = 'TRNSCOMP ';
        this.tr_log = [];
        this.table_header = [];
        this.unwnat = [];
        this.others = [];
        this.p = 1;
        this.page_view_conf = this.navParams.get('conf');
        if (this.page_view_conf) {
            this.btn_conf = this.page_view_conf['btn_conf'];
            this.table_header = this.page_view_conf['table_header'];
            this.paramOne = this.page_view_conf['main_param'][0];
            this.paramTwo = this.page_view_conf['main_param'][1];
        }
        this.tools = this.tools = {
            line: false,
            menu: false,
            shift: false,
            user: false,
        };
        this.eventListner();
    }
    TransactionlogPage.prototype.ionViewDidLoad = function () {
    };
    TransactionlogPage.prototype.ionViewWillEnter = function () {
        this.initCall();
        var cntxtCrnt = this.businessCtx.getCurrentContext();
        this.setCntxtShown(cntxtCrnt.ctx);
    };
    /*
    init method for transaction log loading
     */
    TransactionlogPage.prototype.initCall = function () {
        this.tr_log = this._trLogSrv.localTransactionLog();
        if (this.tr_log.length > 0) {
            this.sortingTrLog();
        }
        this.logger.trace(this.TRLOG, 'transaction log size', this.tr_log.length);
        this.logger.trace(this.TRLOG, 'transaction log', this.tr_log);
    };
    /*
    event listner methods
     */
    TransactionlogPage.prototype.eventListner = function () {
        var _this = this;
        if (!this.tr_subscriber) {
            this.tr_subscriber = this._trLogSrv.LogUpdate.subscribe(function (res) {
                if (res) {
                    _this.sortingTrLog();
                }
            });
        }
        if (!this.tr_init_subscribe) {
            this.tr_init_subscribe = this._trLogSrv.InitLog.subscribe(function (res) {
                if (res) {
                    _this.initCall();
                }
            });
        }
    };
    /*
    delete log from transaction log
     */
    TransactionlogPage.prototype.deleteLog = function (indx, page, size) {
        var _this = this;
        var ind = (page - 1) * size + indx;
        var alert = this.alertCtrl.create({
            title: 'Are you sure...',
            subTitle: 'Fail amount',
            buttons: [
                {
                    text: 'Cancel'
                },
                {
                    text: 'Ok',
                    handler: function (data) {
                        if (parseInt(data.value) > 0) {
                            _this.deleteSelectItem(ind, data, _this.tr_log[ind]);
                        }
                    }
                }
            ],
            inputs: [
                {
                    name: 'value',
                    type: 'number',
                    value: '1'
                },
            ],
            enableBackdropDismiss: false
        });
        alert.present();
        // this.tr_log[ind].delete_btn_availability = false;
        // this._shrdDataSrv.updateSharedDataService(this.btn_conf, - this.tr_log[ind].value, this.tr_log[ind]);
    };
    /*
     set cntxt showing details
     */
    TransactionlogPage.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);
        }
    };
    /*
    sort log by datetime
     */
    TransactionlogPage.prototype.sortingTrLog = function () {
        this.tr_log.sort(function (a, b) {
            return b.id - a.id;
        });
    };
    /*
    fail select amount items
     */
    TransactionlogPage.prototype.deleteSelectItem = function (ind, data, model) {
        if (this.tr_log[ind].value >= parseInt(data.value)) {
            this.tr_log[ind].delete_btn_availability = false;
            this._appCache.updateSpecialScen(this.btn_conf, -parseInt(data.value), this.tr_log[ind]);
        }
    };
    /*
    unsubcribe event listners
     */
    TransactionlogPage.prototype.ngOnDestroy = function () {
        this.tr_subscriber.unsubscribe();
        this.tr_init_subscribe.unsubscribe();
    };
    TransactionlogPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-transactionlog',
            template: __WEBPACK_IMPORTED_MODULE_3__transactionlog_template__["a" /* TRANSACTION_LOG_HTML */],
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */],
            __WEBPACK_IMPORTED_MODULE_4__providers_transactionlog_transaction_log__["a" /* TransactionLogSrv */],
            __WEBPACK_IMPORTED_MODULE_5__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */],
            __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_7__providers_key_generator_key_generator__["a" /* KeyGenerator */],
            __WEBPACK_IMPORTED_MODULE_8__providers_application_cache_service_app_cache_service__["a" /* AppCacheService */]])
    ], TransactionlogPage);
    return TransactionlogPage;
}());

//# sourceMappingURL=transactionlog.js.map

/***/ }),

/***/ 1861:
/***/ (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 11/6/18.
 */
var TRANSACTION_LOG_HTML = "\n<ion-header >\n<common-main-header [title]=\"page_view_conf?.title\" [tools]=\"tools\"></common-main-header>\n </ion-header>\n<ion-content>\n  <ion-grid class=\"content-wrapper\">\n  <ion-row class=\"tbl-data-hdr\">\n <ion-col col-1 no-padding >{{table_header[0]}}</ion-col>\n <ion-col col-4 no-padding >{{table_header[1]}}</ion-col>\n <ion-col col-2 no-padding >{{table_header[2]}}</ion-col>\n <ion-col col-1 no-padding *ngFor=\"let topic of table_header[3]\">{{topic}}</ion-col>\n         </ion-row>\n  <ion-row class=\"tbl-data-row\" *ngFor=\"let log of tr_log | paginate: { itemsPerPage: 10, currentPage: p };let i = index\">\n <ion-col col-1 class=\"dtatim\"><ion-row>{{log.date}}</ion-row>\n            <ion-row>{{log.id |  date: 'H:mm'}}</ion-row></ion-col>\n<ion-col col-4>\n              <ion-row class=\"inlin-dta\" no-padding style=\"border-bottom: none;\">\n                <ion-col *ngIf=\"log.bsns_cntxt.length>0 && log.bsns_cntxt[pr1]\"\n                 class=\"sty-dta\">{{log.bsns_cntxt[pr1].v}}</ion-col>\n                <ion-col *ngIf=\"log.bsns_cntxt.length>0 && log.bsns_cntxt[pr2]\"\n                 class=\"po-dta\">{{log.bsns_cntxt[pr2].v}}</ion-col>\n              </ion-row>\n              <ion-row *ngIf=\"log.bsns_cntxt.length>0\" class=\"inlin-dta\" no-padding >\n                <ion-col *ngFor=\"let ind of others\">{{log.bsns_cntxt[ind].v}}</ion-col>\n              </ion-row>\n      </ion-col>\n <ion-col class=\"cl-hdr-topic-pddn\" col-2 no-padding>{{log.recent_grade}}</ion-col>\n <ion-col class=\"cl-hdr-topic-pddn\" col-1 no-padding>{{log.value}}</ion-col>\n <ion-col class=\"cl-hdr-topic-pddn\" col-1 no-padding>{{log.status}}</ion-col>\n <ion-col class=\"cl-hdr-topic-pddn\" col-2 no-padding>{{log.action}}</ion-col>\n <ion-col class=\"delete-btn\" col-1 no-padding><button ion-button [disabled]=\"!log.delete_btn_availability\" (click)=\"deleteLog(i, p, 10)\">\n <ion-icon name=\"trash\"></ion-icon></button></ion-col>\n</ion-row>\n  </ion-grid>\n</ion-content>\n<ion-footer>\n <pagination-controls (pageChange)=\"p = $event\"></pagination-controls>\n</ion-footer>\n";
//# sourceMappingURL=transactionlog-template.js.map

/***/ })

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