(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-controle-nota-entrada-nota-entrada-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component.html":
/*!******************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component.html ***!
  \******************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal fade\" id=\"nota-entrada-filter-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-45\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.pesquisaDeNotaEntrada' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"periodoDe\"\r\n                                       class=\"required\">{{\"labels.periodoDe\" | translate }}</label>\r\n                                <app-data id=\"periodoDe\"\r\n                                          name=\"periodoDe\"\r\n                                          [(ngModel)]=\"service.filtro.dataI\"\r\n                                          autofocus\r\n                                          class=\"dataHora\"\r\n                                          [formatDateTime]=\"mascara.getFormatData\"\r\n                                          required=\"true\">\r\n                                </app-data>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"ate\"\r\n                                       class=\"required\">{{\"labels.ate\" | translate}}</label>\r\n                                <app-data id=\"ate\"\r\n                                          name=\"ate\"\r\n                                          [(ngModel)]=\"service.filtro.dataF\"\r\n                                          class=\"dataHora\"\r\n                                          [formatDateTime]=\"mascara.getFormatData\"\r\n                                          required=\"true\">\r\n                                </app-data>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-pesquisa-destinatario id=\"cliente\" name=\"cliente\" tipoDestinatario=\"C\"\r\n                                                           modalTitle=\"pesquisaDeCliente\" label=\"cliente\"\r\n                                                           [(ngModel)]=\"service.filtro.destinatarioIdCliente\"\r\n                                                           showInscricao=\"false\" showCgcCpf=\"false\">\r\n                                </app-pesquisa-destinatario>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"notaFiscal\">{{ 'labels.notaFiscal' | translate }}</label>\r\n                                <input type=\"text\" class=\"form-control-sm form-control\"\r\n                                       id=\"notaFiscal\"\r\n                                       name=\"notaFiscal\"\r\n                                       appNumbersPositive\r\n                                       [(ngModel)]=\"service.filtro.nota\">\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"recebimento\">{{ 'labels.recebimento' | translate }}</label>\r\n                                <input type=\"text\" class=\"form-control-sm form-control\"\r\n                                       id=\"recebimento\"\r\n                                       name=\"recebimento\"\r\n                                       appNumbersPositive\r\n                                       [(ngModel)]=\"service.filtro.recebimento\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.pesquisar' | translate }}\r\n                    </button>\r\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Sair</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>\r\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.html":
/*!**************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.html ***!
  \**************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaForm\" [formAction]=\"actionForm\" [itemData]=\"data.nota\"\r\n    [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"row\">\r\n    <div class=\"col-lg-12\">\r\n        <div class=\"section-comand-bar\">\r\n            <div class=\"tab-content top\">\r\n                <app-form-legenda></app-form-legenda>\r\n                <div class=\"tab-pane active show\" id=\"ge\">\r\n                    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                        <app-validacoes></app-validacoes>\r\n                        <div class=\"clearfix\">\r\n                            <ul class=\"nav nav-tabs \">\r\n                                <li class=\"nav-item\">\r\n                                    <a class=\"nav-link active show\" data-toggle=\"tab\" href=\"#dados\">{{\"labels.dados\" |\r\n                                        translate}}</a>\r\n                                </li>\r\n                                <li class=\"nav-item\">\r\n                                    <a class=\"nav-link\" data-toggle=\"tab\" href=\"#itens\">{{\"labels.itens\" |\r\n                                        translate}}</a>\r\n                                </li>\r\n                                <li class=\"nav-item\">\r\n                                    <a class=\"nav-link\" data-toggle=\"tab\" href=\"#totais\">{{\"labels.totais\" |\r\n                                        translate}}</a>\r\n                                </li>\r\n                            </ul>\r\n                        </div>\r\n                        <div class=\"tab-content top\">\r\n                            <div class=\"tab-pane active show\" id=\"dados\">\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"numRecebimento\">{{'labels.numRecebimento' | translate}}</label>\r\n                                            <input id=\"numRecebimento\" name=\"numRecebimento\" [(ngModel)]=\"data.pedidoId\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\" disabled>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"autorizacao\">{{'labels.autorizacao' | translate}}</label>\r\n                                            <input id=\"autorizacao\" name=\"autorizacao\" [(ngModel)]=\"data.autorizacao\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\" disabled>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <app-pesquisa-destinatario id=\"cliente\" name=\"cliente\" tipoDestinatario=\"C\"\r\n                                                modalTitle=\"pesquisaDeCliente\" label=\"cliente\"\r\n                                                [(ngModel)]=\"data.destinatarioIdCliente\" showInscricao=\"false\"\r\n                                                showCgcCpf=\"false\" [inSelected]=\"data.cliente\" [disabled]=\"true\"\r\n                                                required=\"true\">\r\n                                            </app-pesquisa-destinatario>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"dtEntrada\" class=\"required\">{{'labels.dtEntrada' |\r\n                                                translate}}</label>\r\n                                            <app-data-h-m-s id=\"dtEntrada\" name=\"dtEntrada\" [(ngModel)]=\"data.dtEscritura\"\r\n                                                required [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                class=\"dataHora\" [formatDateTime]=\"mascara.getFormatDataHorMin\"\r\n                                                (executa)=\"validaDatas({'dtEscritura': $event})\"></app-data-h-m-s>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-6 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"modeloNota\" class=\"required\">{{ \"labels.modeloNota\" | translate\r\n                                                }}</label>\r\n                                            <select class=\"form-control form-control-sm\" id=\"modeloNota\"\r\n                                                name=\"modeloNota\" [(ngModel)]=\"data.modNota\"\r\n                                                (change)=\"selectedModeloNota($event)\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" required=\"true\">\r\n                                                <option *ngFor=\"let item of modNotas\" value=\"{{ item.modeloNotaId }}\">{{\r\n                                                    item.descrModNota }}</option>\r\n                                            </select>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"chaveNFe\"\r\n                                                [class.required]=\"isRequiredDadosNfe && service.obrChaveNFeEnt && (data.modNota && data.modNota === '55')\">{{'labels.chaveNFE'\r\n                                                | translate}}</label>\r\n                                            <div class=\"input-group\">\r\n                                                <input type=\"text\" id=\"chaveNFe\" name=\"chaveNfe\"\r\n                                                    class=\"form-control form-control-sm\" [(ngModel)]=\"data.chaveNFE\"\r\n                                                    [disabled]=\"funcoesService.isDetail(actionForm) || (data.modNota && data.modNota !== '55')\"\r\n                                                    [required]=\"isRequiredDadosNfe && service.obrChaveNFeEnt && (data.modNota && data.modNota === '55')\"\r\n                                                    data-title=\"{{'labels.chaveNFE' | translate}}\"\r\n                                                    mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\"\r\n                                                    (blur)=\"validaChaveNfe()\">\r\n                                                <span class=\"input-group-btn\">\r\n                                                    <button type=\"button\" class=\"btn btn-success btn-sm\"\r\n                                                        [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                        (click)=\"importarDanfe(data.chaveNFE)\" title=\"Importa DANFE\"> <i\r\n                                                            class=\"fa fa-search\"></i>\r\n                                                    </button>\r\n                                                </span>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label\r\n                                                [class.required]=\"isRequiredDadosNfe && service.obrigaSerieNf\">{{'labels.serie'\r\n                                                | translate}}</label>\r\n                                            <app-combo-serie-nota id=\"serie\" name=\"serie\" [(ngModel)]=\"data.serieNF\"\r\n                                                [disabled]=\"isDisabledDanfeImportada\"\r\n                                                [required]=\"isRequiredDadosNfe && service.obrigaSerieNf\">\r\n                                            </app-combo-serie-nota>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"nota\" class=\"required\">{{'labels.notaFiscal' |\r\n                                                translate}}</label>\r\n                                            <input type=\"text\" id=\"nota\" name=\"nota\"\r\n                                                class=\"form-control form-control-sm\" [(ngModel)]=\"data.nota\"\r\n                                                [disabled]=\"isDisabledDanfeImportada\" required\r\n                                                data-title=\"{{'labels.nota' | translate}}\" (blur)=\"validaNota()\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"emissao\" class=\"required\">{{'labels.emissao' |\r\n                                                translate}}</label>\r\n                                            <app-data id=\"emissao\" name=\"emissao\" [(ngModel)]=\"data.dtEmissao\" required\r\n                                                [disabled]=\"isDisabledDanfeImportada\" class=\"dataHora\"\r\n                                                [formatDateTime]=\"mascara.getFormatData\"\r\n                                                (executa)=\"validaDtEmissao({'dtEmissao': $event})\"></app-data>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-12\">\r\n                                        <div class=\"custom-control custom-checkbox\">\r\n                                            <input id=\"rateio\" name=\"rateio\" [ngModel]=\"data.flagCompl === 'S'\"\r\n                                                (ngModelChange)=\"data.flagCompl=$event?'S':'N'\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                                            <label class=\"custom-control-label\" for=\"rateio\">{{'labels.complementar' |\r\n                                                translate}}</label>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"observacoes\">{{'labels.observacoes' | translate}}</label>\r\n                                            <textarea id=\"observacoes\" name=\"observacoes\" [(ngModel)]=\"data.observ\"\r\n                                                class=\"form-control\" rows=\"3\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" autofocus\r\n                                                data-title=\"{{'labels.observacoes' | translate}}\"></textarea>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"tab-pane\" id=\"itens\">\r\n                                <app-nota-entrada-item *ngIf=\"showComponents\" [data]=\"data\" [item]=\"item\" [object]=\"obj\"\r\n                                    [isDetail]=\"funcoesService.isDetail(actionForm)\"\r\n                                    (selectedItem)=\"selectedItem($event)\" (response)=\"updateShowButtom($event)\">\r\n                                </app-nota-entrada-item>\r\n                            </div>\r\n                            <div class=\"tab-pane\" id=\"totais\">\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"kilos\">{{'labels.totalEmKilos' | translate}}</label>\r\n                                            <input id=\"kilos\" name=\"kilos\" type=\"text\" disabled currencyMask\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                                                [(ngModel)]=\"data.kilos\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"litros\">{{'labels.totalEmLitros' | translate}}</label>\r\n                                            <input id=\"litros\" name=\"litros\" type=\"text\" disabled currencyMask\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                                                [(ngModel)]=\"data.litros\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"vlMerc\">{{'labels.valorDasMercadorias' | translate}}</label>\r\n                                            <input id=\"vlMerc\" name=\"vlMerc\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                (blur)=\"trataVlNota()\"\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.vlMerc\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"basIcm\">{{'labels.baseDeCalcICMS' | translate}}</label>\r\n                                            <input id=\"basIcm\" name=\"basIcm\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.basIcm\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"basIpi\">{{'labels.baseDeCalcIPI' | translate}}</label>\r\n                                            <input id=\"basIpi\" name=\"basIpi\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.basIpi\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"vlIcms\">{{'labels.valorDoICMS' | translate}}</label>\r\n                                            <input id=\"vlIcms\" name=\"vlIcms\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.vlIcms\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"vlIpi\">{{'labels.valorDoIPI' | translate}}</label>\r\n                                            <input id=\"vlIpi\" name=\"vlIpi\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                (blur)=\"trataVlNota()\"\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.vlIpi\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"vlDesc\">{{'labels.valorDoDesconto' | translate}}</label>\r\n                                            <input id=\"vlDesc\" name=\"vlDesc\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                (blur)=\"trataVlNota()\"\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.vlDesc\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"vlNota\">{{'labels.totalDaNF' | translate}}</label>\r\n                                            <input id=\"vlNota\" name=\"vlNota\" type=\"text\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                                (blur)=\"trataVlNota()\"\r\n                                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\r\n                                                [(ngModel)]=\"data.vlNota\" class=\"form-control form-control-sm\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\" *ngIf=\"showButton\">\r\n                            <div class=\"col-6 col-12\">\r\n                                <div class=\"form-group\">\r\n                                    <button class=\"btn btn-success mr-2\" type=\"submit\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        {{ 'buttons.salvar' | translate }}\r\n                                    </button>\r\n                                    <button class=\"btn btn-default\" type=\"button\" (click)=\"onCancelar()\">\r\n                                        {{ 'buttons.cancelar' | translate }}\r\n                                    </button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </form>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.html":
/*!****************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.html ***!
  \****************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaIndex\" [formAction]=\"actionForm\" [itemData]=\"data.regNota\"\r\n    [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <table id=\"dtConsulta\" class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\r\n</div>\r\n\r\n<app-propriedades></app-propriedades>\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-nota-entrada-filter (filtrar)=\"executaFiltro()\"></app-nota-entrada-filter>\r\n<app-pesquisa-autorizacao [inFiltro]=\"filtroAutorizacao\"\r\n    (outSelected)=\"createNotaEntrada($event)\"></app-pesquisa-autorizacao>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.html":
/*!**************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.html ***!
  \**************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"container-buttons\">\r\n    <div class=\"btn-group\">\r\n        <a title=\"\" class=\"btn uni-btn btn-sm\" (click)=\"back()\" *ngIf=\"!showTable\">\r\n            <i class=\"icon-arrow-left _white\"></i>\r\n        </a>\r\n        <a title=\"{{ 'buttons.novo' | translate }}\" class=\"btn uni-btn btn-sm\" *ngIf=\"showTable\"\r\n            [ngClass]=\"{'opacity': isDetail == true ? true: false}\" (click)=\"new()\">\r\n            <i class=\"icon-plus _white\"></i>\r\n        </a>\r\n        <a title=\"{{ 'buttons.visualizar' | translate }}\" class=\"btn uni-btn btn-sm opacity\" *ngIf=\"showTable\"\r\n            [ngClass]=\"{'opacity': item?.notaFiscalItemId == null ? true: false}\" (click)=\"show()\">\r\n            <i class=\"icon-eye _white\"></i>\r\n        </a>\r\n        <a title=\"{{ 'buttons.editar' | translate }}\" class=\"btn uni-btn btn-sm opacity\" *ngIf=\"showTable || detail\"\r\n            [ngClass]=\"{'opacity': (item?.notaFiscalItemId == null ? true: false) || (isDetail == true ? true: false)}\"\r\n            (click)=\"edit()\">\r\n            <i class=\"icon-pencil _white\"></i>\r\n        </a>\r\n        <a title=\"{{ 'buttons.excluir' | translate }}\" *ngIf=\"showTable\" class=\"btn uni-btn btn-sm opacity\"\r\n            [ngClass]=\"{'opacity': ((item?.notaFiscalItemId == null && !item?.notMapped) ? true: false) || (isDetail == true ? true: false)}\"\r\n            (click)=\"delete(item)\">\r\n            <i class=\"icon-close _white\"></i>\r\n        </a>\r\n    </div>\r\n</div>\r\n<table class=\"table table-striped table-bordered table-hover rownowrap form-control-sm\" *ngIf=\"showTable\">\r\n    <tr>\r\n        <th class=\"text-center\">{{ 'labels.autorizacao' | translate }}</th>\r\n        <th class=\"text-center\">{{ 'labels.item' | translate }}</th>\r\n        <th class=\"text-center\">{{ 'labels.produto' | translate }}</th>\r\n        <th class=\"text-center\">{{ 'labels.descricao' | translate }}</th>\r\n        <th class=\"text-center\">{{ 'labels.quantidade' | translate }}</th>\r\n        <th class=\"text-center\">{{ 'labels.preco' | translate }}</th>\r\n        <th class=\"text-center\">{{ 'labels.valorTotal' | translate }}</th>\r\n    </tr>\r\n    <tbody>\r\n        <tr *ngFor=\"let val of data.itens | removeExcluidos;let i = index\" (click)=\"selected(val, i)\"\r\n            [ngClass]=\"{'info':i === _index && item.notaFiscalItemId === val.notaFiscalItemId }\">\r\n            <td class=\"text-center\">{{val.autorizacao}}</td>\r\n            <td class=\"text-center\">{{val.notaFiscalItemId}}</td>\r\n            <td class=\"text-center\">{{val.material}}</td>\r\n            <td class=\"text-center\">{{val.descrMater}}</td>\r\n            <td class=\"text-center\">{{val.pesodoc | formatCurrency}}</td>\r\n            <td class=\"text-center\">{{val.preco | formatCurrency: 9}}</td>\r\n            <td class=\"text-center\">{{val.totItem | formatCurrency: 2}}</td>\r\n        </tr>\r\n        <tr *ngIf=\"!data.itens || data.itens.length === 0\">\r\n            <th colspan=\"7\">\r\n                {{'messages.nenhumRegistroEncontrado' | translate }}\r\n            </th>\r\n        </tr>\r\n    </tbody>\r\n</table>\r\n<form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\" *ngIf=\"!showTable\" autocomplete=\"off\">\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <div class=\"form-group\">\r\n                    <label for=\"notaFiscalItemId\">{{'labels.item' | translate}}</label>\r\n                    <input type=\"notaFiscalItemId\" id=\"notaFiscalItemId\" name=\"notaFiscalItemId\"\r\n                        class=\"form-control form-control-sm\" [(ngModel)]=\"item.notaFiscalItemId\" disabled>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"autorizacao\">{{'labels.autorizacao' | translate}}</label>\r\n                <div class=\"input-group\">\r\n                    <input id=\"autorizacao\" name=\"autorizacao\" [(ngModel)]=\"item.autorizacao\"\r\n                        class=\"form-control form-control-sm\" type=\"text\" (blur)=\"buscaPorAutorizacao();\"\r\n                        [disabled]=\"disabledAutorizacao\">\r\n                    <div class=\"input-group-prepend\">\r\n                        <button type=\"button\" class=\"input-group-text\" data-toggle=\"modal\" (click)=\"opnModal();\"\r\n                            [disabled]=\"disabledAutorizacao\">\r\n                            <i class=\"fa fa-search\"></i>\r\n                        </button>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <app-pesquisa-saldo-lote-deposito id=\"lote\" name=\"lote\" required=\"true\" [modalTitle]=\"'lotes'\"\r\n                    [disabled]=\"detail === true || autorizacaoConfirmada === false? true: null\" [field]=\"'loteId'\"\r\n                    [options]=\"saldoLoteOptions\" [(ngModel)]=\"item.loteId\" (outModel)=\"trataLote($event)\">\r\n                </app-pesquisa-saldo-lote-deposito>\r\n            </div>\r\n        </div>\r\n    </div> \r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"operacao\" class=\"required\">{{\"labels.operacao\" | translate}}</label>\r\n                <select class=\"form-control form-control-sm\" id=\"operacao\" name=\"operacao\" [(ngModel)]=\"item.operacao\"\r\n                    [disabled]=\"detail === true || autorizacaoConfirmada === false? true: null\" required>\r\n                    <option value=\"\">{{'labels.selecione' | translate}}</option>\r\n                    <option *ngFor=\"let item of operation\" [value]=\"item.operacaoId\">{{ item.descrOperacao }}\r\n                    </option>\r\n                </select>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6 col-md-12 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <app-pesquisa-material id=\"materialId\" name=\"materialId\" label=\"produto\" modalTitle=\"pesquisaDeProduto\"\r\n                    [(ngModel)]=\"item.materialId\" [inSelected]=\"item.materialItem\" disabled>\r\n                </app-pesquisa-material>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6 col-md-12 col-sm-12\">\r\n            <input id=\"nomeArmazenado\" type=\"text\" class=\"form-control form-control-sm\" name=\"nomeArmazenado\"\r\n                [ngModel]=\"item.nomearmazenado\" readonly>\r\n        </div>\r\n    </div>\r\n    <div class=\"clearfix\">&nbsp;</div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-2 col-md-10 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"densidade\">{{'labels.densidade' | translate}}</label>\r\n                <input id=\"densidade\" name=\"densidade\" type=\"text\" disabled currencyMask\r\n                    [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 5 }\" [(ngModel)]=\"item.densidade\"\r\n                    maxlength=\"7\" class=\"form-control form-control-sm\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\" [label]=\"'deposito'\"\r\n                    [modalTitle]=\"'deposito'\"\r\n                    [disabled]=\"detail === true || autorizacaoConfirmada === false ? true: false\" [field]=\"'tanqueId'\"\r\n                    [options]=\"saldoDepositoOptions\" [(ngModel)]=\"item.tanqueId\">\r\n                </app-pesquisa-saldo-lote-deposito>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"pesoDoc\" [class.required]=\"data.flagCompl !== 'S'\">{{'labels.pesoDocumento' |\r\n                    translate}}</label>\r\n                <input id=\"pesoDoc\" name=\"pesoDoc\" [(ngModel)]=\"item.pesodoc\" class=\"form-control form-control-sm\"\r\n                    type=\"text\" [disabled]=\"detail === true|| autorizacaoConfirmada === false? true: null\" currencyMask\r\n                    [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                    [required]=\"data.flagCompl !== 'S'\" (blur)=\"validaPesoDoc()\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"quantidDoc\"\r\n                    [class.required]=\"data.flagCompl !== 'S' || unidadeId === 'LT' || unidadeId === 'CC'\">{{'labels.litrosCc'\r\n                    | translate}}</label>\r\n                <input id=\"quantidDoc\" name=\"quantidDoc\" [(ngModel)]=\"item.quantidDoc\"\r\n                    class=\"form-control form-control-sm\" type=\"text\"\r\n                    [disabled]=\"detail === true || autorizacaoConfirmada === false? true: null\" currencyMask\r\n                    [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                    [required]=\"data.flagCompl !== 'S' || unidadeId === 'LT' || unidadeId === 'CC'\"\r\n                    (blur)=\"validaQuantidDoc()\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"quantid\" [class.required]=\"data.flagCompl !== 'S'\">{{'labels.quantidade' |\r\n                    translate}}</label>\r\n                <input id=\"quantid\" name=\"quantid\" [(ngModel)]=\"item.quantid\" class=\"form-control form-control-sm\"\r\n                    type=\"text\" [disabled]=\"detail === true || autorizacaoConfirmada === false? true: null\" currencyMask\r\n                    [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                    [required]=\"data.flagCompl !== 'S'\" (blur)=\"validaQuantid()\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"precoArmazenado\">{{'labels.precoUnitario' | translate}}</label>\r\n                <input id=\"precoArmazenado\" name=\"precoArmazenado\" [(ngModel)]=\"item.precoArmazenado\"\r\n                    class=\"form-control form-control-sm\" type=\"text\" disabled currencyMask\r\n                    [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 9 }\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"valorTotal\">{{'labels.valorTotal' | translate}}</label>\r\n                <input id=\"valorTotal\" name=\"valorTotal\" [(ngModel)]=\"item.totItem\" class=\"form-control form-control-sm\"\r\n                    type=\"text\" [disabled]=\"detail === true || autorizacaoConfirmada === false? true: null\" currencyMask\r\n                    [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"loteOrigem\">{{'labels.loteOrigem' | translate}}</label>\r\n                <input type=\"text\" class=\"form-control form-control-sm\" id=\"loteOrigem\" name=\"loteOrigem\"\r\n                    [(ngModel)]=\"item.loteIdOrigem\" [disabled]=\"((detail === true) || (update === true))? true: null\"\r\n                    maxlength=\"20\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"nrFatura\">{{'labels.nrFatura' | translate}}</label>\r\n                <input type=\"text\" class=\"form-control form-control-sm\" id=\"nrFatura\" name=\"nrFatura\"\r\n                    [(ngModel)]=\"item.nrFatura\" [disabled]=\"((detail === true) || (update === true))? true: null\"\r\n                    currencyMask [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"nrPedido\">{{'labels.nrPedido' | translate}}</label>\r\n                <input type=\"text\" class=\"form-control form-control-sm\" id=\"nrPedido\" name=\"nrPedido\"\r\n                    [(ngModel)]=\"item.nrPedido\" [disabled]=\"((detail === true) || (update === true))? true: null\"\r\n                    maxlength=\"20\">\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <button class=\"btn btn-success mr-1\" type=\"submit\" [disabled]=\"isDetail || detail\">{{ 'buttons.salvar' |\r\n                    translate }}\r\n                </button>\r\n                <button class=\"btn btn-default mr-1\" type=\"button\" (click)=\"onCancelar(2)\"\r\n                    [disabled]=\"isDetail || detail\">{{ 'buttons.cancelar' | translate }}\r\n                </button>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</form>\r\n<app-pesquisa-autorizacao [inFiltro]=\"filtroAutorizacao\" (outSelected)=\"selectedAutorizacao($event)\">\r\n</app-pesquisa-autorizacao>");

/***/ }),

/***/ "./src/app/pages/cadastro/operacao/operacao.model.ts":
/*!***********************************************************!*\
  !*** ./src/app/pages/cadastro/operacao/operacao.model.ts ***!
  \***********************************************************/
/*! exports provided: Operacao, OperacaoFilter, OperacaoDto, ClassTribCst, ClassTribComboBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Operacao", function() { return Operacao; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OperacaoFilter", function() { return OperacaoFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OperacaoDto", function() { return OperacaoDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassTribCst", function() { return ClassTribCst; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassTribComboBox", function() { return ClassTribComboBox; });
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var Operacao = /** @class */ (function (_super) {
    __extends(Operacao, _super);
    function Operacao() {
        var _this = _super.call(this) || this;
        _this.destino = "";
        _this.rec50Ipi = "N";
        _this.exibe = "N";
        _this.fatura = "N";
        _this.flagSemQtd = "N";
        _this.altDescrMater = "N";
        _this.ordProducao = "N";
        _this.geraCOrdem = "N";
        _this.flagRetorno = "N";
        _this.flagRetSimbolico = "N";
        _this.flagCtrDevolucao = "N";
        _this.flagServ = "N";
        _this.ir = "N";
        _this.csl = "N";
        _this.retCsl = "N";
        _this.pis = "N";
        _this.retPis = "N";
        _this.credPis = "N";
        _this.cofins = "N";
        _this.retCofins = "N";
        _this.credCofins = "N";
        _this.iss = "N";
        _this.retIss = "N";
        _this.inss = "N";
        _this.dedInss = "N";
        _this.ipi = "N";
        _this.destIpi = "N";
        _this.icms = "N";
        _this.icmsDif = "N";
        _this.cFiscalDif = "N";
        _this.icmsRet = "N";
        _this.flagStOutras = "N";
        _this.flagBoletoSt = "N";
        _this.flagStObserv = "N";
        _this.icmsBase = "N";
        _this.dedIcms = "N";
        _this.redComoDesc = "N";
        _this.flagIcmsObserv = "N";
        _this.icmSIpi = "N";
        _this.ii = "N";
        _this.aliqFatorIi = "N";
        _this.trib = "N";
        _this.consFinal = "N";
        _this.estoque = "N";
        _this.recIcms = "N";
        _this.somaIcmsSt = "N";
        _this.subtraiPis = "N";
        _this.rec50Ipi = "N";
        _this.recIpi = "N";
        _this.movEstLivre = "N";
        _this.terceiros = "N";
        _this.acaoTerc = "E";
        _this.tipoTerc = "N";
        _this.escritura = "N";
        _this.escrVal = "N";
        _this.escrituraPisCofins = "N";
        _this.tribIcms = "";
        _this.emsUnidNegocio = "";
        _this.integraCCT = "N";
        _this.flagMob = "N";
        _this.flagEmailTransp = "N";
        _this.codIcm = "1";
        _this.codIpi = "1";
        return _this;
    }
    return Operacao;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var OperacaoFilter = /** @class */ (function () {
    function OperacaoFilter() {
        this.descrOperacao = "";
        this.naturezaId = "";
        this.origem = "E";
        this.operacaoId = 0;
    }
    return OperacaoFilter;
}());

var OperacaoDto = /** @class */ (function (_super) {
    __extends(OperacaoDto, _super);
    function OperacaoDto() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return OperacaoDto;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var ClassTribCst = /** @class */ (function (_super) {
    __extends(ClassTribCst, _super);
    function ClassTribCst() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return ClassTribCst;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var ClassTribComboBox = /** @class */ (function () {
    function ClassTribComboBox() {
    }
    return ClassTribComboBox;
}());



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component.ts":
/*!**************************************************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component.ts ***!
  \**************************************************************************************************/
/*! exports provided: NotaEntradaFilterComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaFilterComponent", function() { return NotaEntradaFilterComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../nota-entrada.constants */ "./src/app/pages/controle/nota-entrada/nota-entrada.constants.ts");
/* harmony import */ var _nota_entrada_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../nota-entrada.service */ "./src/app/pages/controle/nota-entrada/nota-entrada.service.ts");
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var NotaEntradaFilterComponent = /** @class */ (function () {
    function NotaEntradaFilterComponent(service) {
        this.service = service;
        this.filtrar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["Mascaras"]();
        this.constantes = new _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_3__["NotaEntradaConstants"]();
    }
    NotaEntradaFilterComponent.prototype.ngOnInit = function () {
    };
    NotaEntradaFilterComponent.prototype.onSubmit = function (form) {
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        this.filtrar.emit();
        jQuery("#nota-entrada-filter-dialog").modal("hide");
    };
    NotaEntradaFilterComponent.ctorParameters = function () { return [
        { type: _nota_entrada_service__WEBPACK_IMPORTED_MODULE_4__["NotaEntradaService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], NotaEntradaFilterComponent.prototype, "filtrar", void 0);
    NotaEntradaFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-nota-entrada-filter",
            template: __importDefault(__webpack_require__(/*! raw-loader!./nota-entrada-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_nota_entrada_service__WEBPACK_IMPORTED_MODULE_4__["NotaEntradaService"]])
    ], NotaEntradaFilterComponent);
    return NotaEntradaFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.ts":
/*!**********************************************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.ts ***!
  \**********************************************************************************************/
/*! exports provided: NotaEntradaFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaFormComponent", function() { return NotaEntradaFormComponent; });
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _cadastro_modelo_nota_modelo_nota_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../cadastro/modelo-nota/modelo-nota.service */ "./src/app/pages/cadastro/modelo-nota/modelo-nota.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _nota_fiscal_nota_fiscal_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../nota-fiscal/nota-fiscal.service */ "./src/app/pages/nota-fiscal/nota-fiscal.service.ts");
/* harmony import */ var _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../nota-entrada.constants */ "./src/app/pages/controle/nota-entrada/nota-entrada.constants.ts");
/* harmony import */ var _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../nota-entrada.model */ "./src/app/pages/controle/nota-entrada/nota-entrada.model.ts");
/* harmony import */ var _nota_entrada_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../nota-entrada.service */ "./src/app/pages/controle/nota-entrada/nota-entrada.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};























var NotaEntradaFormComponent = /** @class */ (function (_super) {
    __extends(NotaEntradaFormComponent, _super);
    function NotaEntradaFormComponent(router, messageService, activatedRoute, service, funcoesService, permissoesUtils, configuracao, loginService, modeloNotaService, destinatarioService, notaFiscalService, materialService, loteService) {
        var _this = _super.call(this, new _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_18__["NotaEntradaConstants"](), funcoesService) || this;
        _this.router = router;
        _this.messageService = messageService;
        _this.activatedRoute = activatedRoute;
        _this.service = service;
        _this.funcoesService = funcoesService;
        _this.permissoesUtils = permissoesUtils;
        _this.configuracao = configuracao;
        _this.loginService = loginService;
        _this.modeloNotaService = modeloNotaService;
        _this.destinatarioService = destinatarioService;
        _this.notaFiscalService = notaFiscalService;
        _this.materialService = materialService;
        _this.loteService = loteService;
        _this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__["NotaEntrada"]();
        _this.dataOld = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__["NotaEntrada"]();
        _this.mensagens = [];
        _this.constantes = new _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_18__["NotaEntradaConstants"]();
        _this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_6__["Mascaras"]();
        _this.hasDados = false;
        _this.avancar = true;
        _this.target = _this.funcoesService.getTargetLocation();
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    NotaEntradaFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.showButton = true;
        this.modNotas = [];
        this.importaDanfeTmp = "N";
        this.item = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__["NotaEntradalItem"]();
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, this.permissoesUtils.getLibRotina(this.actionForm), function () {
            var id = _this.activatedRoute.snapshot.paramMap.get("id");
            if (id) {
                _this.preEdit(id);
            }
            else {
                _this.activatedRoute.queryParams.subscribe(function (params) {
                    var obj = params['key'];
                    if (!obj)
                        _this.back();
                    _this.preCreate(obj);
                });
            }
        }, function () { return _this.permissoesUtils.back(); });
        this.modeloNotaService.get().subscribe(function (resp) {
            if (resp) {
                _this.modNotas = resp.filter(function (val) {
                    if (val.flagAtivo === "S" && val.sitReg !== 'E') {
                        return val;
                    }
                });
            }
        });
    };
    NotaEntradaFormComponent.prototype.preCreate = function (obj) {
        var _this = this;
        this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__["NotaEntrada"]();
        if (obj) {
            var object = JSON.parse(atob(obj));
            this.obj = object;
            this.data.autorizacao = object.autorizacao;
            this.data.nota = object.nota;
            this.data.serieNF = object.serie;
            this.data.modNota = object.modNota;
            this.data.chaveNFE = object.chaveNFE;
            var dtEscritura = moment__WEBPACK_IMPORTED_MODULE_5__(object.dtEscritura).format('YYYY,MM,DD,HH,mm').split(',');
            var dtEmissao = moment__WEBPACK_IMPORTED_MODULE_5__(object.dtEmissao).format('YYYY,MM,DD,HH,mm').split(',');
            this.data.dtEmissao = new Date(new Date(+dtEmissao[0], +dtEmissao[1] - 1, +dtEmissao[2], +dtEmissao[3], +dtEmissao[4]));
            this.data.dtEscritura = new Date(new Date(+dtEscritura[0], +dtEscritura[1] - 1, +dtEscritura[2], +dtEscritura[3], +dtEscritura[4]));
            this.data.destinatarioIdCliente = object.codDest;
            if (this.funcoesService.isPositive(object.codDest)) {
                this.destinatarioService.getById(object.codDest).subscribe(function (resp) {
                    if (resp) {
                        _this.data.cliente = resp;
                    }
                });
            }
            this.dtSaidaTmp = new Date(object.dtSaida);
            this.importaDanfeTmp = object.importaDanfe;
            this.notaTmp = object.nota;
            this.data.loteId = object.lote;
            this.getLote();
            this.data.densidade = object.densidade;
            this.data.operacao = object.operacao;
            this.data.materialId = object.material;
            this.data.tanqueId = object.deposito;
            this.data.pesodoc = object.pesodoc;
            this.data.quantidDoc = object.quantidDoc;
            this.data.quantid = object.quantid;
            this.data.precoArmazenado = object.precoArmazenado;
            this.data.totItem = object.totItem;
            this.showComponents = true;
            if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(this.data.dtEscritura, ['H', 'M'])) {
                this.messageService.warning("titles.notaEntrada", "messages.dataNaoPodeSerMaiorQueAtual");
            }
            else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(this.data.dtEscritura, this.dtSaidaTmp, ['H', 'M'])) {
                this.messageService.warning("titles.notaEntrada", "messages.dtEntradaNaoPodeSerMenorQueDtSaida");
            }
            else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(this.data.dtEscritura, this.service.dtSeguro, ['H', 'M'])) {
                this.messageService.warning("titles.notaEntrada", "messages.dataNaoPodeSerMenorFechamentoSeg");
            }
            else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(this.data.dtEscritura, this.service.fechamentoEst, ['H', 'M'])) {
                this.messageService.warning("titles.notaEntrada", "messages.dataAnteriorFechamentoCont");
            }
            else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(this.data.dtEscritura, this.service.fechamentoFis, ['H', 'M'])) {
                this.messageService.warning("titles.notaEntrada", "messages.dataAnteriorFechamentoFiscal");
            }
        }
    };
    NotaEntradaFormComponent.prototype.preEdit = function (regNota) {
        var _this = this;
        this.service.getById(regNota).subscribe(function (r) { return __awaiter(_this, void 0, void 0, function () {
            var i, currentMaterial, i, j;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.data = r;
                        this.data.regNota = r.notaFiscalId;
                        this.data.pedidoId = r.logDePedidos.pedidoId;
                        this.data.regPedido = r.regPedido;
                        this.data.observ = r.observacoes;
                        this.notaTmp = this.data.nota;
                        this.dataOld = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_22__["ObjectUtilsStaticService"].clone(this.data);
                        this.service.getMinAutorizacao({ regNota: regNota }).subscribe(function (resp) {
                            _this.data.autorizacao = resp;
                            _this.getTmpWebDadosAutorizacao();
                        });
                        this.data.itens = r.notaFiscalItens;
                        i = 0;
                        _a.label = 1;
                    case 1:
                        if (!(i < this.data.itens.length)) return [3 /*break*/, 5];
                        if (!(this.data.itens[i].descrMater.trim() === "")) return [3 /*break*/, 3];
                        currentMaterial = void 0;
                        return [4 /*yield*/, this.materialService.getById(this.data.itens[i].material).toPromise()];
                    case 2:
                        currentMaterial = _a.sent();
                        if (currentMaterial) {
                            this.data.itens[i].descrMater = currentMaterial.descrMater;
                        }
                        _a.label = 3;
                    case 3:
                        this.data.itens[i].notaFiscalId = this.data.regNota;
                        _a.label = 4;
                    case 4:
                        i++;
                        return [3 /*break*/, 1];
                    case 5:
                        this.data.itemDados = r.notaFiscalDadosItens;
                        for (i = 0; i < this.data.itens.length; i++) {
                            for (j = 0; j < this.data.itemDados.length; j++) {
                                if (this.data.itens[i].notaFiscalItemId === this.data.itemDados[j].item) {
                                    this.data.itens[i].loteId = this.data.itemDados[j].lote;
                                    this.data.itens[i].tanqueId = this.data.itemDados[j].deposito;
                                    this.data.itens[i].pesodoc = this.data.itemDados[j].kilos;
                                    this.data.itens[i].litros = this.data.itemDados[j].litros;
                                    this.data.itens[i].autorizacao = this.data.itemDados[j].autorizacao;
                                }
                            }
                        }
                        this.service.liberacaoProdutoTotais({ regNota: regNota }).subscribe(function (ret) {
                            _this.data.kilos = ret.kilos;
                            _this.data.litros = ret.litros;
                            _this.data.vlMerc = (ret.vlNota + ret.vlIpi) - ret.vlDesc;
                            _this.data.basIcm = ret.basIcm;
                            _this.data.basIpi = ret.basIpi;
                            _this.data.vlIcms = ret.vlIcms;
                            _this.data.vlIpi = ret.vlIpi;
                            _this.data.vlDesc = ret.vlDesc;
                            _this.data.vlNota = ret.vlNota;
                        });
                        this.showComponents = true;
                        return [2 /*return*/];
                }
            });
        }); });
    };
    NotaEntradaFormComponent.prototype.loadConfig = function () {
        this.service.dtSeguro = this.configuracao.lerConfig("CTR", "DtSeguro");
        this.service.fechamentoEst = this.configuracao.lerConfig("MAT", "FechamentoEst");
        this.service.fechamentoFis = this.configuracao.lerConfig("LIV", "FechamentoFis");
        this.service.obrChaveNFeEnt = this.configuracao.lerConfig("UNI", "ObrChaveNFeEnt") === "S" ? true : false;
        this.service.obrigaSerieNf = this.configuracao.lerConfig("STO", "ObrigaSerieNf") === "S" ? true : false;
    };
    NotaEntradaFormComponent.prototype.onSubmit = function (form, create) {
        if (create === void 0) { create = false; }
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_21__["EventEmitterService"].get("formError").emit(form);
                        if (form.invalid) {
                            return [2 /*return*/];
                        }
                        if (this.data.modNota === "55" && !this.validaChaveNfe()) {
                            return [2 /*return*/];
                        }
                        if (!this.validaDatas(this.data)) {
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.validaNota()];
                    case 1:
                        if (!_a.sent()) return [3 /*break*/, 3];
                        return [4 /*yield*/, this.calculaDif()];
                    case 2:
                        _a.sent();
                        this.data.logRotina = "Nota de Entrada";
                        this.service
                            .save(this.data, this.funcoesService.isEdit(this.actionForm))
                            .subscribe(function (result) {
                            if (!result.validationResult.isValid) {
                                _this.mensagens = _this.messageService.validationResult(result.validationResult);
                                if (_this.mensagens.length > 0 && _this.mensagens[0] === "Nota Fiscal ja transferida para o EMS") {
                                    _this.messageService.warning("titles.notaEntrada", _this.mensagens[0]);
                                    _this.back();
                                    return;
                                }
                                else {
                                    _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_21__["EventEmitterService"].get("backError").emit(_this.mensagens);
                                    _this.funcoesService.backToTop();
                                }
                            }
                            else {
                                _this.messageService.saveSuccess("titles.notaEntrada");
                                if (create) {
                                    _this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__["NotaEntrada"]();
                                    _this.router.navigate([_this.target + "/controle/liberacaoProduto/notaEntrada"]);
                                }
                                else {
                                    _this.back();
                                }
                            }
                        });
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaFormComponent.prototype.calculaDif = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.data.difBasIcm = (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.basIcm) - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.dataOld.basIcm));
                this.data.difBasIpi = (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.basIpi) - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.dataOld.basIpi));
                this.data.difVlIcms = (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.vlIcms) - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.dataOld.vlIcms));
                this.data.difVlIpi = (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.vlIpi) - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.dataOld.vlIpi));
                return [2 /*return*/];
            });
        });
    };
    NotaEntradaFormComponent.prototype.edit = function () {
        if (!!this.data.regNota) {
            this.router.navigate([this.target + "/controle/notaEntrada/edit/" + this.data.regNota]);
        }
    };
    NotaEntradaFormComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate([this.target + "/controle/notaEntrada"]);
    };
    NotaEntradaFormComponent.prototype.onCancelar = function () {
        this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_19__["NotaEntrada"]();
        this.back();
    };
    NotaEntradaFormComponent.prototype.validaDatas = function (params) {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(params.dtEscritura, ['H', 'M'])) {
            this.messageService.warning("titles.notaEntrada", "messages.dataNaoPodeSerMaiorQueAtual");
            return false;
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(params.dtEscritura, this.dtSaidaTmp, ['H', 'M'])) {
            this.messageService.warning("titles.notaEntrada", "messages.dtEntradaNaoPodeSerMenorQueDtSaida");
            return false;
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(params.dtEscritura, this.service.dtSeguro, ['H', 'M'])) {
            this.messageService.warning("titles.notaEntrada", "messages.dataNaoPodeSerMenorFechamentoSeg");
            return false;
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(params.dtEscritura, this.service.fechamentoEst, ['H', 'M'])) {
            this.messageService.warning("titles.notaEntrada", "messages.dataAnteriorFechamentoCont");
            return false;
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(params.dtEscritura, this.service.fechamentoFis, ['H', 'M'])) {
            this.messageService.warning("titles.notaEntrada", "messages.dataAnteriorFechamentoFiscal");
            return false;
        }
        else {
            return true;
        }
    };
    Object.defineProperty(NotaEntradaFormComponent.prototype, "isRequiredDadosNfe", {
        get: function () {
            if (!this.data)
                return false;
            return this.data.modNota === "55";
        },
        enumerable: true,
        configurable: true
    });
    NotaEntradaFormComponent.prototype.validaChaveNfe = function () {
        if (this.funcoesService.isNotUndefinedOrNull(this.data) && this.funcoesService.isNotUndefinedOrNull(this.data.chaveNFE)) {
            if (this.funcoesService.stringUtils.isEmpty(this.data.nota)) {
                this.data.nota = +this.funcoesService.getNumeroNota(this.data.chaveNFE);
            }
            if (this.funcoesService.stringUtils.isEmpty(this.data.serieNF)) {
                this.data.serieNF = this.funcoesService.getSerieNota(this.data.chaveNFE);
            }
            var result = this.funcoesService.validaChaveNFe(this.data.chaveNFE, this.emitente, this.data.nota, this.data.serieNF);
            if (!result) {
                this.messageService.warning("titles.validacao", "messages.chaveNfeInvalida");
                return false;
            }
            return true;
        }
        return false;
    };
    NotaEntradaFormComponent.prototype.importarDanfe = function (chave) {
        var _this = this;
        if (this.funcoesService.isUndefinedOrNull(chave) || (!this.funcoesService.isUndefinedOrNull(chave) && chave.trim() === '')) {
            this.messageService.info('labels.chaveNFE', 'messages.chaveNfeDeveSerInformada');
            return;
        }
        if (!this.validaChaveNfe())
            return;
        this.funcoesService.nfeHelper.importaDanfe({
            "chave": chave,
            "destinatarioIdCliente": this.data.destinatarioIdCliente
        })
            .subscribe(function (result) {
            if (!result.validationResult.isValid) {
                _this.mensagens = _this.messageService.validationResult(result.validationResult);
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_21__["EventEmitterService"].get("backError").emit(_this.mensagens);
                return;
            }
            _this.data.nfeAuto = "S";
            _this.data.serieNF = result.serie;
            _this.data.nota = result.numero;
            _this.data.dtEmissao = result.dtEmissao;
        });
    };
    Object.defineProperty(NotaEntradaFormComponent.prototype, "isDisabledDanfeImportada", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (!this.data)
                return true;
            if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(this.data.nfeAuto))
                return true;
            if (this.isRequiredDadosNfe && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(this.importaDanfeTmp))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    NotaEntradaFormComponent.prototype.validaDtEmissao = function (params) {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(params.dtEmissao)) {
            this.messageService.warning("titles.notaEntrada", "messages.dataNaoPodeSerMaiorQueAtual");
            return;
        }
    };
    NotaEntradaFormComponent.prototype.validaNota = function () {
        return __awaiter(this, void 0, void 0, function () {
            var confirmation1, resp, confirmation2;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(this.data.nota)) {
                            this.messageService.warning("titles.notaEntrada", "messages.campoObrigatorio", { name: this.messageService.translate("labels.notaFiscal") });
                            return [2 /*return*/, false];
                        }
                        if (!this.funcoesService.isNotUndefinedOrNull(this.notaTmp)) return [3 /*break*/, 7];
                        if (!(this.data.nota !== this.notaTmp)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.showConfirmation("titles.notaEntrada", "messages.numeroNotaDifAutDescargaDesejaContinuar")];
                    case 1:
                        confirmation1 = _a.sent();
                        if (!confirmation1) {
                            this.data.nota = this.notaTmp;
                            return [2 /*return*/, false];
                        }
                        _a.label = 2;
                    case 2:
                        if (!this.funcoesService.isNotUndefinedOrNull(this.data.nota)) return [3 /*break*/, 6];
                        return [4 /*yield*/, this.service.verificaNotaLiberada({
                                regNota: !!this.data.regNota ? this.data.regNota : 0,
                                nota: !!this.data.nota ? this.data.nota : 0,
                                destinatarioIdCliente: !!this.data.destinatarioIdCliente ? this.data.destinatarioIdCliente : 0,
                                destinatarioIdEmitente: 0,
                                serieNf: this.data.serieNF,
                                modNota: this.data.modNota
                            }).toPromise()];
                    case 3:
                        resp = _a.sent();
                        if (!resp) return [3 /*break*/, 5];
                        return [4 /*yield*/, this.showConfirmation("titles.notaEntrada", "messages.notaFiscalJaLancadaDesejaContinuar")];
                    case 4:
                        confirmation2 = _a.sent();
                        if (!confirmation2) {
                            this.data.nota = this.notaTmp;
                            this.data.serieNF = this.dataOld.serieNF;
                            return [2 /*return*/, false];
                        }
                        else {
                            return [2 /*return*/, true];
                        }
                        return [3 /*break*/, 6];
                    case 5: return [2 /*return*/, true];
                    case 6: return [2 /*return*/, false];
                    case 7: return [2 /*return*/, false];
                }
            });
        });
    };
    NotaEntradaFormComponent.prototype.selectedItem = function (event) {
        this.item = event;
    };
    NotaEntradaFormComponent.prototype.updateShowButtom = function (event) {
        this.showButton = event;
    };
    NotaEntradaFormComponent.prototype.getTmpWebDadosAutorizacao = function () {
        var _this = this;
        if (this.funcoesService.isPositive(this.data.autorizacao)) {
            this.service.tmpWebDadosAutorizacaoGetByColaboradorId({
                autorizacao: this.data.autorizacao
            }).subscribe(function (resp) {
                if (resp) {
                    _this.tmpWebDadosAutorizacao = resp;
                    _this.dtSaidaTmp = _this.tmpWebDadosAutorizacao.dtSaida;
                    _this.notaTmp = _this.tmpWebDadosAutorizacao.nota;
                }
            });
        }
    };
    NotaEntradaFormComponent.prototype.selectedModeloNota = function (e) {
        if (!e || (e && (e.target.value === "0" || e.target.value === ""))) {
            return;
        }
        this.data.chaveNFE = null;
    };
    NotaEntradaFormComponent.prototype.getLote = function () {
        return __awaiter(this, void 0, void 0, function () {
            var lote;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.loteService.getByLoteId(this.data.loteId).toPromise()];
                    case 1:
                        lote = _a.sent();
                        if (!!lote) {
                            this.emitente = lote.emitente;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaFormComponent.prototype.showConfirmation = function (title, message) {
        var _this = this;
        return new Promise(function (resolve) {
            _this.messageService.confirm(title, message, null, function () { return resolve(true); }, false, function () { return resolve(false); });
        });
    };
    NotaEntradaFormComponent.prototype.trataVlNota = function () {
        this.data.vlNota = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.vlMerc) + _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.vlIpi) - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.data.vlDesc);
    };
    NotaEntradaFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: _nota_entrada_service__WEBPACK_IMPORTED_MODULE_20__["NotaEntradaService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_8__["ConfiguracaoFacade"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_16__["LoginService"] },
        { type: _cadastro_modelo_nota_modelo_nota_service__WEBPACK_IMPORTED_MODULE_15__["ModeloNotaService"] },
        { type: _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_12__["DestinatarioService"] },
        { type: _nota_fiscal_nota_fiscal_service__WEBPACK_IMPORTED_MODULE_17__["NotaFiscalService"] },
        { type: _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__["MaterialService"] },
        { type: _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_13__["LoteService"] }
    ]; };
    NotaEntradaFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-nota-entrada-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./nota-entrada-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            _nota_entrada_service__WEBPACK_IMPORTED_MODULE_20__["NotaEntradaService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_8__["ConfiguracaoFacade"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_16__["LoginService"],
            _cadastro_modelo_nota_modelo_nota_service__WEBPACK_IMPORTED_MODULE_15__["ModeloNotaService"],
            _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_12__["DestinatarioService"],
            _nota_fiscal_nota_fiscal_service__WEBPACK_IMPORTED_MODULE_17__["NotaFiscalService"],
            _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__["MaterialService"],
            _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_13__["LoteService"]])
    ], NotaEntradaFormComponent);
    return NotaEntradaFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_7__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.ts":
/*!************************************************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.ts ***!
  \************************************************************************************************/
/*! exports provided: NotaEntradaIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaIndexComponent", function() { return NotaEntradaIndexComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.model */ "./src/app/shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.model.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../nota-entrada.constants */ "./src/app/pages/controle/nota-entrada/nota-entrada.constants.ts");
/* harmony import */ var _nota_entrada_model__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../nota-entrada.model */ "./src/app/pages/controle/nota-entrada/nota-entrada.model.ts");
/* harmony import */ var _nota_entrada_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../nota-entrada.service */ "./src/app/pages/controle/nota-entrada/nota-entrada.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};














var NotaEntradaIndexComponent = /** @class */ (function (_super) {
    __extends(NotaEntradaIndexComponent, _super);
    function NotaEntradaIndexComponent(router, messageService, service, datatables, message, funcoes, permissoesUtils, loginService, configuracao) {
        var _this = _super.call(this, new _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_11__["NotaEntradaConstants"](), funcoes) || this;
        _this.router = router;
        _this.messageService = messageService;
        _this.service = service;
        _this.datatables = datatables;
        _this.message = message;
        _this.funcoes = funcoes;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.configuracao = configuracao;
        _this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_12__["NotaEntrada"]();
        _this.constantes = new _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_11__["NotaEntradaConstants"]();
        _this.mensagens = [];
        _this.filtroAutorizacao = new _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_model__WEBPACK_IMPORTED_MODULE_7__["SelecionaAutorizacaoDescargaFiltro"];
        _this.target = _this.funcoes.getTargetLocation();
        _this.confirmRemove = function () {
            _this.messageService.removeConfirm(function () {
                _this.service.remove(_this.data).subscribe(function (result) {
                    if (!result.validationResult.isValid) {
                        _this.mensagens = _this.messageService.validationResult(result.validationResult);
                        _this.messageService.warning("titles.notaEntrada", _this.mensagens[0]);
                    }
                    else {
                        _this.datatables.remove("dtConsulta");
                        _this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_12__["NotaEntrada"]();
                    }
                });
            });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        if (!_this.service.filtro) {
            _this.service.filtro = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_12__["NotaEntradaFilter"]();
        }
        _this.service.filtro.filialId = loginService.getLogin().filialId;
        return _this;
    }
    NotaEntradaIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () {
            if (!_this.loginService.isTokenExpired()) {
                if (_this.funcoes.abrirFiltro) {
                    jQuery("#nota-entrada-filter-dialog").modal("show");
                }
                else {
                    _this.refresh();
                }
            }
        }, function () { return _this.permissoesUtils.back(); }, true);
    };
    NotaEntradaIndexComponent.prototype.create = function () {
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("formError").emit(null);
        jQuery("#pesquisa-autorizacao-dialog").modal("show");
    };
    NotaEntradaIndexComponent.prototype.refresh = function () {
        var _this = this;
        this.service.getByFiltro(this.service.filtro).subscribe(function (data) {
            var columns = [
                _this.datatables.getDataString("tipoMov", "tipo"),
                _this.datatables.getDataString("nota", "nota"),
                _this.datatables.getDataString("serieNF", "serie"),
                _this.datatables.getDataDateTime("dtEmissao", "emissao", "DD/MM/YYYY", "15%"),
                _this.datatables.getDataDateTime("dtEscritura", "escrituracao", "DD/MM/YYYY", "15%"),
                _this.datatables.getDataString("pedido", "pedido"),
                _this.datatables.getDataString("regNota", "recebimento"),
                _this.datatables.getDataString("fantasia", "destinatarioICMS"),
                _this.datatables.getDataString("nomeFilial", "filial"),
            ];
            _this.datatables.toDataTable({ tableId: "dtConsulta", columns: columns, data: data, columnOrder: 4 }, function (aData) {
                _this.data = aData;
            });
        });
    };
    NotaEntradaIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 6, function () {
            _super.prototype.properties.call(_this, _this.data);
        });
    };
    NotaEntradaIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 7, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    NotaEntradaIndexComponent.prototype.filtrar = function () {
        jQuery("#nota-entrada-filter-dialog").modal("show");
    };
    NotaEntradaIndexComponent.prototype.executaFiltro = function () {
        this.refresh();
    };
    NotaEntradaIndexComponent.prototype.detail = function () {
        if (this.funcoes.isNotUndefinedOrNull(this.data.regNota)) {
            this.router.navigate([this.target + "/controle/notaEntrada/detail/" + this.data.regNota]);
        }
    };
    NotaEntradaIndexComponent.prototype.edit = function () {
        if (this.funcoes.isNotUndefinedOrNull(this.data.regNota)) {
            this.router.navigate([this.target + "/controle/notaEntrada/edit/" + this.data.regNota]);
        }
    };
    NotaEntradaIndexComponent.prototype.remove = function () {
        var _this = this;
        if (this.funcoes.isNotUndefinedOrNull(this.data.regNota)) {
            this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () { return __awaiter(_this, void 0, void 0, function () {
                var continua, validaNotaComplementarResult;
                var _this = this;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            continua = true;
                            return [4 /*yield*/, this.service.validaNotaComplementar(this.data.regNota).toPromise()];
                        case 1:
                            validaNotaComplementarResult = _a.sent();
                            if (!validaNotaComplementarResult.isValid) {
                                this.mensagens = this.messageService.validationResult(validaNotaComplementarResult);
                            }
                            continua = validaNotaComplementarResult.isValid;
                            if (!continua) {
                                this.messageService.confirm("titles.notaEntrada", this.mensagens[0], null, function (_) { return _this.confirmRemove(); });
                            }
                            else {
                                this.confirmRemove();
                            }
                            return [2 /*return*/];
                    }
                });
            }); });
        }
    };
    NotaEntradaIndexComponent.prototype.loadConfig = function () {
        this.service.dtSeguro = this.configuracao.lerConfig("CTR", "DtSeguro");
        this.service.fechamentoEst = this.configuracao.lerConfig("MAT", "FechamentoEst");
        this.service.fechamentoFis = this.configuracao.lerConfig("LIV", "FechamentoFis");
        this.service.obrChaveNFeEnt = this.configuracao.lerConfig("UNI", "ObrChaveNFeEnt") === "S" ? true : false;
        this.service.obrigaSerieNf = this.configuracao.lerConfig("STO", "ObrigaSerieNf") === "S" ? true : false;
    };
    NotaEntradaIndexComponent.prototype.createNotaEntrada = function (data) {
        var object = btoa(JSON.stringify({
            autorizacao: data.autorizacao,
            nota: data.nota,
            serie: data.serie,
            modNota: data.modNota,
            chaveNFE: data.chaveNFE,
            dtEmissao: data.dtEmissao,
            dtEscritura: data.dtEscritura,
            codDest: data.codDest,
            dtSaida: data.dtSaida,
            importaDanfe: data.importaDanfe,
            lote: data.lote,
            densidade: data.densidade,
            operacao: data.operacao,
            material: data.material,
            deposito: data.deposito,
            pesodoc: data.pesodoc,
            quantidDoc: data.quantidDoc,
            quantid: data.quantid,
            precoArmazenado: data.precoArmazenado,
            totItem: data.totItem
        }));
        this.router.navigateByUrl("pages/controle/notaEntrada/create?key=" + object);
    };
    NotaEntradaIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"] },
        { type: _nota_entrada_service__WEBPACK_IMPORTED_MODULE_13__["NotaEntradaService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__["DatatablesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_9__["PermissoesUtilsService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_10__["LoginService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_3__["ConfiguracaoFacade"] }
    ]; };
    NotaEntradaIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-nota-entrada-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./nota-entrada-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"],
            _nota_entrada_service__WEBPACK_IMPORTED_MODULE_13__["NotaEntradaService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__["DatatablesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_9__["PermissoesUtilsService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_10__["LoginService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_3__["ConfiguracaoFacade"]])
    ], NotaEntradaIndexComponent);
    return NotaEntradaIndexComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_6__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.scss":
/*!************************************************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.scss ***!
  \************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = (".opacity {\n  opacity: 0.7;\n}\n\ni._white {\n  color: white;\n}\n\ntable tr.active {\n  background-color: #f5f5f5;\n}\n\ndiv.container-buttons {\n  margin-bottom: 5px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvcGFnZXMvY29udHJvbGUvbm90YS1lbnRyYWRhL25vdGEtZW50cmFkYS1pdGVtL0M6XFxDb3Jwb3JhdGVcXENvcnBvcmF0ZVdlYkRlc2VudlxcX3VuaXNvbHV0aW9uL3NyY1xcYXBwXFxwYWdlc1xcY29udHJvbGVcXG5vdGEtZW50cmFkYVxcbm90YS1lbnRyYWRhLWl0ZW1cXG5vdGEtZW50cmFkYS1pdGVtLmNvbXBvbmVudC5zY3NzIiwic3JjL2FwcC9wYWdlcy9jb250cm9sZS9ub3RhLWVudHJhZGEvbm90YS1lbnRyYWRhLWl0ZW0vbm90YS1lbnRyYWRhLWl0ZW0uY29tcG9uZW50LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxZQUFBO0FDQ0Y7O0FERUE7RUFDRSxZQUFBO0FDQ0Y7O0FERUE7RUFDRSx5QkFBQTtBQ0NGOztBREVBO0VBQ0Usa0JBQUE7QUNDRiIsImZpbGUiOiJzcmMvYXBwL3BhZ2VzL2NvbnRyb2xlL25vdGEtZW50cmFkYS9ub3RhLWVudHJhZGEtaXRlbS9ub3RhLWVudHJhZGEtaXRlbS5jb21wb25lbnQuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5vcGFjaXR5IHtcclxuICBvcGFjaXR5OiAwLjc7XHJcbn1cclxuXHJcbmkuX3doaXRlIHtcclxuICBjb2xvcjogd2hpdGU7XHJcbn1cclxuXHJcbnRhYmxlIHRyLmFjdGl2ZSB7XHJcbiAgYmFja2dyb3VuZC1jb2xvcjogI2Y1ZjVmNTtcclxufVxyXG5cclxuZGl2LmNvbnRhaW5lci1idXR0b25zIHtcclxuICBtYXJnaW4tYm90dG9tOiA1cHg7XHJcbn1cclxuIiwiLm9wYWNpdHkge1xuICBvcGFjaXR5OiAwLjc7XG59XG5cbmkuX3doaXRlIHtcbiAgY29sb3I6IHdoaXRlO1xufVxuXG50YWJsZSB0ci5hY3RpdmUge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjVmNWY1O1xufVxuXG5kaXYuY29udGFpbmVyLWJ1dHRvbnMge1xuICBtYXJnaW4tYm90dG9tOiA1cHg7XG59Il19 */");

/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.ts":
/*!**********************************************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.ts ***!
  \**********************************************************************************************/
/*! exports provided: NotaEntradaItemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaItemComponent", function() { return NotaEntradaItemComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../nota-entrada.model */ "./src/app/pages/controle/nota-entrada/nota-entrada.model.ts");
/* harmony import */ var _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _nota_entrada_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../nota-entrada.service */ "./src/app/pages/controle/nota-entrada/nota-entrada.service.ts");
/* harmony import */ var _cadastro_operacao_operacao_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../cadastro/operacao/operacao.model */ "./src/app/pages/cadastro/operacao/operacao.model.ts");
/* harmony import */ var _cadastro_operacao_operacao_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../cadastro/operacao/operacao.service */ "./src/app/pages/cadastro/operacao/operacao.service.ts");
/* harmony import */ var _cadastro_filial_filial_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../cadastro/filial/filial.service */ "./src/app/pages/cadastro/filial/filial.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var _cadastro_nome_armazenado_nome_armazenado_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../cadastro/nome-armazenado/nome-armazenado.service */ "./src/app/pages/cadastro/nome-armazenado/nome-armazenado.service.ts");
/* harmony import */ var _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_model__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.model */ "./src/app/shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.model.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../nota-entrada.constants */ "./src/app/pages/controle/nota-entrada/nota-entrada.constants.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_component__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../../shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.component */ "./src/app/shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.component.ts");
/* harmony import */ var _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../../shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.service */ "./src/app/shared/components/pesquisa/pesquisa-autorizacao/pesquisa-autorizacao.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};























var NotaEntradaItemComponent = /** @class */ (function () {
    function NotaEntradaItemComponent(loginService, materialService, notaEntradaService, message, operacaoService, filialService, funcoesService, loteService, nomeArmazenadoService, destinatarioService, permissoesUtils, servicePesquisaAutorizacao) {
        var _this = this;
        this.loginService = loginService;
        this.materialService = materialService;
        this.notaEntradaService = notaEntradaService;
        this.message = message;
        this.operacaoService = operacaoService;
        this.filialService = filialService;
        this.funcoesService = funcoesService;
        this.loteService = loteService;
        this.nomeArmazenadoService = nomeArmazenadoService;
        this.destinatarioService = destinatarioService;
        this.permissoesUtils = permissoesUtils;
        this.servicePesquisaAutorizacao = servicePesquisaAutorizacao;
        this.response = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.selectedItem = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.detail = false;
        this.update = false;
        this.isEdit = false;
        this.disabledAutorizacao = false;
        this.filtroAutorizacao = new _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_model__WEBPACK_IMPORTED_MODULE_14__["SelecionaAutorizacaoDescargaFiltro"];
        this.autorizacaoConfirmada = false;
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_3__["Mascaras"]();
        this.mensagens = [];
        this.operacao = new _cadastro_operacao_operacao_model__WEBPACK_IMPORTED_MODULE_8__["Operacao"]();
        this.constantes = new _nota_entrada_constants__WEBPACK_IMPORTED_MODULE_17__["NotaEntradaConstants"]();
        this.disabledCamposItens = true;
        this.confirmRemove = function (item) {
            _this.message.removeConfirm(function () {
                _this.notaEntradaService
                    .liberacaoProdutoItemExclui({
                    regNota: _this.regNota,
                    item: _this.itemId,
                    dtEscritura: _this.dtEscritura
                })
                    .subscribe(function (result) {
                    _this.mensagens = _this.message.validationResult(result.validationResult);
                    if (result.validationResult != null && !result.validationResult.isValid) {
                        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__["EventEmitterService"].get("backError").emit(_this.mensagens);
                    }
                    else {
                        var count_1 = 0;
                        _this.data.itens.forEach(function (val) {
                            if (item.notaFiscalItemId === val.notaFiscalItemId && item.notaFiscalItemId && item.notaFiscalItemId === val.notaFiscalItemId) {
                                val.sitReg = 'E';
                            }
                            else if (!item.notaFiscalItemId && item.notaFiscalItemId === val.notaFiscalItemId) {
                                _this.data.itens.splice(count_1, 1);
                            }
                            count_1++;
                        });
                        _this.item = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntradalItem"]();
                        _this.selectedItem.emit(_this.item);
                        /* Aba Totais */
                        var objTotal = {
                            regNota: _this.regNota
                        };
                        _this.notaEntradaService.liberacaoProdutoTotais(objTotal).subscribe(function (ret) {
                            _this.data.kilos = ret.kilos;
                            _this.data.litros = ret.litros;
                            _this.data.vlMerc = (ret.vlNota + ret.vlIpi) - ret.vlDesc;
                            _this.data.basIcm = ret.basIcm;
                            _this.data.basIpi = ret.basIpi;
                            _this.data.vlIcms = ret.vlIcms;
                            _this.data.vlIpi = ret.vlIpi;
                            _this.data.vlDesc = ret.vlDesc;
                            _this.data.vlNota = ret.vlNota;
                        });
                    }
                });
            });
        };
    }
    NotaEntradaItemComponent.prototype.ngOnInit = function () {
        this.getTmpWebDadosAutorizacao();
        this.pesoDoc = 0;
        this.quantidDoc = 0;
        this.quantid = 0;
        this.showTable = true;
        this.material = new _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_5__["Material"]();
        this._index = 0;
    };
    NotaEntradaItemComponent.prototype.back = function () {
        this.response.emit(true);
        this.showTable = true;
        this.material = new _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_5__["Material"]();
        this.item = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntradalItem"]();
        this.selectedItem.emit(this.item);
        this.autorizacaoConfirmada = false;
    };
    NotaEntradaItemComponent.prototype.new = function () {
        if (this.isDetail) {
            return false;
        }
        this.detail = false;
        this.disabledAutorizacao = false;
        this.update = false;
        this.showTable = false;
        this.item = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntradalItem"]();
        if (this.data.itens.length === 0) {
            this.item.autorizacao = this.data.autorizacao;
            this.buscaPorAutorizacao();
        }
        else {
            this.item.autorizacao = 0;
        }
        this.material = new _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_5__["Material"]();
        this.response.emit(false);
    };
    NotaEntradaItemComponent.prototype.selected = function (val, index) {
        this._index = index;
        this.item = val;
        this.selectedItem.emit(this.item);
    };
    NotaEntradaItemComponent.prototype.edit = function () {
        if (!this.item.notaFiscalItemId || this.isDetail) {
            return;
        }
        this.autorizacaoConfirmada = true;
        this.detail = false;
        this.disabledAutorizacao = true;
        this.update = false;
        this.isEdit = true;
        this.showTable = false;
        this.response.emit(false);
        if (this.data.itemDados) {
            for (var i = 0; i < this.data.itemDados.length; i++) {
                if (this.data.itemDados[i].item === this.item.notaFiscalItemId) {
                    this.item.autorizacao = this.data.itemDados[i].autorizacao;
                    this.item.loteId = this.data.itemDados[i].lote;
                    this.item.tanqueId = this.data.itemDados[i].deposito;
                    this.item.pesodoc = this.data.itemDados[i].kilos;
                    this.item.quantidDoc = this.data.itemDados[i].litros;
                    this.item.quantid = this.data.itemDados[i].quantid;
                    this.pesoDoc = this.item.pesodoc;
                    this.quantidDoc = this.item.quantidDoc;
                    this.quantid = this.item.quantid;
                    break;
                }
            }
        }
        this.item.materialId = this.item.material;
        this.getProduto(this.item.material);
        this.getLote(this.item.loteId);
        this.geraTmpSaldos();
    };
    NotaEntradaItemComponent.prototype.show = function () {
        if (!this.item.notaFiscalItemId) {
            return;
        }
        this.detail = true;
        this.disabledAutorizacao = true;
        this.update = false;
        this.showTable = false;
        this.response.emit(false);
        for (var i = 0; i < this.data.itemDados.length; i++) {
            if (this.data.itemDados[i].item === this.item.notaFiscalItemId) {
                this.item.autorizacao = this.data.itemDados[i].autorizacao;
                this.item.loteId = this.data.itemDados[i].lote;
                this.item.tanqueId = this.data.itemDados[i].deposito;
                this.item.pesodoc = this.data.itemDados[i].kilos;
                this.item.quantidDoc = this.data.itemDados[i].litros;
                this.item.quantid = this.data.itemDados[i].quantid;
                this.pesoDoc = this.item.pesodoc;
                this.quantidDoc = this.item.quantidDoc;
                this.quantid = this.item.quantid;
                break;
            }
        }
        this.item.materialId = this.item.material;
        this.getProduto(this.item.materialId);
        this.getLote(this.item.loteId);
    };
    NotaEntradaItemComponent.prototype.getProduto = function (materialId) {
        var _this = this;
        this.materialService.getById(materialId).subscribe(function (resp) {
            _this.material = resp;
            _this.item.materialItem = resp;
            if (_this.funcoesService.isNotUndefinedOrNull(_this.tmpWebDadosAutorizacao)) {
                _this.item.densidade = _this.tmpWebDadosAutorizacao.densidade;
            }
            else {
                _this.item.densidade = resp.densidadePadrao;
            }
        });
    };
    NotaEntradaItemComponent.prototype.getLote = function (loteId) {
        var _this = this;
        this.loteService._getById(loteId).subscribe(function (ret) {
            _this.unidadeId = ret.unidadeId;
            _this.item.unidadeId = _this.unidadeId;
            _this.precoArmazenado = ret.precoArmazenado;
            _this.item.precoArmazenado = _this.precoArmazenado;
            _this.nomeArmazenadoService.getById(ret.nomeArmazenadoId).subscribe(function (r) {
                _this.item.nomearmazenado = r.descrMater;
            });
            _this.opEntrada = ret.operacaoIdEntrada;
            _this.operacaoService.get().subscribe(function (resp) {
                _this.operation = resp.filter(function (val) {
                    if (_this.opEntrada) {
                        if (val.origem === "E" && val.flagServ !== "S" && val.sitReg !== 'E' && val.operacaoId === +_this.opEntrada) {
                            return val;
                        }
                    }
                    else {
                        if (val.origem === "E" && val.flagServ !== "S" && val.sitReg !== 'E') {
                            return val;
                        }
                    }
                });
            });
        });
    };
    NotaEntradaItemComponent.prototype.delete = function (item) {
        var _this = this;
        if (this.isDetail) {
            return false;
        }
        this.regNota = item.notaFiscalId === 0 ? this.retRegNota : item.notaFiscalId;
        this.itemId = item.notaFiscalItemId;
        this.dtEscritura = this.data.dtEscritura;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () { return __awaiter(_this, void 0, void 0, function () {
            var continua, validaNotaComplementarResult;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        continua = true;
                        if (!(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(this.data.regNota) > 0 && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(item.notaFiscalItemId))) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.notaEntradaService.validaNotaComplementar(this.data.regNota, item.notaFiscalItemId).toPromise()];
                    case 1:
                        validaNotaComplementarResult = _a.sent();
                        if (!validaNotaComplementarResult.isValid) {
                            this.mensagens = this.message.validationResult(validaNotaComplementarResult);
                        }
                        continua = validaNotaComplementarResult.isValid;
                        _a.label = 2;
                    case 2:
                        if (!continua) {
                            this.message.confirm("titles.notaEntrada", this.mensagens[0], null, function (_) { return _this.confirmRemove(item); });
                        }
                        else {
                            this.confirmRemove(item);
                        }
                        return [2 /*return*/];
                }
            });
        }); });
    };
    NotaEntradaItemComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var importacao, maxId, object;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.isExists = false;
                        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__["EventEmitterService"].get("formError").emit(form);
                        if (form.invalid) {
                            return [2 /*return*/];
                        }
                        if (!this.funcoesService.isPositive(this.item.autorizacao)) {
                            this.message.warning("titles.notaEntrada", "messages.informeUmaAutorizacao");
                            return [2 /*return*/];
                        }
                        if (!this.disabledAutorizacao) {
                            if (this.isExists) {
                                return [2 /*return*/];
                            }
                        }
                        return [4 /*yield*/, this.verificarImportacao(this.item.loteId, (this.item.pesodoc - (this.isEdit ? this.pesoDoc : 0)))];
                    case 1:
                        importacao = _a.sent();
                        if (!importacao.isValid) {
                            this.mensagens = this.message.validationResult(importacao);
                            this.message.warning("titles.notaEntrada", this.mensagens[0]);
                            return [2 /*return*/];
                        }
                        if (!this.item.notaFiscalItemId && (!this.isExists)) {
                            maxId = this.data.itens.reduce(function (max, obj) {
                                var currentId = Number(obj.notaFiscalItemId) || 0;
                                return currentId > max ? currentId : max;
                            }, 0);
                            this.item.notaFiscalItemId = maxId + 1;
                            this.item.item = this.item.notaFiscalItemId;
                            this.item.notMapped = true;
                            this.item.material = this.item.materialId;
                            this.item.descrMater = this.item.nomearmazenado;
                            this.item.preco = this.item.precoArmazenado;
                            this.data.itens.push(this.item);
                        }
                        else if (this.item.notaFiscalItemId) {
                            this.data.itens.forEach(function (item) {
                                if (item.item === _this.item.item && item.notaFiscalItemId === _this.item.notaFiscalItemId) {
                                    /* se existir validação de edição */
                                }
                            });
                        }
                        object = {
                            pedido: this.data.pedidoId,
                            regNota: this.data.regNota,
                            nota: this.data.nota,
                            serieNf: this.data.serieNF,
                            modNota: this.data.modNota,
                            chaveNFe: this.data.chaveNFE,
                            dtEmissao: this.data.dtEmissao,
                            dtEscritura: this.data.dtEscritura,
                            destinatarioIdCliente: this.data.destinatarioIdCliente,
                            flagCompl: this.data.flagCompl,
                            observacoes: this.data.observ,
                            item: this.item.notaFiscalItemId,
                            materialId: this.item.material,
                            descrMater: "",
                            preco: this.item.preco,
                            totItem: this.item.totItem,
                            operacao: this.item.operacao,
                            procedencia: "",
                            unidadeId: this.item.unidadeId,
                            autorizacao: this.item.autorizacao,
                            loteId: this.item.loteId,
                            tanqueId: this.item.tanqueId,
                            kilos: this.item.pesodoc,
                            litro: this.item.quantidDoc,
                            quantid: this.item.quantid,
                            loteIdOrigem: this.item.loteIdOrigem,
                            nroFatura: this.item.nrFatura,
                            nroPedido: this.item.nrPedido
                        };
                        this.notaEntradaService
                            .liberacaoProdutoGrava(object)
                            .subscribe(function (result) {
                            if (result.validationResult != null && !result.validationResult.isValid) {
                                _this.mensagens = _this.message.validationResult(result.validationResult);
                                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__["EventEmitterService"].get("backError").emit(_this.mensagens);
                                _this.data.itens.splice((_this.data.itens.length - 1), 1);
                            }
                            else {
                                _this.autorizacaoConfirmada = false;
                                _this.showTable = true;
                                _this.selectedItem.emit(_this.item);
                                _this.item = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntradalItem"]();
                                _this.response.emit(true);
                                _this.retRegNota = result.retRegNota;
                                _this.retItem = result.retItem;
                                _this.retPedido = result.retPedido;
                                _this.data.regNota = _this.retRegNota;
                                _this.data.pedidoId = _this.retPedido;
                                for (var i = 0; i < _this.data.itens.length; i++) {
                                    _this.data.itens[i].notaFiscalId = _this.data.regNota;
                                }
                                var objTotal = { regNota: _this.retRegNota };
                                _this.notaEntradaService.liberacaoProdutoTotais(objTotal).subscribe(function (ret) {
                                    _this.data.kilos = ret.kilos;
                                    _this.data.litros = ret.litros;
                                    _this.data.vlMerc = (ret.vlNota + ret.vlIpi) - ret.vlDesc;
                                    _this.data.basIcm = ret.basIcm;
                                    _this.data.basIpi = ret.basIpi;
                                    _this.data.vlIcms = ret.vlIcms;
                                    _this.data.vlIpi = ret.vlIpi;
                                    _this.data.vlDesc = ret.vlDesc;
                                    _this.data.vlNota = ret.vlNota;
                                });
                            }
                        });
                        return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaItemComponent.prototype.validaPesoDoc = function () {
        if (this.funcoesService.isNotUndefinedOrNull(this.item.loteId) &&
            this.funcoesService.isNotUndefinedOrNull(this.item.tanqueId) &&
            this.funcoesService.isNotUndefinedOrNull(this.item.pesodoc)) {
            this.processData();
            this.item.loteIdOrigem = "";
        }
    };
    NotaEntradaItemComponent.prototype.processData = function () {
        return __awaiter(this, void 0, void 0, function () {
            var result, object, message, obj, err_1;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _a.trys.push([0, 4, , 5]);
                        result = void 0;
                        object = {
                            loteId: this.item.loteId,
                            tanqueId: this.item.tanqueId,
                            kilos: this.pesoDoc + this.item.pesodoc,
                            oldKilos: this.pesoDoc,
                        };
                        return [4 /*yield*/, this.verificarImportacao(object.loteId, this.item.pesodoc - (this.isEdit ? this.pesoDoc : 0))];
                    case 1:
                        result = _a.sent();
                        if (!result.isValid) {
                            this.mensagens = this.message.validationResult(result);
                            this.message.warning("titles.notaEntrada", this.mensagens[0]);
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.validaKilosSemLib(object)];
                    case 2:
                        result = _a.sent();
                        if (!result.isValid) {
                            message = this.message.validationResult(result)[0];
                            this.message.warning("titles.notaEntrada", message);
                            this.item.pesodoc = this.pesoDoc;
                            return [2 /*return*/];
                        }
                        obj = {
                            autorizacao: this.data.autorizacao
                        };
                        return [4 /*yield*/, this.tmpWebDadosAutorizacaoGetByColaboradorId(obj)];
                    case 3:
                        result = _a.sent();
                        if (result) {
                            if (this.item.pesodoc > result.pesodoc) {
                                this.message.warning("titles.notaEntrada", "messages.pesoDocMaiorInformada");
                                this.item.pesodoc = this.pesoDoc;
                                return [2 /*return*/];
                            }
                        }
                        this.calcTotItem();
                        return [3 /*break*/, 5];
                    case 4:
                        err_1 = _a.sent();
                        return [2 /*return*/, console.log(err_1.message)];
                    case 5: return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaItemComponent.prototype.validaKilosSemLib = function (data) {
        var request = this.notaEntradaService;
        var promise = new Promise(function (resolve, reject) {
            request.validaKilosSemLib(data).subscribe(function (resp) {
                resolve(resp);
            });
        });
        return promise;
    };
    NotaEntradaItemComponent.prototype.tmpWebDadosAutorizacaoGetByColaboradorId = function (obj) {
        var _this = this;
        var promise = new Promise(function (resolve, reject) {
            _this.notaEntradaService.tmpWebDadosAutorizacaoGetByColaboradorId(obj).subscribe(function (resp) {
                resolve(resp);
            });
        });
        return promise;
    };
    NotaEntradaItemComponent.prototype.calcTotItem = function () {
        if (this.unidadeId === "KG") {
            this.item.totItem = this.funcoesService.numberUtils.round(this.item.pesodoc * this.precoArmazenado, 2);
        }
        else if (this.unidadeId === "LT" || this.unidadeId === "CC") {
            this.item.totItem = this.funcoesService.numberUtils.round(this.item.quantidDoc * this.precoArmazenado, 2);
        }
        else if (this.unidadeId === "UN") {
            this.item.totItem = this.funcoesService.numberUtils.round(this.item.quantid * this.precoArmazenado, 2);
        }
        var object = {
            totItem: this.item.totItem,
            autorizacao: this.data.autorizacao
        };
        this.notaEntradaService.setTotItem(object).subscribe();
    };
    NotaEntradaItemComponent.prototype.verificarImportacao = function (loteId, kilos) {
        var _this = this;
        var promise = new Promise(function (resolve, reject) {
            _this.notaEntradaService.validarDadosDI(loteId, kilos).subscribe(function (resp) {
                resolve(resp);
            });
        });
        return promise;
    };
    NotaEntradaItemComponent.prototype.validaQuantidDoc = function () {
        if (this.funcoesService.isNotUndefinedOrNull(this.item.loteId) &&
            this.funcoesService.isNotUndefinedOrNull(this.item.tanqueId) &&
            this.funcoesService.isNotUndefinedOrNull(this.item.quantidDoc)) {
            this.processValidaQuantidDoc();
            this.item.loteIdOrigem = "";
        }
    };
    NotaEntradaItemComponent.prototype.processValidaQuantidDoc = function () {
        return __awaiter(this, void 0, void 0, function () {
            var r, result, object, obj, err_2;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _a.trys.push([0, 3, , 4]);
                        r = { "isValid": true, "message": "" };
                        result = void 0;
                        object = {
                            loteId: this.item.loteId,
                            tanqueId: this.item.tanqueId,
                            litros: this.item.quantidDoc,
                            oldLitros: this.quantidDoc,
                        };
                        return [4 /*yield*/, this.validaLitrosSemLib(object)];
                    case 1:
                        result = _a.sent();
                        r.isValid = result.isValid;
                        r.message = this.message.validationResult(result)[0];
                        if (!r.isValid) {
                            this.message.warning("titles.notaEntrada", r.message);
                            this.item.quantidDoc = this.quantidDoc;
                            return [2 /*return*/];
                        }
                        obj = {
                            autorizacao: this.data.autorizacao
                        };
                        return [4 /*yield*/, this.tmpWebDadosAutorizacaoGetByColaboradorId(obj)];
                    case 2:
                        result = _a.sent();
                        if (result) {
                            if (this.item.quantidDoc > result.quantidDoc) {
                                this.message.warning("titles.notaEntrada", "messages.quantidDocMaiorInformada");
                                this.item.quantidDoc = this.quantidDoc;
                                return [2 /*return*/];
                            }
                        }
                        this.calcTotItem();
                        return [3 /*break*/, 4];
                    case 3:
                        err_2 = _a.sent();
                        return [2 /*return*/, console.log(err_2.message)];
                    case 4: return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaItemComponent.prototype.validaLitrosSemLib = function (data) {
        var request = this.notaEntradaService;
        var promise = new Promise(function (resolve, reject) {
            request.validaLitrosSemLib(data).subscribe(function (resp) {
                resolve(resp);
            });
        });
        return promise;
    };
    NotaEntradaItemComponent.prototype.validaQuantid = function () {
        if (this.funcoesService.isNotUndefinedOrNull(this.item.loteId) &&
            this.funcoesService.isNotUndefinedOrNull(this.item.tanqueId) &&
            this.funcoesService.isNotUndefinedOrNull(this.item.quantid)) {
            this.processValidaQuantSemLib();
            this.item.loteIdOrigem = "";
        }
    };
    NotaEntradaItemComponent.prototype.processValidaQuantSemLib = function () {
        return __awaiter(this, void 0, void 0, function () {
            var r, result, object, obj, err_3;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _a.trys.push([0, 3, , 4]);
                        r = { "isValid": true, "message": "" };
                        result = void 0;
                        object = {
                            loteId: this.item.loteId,
                            tanqueId: this.item.tanqueId,
                            quantid: this.item.quantid,
                            oldQuantid: this.quantid
                        };
                        return [4 /*yield*/, this.validaQuantSemLib(object)];
                    case 1:
                        result = _a.sent();
                        r.isValid = result.isValid;
                        r.message = this.message.validationResult(result)[0];
                        if (!r.isValid) {
                            this.message.warning("titles.notaEntrada", r.message);
                            this.item.quantid = this.quantid;
                            return [2 /*return*/];
                        }
                        obj = {
                            autorizacao: this.data.autorizacao
                        };
                        return [4 /*yield*/, this.tmpWebDadosAutorizacaoGetByColaboradorId(obj)];
                    case 2:
                        result = _a.sent();
                        if (result) {
                            if (this.item.quantid > result.quantid) {
                                this.message.warning("titles.notaEntrada", "messages.quantidDocMaiorInformada");
                                this.item.quantid = this.quantid;
                                return [2 /*return*/];
                            }
                        }
                        this.calcTotItem();
                        return [3 /*break*/, 4];
                    case 3:
                        err_3 = _a.sent();
                        return [2 /*return*/, console.log(err_3.message)];
                    case 4: return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaItemComponent.prototype.validaQuantSemLib = function (data) {
        var request = this.notaEntradaService;
        var promise = new Promise(function (resolve, reject) {
            request.validaQuantSemLib(data).subscribe(function (resp) {
                resolve(resp);
            });
        });
        return promise;
    };
    NotaEntradaItemComponent.prototype.trataLote = function (event) {
        var _this = this;
        if (!event) {
            return;
        }
        this.materialService.getById(event.lote.materialId).subscribe(function (currentMaterial) {
            _this.material = currentMaterial;
            _this.item.materialItem = currentMaterial;
            _this.opEntrada = event.lote.operacaoIdEntrada;
            _this.unidadeId = event.lote.unidadeId;
            _this.precoArmazenado = event.lote.precoArmazenado;
            _this.item.precoArmazenado = _this.precoArmazenado;
            _this.nomeArmazenadoService.getById(event.lote.nomeArmazenadoId).subscribe(function (r) {
                _this.item.nomearmazenado = r.descrMater;
            });
        });
    };
    Object.defineProperty(NotaEntradaItemComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.item.materialId,
                modo: 1,
                tipoSaldo: 1,
                dataMovimento: this.data.dtEscritura,
                tipoAgrupa: 'D',
                geraArquivo: 'S'
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NotaEntradaItemComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.item.materialId,
                loteId: this.item.loteId,
                modo: 1,
                tipoSaldo: 1,
                dataMovimento: this.data.dtEscritura,
                tipoAgrupa: 'D',
                geraArquivo: 'S'
            };
        },
        enumerable: true,
        configurable: true
    });
    NotaEntradaItemComponent.prototype.selectedAutorizacao = function (data) {
        var _this = this;
        this.item.autorizacao = data.autorizacao;
        this.item.loteId = data.lote;
        this.loteService._getById(this.item.loteId).subscribe(function (ret) {
            _this.unidadeId = ret.unidadeId;
            _this.item.unidadeId = _this.unidadeId;
            _this.precoArmazenado = ret.precoArmazenado;
            _this.opEntrada = ret.operacaoIdEntrada;
            _this.preencheComboOperacao(data);
            _this.item.precoArmazenado = _this.precoArmazenado;
            _this.nomeArmazenadoService.getById(ret.nomeArmazenadoId).subscribe(function (r) {
                _this.item.nomearmazenado = r.descrMater;
            });
        });
        this.item.densidade = data.densidade;
        this.item.operacao = data.operacao;
        this.item.materialId = data.material;
        this.materialService.getById(this.item.materialId).subscribe(function (resp) {
            _this.item.materialItem = resp;
        });
        this.item.tanqueId = data.deposito;
        this.item.pesodoc = data.pesodoc;
        this.item.quantidDoc = data.quantidDoc;
        this.item.quantid = data.quantid;
        this.item.totItem = data.totItem;
        this.geraTmpSaldos();
        this.pesoDoc = this.item.pesodoc;
        this.quantidDoc = this.item.quantidDoc;
        this.quantid = this.item.quantid;
        jQuery("#pesquisa-autorizacao-dialog").modal("hide");
    };
    NotaEntradaItemComponent.prototype.opnModal = function () {
        var _this = this;
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__["EventEmitterService"].get("formError").emit(null);
        this.filtroAutorizacao.destinatarioIdCliente = this.data.destinatarioIdCliente;
        this.filtroAutorizacao.autorizacao = this.item.autorizacao;
        this.destinatarioService.getById(this.data.destinatarioIdCliente).subscribe(function (resp) {
            _this.filtroAutorizacao.cliente = resp;
            _this.childPesquisaAutorizacaoComponent.objectSelect(true);
            jQuery("#pesquisa-autorizacao-dialog").modal("show");
            _this.disabledCamposItens = false;
            _this.autorizacaoConfirmada = true;
        });
    };
    NotaEntradaItemComponent.prototype.buscaPorAutorizacao = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.funcoesService.isPositive(+this.item.autorizacao)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.servicePesquisaAutorizacao.selecionaAutorizacaoDescarga({
                                liberado: "*",
                                tipoTransp: "",
                                destinatarioIdCliente: 0,
                                materialId: "",
                                destinatarioIdTransportadora: 0,
                                placa: "",
                                autorizacao: this.item.autorizacao
                            }).toPromise()];
                    case 1:
                        _a.sent();
                        this.notaEntradaService.tmpWebDadosAutorizacaoGetByColaboradorId({ autorizacao: this.item.autorizacao })
                            .subscribe(function (resp) {
                            if (resp) {
                                _this.autorizacaoConfirmada = true;
                                _this.item.autorizacao = resp.autorizacao;
                                _this.item.loteId = resp.lote;
                                _this.item.operacao = "";
                                _this.loteService._getById(_this.item.loteId).subscribe(function (ret) {
                                    _this.unidadeId = ret.unidadeId;
                                    _this.opEntrada = ret.operacaoIdEntrada;
                                    _this.preencheComboOperacao(resp);
                                    _this.item.unidadeId = _this.unidadeId;
                                    _this.precoArmazenado = ret.precoArmazenado;
                                    _this.item.precoArmazenado = _this.precoArmazenado;
                                    _this.nomeArmazenadoService.getById(ret.nomeArmazenadoId).subscribe(function (r) {
                                        _this.item.nomearmazenado = r.descrMater;
                                    });
                                });
                                _this.item.densidade = resp.densidade;
                                _this.item.materialId = resp.material;
                                _this.materialService.getById(_this.item.materialId).subscribe(function (r) {
                                    _this.item.materialItem = r;
                                });
                                _this.item.tanqueId = resp.deposito;
                                _this.item.pesodoc = resp.pesodoc;
                                _this.item.quantidDoc = resp.quantidDoc;
                                _this.item.quantid = resp.quantid;
                                _this.item.totItem = resp.totItem;
                                _this.geraTmpSaldos();
                                _this.pesoDoc = _this.item.pesodoc;
                                _this.quantidDoc = _this.item.quantidDoc;
                                _this.quantid = _this.item.quantid;
                                _this.disabledCamposItens = false;
                            }
                            else {
                                _this.opnModal();
                                _this.item.autorizacao = 0;
                                _this.item.loteId = '';
                                _this.item.densidade = 0;
                                _this.item.operacao = "";
                                _this.item.materialId = '';
                                _this.item.tanqueId = '';
                                _this.item.pesodoc = 0;
                                _this.item.quantidDoc = 0;
                                _this.item.quantid = 0;
                                _this.item.totItem = 0;
                                _this.item.nomearmazenado = "";
                                _this.item.precoArmazenado = 0;
                                _this.disabledCamposItens = true;
                            }
                        });
                        return [3 /*break*/, 3];
                    case 2:
                        this.opnModal();
                        this.item.autorizacao = 0;
                        this.item.loteId = '';
                        this.item.densidade = 0;
                        this.item.operacao = "";
                        this.item.materialId = '';
                        this.item.tanqueId = '';
                        this.item.pesodoc = 0;
                        this.item.quantidDoc = 0;
                        this.item.quantid = 0;
                        this.item.totItem = 0;
                        this.item.nomearmazenado = "";
                        this.item.precoArmazenado = 0;
                        this.disabledCamposItens = true;
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaItemComponent.prototype.onCancelar = function (status) {
        if (status === void 0) { status = 1; }
        if (status === 1) {
            this.data = new _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntrada"]();
        }
        this.autorizacaoConfirmada = false;
        this.back();
    };
    NotaEntradaItemComponent.prototype.preencheComboOperacao = function (obj) {
        return __awaiter(this, void 0, void 0, function () {
            var self, filialId, operation, operacoes;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        self = this;
                        filialId = self.loginService.getLogin().filialId;
                        operation = [];
                        self.operacao = new _cadastro_operacao_operacao_model__WEBPACK_IMPORTED_MODULE_8__["Operacao"]();
                        self.operation = [];
                        return [4 /*yield*/, this.operacaoService.get().toPromise()];
                    case 1:
                        operacoes = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_22__["ArrayUtilsStaticService"].any(operacoes)) {
                            if (self.opEntrada) {
                                operation = operacoes.filter(function (val) { return val.origem === "E" && val.flagServ !== "S" && val.sitReg !== 'E' && self.opEntrada.split(',').includes(val.operacaoId.toString()); });
                            }
                            else {
                                operation = operacoes.filter(function (val) { return val.origem === "E" && val.flagServ !== "S" && val.sitReg !== 'E'; });
                            }
                            self.filialService.getById(filialId).subscribe(function (ret) {
                                if (ret) {
                                    if (ret.estadoId === obj.estadoCli) {
                                        self.operation = operation.filter(function (op) { return op.destino === "D" || op.destino === "T"; });
                                    }
                                    else {
                                        self.operation = operation.filter(function (op) { return op.destino === "F" || op.destino === "T"; });
                                    }
                                }
                            });
                        }
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_22__["ArrayUtilsStaticService"].any(operacoes)) {
                            if (self.operation.length === 1) {
                                this.item.operacao = self.operation[0].operacaoId;
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    NotaEntradaItemComponent.prototype.geraTmpSaldos = function () {
        var _this = this;
        var filtro = {
            destinatarioIdCliente: this.data.destinatarioIdCliente,
            destinatarioIdEmitente: 0,
            materialId: this.item.materialId,
            tanqueId: "",
            loteId: this.item.loteId,
            sitLote: "A",
            modo: 1,
            tipoSaldo: 1,
            osgId: 0,
            dataMovimento: new Date(),
            filialId: this.loginService.getLogin().filialId,
            localOperacaoId: 0,
            colaboradorId: this.loginService.getLogin().colaboradorId,
            tipoAgrupa: "D",
            geraArquivo: "S",
            showWithoutBalance: false
        };
        this.loteService.getLoteDeposito(filtro).subscribe(function (data) {
            if (data) {
                _this.tmpSaldos = data;
            }
        });
    };
    NotaEntradaItemComponent.prototype.getTmpWebDadosAutorizacao = function () {
        var _this = this;
        if (this.funcoesService.isPositive(this.data.autorizacao)) {
            var obj = {
                autorizacao: this.data.autorizacao
            };
            this.notaEntradaService.tmpWebDadosAutorizacaoGetByColaboradorId(obj).subscribe(function (resp) {
                if (resp) {
                    _this.tmpWebDadosAutorizacao = resp;
                }
            });
        }
    };
    NotaEntradaItemComponent.ctorParameters = function () { return [
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_1__["LoginService"] },
        { type: _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__["MaterialService"] },
        { type: _nota_entrada_service__WEBPACK_IMPORTED_MODULE_7__["NotaEntradaService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: _cadastro_operacao_operacao_service__WEBPACK_IMPORTED_MODULE_9__["OperacaoService"] },
        { type: _cadastro_filial_filial_service__WEBPACK_IMPORTED_MODULE_10__["FilialService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"] },
        { type: _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_12__["LoteService"] },
        { type: _cadastro_nome_armazenado_nome_armazenado_service__WEBPACK_IMPORTED_MODULE_13__["NomeArmazenadoService"] },
        { type: _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_16__["DestinatarioService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_18__["PermissoesUtilsService"] },
        { type: _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_service__WEBPACK_IMPORTED_MODULE_20__["PesquisaAutorizacaoService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])(_shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_component__WEBPACK_IMPORTED_MODULE_19__["PesquisaAutorizacaoComponent"], { static: false }),
        __metadata("design:type", _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_component__WEBPACK_IMPORTED_MODULE_19__["PesquisaAutorizacaoComponent"])
    ], NotaEntradaItemComponent.prototype, "childPesquisaAutorizacaoComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntrada"])
    ], NotaEntradaItemComponent.prototype, "data", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Boolean)
    ], NotaEntradaItemComponent.prototype, "isDetail", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", _nota_entrada_model__WEBPACK_IMPORTED_MODULE_4__["NotaEntradalItem"])
    ], NotaEntradaItemComponent.prototype, "item", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], NotaEntradaItemComponent.prototype, "object", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], NotaEntradaItemComponent.prototype, "response", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], NotaEntradaItemComponent.prototype, "selectedItem", void 0);
    NotaEntradaItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-nota-entrada-item',
            template: __importDefault(__webpack_require__(/*! raw-loader!./nota-entrada-item.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
            styles: [__importDefault(__webpack_require__(/*! ./nota-entrada-item.component.scss */ "./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.scss")).default]
        }),
        __metadata("design:paramtypes", [_login_login_service__WEBPACK_IMPORTED_MODULE_1__["LoginService"],
            _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__["MaterialService"],
            _nota_entrada_service__WEBPACK_IMPORTED_MODULE_7__["NotaEntradaService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            _cadastro_operacao_operacao_service__WEBPACK_IMPORTED_MODULE_9__["OperacaoService"],
            _cadastro_filial_filial_service__WEBPACK_IMPORTED_MODULE_10__["FilialService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"],
            _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_12__["LoteService"],
            _cadastro_nome_armazenado_nome_armazenado_service__WEBPACK_IMPORTED_MODULE_13__["NomeArmazenadoService"],
            _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_16__["DestinatarioService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_18__["PermissoesUtilsService"],
            _shared_components_pesquisa_pesquisa_autorizacao_pesquisa_autorizacao_service__WEBPACK_IMPORTED_MODULE_20__["PesquisaAutorizacaoService"]])
    ], NotaEntradaItemComponent);
    return NotaEntradaItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada.constants.ts":
/*!***********************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada.constants.ts ***!
  \***********************************************************************/
/*! exports provided: NotaEntradaConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaConstants", function() { return NotaEntradaConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var NotaEntradaConstants = /** @class */ (function () {
    function NotaEntradaConstants() {
        this.sisFormularioId = 90051;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.inclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.alteracao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.exclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 5, acao: "labels.notaJaIntegrada" },
            { sisFormularioId: this.sisFormularioId, libRotina: 6, acao: "labels.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.permissoes" },
        ];
        this.sisSistemaId = "CAD";
        this.nomeForm = "titles.notaEntrada";
        this.listaIndex = [
            { title: 'Novo', action: 'create', icon: "icon-plus", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Visualizar', action: 'detail', icon: "icon-eye", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Excluir', action: 'remove', icon: "icon-close", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Pesquisar', action: 'filtrar', icon: "icon-search", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Atualizar', action: 'refresh', icon: "icon-reload", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.listaParam = [
            { 'sistema': 'STO', 'parametros': ["ObrigaSerieNf"] },
            { 'sistema': 'UNI', 'parametros': ["ObrChaveNFeEnt"] },
            { 'sistema': 'LIV', 'parametros': ["FechamentoFis"] },
            { 'sistema': 'MAT', 'parametros': ["FechamentoEst"] },
            { 'sistema': 'CTR', 'parametros': ["DtSeguro"] }
        ];
    }
    return NotaEntradaConstants;
}());



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada.model.ts":
/*!*******************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada.model.ts ***!
  \*******************************************************************/
/*! exports provided: NotaEntrada, NotaEntradaItemDados, NotaEntradalItem, NotaEntradaFilter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntrada", function() { return NotaEntrada; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaItemDados", function() { return NotaEntradaItemDados; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradalItem", function() { return NotaEntradalItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaFilter", function() { return NotaEntradaFilter; });
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var NotaEntrada = /** @class */ (function (_super) {
    __extends(NotaEntrada, _super);
    function NotaEntrada() {
        var _this = _super.call(this) || this;
        _this.flagCompl = "N";
        _this.itens = [];
        _this.notaFiscalDadosItens = [];
        return _this;
    }
    return NotaEntrada;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var NotaEntradaItemDados = /** @class */ (function (_super) {
    __extends(NotaEntradaItemDados, _super);
    function NotaEntradaItemDados() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return NotaEntradaItemDados;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var NotaEntradalItem = /** @class */ (function (_super) {
    __extends(NotaEntradalItem, _super);
    function NotaEntradalItem() {
        var _this = _super.call(this) || this;
        _this.quantidDoc = 0;
        _this.quantid = 0;
        _this.totItem = 0;
        _this.precoArmazenado = 0;
        _this.loteId = "";
        _this.tanqueId = "";
        _this.pesodoc = 0;
        _this.operacao = "";
        return _this;
    }
    return NotaEntradalItem;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var NotaEntradaFilter = /** @class */ (function () {
    function NotaEntradaFilter() {
        var currentDate = new Date();
        currentDate.setDate(1);
        this.destinatarioIdCliente = 0;
        this.nota = 0;
        this.recebimento = 0;
        this.dataI = currentDate;
        this.dataF = new Date();
        this.filialId = 0;
    }
    return NotaEntradaFilter;
}());



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada.module.ts":
/*!********************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada.module.ts ***!
  \********************************************************************/
/*! exports provided: NotaEntradaModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaModule", function() { return NotaEntradaModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_pages_controle_nota_entrada_nota_entrada_filter_nota_entrada_filter_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component */ "./src/app/pages/controle/nota-entrada/nota-entrada-filter/nota-entrada-filter.component.ts");
/* harmony import */ var app_pages_controle_nota_entrada_nota_entrada_form_nota_entrada_form_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component */ "./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.ts");
/* harmony import */ var app_pages_controle_nota_entrada_nota_entrada_index_nota_entrada_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component */ "./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.ts");
/* harmony import */ var app_pages_controle_nota_entrada_nota_entrada_routing_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/controle/nota-entrada/nota-entrada.routing.module */ "./src/app/pages/controle/nota-entrada/nota-entrada.routing.module.ts");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _nota_entrada_item_nota_entrada_item_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./nota-entrada-item/nota-entrada-item.component */ "./src/app/pages/controle/nota-entrada/nota-entrada-item/nota-entrada-item.component.ts");
var __decorate = (undefined && undefined.__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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var NotaEntradaModule = /** @class */ (function () {
    function NotaEntradaModule() {
    }
    NotaEntradaModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_shared_shared_module__WEBPACK_IMPORTED_MODULE_5__["SharedModule"], app_pages_controle_nota_entrada_nota_entrada_routing_module__WEBPACK_IMPORTED_MODULE_4__["NotaEntradaRoutingModule"]],
            declarations: [app_pages_controle_nota_entrada_nota_entrada_form_nota_entrada_form_component__WEBPACK_IMPORTED_MODULE_2__["NotaEntradaFormComponent"], app_pages_controle_nota_entrada_nota_entrada_index_nota_entrada_index_component__WEBPACK_IMPORTED_MODULE_3__["NotaEntradaIndexComponent"], app_pages_controle_nota_entrada_nota_entrada_filter_nota_entrada_filter_component__WEBPACK_IMPORTED_MODULE_1__["NotaEntradaFilterComponent"], _nota_entrada_item_nota_entrada_item_component__WEBPACK_IMPORTED_MODULE_6__["NotaEntradaItemComponent"]]
        })
    ], NotaEntradaModule);
    return NotaEntradaModule;
}());



/***/ }),

/***/ "./src/app/pages/controle/nota-entrada/nota-entrada.routing.module.ts":
/*!****************************************************************************!*\
  !*** ./src/app/pages/controle/nota-entrada/nota-entrada.routing.module.ts ***!
  \****************************************************************************/
/*! exports provided: NotaEntradaRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaEntradaRoutingModule", function() { return NotaEntradaRoutingModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _nota_entrada_form_nota_entrada_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nota-entrada-form/nota-entrada-form.component */ "./src/app/pages/controle/nota-entrada/nota-entrada-form/nota-entrada-form.component.ts");
/* harmony import */ var _nota_entrada_index_nota_entrada_index_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./nota-entrada-index/nota-entrada-index.component */ "./src/app/pages/controle/nota-entrada/nota-entrada-index/nota-entrada-index.component.ts");
var __decorate = (undefined && undefined.__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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var MRoutes = [
    {
        path: "",
        component: _nota_entrada_index_nota_entrada_index_component__WEBPACK_IMPORTED_MODULE_4__["NotaEntradaIndexComponent"],
        data: { breadcrumb: "notaEntrada", formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
    {
        path: "create",
        component: _nota_entrada_form_nota_entrada_form_component__WEBPACK_IMPORTED_MODULE_3__["NotaEntradaFormComponent"],
        data: {
            breadcrumb: "notaEntrada",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "edit/:id",
        component: _nota_entrada_form_nota_entrada_form_component__WEBPACK_IMPORTED_MODULE_3__["NotaEntradaFormComponent"],
        data: {
            breadcrumb: "notaEntrada",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    },
    {
        path: "detail/:id",
        component: _nota_entrada_form_nota_entrada_form_component__WEBPACK_IMPORTED_MODULE_3__["NotaEntradaFormComponent"],
        data: {
            breadcrumb: "notaEntrada",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].detail }
        }
    }
];
var NotaEntradaRoutingModule = /** @class */ (function () {
    function NotaEntradaRoutingModule() {
    }
    NotaEntradaRoutingModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(MRoutes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
        })
    ], NotaEntradaRoutingModule);
    return NotaEntradaRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/nota-fiscal/nota-fiscal.model.ts":
/*!********************************************************!*\
  !*** ./src/app/pages/nota-fiscal/nota-fiscal.model.ts ***!
  \********************************************************/
/*! exports provided: ConNotaDtoOrigemRetorno, NotaFiscalOrigemRetorno, NotaFiscalFilter, NotaFiscalIndexDto, ConsultaNotaPedidoEmbarque, NotaFiscal, LogDePedidos, NotaFiscalDadosItem, NotaFiscalItem, NotaFiscalXml, Contatos, NotaFiscalNfeProtocoloAut, NotaServico, NotaFiscalNfeProtocoloCanc, NotaFiscalTipoEventoManifesto, NotaFiscalEntradaSaida, NotaFiscalMovimentacao */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConNotaDtoOrigemRetorno", function() { return ConNotaDtoOrigemRetorno; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalOrigemRetorno", function() { return NotaFiscalOrigemRetorno; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalFilter", function() { return NotaFiscalFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalIndexDto", function() { return NotaFiscalIndexDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsultaNotaPedidoEmbarque", function() { return ConsultaNotaPedidoEmbarque; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscal", function() { return NotaFiscal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogDePedidos", function() { return LogDePedidos; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalDadosItem", function() { return NotaFiscalDadosItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalItem", function() { return NotaFiscalItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalXml", function() { return NotaFiscalXml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Contatos", function() { return Contatos; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalNfeProtocoloAut", function() { return NotaFiscalNfeProtocoloAut; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaServico", function() { return NotaServico; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalNfeProtocoloCanc", function() { return NotaFiscalNfeProtocoloCanc; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalTipoEventoManifesto", function() { return NotaFiscalTipoEventoManifesto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalEntradaSaida", function() { return NotaFiscalEntradaSaida; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalMovimentacao", function() { return NotaFiscalMovimentacao; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var ConNotaDtoOrigemRetorno = /** @class */ (function () {
    function ConNotaDtoOrigemRetorno() {
    }
    return ConNotaDtoOrigemRetorno;
}());

var NotaFiscalOrigemRetorno = /** @class */ (function () {
    function NotaFiscalOrigemRetorno() {
    }
    return NotaFiscalOrigemRetorno;
}());

var NotaFiscalFilter = /** @class */ (function () {
    function NotaFiscalFilter() {
        this.tipoData = 1;
        this.tipoMov = "T";
        this.tipoNfe = "";
        this.dataI = new Date();
        this.dataI.setHours(0, 0, 0);
        this.dataF = new Date();
        this.destinatarioIdCliente = 0;
        this.loteId = "";
        this.materialId = "";
        this.modNota = "";
        this.codIntegracao = "";
        this.nota = 0;
        this.notaFiscalId = 0;
        this.autorizacao = 0;
        this.regNota = 0;
        this.mostrarFiltro = true;
    }
    return NotaFiscalFilter;
}());

var NotaFiscalIndexDto = /** @class */ (function () {
    function NotaFiscalIndexDto() {
    }
    return NotaFiscalIndexDto;
}());

var ConsultaNotaPedidoEmbarque = /** @class */ (function () {
    function ConsultaNotaPedidoEmbarque() {
    }
    return ConsultaNotaPedidoEmbarque;
}());

var NotaFiscal = /** @class */ (function () {
    function NotaFiscal() {
    }
    return NotaFiscal;
}());

var LogDePedidos = /** @class */ (function () {
    function LogDePedidos() {
    }
    return LogDePedidos;
}());

var NotaFiscalDadosItem = /** @class */ (function () {
    function NotaFiscalDadosItem() {
    }
    return NotaFiscalDadosItem;
}());

var NotaFiscalItem = /** @class */ (function () {
    function NotaFiscalItem() {
    }
    return NotaFiscalItem;
}());

var NotaFiscalXml = /** @class */ (function () {
    function NotaFiscalXml() {
    }
    return NotaFiscalXml;
}());

var Contatos = /** @class */ (function () {
    function Contatos() {
    }
    return Contatos;
}());

var NotaFiscalNfeProtocoloAut = /** @class */ (function () {
    function NotaFiscalNfeProtocoloAut() {
    }
    return NotaFiscalNfeProtocoloAut;
}());

var NotaServico = /** @class */ (function () {
    function NotaServico() {
    }
    return NotaServico;
}());

var NotaFiscalNfeProtocoloCanc = /** @class */ (function () {
    function NotaFiscalNfeProtocoloCanc() {
    }
    return NotaFiscalNfeProtocoloCanc;
}());

var NotaFiscalTipoEventoManifesto = /** @class */ (function () {
    function NotaFiscalTipoEventoManifesto() {
    }
    return NotaFiscalTipoEventoManifesto;
}());

var NotaFiscalEntradaSaida = /** @class */ (function () {
    function NotaFiscalEntradaSaida() {
    }
    return NotaFiscalEntradaSaida;
}());

var NotaFiscalMovimentacao = /** @class */ (function () {
    function NotaFiscalMovimentacao() {
    }
    return NotaFiscalMovimentacao;
}());



/***/ }),

/***/ "./src/app/pages/nota-fiscal/nota-fiscal.service.ts":
/*!**********************************************************!*\
  !*** ./src/app/pages/nota-fiscal/nota-fiscal.service.ts ***!
  \**********************************************************/
/*! exports provided: NotaFiscalService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalService", function() { return NotaFiscalService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var _app_error_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var _shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/services/base/base.service */ "./src/app/shared/services/base/base.service.ts");
/* harmony import */ var _nota_fiscal_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./nota-fiscal.model */ "./src/app/pages/nota-fiscal/nota-fiscal.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var NotaFiscalService = /** @class */ (function (_super) {
    __extends(NotaFiscalService, _super);
    function NotaFiscalService(http) {
        var _this = _super.call(this, http, "balanca/notaFiscal") || this;
        _this.http = http;
        _this.filtro = new _nota_fiscal_model__WEBPACK_IMPORTED_MODULE_6__["NotaFiscalFilter"]();
        _this.filtroAux = [];
        _this.data = new _nota_fiscal_model__WEBPACK_IMPORTED_MODULE_6__["NotaFiscalIndexDto"]();
        return _this;
    }
    NotaFiscalService.prototype.getById = function (notaFiscalId) {
        return this.http
            .get(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/" + notaFiscalId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.getByFiltro = function (filtro) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/GetByFiltro", filtro)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.cancelarNotaSistema = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/cancelarNotaSistema", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.consultarSituacaoNfe = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/consultarSituacaoNfe", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.ConsultaStatusServico = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/consultarStatusServico", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.inutilizarNota = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/inutilizarNota", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.ConsultaOrigemNota = function (notaFiscalId) {
        return this.http
            .get(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/getConsulta/" + notaFiscalId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.enviarXml = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/enviarXml", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.geraXml = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscalXml/geraXmlBanco", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.enviarEmailNotaXmlCliente = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/enviarEmailNotaXmlCliente", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.alteraDados = function (data) {
        return this.http
            .put(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/alteraDados", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.enviarEmailXmlPdfCliente = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/enviarEmailXmlPdfCliente", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.prototype.setDtFimFormCont = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaFiscal/setDtFimFormCont", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    NotaFiscalService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] }
    ]; };
    NotaFiscalService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]])
    ], NotaFiscalService);
    return NotaFiscalService;
}(_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_5__["BaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-controle-nota-entrada-nota-entrada-module.js.map