(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["default~app-pages-balanca-emissao-nota-fiscal-lote-emissao-nota-fiscal-lote-module~app-pages-nota-fi~29ec0b46"],{

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotaFiscalEmissaoService", function() { return NotaFiscalEmissaoService; });
/* 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 app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/base/base.service */ "./src/app/shared/services/base/base.service.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _app_error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./nota-fiscal-emissao.model */ "./src/app/pages/nota-fiscal/nota-fiscal-emissao/nota-fiscal-emissao.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 NotaFiscalEmissaoService = /** @class */ (function (_super) {
    __extends(NotaFiscalEmissaoService, _super);
    function NotaFiscalEmissaoService(http) {
        var _this = _super.call(this, http, "balanca/notaCarga") || this;
        _this.http = http;
        _this.filter = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["FuncAutorizacaoFilterVo"]();
        _this.data = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["TmpWebAutorizacaoNotaCargaDto"]();
        _this.lote = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["TmpWebLoteNotaCargaDto"]();
        _this.notaRemessa = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["NotaRemessaDto"]();
        _this.notaFiscalEmissao = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["NotaFiscalEmissao"]();
        _this.configs = {
            altDtNFRet: false,
            bloq2AutFormControle: false,
            geraNotaPorItem: false,
            flagObsCarga: false,
            chkDataServ: false,
            rSeriePadrao: 0,
            impFormCtrl: false,
            ida1Certificate: "",
            controlaEmail: false,
            naoPermTrocarLoteNF: false
        };
        return _this;
    }
    NotaFiscalEmissaoService.prototype.clear = function () {
        this.filter = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["FuncAutorizacaoFilterVo"]();
        this.data = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["TmpWebAutorizacaoNotaCargaDto"]();
        this.lote = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["TmpWebLoteNotaCargaDto"]();
        this.notaRemessa = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["NotaRemessaDto"]();
        this.notaFiscalEmissao = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["NotaFiscalEmissao"]();
        this.operacao = {};
        sessionStorage.removeItem('us.auxdata');
    };
    NotaFiscalEmissaoService.prototype.getFuncAutorizacao = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/funcAutorizacao", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.getFuncLote = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/funcLote", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.getFuncCalculaQuantidades = function (tipoCalc, tipo) {
        var data = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["FuncCalculaQuantidadesFilterVo"]();
        data.autorizacao = this.data.autorizacao;
        data.tipoCalc = tipoCalc;
        data.operacao = this.notaFiscalEmissao.operacao;
        data.lote = this.notaFiscalEmissao.lote;
        switch (tipo) {
            case "Lote":
            case "Ajuste":
                data.kilos = this.notaFiscalEmissao.kilos;
                data.litros = this.notaFiscalEmissao.litros;
                data.quantid = this.notaFiscalEmissao.quantid;
                break;
            default:
                data.kilos = this.data.saldoAOKilos;
                data.litros = this.data.saldoAOLitro;
                data.quantid = this.data.saldoAOQT;
                break;
        }
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/funcCalculaQuantidades", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.getNotaRemessa = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/notaRemessa", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.gravaNotaCarga = function () {
        var data = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["GravaNotaCargaFilterVo"]();
        data.regNota = this.notaFiscalEmissao.regNota;
        data.operacao = this.notaFiscalEmissao.operacao;
        data.descrVol = this.notaFiscalEmissao.descrVol;
        data.volQuant = this.notaFiscalEmissao.volQuant;
        data.aliqIcms = this.notaFiscalEmissao.aliqIcms;
        data.autorizacao = this.data.autorizacao;
        data.lote = this.notaFiscalEmissao.lote;
        data.deposito = this.notaFiscalEmissao.deposito;
        data.kilos = this.notaFiscalEmissao.kilos;
        data.litro = this.notaFiscalEmissao.litros;
        data.quantid = this.notaFiscalEmissao.quantid;
        data.vlIcms = this.notaFiscalEmissao.vlIcms;
        data.totItem = this.notaFiscalEmissao.totItem;
        data.bPesoAut2 = this.data.bPesoAut;
        data.bLitrosAut2 = this.data.bLitros;
        data.bQuantid2 = this.data.bQuantid;
        data.dtEmissao = this.notaFiscalEmissao.dtEmissao;
        data.regOrigem = this.notaFiscalEmissao.notaRemessa;
        data.notaCli = this.notaFiscalEmissao.notaVenda;
        data.vldSaldoPedEmbarque = "";
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/gravaNotaCarga", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.cancelaNotaCarga = function () {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/cancelaNotaCarga", { regNota: this.notaFiscalEmissao.regNota })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.validaConfirmacao = function () {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/validaConfirmacao", { regNota: this.notaFiscalEmissao.regNota })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.validaPesoMaxVeiculo = function () {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/validaPesoMaxVeiculo", { autorizacao: this.autorizacao })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.confirmaNotaCarga = function () {
        var _this = this;
        var data = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["ConfirmacaoNotaCargaFilterVo"]();
        data.regNota = this.notaFiscalEmissao.regNota;
        data.dtEmissao = new Date(this.notaFiscalEmissao.dtEmissao);
        data.codDest = this.notaFiscalEmissao.codDest;
        data.nota = this.notaFiscalEmissao.nota;
        data.regSerie = this.notaFiscalEmissao.regSerie;
        data.observDig = this.notaFiscalEmissao.observacao;
        data.regNotaOri = this.notaFiscalEmissao.notaVenda;
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/confirmaNotaCarga", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(function (resp) {
            _this.notaFiscalEmissao.retRegNota = resp.retRegNota,
                _this.notaFiscalEmissao.retNumReg = resp.retNumReg;
        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.confirmaNotaCargaLote = function () {
        var _this = this;
        var data = new _nota_fiscal_emissao_model__WEBPACK_IMPORTED_MODULE_6__["ConfirmacaoNotaCargaFilterVo"]();
        data.regNota = this.notaFiscalEmissao.regNota;
        data.dtEmissao = new Date(this.notaFiscalEmissao.dtEmissao);
        data.codDest = this.notaFiscalEmissao.codDest;
        data.nota = this.notaFiscalEmissao.nota;
        data.regSerie = this.notaFiscalEmissao.regSerie;
        data.observDig = this.notaFiscalEmissao.observacao;
        data.regNotaOri = this.notaFiscalEmissao.notaVenda;
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/confirmaNotaCargaLote", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(function (resp) {
            _this.notaFiscalEmissao.retRegNota = resp.retRegNota,
                _this.notaFiscalEmissao.retNumReg = resp.retNumReg;
        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.prototype.getVerifPossuiLoteItemEV = function (regControle, materialId) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/balanca/notaCarga/getVerifPossuiLoteItemEV", { regControle: regControle, materialId: materialId })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    NotaFiscalEmissaoService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] }
    ]; };
    NotaFiscalEmissaoService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]])
    ], NotaFiscalEmissaoService);
    return NotaFiscalEmissaoService;
}(app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_2__["BaseService"]));



/***/ })

}]);
//# sourceMappingURL=default~app-pages-balanca-emissao-nota-fiscal-lote-emissao-nota-fiscal-lote-module~app-pages-nota-fi~29ec0b46.js.map