webpackJsonp([4],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AqlPkgDetailPageModule", function() { return AqlPkgDetailPageModule; });
/* 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__aql_pkg_detail__ = __webpack_require__(1835);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_components_module__ = __webpack_require__(991);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ngx_translate_core__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pipes__ = __webpack_require__(1838);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_common_module_nspcommon_module__ = __webpack_require__(383);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_common_module_components_ccomponent_module__ = __webpack_require__(217);
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 AqlPkgDetailPageModule = /** @class */ (function () {
    function AqlPkgDetailPageModule() {
    }
    AqlPkgDetailPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__aql_pkg_detail__["a" /* AqlPkgDetailPage */],
                __WEBPACK_IMPORTED_MODULE_6__pipes__["a" /* PassTotalPipe */]
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_3__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_common_module_nspcommon_module__["a" /* NSPCommonModule */],
                __WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_common_module_components_ccomponent_module__["a" /* CComponentModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__aql_pkg_detail__["a" /* AqlPkgDetailPage */]),
                __WEBPACK_IMPORTED_MODULE_4__ngx_translate_core__["b" /* TranslateModule */].forChild()
            ],
        })
    ], AqlPkgDetailPageModule);
    return AqlPkgDetailPageModule;
}());

//# sourceMappingURL=aql-pkg-detail.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AqlPkgDetailPage; });
/* 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__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_aql_data_provider__ = __webpack_require__(368);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__aql_pkg_detail_template__ = __webpack_require__(1836);
/* 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__aql_events_aql_event__ = __webpack_require__(1837);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__providers_masterdata_service_masterdata_service__ = __webpack_require__(207);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__models_btnModel__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__providers_shared_data_service_shared_data_service__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__ = __webpack_require__(382);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__providers_bucket_combinations_bucketCombination__ = __webpack_require__(1022);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__providers_application_cache_service_app_cache_service__ = __webpack_require__(148);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__providers_activity_log_activity_log__ = __webpack_require__(149);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__ncinga_sp_nsp_app_core_dist_providers_app_events__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__ncinga_sp_nsp_common_module_providers_context_service__ = __webpack_require__(155);
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);
};


















var AqlPkgDetailPage = /** @class */ (function () {
    function AqlPkgDetailPage(logger, navigationProvider, navParams, aqlDataProvider, businessContext, applicationContext, appState, toastCtrl, alertCtrl, appMasDa, modalCtrl, sharedDataService, bcktComb, appCache, loadingCtrl, actvtLogSrv, actCtx) {
        this.logger = logger;
        this.navigationProvider = navigationProvider;
        this.navParams = navParams;
        this.aqlDataProvider = aqlDataProvider;
        this.businessContext = businessContext;
        this.applicationContext = applicationContext;
        this.appState = appState;
        this.toastCtrl = toastCtrl;
        this.alertCtrl = alertCtrl;
        this.appMasDa = appMasDa;
        this.modalCtrl = modalCtrl;
        this.sharedDataService = sharedDataService;
        this.bcktComb = bcktComb;
        this.appCache = appCache;
        this.loadingCtrl = loadingCtrl;
        this.actvtLogSrv = actvtLogSrv;
        this.actCtx = actCtx;
        this.nextPage = '';
        this.pkg_details_list = new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */]({});
        this.new_pkg_detail = {};
        this.fieldArray = [];
        this.newAttribute = {};
        this.final_pkg_detail = {};
        this.btn_disabled = true;
        this.footer_topic_left = 'Lot Pass';
        this.footer_topic_right = 'Pass Garment';
        this.perc_topic = 'Lot Pass %';
        this.ratio_validation = false;
        this.addrow_cell_data = [];
        this.bctx_data = '';
        this.tools = {
            line: true,
            menu: true,
            shift: true,
            user: true
        };
        this.row_item_description = [];
        this.pkg_grid_data = {};
        this.current_bussness_context = {};
        this.current_bussiness_key = '';
        this.plan_ctx = false;
        this.wip_ctx = false;
        this.scanner_ctx = false;
        // this.pageMnLoading();
        this.upper_total = 0;
        this.lower_total = 0;
        this.upper_pcs = 0;
        this.lower_pcs = 0;
        this.tot_perc = parseFloat('0') + ' %';
        this.eventListners();
        this.bctx_data = 'Red/M/Envc';
    }
    AqlPkgDetailPage.prototype.ngOnInit = function () {
        this.pageMnLoading();
        if (this.currentPageConfig) {
            this.appMasDa.setMsDtList(this.currentPageConfig.masterDataList);
        }
        if (this.applicationContext.getBctxLoading()) {
            var bctx_loading = this.applicationContext.getBctxLoading();
            if (bctx_loading['wip']) {
                this.wip_ctx = bctx_loading['wip'];
            }
            else if (bctx_loading['scanner']) {
                this.scanner_ctx = bctx_loading['scanner'];
            }
            else {
                this.plan_ctx = true;
            }
        }
        else {
            this.plan_ctx = true;
        }
    };
    AqlPkgDetailPage.prototype.ionViewDidLoad = function () {
        this.pageLoading();
        this.checkAvaliability();
        this.countQty();
        this.mainBtnDisabled();
        this.logger.trace('ionViewDidLoad...........', this.currentPageConfig.view_data);
    };
    AqlPkgDetailPage.prototype.ionViewDidEnter = function () {
        this.countQty();
        this.logger.trace('ionViewDidEnter...........', this.currentPageConfig.view_data);
        this.row_item_description = this.bcktComb.combinedData(this.left_side.data_type, this.currentPageConfig.view_data);
        var _self = this;
        this.right_side['bucket'] = false;
        setTimeout(function () {
            if (!_self.applicationContext.getCurrentShift().id) {
                _self.appState.notifyDataChanged(__WEBPACK_IMPORTED_MODULE_16__ncinga_sp_nsp_app_core_dist_providers_app_events__["b" /* APPEvents */].SET_RUNING_SHIFT, Math.random());
            }
            _self.countQty();
            _self.pkg_details_list = new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](_self.sharedDataService.getDataSharedDataService(_self.right_side.id));
            if (_self.pkg_details_list.items.length === 0) {
                // _self.addRow();
            }
        }, 1000);
    };
    /*
    event listners
     */
    AqlPkgDetailPage.prototype.eventListners = function () {
        var _this = this;
        this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_16__ncinga_sp_nsp_app_core_dist_providers_app_events__["b" /* APPEvents */].APP_SUBJECT_CHANGE_IN_CACHE, function (res) {
            if (res) {
                _this.logger.debug('Event: change  cache subject :');
                _this.appMasDa.setCurrentDataSet();
            }
        });
        if (!this.subcripApp) {
            this.subcripApp = this.sharedDataService.appdata.subscribe(function (res) {
                if (res) {
                    _this.logger.trace('change Line......');
                    _this.checkAvaliability();
                }
            });
        }
        if (!this.subcripCtx) {
            this.subcripCtx = this.appMasDa.updatecrntstate.subscribe(function (res) {
                if (res) {
                    _this.logger.trace('change ctx......');
                    _this.getCombinationCellData();
                }
            });
        }
        // listning to scanner module //
        var a = this.appState.subscribe('NEW_CTXS_INTRODUCED', function (res) {
            // if (res) {
            //     let k = res['key'];
            //     this.logger.debug('Add new context', k);
            //     this.addRow(res);
            // }
        });
        var b = this.appState.subscribe('NEW_GROUP_ITEM', function (res) {
            // if (res) {
            //     let k = res['key'];
            //     this.logger.debug('Add new context', k);
            //     this.addRow(res);
            // }
        });
    };
    /*
     page main loading data
     */
    AqlPkgDetailPage.prototype.pageMnLoading = function () {
        this.currentPageConfig = this.navParams.get('conf');
        if (this.currentPageConfig) {
            this.contextConfig = this.currentPageConfig['context_conf'];
            this.scannerConf = this.currentPageConfig['scanner_conf'];
            this.actvtLogSrv.initActivityLog(this.currentPageConfig.btn_conf);
            this.log_limit = this.currentPageConfig.log_limit;
            this.currentPageData = this.currentPageConfig['components_descriptor'];
            if (this.currentPageConfig['footer_topic']) {
                this.footer_topic_left = this.currentPageConfig['footer_topic']['left'];
                this.footer_topic_right = this.currentPageConfig['footer_topic']['right'];
                this.perc_topic = this.currentPageConfig['footer_topic']['percentage'];
            }
            if (this.currentPageConfig['cell_data']) {
                this.addrow_cell_data = this.currentPageConfig['cell_data'];
            }
            if (this.currentPageConfig['scanner_properties']) {
                this.aqlDataProvider.setScanProperties(this.currentPageConfig['scanner_properties']);
            }
            this.ratio_validation = this.currentPageConfig['ratio_validation'] ?
                this.currentPageConfig['ratio_validation'] : false;
            // load page header and footer;
            this.currentPageheader = this.currentPageConfig['title'];
            this.currentPagebuttons = this.currentPageConfig['view_controles'];
        }
        this.currentShift = this.applicationContext.getCurrentShift().id;
        this.current_line = this.applicationContext.getCurrentSubject();
        // this.current_bussness_context = this.businessContext.getCurrentContext();
        // this.logger.debug(this.currentPageConfig);
        if (this.currentPageData) {
            this.left_side = this.currentPageData.left_side;
            this.right_side = this.currentPageData.right_side;
            this.initEventListeners();
        }
    };
    /*
     page loading
     */
    AqlPkgDetailPage.prototype.pageLoading = function () {
        try {
            // check whether next page available
            if (this.currentPageConfig['next_view_ref'] !== 'EXIT') {
                this.nextPage = this.currentPageConfig['next_view_ref'];
            }
            else {
                this.nextPage = 'page_order_end';
            }
            /*  checking whether the componenet is add row OR grid  */
            if (this.left_side) {
                if (this.left_side.comp_name === 'package_detail_comp') {
                    // this.addRow();
                    if (this.left_side.comp_type === 'add_rows') {
                        this.prepareAddRowdata();
                    }
                    else if (this.left_side.comp_type === 'data_grid') {
                        // this.prepareDataGriddata();
                    }
                    this.prepareDisplayData();
                }
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    AqlPkgDetailPage.prototype.initEventListeners = function () {
        var _this = this;
        this.updateSubscription = this.appCache.updates.subscribe(function (res) {
            _this.handleUpdates(res);
            if (res === 'shift_change') {
                _this.countQty();
            }
        });
        this.aqlScanrSubscription = this.appCache.newScnKey.subscribe(function (res) {
            if (res) {
                _this.addRow(res);
            }
        });
    };
    AqlPkgDetailPage.prototype.handleUpdates = function (res) {
        try {
            if (res) {
                if (res === 'START_LOADING') {
                    this.presentLoadingDefault();
                }
                if (res === 'END_LOADING' && this.loader) {
                    this.loader.dismiss();
                }
            }
        }
        catch (e) {
        }
    };
    AqlPkgDetailPage.prototype.prepareAddRowdata = function () {
        try {
            this.bucketModel = this.sharedDataService.getDataSharedDataService(this.right_side.id);
            if (this.bucketModel) {
                var bcktItem = this.bucketModel.items[this.bucketModel.items.length - 1];
                if (bcktItem) {
                    var pass = bcktItem.pass_item[bcktItem.pass_item.length - 1];
                    var fail = bcktItem.fail_item[bcktItem.fail_item.length - 1];
                    if (pass) {
                        this.passModel = new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["b" /* CounterModel */](pass);
                    }
                    if (fail) {
                        this.failModel = new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["a" /* ClassificationModel */](fail);
                    }
                }
                else {
                    this.passModel = new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["b" /* CounterModel */]({});
                    this.failModel = new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["a" /* ClassificationModel */]({});
                }
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    AqlPkgDetailPage.prototype.getCombinationCellData = function () {
        // 2 row types - (i) color/size  (ii) only color
        this.logger.trace('getComb....', this.currentPageConfig.view_data);
        this.row_item_description = this.bcktComb.combinedData(this.left_side.data_type, this.currentPageConfig.view_data);
    };
    AqlPkgDetailPage.prototype.prepareDisplayData = function () {
        // check whether already selected data available for line/bussiness cxt change : REMOVED currently
        this.current_bussness_context = this.businessContext.getCurrentContext().ctx;
        this.current_bussiness_key = this.current_line;
        this.logger.info(this.businessContext.getCurrentContext());
        this.logger.debug(this.aqlDataProvider.aql_pkg_detail_line_data[this.current_bussiness_key]);
        /*
         TOBE modified with bussiness context changes
         */
        if (this.left_side) {
            if (this.left_side.comp_type === 'add_rows') {
                /* if (this.aqlDataProvider.aql_pkg_detail_line_data.hasOwnProperty(this.current_bussiness_key)) {
                 this.pkg_details_list = this.aqlDataProvider.aql_pkg_detail_line_data[this.current_bussiness_key];
                 } else {*/
                // this.addRow();
                // }
            }
            else if (this.left_side.comp_type === 'data_grid') {
                /* if (this.aqlDataProvider.aql_pkg_detail_line_data.hasOwnProperty(this.current_bussiness_key)) {
                 this.pkg_grid_data = this.aqlDataProvider.aql_pkg_detail_line_data[this.current_bussiness_key];
                 } else {*/
                this.pkg_grid_data = {};
                // this.prepareDataGriddata();
                // }
            }
        }
    };
    AqlPkgDetailPage.prototype.shiftChangeOccured = function (event) {
        this.currentShift = event;
    };
    AqlPkgDetailPage.prototype.lineChangeOccured = function (event) {
        if (this.left_side) {
            if (this.left_side.comp_type === 'add_rows') {
                this.aqlDataProvider.aql_pkg_detail_line_data[this.current_bussiness_key] = this.pkg_details_list;
            }
            else if (this.left_side.comp_type === 'data_grid') {
                this.aqlDataProvider.aql_pkg_detail_line_data[this.current_bussiness_key] = this.pkg_grid_data;
            }
        }
        this.current_line = event;
        // this.pkg_details_list = [];
        this.pkg_grid_data = {};
        this.prepareDisplayData();
        this.logger.debug(this.aqlDataProvider.aql_pkg_detail_line_data);
    };
    AqlPkgDetailPage.prototype.bussinessContextChangeOccured = function (event) {
        this.current_bussness_context = event;
        this.logger.debug(this.current_bussness_context, 'new business cxt ');
        if (this.left_side) {
            if (this.left_side.comp_type === 'add_rows') {
                //  this.pkg_details_list = [];
                if (this.plan_ctx) {
                    this.addRow();
                }
            }
            else if (this.left_side.comp_type === 'data_grid') {
                this.pkg_grid_data = {};
                // this.prepareDataGriddata();
            }
        }
    };
    AqlPkgDetailPage.prototype.addFieldValue = function () {
        this.fieldArray.push(this.newAttribute);
        this.newAttribute = {};
        // this.logger.info(this.fieldArray);
    };
    AqlPkgDetailPage.prototype.deleteFieldValue = function (index) {
        this.fieldArray.splice(index, 1);
    };
    AqlPkgDetailPage.prototype.addRow = function (scanner_data) {
        var _this = this;
        try {
            var packageItem = new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["a" /* BucketItemModel */]({});
            if (this.row_item_description.length > 0) {
                packageItem.setDropDownVal(this.row_item_description[0].name);
            }
            if (this.scanner_ctx) {
                var dropDownData_1 = '';
                if (scanner_data) {
                    var scn_data = scanner_data['eCtx'];
                    var tag = new Object();
                    tag = scanner_data['tag'];
                    scn_data.forEach(function (a) {
                        if (_this.addrow_cell_data.indexOf(a['k']) > -1) {
                            if (dropDownData_1 !== '') {
                                dropDownData_1 += '/' + a['v'];
                            }
                            else {
                                dropDownData_1 = a['v'];
                            }
                        }
                    });
                    if (tag !== '{}') {
                        // bundle_qty
                        var info_data = tag['info'];
                        if (info_data && info_data.bundle_qty) {
                            packageItem.setQty(info_data.bundle_qty);
                        }
                        else {
                            packageItem.setQty(0);
                        }
                        // packageItem.setQty(100);
                    }
                    packageItem.setDropDownVal(dropDownData_1);
                    packageItem.setSearchId(tag['tag_id']);
                    var bctx = scanner_data['gCtx'].concat(scanner_data['eCtx']);
                    packageItem.setContextItems(bctx);
                }
            }
            if (this.pkg_details_list.items.length > 0) {
                // let lastItem =
                if (this.scanner_ctx) {
                    this.pkg_details_list.addItem(packageItem);
                }
                else {
                    if (!this.pkg_details_list.hasEmptyRecord()) {
                        this.pkg_details_list.addItem(packageItem);
                    }
                    else {
                        var toast = this.toastCtrl.create({
                            message: 'Please Fill QTY',
                            duration: 2000,
                            position: 'middle',
                            showCloseButton: true,
                            closeButtonText: 'OK'
                        });
                        toast.present();
                    }
                }
            }
            else {
                this.pkg_details_list.addItem(packageItem);
            }
            this.btn_disabled = true;
            if (this.scanner_ctx) {
                this.sharedDataService.updateSharedDataModelForBucket(this.right_side, 1, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), []);
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    AqlPkgDetailPage.prototype.changeStatus = function (index, data) {
        this.pkg_details_list[index]['status'] = data;
        // this.logger.info(this.pkg_details_list);
    };
    AqlPkgDetailPage.prototype.changeStatusandCount = function (index, data, sampleQty, nextPage, sub_nm) {
        var _this = this;
        var addingItem = new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["a" /* BucketItemModel */](this.pkg_details_list.items[index]);
        addingItem['status'] = data;
        var current_total = this.pkg_details_list.items[index]['pass_item'].length + this.pkg_details_list.items[index]['fail_item'].length;
        // this.logger.info(current_total);
        if (current_total < sampleQty) {
            if (addingItem.undo_log.length > 0) {
                if (addingItem.undo_log.length < this.log_limit) {
                    addingItem.addUndoLog(data);
                }
                else {
                    addingItem.undo_log.shift();
                    addingItem.addUndoLog(data);
                }
            }
            else {
                addingItem.addUndoLog(data);
            }
            var temp_1 = new Object();
            this.row_item_description.forEach(function (dt) {
                if (dt.name === _this.pkg_details_list.items[index]['size']) {
                    temp_1 = Object.assign({}, dt);
                }
            });
            delete temp_1['id'];
            delete temp_1['group_id'];
            delete temp_1['grading_item'];
            delete temp_1['active'];
            delete temp_1['status'];
            delete temp_1['value'];
            delete temp_1['item'];
            if (data === 'pass') {
                this.ac_event = [
                    {
                        size: JSON.stringify(temp_1) !== '{}' ? temp_1 : { name: 'default' }
                    }
                ];
                this.right_side['bucket'] = false;
                addingItem.addPass(new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["b" /* CounterModel */]({ name: 'pass', event_actual: this.ac_event, sub_name: sub_nm }));
                if (nextPage !== 'page_order_end') {
                    this.pkg_details_list.items[index]['pass_count'] = this.pkg_details_list.items[index]['pass_count'] + 1;
                }
                else {
                    this.sharedDataService.updateSharedDataModelForBucket(this.right_side, 1, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), []);
                }
            }
            if (data === 'fail') {
                var modelToSend = new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["a" /* ClassificationModel */]({
                    name: 'aql_package',
                    id: '999999',
                    value: 1,
                    sub_name: sub_nm,
                    select_item: temp_1
                });
                if (nextPage !== 'page_order_end') {
                    this.right_side['bucket'] = true;
                    this.right_side['index'] = index;
                    this.navigationProvider.nextView(nextPage, {
                        data: this.previous_data_set, model: modelToSend,
                        btnConf: this.right_side
                    });
                }
            }
        }
        else {
        }
        this.mainBtnDisabled();
        this.pkg_details_list.items[index]['latest'] = data;
        // this.logger.info(this.pkg_details_list);
    };
    AqlPkgDetailPage.prototype.undoCount = function (index) {
        var selectItem = this.pkg_details_list.items[index];
        var lstItem = selectItem.undo_log.pop();
        if (lstItem === 'pass') {
            this.pkg_details_list.items[index]['pass_item'].pop();
        }
        else if (lstItem === 'fail') {
            this.pkg_details_list.items[index]['fail_item'].pop();
        }
        this.mainBtnDisabled();
        this.sharedDataService.updateSharedDataModelForBucket(this.right_side, -1, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), []);
    };
    AqlPkgDetailPage.prototype.deleteRow = function (index) {
        var _this = this;
        var deleteAlert = this.alertCtrl.create({
            title: 'Delete Row  ?',
            message: '<br>Continue?',
            cssClass: 'codeQR',
            buttons: [
                {
                    text: 'Yes',
                    handler: function (data) {
                        _this.pkg_details_list.items.splice(index, 1);
                        if (_this.pkg_details_list.items.length === 0) {
                            _this.pkg_details_list.tot_qty = 0;
                            if (_this.scanner_ctx) {
                                _this.pkg_details_list.smple_tot_qty = 0;
                            }
                            if (_this.plan_ctx) {
                                _this.addRow();
                            }
                        }
                        _this.countQty();
                        _this.sharedDataService.updateSharedDataModelForBucket(_this.right_side, 1, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](_this.pkg_details_list), []);
                        _this.mainBtnDisabled();
                        if (_this.scanner_ctx) {
                            if (_this.pkg_details_list.items.length === 0) {
                                _this.actCtx.removeCurrentGroup();
                            }
                        }
                    }
                },
                {
                    text: 'No',
                    role: 'cancel',
                    handler: function (data) {
                    }
                }
            ]
        });
        deleteAlert.present();
    };
    AqlPkgDetailPage.prototype.onValueChange = function (input, index) {
        if (this.ratio_validation) {
            if (this.row_item_description.length > 0) {
                this.rowBtnDisabled(index);
            }
        }
        else {
            this.rowBtnDisabled(index);
        }
        this.sharedDataService.updateSharedDataModelForBucket(this.right_side, 1, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), []);
    };
    AqlPkgDetailPage.prototype.mainPassFailButtonsClicked = function (box_dt) {
        var finalStatus = box_dt && box_dt['value'] ? box_dt['value'] : 0;
        var reasonCaptureStatus = box_dt && box_dt['reason'] ? box_dt['reason'] : null;
        var nm = box_dt && box_dt['nm'] ? box_dt['nm'] : null;
        var sub_nm = box_dt && box_dt['sub_nm'] ? box_dt['sub_nm'] : null;
        var bool_insert = true;
        this.pkg_details_list.setName(nm);
        this.pkg_details_list.items.forEach(function (bckt) {
            var sampleV = parseInt(bckt.sub_qty);
            var qtyV = bckt.pass_item.length + bckt.fail_item.length;
            if (sampleV !== qtyV) {
                bool_insert = false;
            }
        });
        if (bool_insert && this.left_side) {
            var package_items_1 = [];
            var total_qty_1 = 0;
            var sample_total_qty_1 = 0;
            var last_row_qty_filled = true;
            var pass_qty_1 = 0;
            if (this.left_side.comp_type === 'add_rows' && this.left_side.data_type === 'size_only') {
                this.pkg_details_list.items.forEach(function (item, idx) {
                    if (item.hasOwnProperty('qty') && item.qty > 0) {
                        var currItem = new __WEBPACK_IMPORTED_MODULE_7__aql_events_aql_event__["b" /* AqlPkgItem */]({
                            color: item.color,
                            size: item.size,
                            qty: item.qty,
                            is_fail: -1,
                            item_issue: []
                        });
                        package_items_1.push(currItem);
                        total_qty_1 += parseInt(item.qty);
                        sample_total_qty_1 += parseInt(item.sub_qty);
                        pass_qty_1 += item.pass_item.length;
                    }
                });
            }
            this.pkg_details_list.status = finalStatus;
            var currentAqlEvent = new __WEBPACK_IMPORTED_MODULE_7__aql_events_aql_event__["a" /* AqlEvent */]({
                ty: 'category',
                nm: 'aql',
                v1: 1,
                cv: 1,
                package_items: package_items_1,
                status: finalStatus,
                total_qty: total_qty_1,
                shift: this.currentShift,
                line: this.current_line,
                package_issue: []
            });
            this.logger.debug(currentAqlEvent);
            var bussiness_cxt_list = {};
            var output = {};
            output['event'] = currentAqlEvent;
            output['data'] = bussiness_cxt_list;
            var time = new Date();
            var display_date = time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });
            output['time'] = display_date;
            // if (total_qty > 0 && last_row_qty_filled === true) {
            if (reasonCaptureStatus === true) {
                this.logger.debug('CAPTURE FAIL REASONS ', this.nextPage);
                // TODO: gather all required data
                var modelToSend = new __WEBPACK_IMPORTED_MODULE_10__models_btnModel__["a" /* ClassificationModel */]({
                    name: 'aql_package',
                    id: '999999',
                    value: total_qty_1,
                    list_key: 'aqldepartment',
                    children: package_items_1
                });
                this.navigationProvider.nextView(this.nextPage, {
                    model: modelToSend,
                    data: {}
                });
            }
            else {
                this.logger.debug(finalStatus);
                var toast = this.toastCtrl.create({
                    message: 'Cartoon ' + finalStatus.toUpperCase(),
                    duration: 2500,
                    position: 'top',
                    showCloseButton: false,
                    cssClass: 'pass_fail_toast'
                });
                if (finalStatus === 'pass') {
                    this.pkg_details_list.pass_crtn += 1;
                    this.pkg_details_list.pass_qty += total_qty_1;
                }
                else if (finalStatus === 'fail') {
                    this.pkg_details_list.fail_crtn += 1;
                    this.pkg_details_list.fail_qty += total_qty_1;
                }
                toast.present();
                this.right_side['nm'] = nm;
                this.right_side['sub_nm'] = sub_nm;
                this.sharedDataService.updateSharedDataModelForBucket(this.right_side, 0, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), []);
                this.countQty();
                this.mainBtnDisabled(true);
                this.pkg_details_list.items = [];
                this.pkg_details_list.tot_qty = total_qty_1;
                this.pkg_details_list.smple_tot_qty = sample_total_qty_1;
                if (this.plan_ctx) {
                    this.addRow();
                }
                this.sharedDataService.updateSharedDataModelForBucket(this.right_side, -1, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), []);
                // let _self = this;
                // setTimeout(function () {
                //     _self.sharedDataService.updateSharedDataModelForBucket(_self.right_side, -1,
                //         new BucketModel(_self.pkg_details_list), []);
                // }, 1000);
                // this.navigationProvider.exitToRoot({});
                if (this.scanner_ctx) {
                    this.actCtx.removeCurrentGroup();
                }
            }
        }
        else {
            this.fullRoundValidation();
        }
    };
    AqlPkgDetailPage.prototype.incompletePkg = function () {
    };
    // check data store availabilyty//
    AqlPkgDetailPage.prototype.checkAvaliability = function () {
        this.pkg_details_list = this.sharedDataService.getDataSharedDataService(this.right_side.id);
        var subject = this.applicationContext.getCurrentSubject();
        if (!this.pkg_details_list) {
            this.pkg_details_list = new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */]({
                bsns_cntxt: this.current_bussness_context,
                subject: subject.id,
                instance: 'BucketModel'
            });
            this.sharedDataService.setDataSharedDataService(this.right_side.id, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list));
            if (this.plan_ctx) {
                this.addRow();
            }
        }
        else if (this.pkg_details_list.items.length === 0) {
            if (this.plan_ctx) {
                this.addRow();
            }
        }
        this.countQty();
        this.mainBtnDisabled();
    };
    AqlPkgDetailPage.prototype.presentLoadingDefault = function () {
        this.loader = this.loadingCtrl.create({
            content: 'Please wait...',
            duration: 2000
        });
        this.loader.present();
    };
    /*
     * Floating menu controller
     * */
    AqlPkgDetailPage.prototype.floatingMenuHandler = function (conf) {
        try {
            switch (conf.type) {
                case 'page': {
                    this.navigationProvider.nextView(conf.next_view_ref, conf);
                    break;
                }
            }
        }
        catch (e) {
            this.logger.error('Action not found ');
        }
    };
    AqlPkgDetailPage.prototype.qtychange = function (index, name, val, input) {
        if (name === 'qty') {
            var item = this.pkg_details_list.items[index];
            if (item.qty === '') {
                item.qty = 0;
            }
            else {
                item.qty = val;
            }
            this.countQty();
            this.mainBtnDisabled();
            this.logger.trace('******* index of change qty ****', index, item, item.qty);
        }
        else {
            if (this.scanner_ctx) {
                var item = this.pkg_details_list.items[index];
                this.logger.trace('******* index of change qty ****', index, item, item.sub_qty);
                if (item.sub_qty === '') {
                    item.sub_qty = 0;
                }
                else {
                    item.sub_qty = val;
                }
                this.countQty();
                this.mainBtnDisabled();
                this.logger.trace('******* index of change qty ****', index, item, item.sub_qty);
            }
        }
        this.onValueChange(input, index);
    };
    /*
     count all list qty
     */
    AqlPkgDetailPage.prototype.countQty = function () {
        var _this = this;
        this.pkg_details_list.tot_qty = 0;
        this.pkg_details_list.smple_tot_qty = 0;
        this.pkg_details_list.items.forEach(function (dt) {
            if (dt.qty !== '') {
                _this.pkg_details_list.tot_qty += parseInt(dt.qty);
            }
            else {
                _this.pkg_details_list.tot_qty += 0;
            }
            if (dt.sub_qty !== '') {
                _this.pkg_details_list.smple_tot_qty += parseInt(dt.sub_qty);
            }
            else {
                _this.pkg_details_list.smple_tot_qty += 0;
            }
        });
        var rtnset = this.appCache.createTot('upper_total', 'lower_total', 'upper_pcs', 'lower_pcs');
        this.upper_total = rtnset['upper_total'];
        this.lower_total = rtnset['lower_total'];
        this.upper_pcs = rtnset['upper_pcs'];
        this.lower_pcs = rtnset['lower_pcs'];
        if (this.upper_pcs > 0 && this.lower_pcs > 0) {
            this.tot_perc = parseFloat((this.upper_pcs / this.lower_pcs) * 100 + '').toFixed(2) + ' %';
        }
        else {
            this.tot_perc = parseFloat('0') + ' %';
        }
        if (this.scanner_ctx) {
            this.sharedDataService.setDataSharedDataService(this.right_side.id, new __WEBPACK_IMPORTED_MODULE_12__models_bucketModel__["b" /* BucketModel */](this.pkg_details_list), true);
        }
        this.logger.trace('======================', rtnset);
    };
    /*
     disabled main btn
     */
    AqlPkgDetailPage.prototype.mainBtnDisabled = function (disabled) {
        var _this = this;
        this.btn_disabled = false;
        var bool = false;
        if (this.pkg_details_list.items.length > 0) {
            this.pkg_details_list.items.forEach(function (dt, index) {
                var sample = (dt.sub_qty === '') ? 0 : parseInt(dt.sub_qty);
                var qty = dt.pass_item.length + dt.fail_item.length;
                if (sample > 0) {
                    if (sample !== qty) {
                        bool = true;
                    }
                    _this.rowBtnDisabled(index);
                }
                else {
                    bool = true;
                }
                if (dt.pass_item.length === 0 && dt.fail_item.length === 0) {
                    _this.btn_disabled = true;
                }
            });
        }
        else {
            bool = true;
        }
        if (!bool) {
            this.btn_disabled = false;
        }
        else {
            this.btn_disabled = true;
        }
        if (disabled) {
            this.btn_disabled = true;
            this.pkg_details_list.tot_qty = 0;
            this.pkg_details_list.smple_tot_qty = 0;
        }
    };
    /*
     btn pass & fail count validation
     */
    AqlPkgDetailPage.prototype.btnValidation = function () {
        var validation = this.alertCtrl.create({
            title: 'Prohibitted action',
            subTitle: 'Selcted all items are checked ...',
        });
        validation.present();
        setTimeout(function () {
            validation.dismiss();
        }, 1000);
    };
    /*
     full round validation
     */
    AqlPkgDetailPage.prototype.fullRoundValidation = function () {
        var btnValidation = this.alertCtrl.create({
            title: 'Prohibitted action',
            subTitle: 'Please finish worked before close',
        });
        btnValidation.present();
        setTimeout(function () {
            btnValidation.dismiss();
        }, 1000);
    };
    AqlPkgDetailPage.prototype.ngOnDestroy = function () {
        try {
            if (this.subcripApp) {
                this.subcripApp.unsubscribe();
            }
            if (this.subcripCtx) {
                this.subcripCtx.unsubscribe();
            }
        }
        catch (e) {
            this.logger.debug(e);
        }
    };
    /*
     count validation
     */
    AqlPkgDetailPage.prototype.countValidation = function (val1, val2) {
        var validation = this.alertCtrl.create({
            title: 'Prohibitted action',
            subTitle: val1 + ' is less than ' + val2,
        });
        validation.present();
        // setTimeout(function () {
        //     validation.dismiss();
        // }, 1000);
    };
    /*
     drop down data empty
     */
    AqlPkgDetailPage.prototype.eptyDropDown = function () {
        var dropValidation = this.alertCtrl.create({
            title: 'Prohibitted action',
            subTitle: 'Please select item',
        });
        dropValidation.present();
    };
    /*
    row data btn disabled
     */
    AqlPkgDetailPage.prototype.rowBtnDisabled = function (index) {
        try {
            var main_qty = this.pkg_details_list.items[index].qty;
            var sub_qty = this.pkg_details_list.items[index].sub_qty;
            var dt = this.pkg_details_list.items[index];
            var qty = dt.pass_item.length + dt.fail_item.length;
            if (parseInt(main_qty) >= parseInt(sub_qty)) {
                if (parseInt(sub_qty) > qty) {
                    dt['disabled_btn'] = false;
                    this.btn_disabled = true;
                }
                else if (parseInt(sub_qty) === qty) {
                    dt['disabled_btn'] = true;
                    // this.btn_disabled = false;
                }
                else {
                    dt['disabled_btn'] = true;
                    this.btn_disabled = true;
                }
            }
            else {
                dt['disabled_btn'] = true;
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    AqlPkgDetailPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-aql-pkg-detail',
            template: __WEBPACK_IMPORTED_MODULE_5__aql_pkg_detail_template__["a" /* PKG_DETAIL_TEMPLATE */],
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__["a" /* NavigationManager */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_4__providers_aql_data_provider__["a" /* AqlDataProvider */], __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_app_core_dist__["d" /* ApplicationContext */], __WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_app_core_dist__["e" /* ApplicationService */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["x" /* ToastController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_9__providers_masterdata_service_masterdata_service__["a" /* AppMasterDataCntrl */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_11__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */], __WEBPACK_IMPORTED_MODULE_13__providers_bucket_combinations_bucketCombination__["a" /* BucketCombination */],
            __WEBPACK_IMPORTED_MODULE_14__providers_application_cache_service_app_cache_service__["a" /* AppCacheService */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["k" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_15__providers_activity_log_activity_log__["a" /* ActivityLogProvider */],
            __WEBPACK_IMPORTED_MODULE_17__ncinga_sp_nsp_common_module_providers_context_service__["a" /* ContextService */]])
    ], AqlPkgDetailPage);
    return AqlPkgDetailPage;
}());

//# sourceMappingURL=aql-pkg-detail.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PKG_DETAIL_TEMPLATE; });
/**
 * Created by Paramee Gunethilake on 6/4/2018.
 */
var PKG_DETAIL_TEMPLATE = "\n<ion-header>\n<common-main-header [title]=\"currentPageheader\" [tools]=\"tools\"></common-main-header>\n\n</ion-header>\n\n\n<ion-content padding class=\"package-body\">\n\n    <ion-grid class=\"main-grid\" >\n<ion-row class=\"summary-row\">\n        <ion-col class=\"summary-col\" *ngIf=\"plan_ctx\">\n            <core-domain-header></core-domain-header>\n        </ion-col>\n        <ion-col class=\"summary-col\" *ngIf=\"scanner_ctx\">\n            <common-domain-header [scannerConf]=\"scannerConf\" [contextConfig]=\"contextConfig\"></common-domain-header>\n        </ion-col>\n    </ion-row>\n <ion-row class=\"main-data-row\">\n\n <ion-grid style=\"margin-top: 10px;\">\n        <ion-row class=cont-wraper>\n\n        <ion-col col-12 col-md-9 *ngIf=\"left_side?.comp_type === 'add_rows'\" class=\"pkg-detail-col\">\n\n                <ion-row class=\"pkg-hdr\" *ngIf=\"plan_ctx\">\n                    <div class=\"hdr\">Package Details</div>\n                    <div class=\"tol-qty\"><span>Total QTY </span> <span class=\"count\">{{pkg_details_list.tot_qty}}</span></div>\n                    <button ion-button class=\"addrowButton\" (click)=\"addRow()\">\n                    <ion-icon name=\"add\"></ion-icon></button>\n                </ion-row>\n                <ion-row class=\"pkg-hdr\" *ngIf=\"scanner_ctx\">\n                    <div class=\"hdr\">Package Details</div>\n                    <div class=\"tol-qty\"><span>Total QTY </span> <span class=\"count\">{{pkg_details_list.tot_qty}}</span></div>\n                    <div class=\"tol-qty\"><span>Total Sample QTY </span> <span class=\"count\">{{pkg_details_list.smple_tot_qty}}</span></div>\n                    <!--<button ion-button class=\"addrowButton\" (click)=\"addRow()\">\n                    <ion-icon name=\"add\"></ion-icon></button>-->\n                </ion-row>\n\n                <div class=\"pkg-detail-lst\">\n                <ion-row *ngFor=\"let itemList of pkg_details_list?.items ; let i= index\" class=\"pkg-detail-row\">\n\n                    <ion-col *ngFor=\"let singleItem of this.left_side.comp_data\" class=\"input-col\">\n                    <ion-col *ngIf=\"singleItem.type === 'label'\" class=\"pkg-detail-dropdown-col\">\n                            <ion-row class=\"inpt-lbl\"> {{singleItem.header}}</ion-row>\n                            <ion-row *ngIf=\"singleItem.header_data === 'bctx_concat'\">\n                                {{itemList?.size}}\n                            </ion-row>\n                        </ion-col>\n                        <ion-col *ngIf=\"singleItem.type === 'dropdown'\" class=\"pkg-detail-dropdown-col\">\n                            <ion-row class=\"inpt-lbl\"> {{singleItem.header}}</ion-row>\n                            <ion-row>\n                                <ion-select [(ngModel)]=\"itemList[singleItem.header_data]\"\n                                 (click)=\"getCombinationCellData()\">\n                                    <ion-option *ngFor=\"let single of row_item_description;let k=index\"\n                                                value=\"{{single.name}}\" [selected]=\"k===0\">\n                                                {{single.name}}\n                                    </ion-option>\n                                </ion-select>\n\t\t\t\t<!-- <button ion-button (click)=\"getCombinationCellData()\">reload</button> -->\n                            </ion-row>\n                        </ion-col>\n\n                        <ion-col *ngIf=\"singleItem.type === 'input'\" class=\"pkg-detail-input-col\">\n                            <ion-row class=\"inpt-lbl\">{{singleItem.header}}</ion-row>\n                            <ion-row *ngIf=\"singleItem.header_data==='qty'\">\n                                <ion-input [(ngModel)]='itemList[singleItem.header_data]' type=\"number\" [min]=\"1\"\n                                           placeholder=\" \" (ionChange)=\"qtychange(i,\n                                            singleItem.header_data, itemList[singleItem.header_data], singleItem)\" disabled>\n                                </ion-input>\n                                 </ion-row>\n                                <ion-row *ngIf=\"singleItem.header_data!=='qty'\">\n                                <ion-input [(ngModel)]='itemList[singleItem.header_data]' type=\"number\" [min]=\"1\"\n                                           placeholder=\" \" (ionChange)=\"qtychange(i,\n                                            singleItem.header_data, itemList[singleItem.header_data], singleItem)\">\n                                </ion-input>\n                            </ion-row>\n                        </ion-col>\n\n\n                        <ion-col *ngIf=\"singleItem.type === 'pass_button' && singleItem.button_type ==='pass_fail_button_only'\"\n                        class=\"pkg-detail-button-col\">\n\n                            <button ion-button\n                                     [ngClass]=\"{ 'green_outline_btn':itemList.pass_selected == false,\n                                    'green_color_btn': itemList.pass_selected == true}\"\n                                    (click)=\"changeStatus(i,'pass');\n                                    itemList.pass_selected = !itemList.pass_selected ;\n                                    itemList.fail_selected = false\">\n                                    Pass\n                            </button>\n                        </ion-col>\n\n                        <ion-col *ngIf=\"singleItem.type === 'fail_button' && singleItem.button_type ==='pass_fail_button_only'\"\n                        class=\"pkg-detail-button-col\">\n\n                            <button ion-button\n                                    [ngClass]=\"{  'red_outline_btn':itemList.fail_selected == false,\n                                    'red_color_btn': itemList.fail_selected == true}\"\n                                    (click)=\"changeStatus(i,'fail');\n                                    itemList.fail_selected = !itemList.fail_selected ;\n                                    itemList.pass_selected = false \">\n                                    Fail\n                            </button>\n                        </ion-col>\n\n                        <ion-col\n                          *ngIf=\"singleItem.type === 'pass_count_button' &&\n                          singleItem.button_type ==='pass_fail_button_with_count_and_classification'\" class=\"pkg-detail-button-col\">\n\n\n                            <button ion-button [disabled]=\"itemList.disabled_btn\"\n                                    [ngClass]=\"{ 'green_outline_btn':itemList.pass_item.length === 0,\n                                    'green_color_btn': itemList.pass_item.length > 0}\"\n                                     (click)=\"changeStatusandCount(i,'pass',itemList.sub_qty,\n                                     singleItem?.next_view_ref, singleItem?.sub_nm)\">\n                               Pass &nbsp; &nbsp;\n                                <span class=\"sm-btn-count\">{{itemList.pass_item.length}}</span>\n                            </button>\n                        </ion-col>\n\n                        <ion-col style=\"max-width: 50px;\"\n                                *ngIf=\"singleItem.type === 'fail_count_button' &&\n                                singleItem.button_type ==='pass_fail_button_with_count_and_classification'\"\n                                class=\"pkg-detail-button-col\">\n\n                            <button ion-button [disabled]=\"itemList.disabled_btn\"\n                                    [ngClass]=\"{  'red_outline_btn':itemList.fail_item.length === 0,\n                                    'red_color_btn': itemList.fail_item.length > 0}\"\n                                    (click)=\"changeStatusandCount(i,'fail',itemList.sub_qty,\n                                     singleItem?.next_view_ref, singleItem?.sub_nm)\">\n                                fail  &nbsp; &nbsp;\n                                <span class=\"sm-btn-count\" >{{itemList.fail_item.length}}</span>\n                            </button>\n                        </ion-col>\n\n                        <ion-col *ngIf=\"singleItem.type === 'button' && singleItem.button_type ==='undo_button'\"\n                         class=\"pkg-detail-button-col undo-btn\">\n                            <button ion-button class=\"undo-button\" (click)=\"undoCount(i)\"> <ion-icon name=\"undo\">\n                            </ion-icon> </button>\n                        </ion-col>\n                    </ion-col>\n\n                    <ion-col class=\"end-btn-col\">\n                        <button ion-button (click)=\"deleteRow(i)\" class=\"\"> <ion-icon name=\"trash\"></ion-icon></button>\n                    </ion-col>\n                </ion-row>\n                <!--===============================add-row-mobile-view================================-->\n                <!-- <ion-row class=\"pkg-detail-row\">\n                    <ion-col>\n                    <ion-row>\n                    <ion-col class=\"\">\n                        <ion-row class=\"inpt-lbl\">Color/Size</ion-row>\n                        <ion-row>\n                            <ion-select>\n                                <ion-option>\n\n                                </ion-option>\n                            </ion-select>\n                        </ion-row>\n                    </ion-col>\n\n                    <ion-col class=\"\">\n                        <ion-row class=\"inpt-lbl\">QTY</ion-row>\n                        <ion-row>\n                            <ion-input type=\"number\" placeholder=\"\">\n\n                            </ion-input>\n                        </ion-row>\n                    </ion-col>\n\n                    <ion-col class=\"\">\n                        <ion-row class=\"inpt-lbl\">QTY</ion-row>\n                        <ion-row>\n                            <ion-input type=\"number\" placeholder=\"\">\n\n                            </ion-input>\n                        </ion-row>\n                    </ion-col>\n                    </ion-row>\n                    </ion-col>\n                </ion-row> -->\n                <!--===============================add-row-mobile-view================================-->\n                </div>\n               <!-- <ion-row justify-content-end class=\"add-row-row\">\n                    <div></div>\n                    <button ion-button class=\"addrowButton\" (click)=\"addRow()\">\n                    <ion-icon name=\"add\"></ion-icon>  &nbsp;  add row</button>\n                </ion-row> -->\n              </ion-col>\n         <ion-col col-md-9 col-12 *ngIf=\"left_side?.comp_type === 'data_grid' && left_side.data_type === 'color_size'\"\n         class=\"pkg-detail-col-for-grid\">\n\n               <ion-row class=\"pkg-hdr\">\n                    <div>Package Details</div>\n                   <!-- <button ion-button class=\"incom-btn\" (click)=\"incompletePkg()\"> Incomplete </button>-->\n                </ion-row>\n\n                <ion-row class=tol-qty>\n                   <!-- <span>Total QTY</span><span class=\"count\">100</span>-->\n                </ion-row>\n                <ion-grid class=\"data-grid\">\n                <ion-row  class=\"data-grid-size-header-row\">\n                <ion-col class=\"data-grid-size-header-col\" col-3></ion-col>\n                 <ion-col *ngFor=\"let sizeItem of current_size_list\" class=\"data-grid-size-header-col\">\n                {{sizeItem.name}}\n                 </ion-col>\n                </ion-row>\n                <ion-row class='data-grid-data-rows'   *ngFor=\"let colorItem of current_color_list\" >\n                <ion-col class='data-grid-data-col col-hdr' col-3>{{colorItem.name}}</ion-col>\n                <ion-col>\n                 <ion-row>\n                 <ion-col *ngFor=\"let sizeItem of current_size_list\"  class='data-grid-data-col' >\n                <ion-input type=\"number\" [min]=\"1\" [(ngModel)]=\"pkg_grid_data[colorItem.name][sizeItem.name]\"></ion-input>\n</ion-col>\n                   </ion-row>\n</ion-col>\n               </ion-row>\n                </ion-grid>\n</ion-col>\n         <ion-col col-md-9 col-12 *ngIf=\"left_side?.comp_type === 'data_grid' && left_side.data_type === 'color_only'\"\n          class=\"pkg-detail-col-for-grid\">\n\n               <ion-row class=\"pkg-hdr\">\n                    <div>Package Details</div>\n                    <div class=\"tol-qty\"><span>Total QTY </span> <span class=\"count\"> {{pkg_details_list.tot_qty}}</span></div>\n                    <button ion-button class=\"addrowButton\" (click)=\"addRow()\">\n                    <ion-icon name=\"add\"></ion-icon></button>\n                </ion-row>\n\n                <ion-grid class=\"data-grid\">\n               <!-- <ion-row *ngFor=\"let colorItem of current_color_list\" >\n                <ion-col col-4>{{colorItem.name}}</ion-col>\n                <ion-col col-3> <ion-input type=\"number\" [min]=\"1\" [(ngModel)]=\"pkg_grid_data[colorItem.name]\"></ion-input></ion-col>\n                </ion-row>-->\n                  <ion-row *ngFor=\"let colorItem of current_color_list\" class=\"data-grid-data-rows\">\n                <ion-col col-4 class=\"col-hdr data-grid-data-col\">{{colorItem.name}}</ion-col>\n                <ion-col col-8 class=\"data-grid-data-col\">\n                <ion-input type=\"number\" [(ngModel)]=\"pkg_grid_data[colorItem.name]\"></ion-input>\n                </ion-col>\n                </ion-row>\n                </ion-grid>\n                </ion-col>\n              <!--====end pkg info ==========-->\n\n\n        <!-- pass fail btn ====-->\n        <ion-col col-md-3 col-12 class=\"pass-fail-btn-col pass-fail-tab\">\n\n            <ion-row *ngFor=\"let box of this.right_side.comp_data\">\n                <button [disabled]=\"btn_disabled\" ion-button [color]=\"box.color\"\n                        (click)=\"mainPassFailButtonsClicked(box)\">\n                    {{box.name}}\n                </button>\n            </ion-row>\n\n        </ion-col>\n\n\n        <!-- pass fail btn mobile ====-->\n        <ion-row col-md-3 col-12 class=\"pass-fail-btn-col pass-fail-m\">\n\n            <ion-col *ngFor=\"let box of this.right_side.comp_data\">\n                <button ion-button [color]=\"box.color\"\n                        (click)=\"mainPassFailButtonsClicked(box)\">\n                    {{box.name}}\n                </button>\n            </ion-col>\n\n        </ion-row>\n\n\n        <!-- end pass fail btn\n        ======================-->\n        </ion-row>\n        <ion-row class=\"button-wraper\">\n            <!-- <ion-col col-12 col-md-4 class=\"bottom-card\"><span class=\"r-align-flx\">Line\n            </span><span class=\"valu-txt\"> {{current_line.name}}</span></ion-col> -->\n            <ion-col col-12 col-md-4 class=\"bottom-card\"><span class=\"r-align-flx\">{{footer_topic_left}}\n            </span> <span class=\"valu-txt\"><span class=\"help-text\">Pass</span> {{upper_total}}/\n            {{lower_total}} <span class=\"help-text\">Total</span></span></ion-col>\n            <ion-col col-12 col-md-4 class=\"bottom-card\">\n                <span class=\"r-align-flx\">{{footer_topic_right}}\n                </span>\n                <span class=\"valu-txt\">\n                    <span class=\"help-text\">Pass</span>{{upper_pcs}} / {{lower_pcs}}\n                    <span class=\"help-text\">Total</span>\n                </span>\n            </ion-col>\n            <ion-col col-12 col-md-3 class=\"bottom-card\">\n                <span class=\"r-align-flx\">{{perc_topic}}\n                </span>\n                <span class=\"valu-txt\">\n                    {{tot_perc}}\n                </span>\n            </ion-col>\n            <ion-col col-12 col-md-1 class=\"bottom-card\"></ion-col>\n        </ion-row>\n\n        </ion-grid>\n\n    </ion-row>\n\n\n    </ion-grid>\n<ion-fab right bottom class=\"flting-btn-main\">\n    <button ion-fab color=\"dark\"><ion-icon name=\"arrow-dropleft\"></ion-icon></button>\n    <ion-fab-list side=\"left\">\n      <button class=\"sub-btn\" color=\"dark\" ion-fab *ngFor=\"let item of currentPageConfig?.floating_menu\" [title]=\"item.name\"\n      (click)=\"floatingMenuHandler(item)\" >\n      <ion-icon [name]=\"item.icon\"></ion-icon></button>\n    </ion-fab-list>\n  </ion-fab>\n</ion-content>\n\n\n";
//# sourceMappingURL=aql-pkg-detail-template.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AqlEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return AqlPkgItem; });
/**
 * Created by Paramee Gunethilake on 6/27/2018.
 */
var AqlEvent = /** @class */ (function () {
    function AqlEvent(obj) {
        this.ty = obj && obj.ty;
        this.nm = obj && obj.nm;
        this.vl = obj && obj.vl;
        this.cv = obj && obj.cv;
        this.ac = {};
        this.setACvalues(obj);
    }
    AqlEvent.prototype.setACvalues = function (obj) {
        this.ac['package_items'] = obj && obj.package_items;
        this.ac['status'] = obj && obj.status;
        this.ac['total_qty'] = obj && obj.total_qty;
        this.ac['shift'] = obj && obj.shift;
        this.ac['line'] = obj && obj.line;
        this.ac['package_issue'] = obj && obj.package_issue;
    };
    return AqlEvent;
}());

var AqlPkgItem = /** @class */ (function () {
    function AqlPkgItem(obj) {
        this.color = obj && obj.color;
        this.size = obj && obj.size || '';
        this.qty = obj && obj.qty;
        this.is_fail = obj && obj.is_fail;
        this.item_issue = obj && obj.item_issue;
    }
    return AqlPkgItem;
}());

//# sourceMappingURL=aql.event.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PassTotalPipe; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/**
 * Created by dilshan on 8/27/18.
 */
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 PassTotalPipe = /** @class */ (function () {
    function PassTotalPipe() {
    }
    PassTotalPipe.prototype.transform = function (value, status) {
        var rtnTot = 0;
        value.forEach(function (dt) {
            dt.pass_item.forEach(function (itm) {
                //noinspection TypeScriptValidateTypes
                // rtnTot += ((typeof itm.value) === 'string') ?parseInt(itm.value):itm.value;
                rtnTot += itm.value;
            });
        });
        return rtnTot;
    };
    PassTotalPipe = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Pipe"])({
            name: 'passTotal'
        })
    ], PassTotalPipe);
    return PassTotalPipe;
}());

//# sourceMappingURL=pipes.js.map

/***/ })

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