@seniorsistemas/yms-integration 1.45.0 → 1.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/seniorsistemas-yms-integration.umd.js +413 -93
- package/bundles/seniorsistemas-yms-integration.umd.js.map +1 -1
- package/bundles/seniorsistemas-yms-integration.umd.min.js +1 -1
- package/bundles/seniorsistemas-yms-integration.umd.min.js.map +1 -1
- package/esm2015/seniorsistemas-yms-integration.js +45 -43
- package/esm2015/src/erp-senior/components/nota-form/nota-form.component.js +14 -9
- package/esm2015/src/wms/components/document-grid/document-grid.component.js +9 -3
- package/esm2015/src/wms/components/document-grid/document-grid.facade.js +68 -11
- package/esm2015/src/wms/components/document-grid/document-grid.module.js +5 -4
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +65 -5
- package/esm2015/src/wms/components/document-grid/register-document/register-document.module.js +3 -1
- package/esm2015/src/wms/components/document-grid/strategies/expedicao-wms.strategy.js +78 -0
- package/esm2015/src/wms/components/document-grid/strategies/silt.strategy.js +7 -1
- package/esm2015/src/wms/components/document-grid/strategies/wms-integration-strategy.factory.js +13 -1
- package/esm2015/src/wms/entities/dados-coleta/dados-coleta.service.js +78 -0
- package/esm2015/src/wms/entities/document/document.js +8 -1
- package/esm2015/src/wms/entities/integration/integration.service.js +2 -1
- package/esm2015/src/wms/shared/cpf-cnpj-format.module.js +15 -0
- package/esm2015/src/wms/shared/cpf-cnpj-format.pipe.js +2 -2
- package/esm5/seniorsistemas-yms-integration.js +45 -43
- package/esm5/src/erp-senior/components/nota-form/nota-form.component.js +15 -9
- package/esm5/src/wms/components/document-grid/document-grid.component.js +9 -3
- package/esm5/src/wms/components/document-grid/document-grid.facade.js +69 -11
- package/esm5/src/wms/components/document-grid/document-grid.module.js +5 -4
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +65 -5
- package/esm5/src/wms/components/document-grid/register-document/register-document.module.js +3 -1
- package/esm5/src/wms/components/document-grid/strategies/expedicao-wms.strategy.js +82 -0
- package/esm5/src/wms/components/document-grid/strategies/silt.strategy.js +7 -1
- package/esm5/src/wms/components/document-grid/strategies/wms-integration-strategy.factory.js +13 -1
- package/esm5/src/wms/entities/dados-coleta/dados-coleta.service.js +81 -0
- package/esm5/src/wms/entities/document/document.js +8 -1
- package/esm5/src/wms/entities/integration/integration.service.js +2 -1
- package/esm5/src/wms/shared/cpf-cnpj-format.module.js +18 -0
- package/esm5/src/wms/shared/cpf-cnpj-format.pipe.js +2 -2
- package/fesm2015/seniorsistemas-yms-integration.js +356 -49
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +370 -52
- package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-yms-integration.d.ts +44 -42
- package/seniorsistemas-yms-integration.metadata.json +1 -1
- package/src/wms/components/document-grid/document-grid.component.d.ts +2 -0
- package/src/wms/components/document-grid/document-grid.facade.d.ts +5 -1
- package/src/wms/components/document-grid/register-document/register-document.component.d.ts +6 -1
- package/src/wms/components/document-grid/strategies/expedicao-wms.strategy.d.ts +21 -0
- package/src/wms/components/document-grid/strategies/wms-integration-strategy.factory.d.ts +6 -0
- package/src/wms/entities/dados-coleta/dados-coleta.service.d.ts +55 -0
- package/src/wms/entities/document/document.d.ts +7 -0
- package/src/wms/entities/integration/integration.service.d.ts +2 -1
- package/src/wms/shared/cpf-cnpj-format.module.d.ts +2 -0
|
@@ -3366,6 +3366,7 @@
|
|
|
3366
3366
|
ProcessType["DEVOLUCAO"] = "DEVOLUCAO";
|
|
3367
3367
|
ProcessType["PROCESSO_AVULSO"] = "PROCESSO_AVULSO";
|
|
3368
3368
|
ProcessType["RECEBIMENTO_WMS"] = "RECEBIMENTO_WMS";
|
|
3369
|
+
ProcessType["EXPEDICAO_WMS"] = "EXPEDICAO_WMS";
|
|
3369
3370
|
})(ProcessType || (ProcessType = {}));
|
|
3370
3371
|
|
|
3371
3372
|
var InvoiceCondition;
|
|
@@ -3593,6 +3594,12 @@
|
|
|
3593
3594
|
header: translate.instant("yms.int.wms_register_document_owner_document"),
|
|
3594
3595
|
type: ColumnType.TEXT,
|
|
3595
3596
|
},
|
|
3597
|
+
{
|
|
3598
|
+
field: "code",
|
|
3599
|
+
header: translate.instant("yms.int.wms_register_document_order_receiving_code"),
|
|
3600
|
+
width: "120px",
|
|
3601
|
+
type: ColumnType.TEXT,
|
|
3602
|
+
},
|
|
3596
3603
|
];
|
|
3597
3604
|
if (!isClienteExterno) {
|
|
3598
3605
|
columns.push({
|
|
@@ -3750,6 +3757,86 @@
|
|
|
3750
3757
|
return SeniorERPStrategy;
|
|
3751
3758
|
}());
|
|
3752
3759
|
|
|
3760
|
+
/**
|
|
3761
|
+
* Strategy específica para EXPEDICAO_WMS
|
|
3762
|
+
* Define colunas e comportamentos específicos para este tipo de processo
|
|
3763
|
+
*/
|
|
3764
|
+
var ExpedicaoWmsStrategy = /** @class */ (function () {
|
|
3765
|
+
function ExpedicaoWmsStrategy() {
|
|
3766
|
+
}
|
|
3767
|
+
ExpedicaoWmsStrategy.prototype.getGridColumns = function (translate, isClienteExterno) {
|
|
3768
|
+
var columns = [
|
|
3769
|
+
{
|
|
3770
|
+
field: "key",
|
|
3771
|
+
header: translate.instant("yms.int.wms_expedicao_document_key"),
|
|
3772
|
+
type: ColumnType.TEXT,
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
field: "invoiceNumber",
|
|
3776
|
+
header: translate.instant("yms.int.wms_register_document_invoice_number"),
|
|
3777
|
+
type: ColumnType.TEXT,
|
|
3778
|
+
},
|
|
3779
|
+
{
|
|
3780
|
+
field: "invoiceSerialNumber",
|
|
3781
|
+
header: translate.instant("yms.int.wms_register_document_invoice_serial_number"),
|
|
3782
|
+
type: ColumnType.TEXT,
|
|
3783
|
+
},
|
|
3784
|
+
{
|
|
3785
|
+
field: "numeroColetaWMS",
|
|
3786
|
+
header: translate.instant("yms.int.wms_expedicao_collection_number"),
|
|
3787
|
+
type: ColumnType.TEXT,
|
|
3788
|
+
},
|
|
3789
|
+
{
|
|
3790
|
+
field: "razaoSocialEmitente",
|
|
3791
|
+
header: translate.instant("yms.int.wms_expedicao_razao_social_emitente"),
|
|
3792
|
+
type: ColumnType.TEXT,
|
|
3793
|
+
},
|
|
3794
|
+
{
|
|
3795
|
+
field: "cnpjEmitente",
|
|
3796
|
+
header: translate.instant("yms.int.wms_expedicao_cnpj_emitente"),
|
|
3797
|
+
type: ColumnType.FORMATTED,
|
|
3798
|
+
pipe: "cpfCnpjFormat",
|
|
3799
|
+
},
|
|
3800
|
+
{
|
|
3801
|
+
field: "nomeRazaoSocialDestinatario",
|
|
3802
|
+
header: translate.instant("yms.int.wms_expedicao_nome_razao_social_destinatario"),
|
|
3803
|
+
type: ColumnType.TEXT,
|
|
3804
|
+
},
|
|
3805
|
+
{
|
|
3806
|
+
field: "cnpjCpfDestinatario",
|
|
3807
|
+
header: translate.instant("yms.int.wms_expedicao_cnpj_cpf_destinatario"),
|
|
3808
|
+
type: ColumnType.FORMATTED,
|
|
3809
|
+
pipe: "cpfCnpjFormat",
|
|
3810
|
+
},
|
|
3811
|
+
{
|
|
3812
|
+
field: "enderecoDestinatario",
|
|
3813
|
+
header: translate.instant("yms.int.wms_expedicao_endereco_destinatario"),
|
|
3814
|
+
type: ColumnType.TEXT,
|
|
3815
|
+
},
|
|
3816
|
+
];
|
|
3817
|
+
return columns;
|
|
3818
|
+
};
|
|
3819
|
+
ExpedicaoWmsStrategy.prototype.updateDocumentKey = function (document) {
|
|
3820
|
+
return document.key || document.invoiceKey || document.invoiceNumber + "-" + document.invoiceSerialNumber;
|
|
3821
|
+
};
|
|
3822
|
+
ExpedicaoWmsStrategy.prototype.validateDocument = function (document, context) {
|
|
3823
|
+
if (!document.invoiceNumber && !document.invoiceKey) {
|
|
3824
|
+
return {
|
|
3825
|
+
isValid: false,
|
|
3826
|
+
errorMessageKey: "yms.int.wms_expedicao_error_missing_invoice",
|
|
3827
|
+
};
|
|
3828
|
+
}
|
|
3829
|
+
return { isValid: true };
|
|
3830
|
+
};
|
|
3831
|
+
ExpedicaoWmsStrategy.prototype.getFilteredInvoiceConditions = function (invoiceCondition, allConditions) {
|
|
3832
|
+
return allConditions;
|
|
3833
|
+
};
|
|
3834
|
+
ExpedicaoWmsStrategy.prototype.supportsInvoiceCondition = function () {
|
|
3835
|
+
return true;
|
|
3836
|
+
};
|
|
3837
|
+
return ExpedicaoWmsStrategy;
|
|
3838
|
+
}());
|
|
3839
|
+
|
|
3753
3840
|
var WmsIntegrationStrategyFactory = /** @class */ (function () {
|
|
3754
3841
|
function WmsIntegrationStrategyFactory() {
|
|
3755
3842
|
this.strategies = new Map([
|
|
@@ -3763,6 +3850,16 @@
|
|
|
3763
3850
|
WmsIntegrationStrategyFactory.prototype.getStrategy = function (wmsSystem) {
|
|
3764
3851
|
return this.strategies.get(wmsSystem) || null;
|
|
3765
3852
|
};
|
|
3853
|
+
/**
|
|
3854
|
+
* Retorna strategy específica para EXPEDICAO_WMS
|
|
3855
|
+
* @param processType Tipo do processo
|
|
3856
|
+
*/
|
|
3857
|
+
WmsIntegrationStrategyFactory.prototype.getStrategyByProcessType = function (processType) {
|
|
3858
|
+
if (processType === ProcessType.EXPEDICAO_WMS) {
|
|
3859
|
+
return new ExpedicaoWmsStrategy();
|
|
3860
|
+
}
|
|
3861
|
+
return null;
|
|
3862
|
+
};
|
|
3766
3863
|
WmsIntegrationStrategyFactory.prototype.hasStrategy = function (wmsSystem) {
|
|
3767
3864
|
return this.strategies.has(wmsSystem);
|
|
3768
3865
|
};
|
|
@@ -3773,8 +3870,79 @@
|
|
|
3773
3870
|
return WmsIntegrationStrategyFactory;
|
|
3774
3871
|
}());
|
|
3775
3872
|
|
|
3873
|
+
/**
|
|
3874
|
+
* Serviço para gerenciar dados de coleta WMS vinculados a agendas YMS.
|
|
3875
|
+
* Utiliza o endpoint padrão gerado pela PlataformaX para a entidade dadosColeta.
|
|
3876
|
+
*
|
|
3877
|
+
* Endpoint: /t/senior.com.br/bridge/1.0/rest/yms_int/wms/entities/dadosColeta
|
|
3878
|
+
*/
|
|
3879
|
+
var DadosColetaService = /** @class */ (function (_super) {
|
|
3880
|
+
__extends(DadosColetaService, _super);
|
|
3881
|
+
function DadosColetaService(http, messageService) {
|
|
3882
|
+
var _this = _super.call(this, http, messageService, "yms_int/wms/entities/dadosColeta", "yms_int/wms/actions") || this;
|
|
3883
|
+
_this.http = http;
|
|
3884
|
+
_this.messageService = messageService;
|
|
3885
|
+
return _this;
|
|
3886
|
+
}
|
|
3887
|
+
/**
|
|
3888
|
+
* Busca o número da coleta WMS associado a uma agenda usando o endpoint padrão.
|
|
3889
|
+
* Utiliza filtro OData para buscar por agendaId.
|
|
3890
|
+
*
|
|
3891
|
+
* @param agendaId UUID da agenda no YMS
|
|
3892
|
+
* @returns Observable com o número da coleta ou null
|
|
3893
|
+
*
|
|
3894
|
+
* @example
|
|
3895
|
+
* ```typescript
|
|
3896
|
+
* dadosColetaService.getNumeroColetaByAgendaId('123e4567-e89b-12d3-a456-426614174000')
|
|
3897
|
+
* .subscribe(result => {
|
|
3898
|
+
* console.log('Número da coleta:', result.numeroColeta);
|
|
3899
|
+
* });
|
|
3900
|
+
* ```
|
|
3901
|
+
*/
|
|
3902
|
+
DadosColetaService.prototype.getNumeroColetaByAgendaId = function (agendaId) {
|
|
3903
|
+
// Usa o método list() padrão do EntityService com filtro OData
|
|
3904
|
+
return this.list({
|
|
3905
|
+
filterQuery: "agendaId eq '" + agendaId + "'",
|
|
3906
|
+
size: 1,
|
|
3907
|
+
page: 0,
|
|
3908
|
+
}).pipe(operators.map(function (response) {
|
|
3909
|
+
// Extrai o número da coleta do primeiro resultado (se existir)
|
|
3910
|
+
var numeroColeta = response.contents && response.contents.length > 0
|
|
3911
|
+
? response.contents[0].numeroColeta
|
|
3912
|
+
: null;
|
|
3913
|
+
return { numeroColeta: numeroColeta };
|
|
3914
|
+
}));
|
|
3915
|
+
};
|
|
3916
|
+
/**
|
|
3917
|
+
* Busca dados de coleta por agendaId retornando o objeto completo.
|
|
3918
|
+
*
|
|
3919
|
+
* @param agendaId UUID da agenda no YMS
|
|
3920
|
+
* @returns Observable com o DadosColetaDto completo ou null
|
|
3921
|
+
*/
|
|
3922
|
+
DadosColetaService.prototype.findByAgendaId = function (agendaId) {
|
|
3923
|
+
return this.list({
|
|
3924
|
+
filterQuery: "agendaId eq '" + agendaId + "'",
|
|
3925
|
+
size: 1,
|
|
3926
|
+
page: 0,
|
|
3927
|
+
}).pipe(operators.map(function (response) {
|
|
3928
|
+
return response.contents && response.contents.length > 0
|
|
3929
|
+
? response.contents[0]
|
|
3930
|
+
: null;
|
|
3931
|
+
}));
|
|
3932
|
+
};
|
|
3933
|
+
DadosColetaService.ngInjectableDef = core.defineInjectable({ factory: function DadosColetaService_Factory() { return new DadosColetaService(core.inject(http.HttpClient), core.inject(messageservice.MessageService)); }, token: DadosColetaService, providedIn: "root" });
|
|
3934
|
+
DadosColetaService = __decorate([
|
|
3935
|
+
core.Injectable({
|
|
3936
|
+
providedIn: "root",
|
|
3937
|
+
}),
|
|
3938
|
+
__metadata("design:paramtypes", [http.HttpClient,
|
|
3939
|
+
api.MessageService])
|
|
3940
|
+
], DadosColetaService);
|
|
3941
|
+
return DadosColetaService;
|
|
3942
|
+
}(EntityService$2));
|
|
3943
|
+
|
|
3776
3944
|
var DocumentGridFacade = /** @class */ (function () {
|
|
3777
|
-
function DocumentGridFacade(translate, documentService, integrationService, agendaService, utils, wmsService, strategyFactory) {
|
|
3945
|
+
function DocumentGridFacade(translate, documentService, integrationService, agendaService, utils, wmsService, strategyFactory, dadosColetaService) {
|
|
3778
3946
|
this.translate = translate;
|
|
3779
3947
|
this.documentService = documentService;
|
|
3780
3948
|
this.integrationService = integrationService;
|
|
@@ -3782,6 +3950,7 @@
|
|
|
3782
3950
|
this.utils = utils;
|
|
3783
3951
|
this.wmsService = wmsService;
|
|
3784
3952
|
this.strategyFactory = strategyFactory;
|
|
3953
|
+
this.dadosColetaService = dadosColetaService;
|
|
3785
3954
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
3786
3955
|
this.summary = "yms.int.wms_saved_document_message_title";
|
|
3787
3956
|
this.currentStrategy = null;
|
|
@@ -3834,9 +4003,19 @@
|
|
|
3834
4003
|
});
|
|
3835
4004
|
};
|
|
3836
4005
|
DocumentGridFacade.prototype.updateStrategy = function (wmsSystem) {
|
|
4006
|
+
if (this.state.processType === ProcessType.EXPEDICAO_WMS) {
|
|
4007
|
+
return;
|
|
4008
|
+
}
|
|
3837
4009
|
this.currentStrategy = this.strategyFactory.getStrategy(wmsSystem);
|
|
3838
4010
|
this.updateGridColumns();
|
|
3839
4011
|
};
|
|
4012
|
+
DocumentGridFacade.prototype.updateStrategyByProcessType = function (processType) {
|
|
4013
|
+
var strategyByProcess = this.strategyFactory.getStrategyByProcessType(processType);
|
|
4014
|
+
if (strategyByProcess) {
|
|
4015
|
+
this.currentStrategy = strategyByProcess;
|
|
4016
|
+
this.updateGridColumns();
|
|
4017
|
+
}
|
|
4018
|
+
};
|
|
3840
4019
|
DocumentGridFacade.prototype.getYard = function () {
|
|
3841
4020
|
var _this = this;
|
|
3842
4021
|
this.documentService
|
|
@@ -3875,6 +4054,10 @@
|
|
|
3875
4054
|
.getProcessTypeByScheduling(this.agenda.tipoAgendamento.id)
|
|
3876
4055
|
.subscribe(function (result) {
|
|
3877
4056
|
_this.updateState({ processType: result.processType });
|
|
4057
|
+
// Se for EXPEDICAO_WMS, atualiza strategy e colunas
|
|
4058
|
+
if (result.processType === ProcessType.EXPEDICAO_WMS) {
|
|
4059
|
+
_this.updateStrategyByProcessType(result.processType);
|
|
4060
|
+
}
|
|
3878
4061
|
});
|
|
3879
4062
|
};
|
|
3880
4063
|
DocumentGridFacade.prototype.cantEditStatus = function () {
|
|
@@ -4042,12 +4225,53 @@
|
|
|
4042
4225
|
? contents.totalElements
|
|
4043
4226
|
: newGridData.length;
|
|
4044
4227
|
var hasElementWithoutId = newGridData.some(function (item) { return !item.id; });
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4228
|
+
// Se for EXPEDICAO_WMS, busca o número da coleta
|
|
4229
|
+
if (_this.state.processType === ProcessType.EXPEDICAO_WMS && newGridData.length > 0) {
|
|
4230
|
+
_this.fetchNumeroColetaForDocuments(newGridData).subscribe(function (documentsWithColeta) {
|
|
4231
|
+
_this.updateState({
|
|
4232
|
+
gridData: documentsWithColeta,
|
|
4233
|
+
disabled: !hasElementWithoutId,
|
|
4234
|
+
loading: false,
|
|
4235
|
+
selection: [],
|
|
4236
|
+
documentTotalRecords: documentTotalRecords,
|
|
4237
|
+
});
|
|
4238
|
+
});
|
|
4239
|
+
}
|
|
4240
|
+
else {
|
|
4241
|
+
_this.updateState({
|
|
4242
|
+
gridData: newGridData,
|
|
4243
|
+
disabled: !hasElementWithoutId,
|
|
4244
|
+
loading: false,
|
|
4245
|
+
selection: [],
|
|
4246
|
+
documentTotalRecords: documentTotalRecords,
|
|
4247
|
+
});
|
|
4248
|
+
}
|
|
4249
|
+
});
|
|
4250
|
+
};
|
|
4251
|
+
DocumentGridFacade.prototype.fetchNumeroColetaForDocuments = function (documents) {
|
|
4252
|
+
var _this = this;
|
|
4253
|
+
// Busca o número da coleta para a agenda
|
|
4254
|
+
return new rxjs.Observable(function (observer) {
|
|
4255
|
+
_this.dadosColetaService
|
|
4256
|
+
.getNumeroColetaByAgendaId(_this.agenda.id)
|
|
4257
|
+
.pipe(operators.catchError(function (err) {
|
|
4258
|
+
console.error("Erro ao buscar número da coleta", err);
|
|
4259
|
+
// Em caso de erro, retorna os documentos sem o número da coleta
|
|
4260
|
+
return rxjs.throwError(err);
|
|
4261
|
+
}))
|
|
4262
|
+
.subscribe({
|
|
4263
|
+
next: function (result) {
|
|
4264
|
+
// Atribui o número da coleta a todos os documentos
|
|
4265
|
+
var documentsWithColeta = documents.map(function (doc) { return (__assign({}, doc, { numeroColetaWMS: result.numeroColeta || "N/A" })); });
|
|
4266
|
+
observer.next(documentsWithColeta);
|
|
4267
|
+
observer.complete();
|
|
4268
|
+
},
|
|
4269
|
+
error: function () {
|
|
4270
|
+
// Em caso de erro, retorna os documentos sem o número da coleta
|
|
4271
|
+
var documentsWithoutColeta = documents.map(function (doc) { return (__assign({}, doc, { numeroColetaWMS: "N/A" })); });
|
|
4272
|
+
observer.next(documentsWithoutColeta);
|
|
4273
|
+
observer.complete();
|
|
4274
|
+
},
|
|
4051
4275
|
});
|
|
4052
4276
|
});
|
|
4053
4277
|
};
|
|
@@ -4151,7 +4375,8 @@
|
|
|
4151
4375
|
AgendaService,
|
|
4152
4376
|
UtilsMessageService,
|
|
4153
4377
|
FormWmsService,
|
|
4154
|
-
WmsIntegrationStrategyFactory
|
|
4378
|
+
WmsIntegrationStrategyFactory,
|
|
4379
|
+
DadosColetaService])
|
|
4155
4380
|
], DocumentGridFacade);
|
|
4156
4381
|
return DocumentGridFacade;
|
|
4157
4382
|
}());
|
|
@@ -4214,6 +4439,12 @@
|
|
|
4214
4439
|
DocumentGridComponent.prototype.notSavedDocuments = function () {
|
|
4215
4440
|
return this.facade.notSavedDocuments();
|
|
4216
4441
|
};
|
|
4442
|
+
DocumentGridComponent.prototype.isExpedicaoWms = function (processType) {
|
|
4443
|
+
return processType === 'EXPEDICAO_WMS';
|
|
4444
|
+
};
|
|
4445
|
+
DocumentGridComponent.prototype.onSearch = function () {
|
|
4446
|
+
this.facade.openInvoiceKeyModal();
|
|
4447
|
+
};
|
|
4217
4448
|
__decorate([
|
|
4218
4449
|
core.Input(),
|
|
4219
4450
|
__metadata("design:type", Object)
|
|
@@ -4261,8 +4492,8 @@
|
|
|
4261
4492
|
DocumentGridComponent = __decorate([
|
|
4262
4493
|
core.Component({
|
|
4263
4494
|
selector: "document-grid",
|
|
4264
|
-
template: "<ng-container *ngIf=\"state$ | async as state\">\n <div\n *ngIf=\"state.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\"\n >\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{ 'yms.int.wms_add_document' | translate }}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n >\n </s-button>\n <s-button\n label=\"{{ 'yms.wms_view_button' | translate }}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.selection || state.selection.length !== 1\"\n (onClick)=\"onView()\"\n >\n </s-button>\n <s-button\n label=\"{{ 'yms.wms_delete_button' | translate }}\"\n priority=\"secondary\"\n [disabled]=\"\n !state.selection ||\n !state.selection.length ||\n !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onDelete()\"\n >\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"onRefresh()\"\n [disabled]=\"notSavedDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div\n class=\"ui-g-12\"\n *ngIf=\"state.gridData && state.gridData.length; else emptyList\"\n >\n <p-table\n #documentTable\n [value]=\"state.gridData\"\n [columns]=\"state.gridColumns\"\n dataKey=\"key\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"state.documentTotalRecords\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [(selection)]=\"state.selection\"\n [loading]=\"state.loading\"\n >\n <ng-template pTemplate=\"
|
|
4265
|
-
styles: [".buttons{display:flex;justify-content:space-between}.center{flex-direction:column;text-align:center}.ui-g{display:block}.button-save{margin:5px 0}#refresh-button{color:#fff}.table-checkbox{width:50px}.invoice-condition .p-dropdown{position:relative;z-index:1000}"]
|
|
4495
|
+
template: "<ng-container *ngIf=\"state$ | async as state\">\n <div\n *ngIf=\"state.processType === 'RECEBIMENTO_WMS' || state.processType === 'EXPEDICAO_WMS'; else processNotConfigured\"\n >\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n *ngIf=\"!isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.int.wms_add_document' | translate }}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n >\n </s-button>\n <s-button\n *ngIf=\"isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.int.wms_search' | translate }}\"\n priority=\"primary\"\n iconClass=\"fa fa-search\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n (onClick)=\"onSearch()\"\n >\n </s-button>\n <s-button\n label=\"{{ 'yms.wms_view_button' | translate }}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.selection || state.selection.length !== 1\"\n (onClick)=\"onView()\"\n >\n </s-button>\n <s-button\n *ngIf=\"!isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.wms_delete_button' | translate }}\"\n priority=\"secondary\"\n [disabled]=\"\n !state.selection ||\n !state.selection.length ||\n !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onDelete()\"\n >\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"onRefresh()\"\n [disabled]=\"notSavedDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div\n class=\"ui-g-12\"\n *ngIf=\"state.gridData && state.gridData.length; else emptyList\"\n >\n <p-table\n #documentTable\n [value]=\"state.gridData\"\n [columns]=\"state.gridColumns\"\n dataKey=\"key\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"state.documentTotalRecords\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [(selection)]=\"state.selection\"\n [loading]=\"state.loading\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-expanded=\"expanded\"\n >\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td\n *ngFor=\"let col of state.gridColumns\"\n (click)=\"onRowSelect(rowData)\"\n (keypress)=\"onRowSelect(rowData)\"\n [title]=\"rowData[col.field]\"\n >\n <span *ngIf=\"!col.type || col.type === 'text'\">\n {{ rowData[col.field] }}\n </span>\n\n <span\n *ngIf=\"\n col.type === 'formatted' && col.pipe === 'cpfCnpjFormat'\n \"\n >\n {{ rowData[col.field] | cpfCnpjFormat }}\n </span>\n\n <p-dropdown\n *ngIf=\"\n col.type === 'dropdown' &&\n col.field === 'invoiceCondition' &&\n !isExpedicaoWms(state.processType)\n \"\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"\n getFilteredInvoiceConditions(rowData?.invoiceCondition)\n \"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"onInvoiceConditionChange()\"\n >\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span\n [translate]=\"'yms.main.total_records'\"\n [translateParams]=\"{ value: state.documentTotalRecords }\"\n >\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <register-document\n [wmsSystem]=\"state.wmsSystem\"\n [processType]=\"state.processType\"\n [edit]=\"state.edit\"\n [viewDocument]=\"state.selection\"\n [(visible)]=\"state.showAddInvoiceModal\"\n [agenda]=\"agenda\"\n [isClienteExterno]=\"state.isClienteExterno\"\n >\n </register-document>\n <insert-key\n [wmsSystem]=\"state.wmsSystem\"\n [agenda]=\"agenda\"\n [(visible)]=\"state.showInvoiceSearchModal\"\n >\n </insert-key>\n </p-panel>\n </div>\n <div class=\"button-save\">\n <s-button\n priority=\"primary\"\n [label]=\"'save' | translate\"\n [disabled]=\"\n state.disabled || !state.gridData || !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onSave()\"\n >\n </s-button>\n </div>\n</ng-container>\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\"\n >\n </s-empty-state>\n </div>\n</ng-template>\n\n<ng-template #processNotConfigured>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"\n 'yms.int.wms_there_no_process_type_configured_for_this_type_scheduling'\n | translate\n \"\n >\n </s-empty-state>\n </div>\n</ng-template>\n",
|
|
4496
|
+
styles: [".buttons{display:flex;justify-content:space-between}.center{flex-direction:column;text-align:center}.ui-g{display:block}.button-save{margin:5px 0}#refresh-button{color:#fff}.table-checkbox{width:50px;min-width:50px;max-width:50px}.invoice-condition .p-dropdown{position:relative;z-index:1000}::ng-deep p-table .ui-table{table-layout:auto!important}::ng-deep p-table td:nth-child(1),::ng-deep p-table th:nth-child(1){min-width:50px;max-width:50px;width:50px}::ng-deep p-table td:nth-child(3),::ng-deep p-table td:nth-child(4),::ng-deep p-table td:nth-child(5),::ng-deep p-table th:nth-child(3),::ng-deep p-table th:nth-child(4),::ng-deep p-table th:nth-child(5){min-width:100px}::ng-deep p-table td:nth-child(7),::ng-deep p-table td:nth-child(9),::ng-deep p-table th:nth-child(7),::ng-deep p-table th:nth-child(9){min-width:140px}::ng-deep p-table td:nth-child(10),::ng-deep p-table td:nth-child(2),::ng-deep p-table td:nth-child(6),::ng-deep p-table td:nth-child(8),::ng-deep p-table th:nth-child(10),::ng-deep p-table th:nth-child(2),::ng-deep p-table th:nth-child(6),::ng-deep p-table th:nth-child(8){min-width:180px}::ng-deep p-table td span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep p-table .ui-resizable-column{border-right:1px solid #c8c8c8}::ng-deep p-table .ui-column-resizer{display:block;position:absolute;top:0;right:0;margin:0;width:.5rem;height:100%;padding:0;cursor:col-resize;border:1px solid transparent}::ng-deep p-table .ui-column-resizer:hover{border-color:#007ad9}"]
|
|
4266
4497
|
}),
|
|
4267
4498
|
__metadata("design:paramtypes", [DocumentGridFacade,
|
|
4268
4499
|
api.ConfirmationService,
|
|
@@ -4293,9 +4524,16 @@
|
|
|
4293
4524
|
"ownerDocument",
|
|
4294
4525
|
"partnerName",
|
|
4295
4526
|
"partnerDocument",
|
|
4527
|
+
"partnerAddress",
|
|
4296
4528
|
"invoiceCondition",
|
|
4297
4529
|
"notes",
|
|
4298
4530
|
"code",
|
|
4531
|
+
"razaoSocialEmitente",
|
|
4532
|
+
"cnpjEmitente",
|
|
4533
|
+
"cnpjCpfDestinatario",
|
|
4534
|
+
"nomeRazaoSocialDestinatario",
|
|
4535
|
+
"enderecoDestinatario",
|
|
4536
|
+
"numeroColetaWMS",
|
|
4299
4537
|
"createdBy",
|
|
4300
4538
|
"createdDate",
|
|
4301
4539
|
"lastModifiedBy",
|
|
@@ -4313,11 +4551,40 @@
|
|
|
4313
4551
|
return Document;
|
|
4314
4552
|
}());
|
|
4315
4553
|
|
|
4554
|
+
var CpfCnpjFormatPipe = /** @class */ (function () {
|
|
4555
|
+
function CpfCnpjFormatPipe() {
|
|
4556
|
+
}
|
|
4557
|
+
CpfCnpjFormatPipe.prototype.transform = function (value) {
|
|
4558
|
+
if (!value) {
|
|
4559
|
+
return '';
|
|
4560
|
+
}
|
|
4561
|
+
var numeros = value.replace(/\D/g, '');
|
|
4562
|
+
var cpfLength = 11;
|
|
4563
|
+
var cnpjLength = 14;
|
|
4564
|
+
if (numeros.length === cpfLength) {
|
|
4565
|
+
return numeros.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, "$1.$2.$3-$4");
|
|
4566
|
+
}
|
|
4567
|
+
else if (numeros.length === cnpjLength) {
|
|
4568
|
+
return numeros.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, "$1.$2.$3/$4-$5");
|
|
4569
|
+
}
|
|
4570
|
+
else {
|
|
4571
|
+
return value;
|
|
4572
|
+
}
|
|
4573
|
+
};
|
|
4574
|
+
CpfCnpjFormatPipe = __decorate([
|
|
4575
|
+
core.Pipe({
|
|
4576
|
+
name: 'cpfCnpjFormat'
|
|
4577
|
+
})
|
|
4578
|
+
], CpfCnpjFormatPipe);
|
|
4579
|
+
return CpfCnpjFormatPipe;
|
|
4580
|
+
}());
|
|
4581
|
+
|
|
4316
4582
|
var RegisterDocumentComponent = /** @class */ (function () {
|
|
4317
|
-
function RegisterDocumentComponent(fb, translate, facade) {
|
|
4583
|
+
function RegisterDocumentComponent(fb, translate, facade, cpfCnpjPipe) {
|
|
4318
4584
|
this.fb = fb;
|
|
4319
4585
|
this.translate = translate;
|
|
4320
4586
|
this.facade = facade;
|
|
4587
|
+
this.cpfCnpjPipe = cpfCnpjPipe;
|
|
4321
4588
|
this.document = new core.EventEmitter();
|
|
4322
4589
|
this.visible = new core.EventEmitter();
|
|
4323
4590
|
this.visibleChange = new core.EventEmitter();
|
|
@@ -4362,9 +4629,19 @@
|
|
|
4362
4629
|
this.formGroup.get("code").setValue(document.code);
|
|
4363
4630
|
this.formGroup.get("partnerName").setValue(document.partnerName);
|
|
4364
4631
|
this.formGroup.get("partnerDocument").setValue(document.partnerDocument);
|
|
4632
|
+
this.formGroup.get("partnerAddress").setValue(document.partnerAddress);
|
|
4365
4633
|
this.formGroup.get("ownerDocument").setValue(document.ownerDocument);
|
|
4366
4634
|
this.formGroup.get("ownerName").setValue(document.ownerName);
|
|
4367
4635
|
this.formGroup.get("invoiceCondition").setValue(document.invoiceCondition);
|
|
4636
|
+
var cnpjEmitente = document.cnpjEmitente || document.ownerDocument;
|
|
4637
|
+
var cnpjCpfDestinatario = document.cnpjCpfDestinatario || document.partnerDocument;
|
|
4638
|
+
this.formGroup.get("razaoSocialEmitente").setValue(document.razaoSocialEmitente || document.ownerName);
|
|
4639
|
+
this.formGroup.get("cnpjEmitente").setValue(!this.edit ? this.cpfCnpjPipe.transform(cnpjEmitente) : cnpjEmitente);
|
|
4640
|
+
this.formGroup.get("cnpjCpfDestinatario").setValue(!this.edit ? this.cpfCnpjPipe.transform(cnpjCpfDestinatario) : cnpjCpfDestinatario);
|
|
4641
|
+
this.formGroup.get("nomeRazaoSocialDestinatario").setValue(document.nomeRazaoSocialDestinatario || document.partnerName);
|
|
4642
|
+
this.formGroup.get("enderecoDestinatario").setValue(document.enderecoDestinatario || document.partnerAddress);
|
|
4643
|
+
this.formGroup.get("numeroColetaWMS").setValue(document.numeroColetaWMS || document.code);
|
|
4644
|
+
this.applyFormStateForExpedicaoWms();
|
|
4368
4645
|
};
|
|
4369
4646
|
RegisterDocumentComponent.prototype.getFormGroup = function () {
|
|
4370
4647
|
this.formGroup = this.fb.group({
|
|
@@ -4379,13 +4656,38 @@
|
|
|
4379
4656
|
ownerDocument: [undefined],
|
|
4380
4657
|
partnerName: [undefined],
|
|
4381
4658
|
partnerDocument: [undefined],
|
|
4659
|
+
partnerAddress: [undefined],
|
|
4382
4660
|
notes: [undefined],
|
|
4383
4661
|
code: [undefined],
|
|
4384
4662
|
invoiceCondition: [undefined],
|
|
4663
|
+
// Campos específicos para EXPEDICAO_WMS
|
|
4664
|
+
razaoSocialEmitente: [undefined],
|
|
4665
|
+
cnpjEmitente: [undefined],
|
|
4666
|
+
cnpjCpfDestinatario: [undefined],
|
|
4667
|
+
nomeRazaoSocialDestinatario: [undefined],
|
|
4668
|
+
enderecoDestinatario: [undefined],
|
|
4669
|
+
numeroColetaWMS: [undefined],
|
|
4385
4670
|
});
|
|
4386
4671
|
};
|
|
4387
4672
|
RegisterDocumentComponent.prototype.save = function () {
|
|
4388
|
-
var
|
|
4673
|
+
var formValue = this.formGroup.getRawValue();
|
|
4674
|
+
// Se for EXPEDICAO_WMS, mapear campos específicos para os campos padrão da entidade
|
|
4675
|
+
if (this.isExpedicaoWms()) {
|
|
4676
|
+
formValue.ownerName = formValue.razaoSocialEmitente;
|
|
4677
|
+
formValue.ownerDocument = formValue.cnpjEmitente;
|
|
4678
|
+
formValue.partnerName = formValue.nomeRazaoSocialDestinatario;
|
|
4679
|
+
formValue.partnerDocument = formValue.cnpjCpfDestinatario;
|
|
4680
|
+
formValue.partnerAddress = formValue.enderecoDestinatario;
|
|
4681
|
+
formValue.code = formValue.numeroColetaWMS;
|
|
4682
|
+
// Manter também os campos específicos para o grid
|
|
4683
|
+
formValue.razaoSocialEmitente = formValue.razaoSocialEmitente;
|
|
4684
|
+
formValue.cnpjEmitente = formValue.cnpjEmitente;
|
|
4685
|
+
formValue.nomeRazaoSocialDestinatario = formValue.nomeRazaoSocialDestinatario;
|
|
4686
|
+
formValue.cnpjCpfDestinatario = formValue.cnpjCpfDestinatario;
|
|
4687
|
+
formValue.enderecoDestinatario = formValue.enderecoDestinatario;
|
|
4688
|
+
formValue.numeroColetaWMS = formValue.numeroColetaWMS;
|
|
4689
|
+
}
|
|
4690
|
+
var document = Document.fromDto(formValue);
|
|
4389
4691
|
if (!this.facade.validateDocument(document)) {
|
|
4390
4692
|
return;
|
|
4391
4693
|
}
|
|
@@ -4404,6 +4706,22 @@
|
|
|
4404
4706
|
RegisterDocumentComponent.prototype.isWmsPartner = function () {
|
|
4405
4707
|
return this.wmsSystem === WmsSystem.PARTNER;
|
|
4406
4708
|
};
|
|
4709
|
+
RegisterDocumentComponent.prototype.isExpedicaoWms = function () {
|
|
4710
|
+
return this.processType === 'EXPEDICAO_WMS';
|
|
4711
|
+
};
|
|
4712
|
+
RegisterDocumentComponent.prototype.applyFormStateForExpedicaoWms = function () {
|
|
4713
|
+
if (this.isExpedicaoWms() && !this.edit) {
|
|
4714
|
+
this.formGroup.get("invoiceKey").disable();
|
|
4715
|
+
this.formGroup.get("invoiceNumber").disable();
|
|
4716
|
+
this.formGroup.get("invoiceSerialNumber").disable();
|
|
4717
|
+
this.formGroup.get("razaoSocialEmitente").disable();
|
|
4718
|
+
this.formGroup.get("cnpjEmitente").disable();
|
|
4719
|
+
this.formGroup.get("nomeRazaoSocialDestinatario").disable();
|
|
4720
|
+
this.formGroup.get("cnpjCpfDestinatario").disable();
|
|
4721
|
+
this.formGroup.get("enderecoDestinatario").disable();
|
|
4722
|
+
this.formGroup.get("numeroColetaWMS").disable();
|
|
4723
|
+
}
|
|
4724
|
+
};
|
|
4407
4725
|
RegisterDocumentComponent.prototype.watchFormChanges = function () {
|
|
4408
4726
|
var _this = this;
|
|
4409
4727
|
this.formGroup.valueChanges.subscribe(function () {
|
|
@@ -4427,6 +4745,10 @@
|
|
|
4427
4745
|
core.Input(),
|
|
4428
4746
|
__metadata("design:type", Boolean)
|
|
4429
4747
|
], RegisterDocumentComponent.prototype, "isClienteExterno", void 0);
|
|
4748
|
+
__decorate([
|
|
4749
|
+
core.Input(),
|
|
4750
|
+
__metadata("design:type", String)
|
|
4751
|
+
], RegisterDocumentComponent.prototype, "processType", void 0);
|
|
4430
4752
|
__decorate([
|
|
4431
4753
|
core.Output(),
|
|
4432
4754
|
__metadata("design:type", core.EventEmitter)
|
|
@@ -4446,15 +4768,31 @@
|
|
|
4446
4768
|
RegisterDocumentComponent = __decorate([
|
|
4447
4769
|
core.Component({
|
|
4448
4770
|
selector: "register-document",
|
|
4449
|
-
template: "<s-sidebar\n [visible]=\"visible\"\n header=\"
|
|
4771
|
+
template: "<s-sidebar\n [visible]=\"visible\"\n [header]=\"(isExpedicaoWms() && !edit) ? ('yms.int.wms_view_document' | translate) : ('yms.int.wms_register_document_add_document' | translate)\"\n (visibleChange)=\"close()\"\n (onclose)=\"close()\"\n>\n <form [formGroup]=\"formGroup\">\n <!-- Layout espec\u00EDfico para EXPEDICAO_WMS -->\n <div class=\"ui-g ui-fluid\" *ngIf=\"isExpedicaoWms()\">\n <div class=\"ui-g-12\">\n <label for=\"invoiceKey\">{{ \"yms.int.wms_expedicao_document_key\" | translate }}</label>\n <input id=\"invoiceKey\" pInputText type=\"text\" formControlName=\"invoiceKey\" />\n </div>\n <div class=\"ui-g-6\">\n <label for=\"invoiceNumber\">{{ \"yms.int.wms_register_document_invoice_number\" | translate }}</label>\n <input id=\"invoiceNumber\" pInputText type=\"text\" formControlName=\"invoiceNumber\" />\n </div>\n <div class=\"ui-g-6\">\n <label for=\"invoiceSerialNumber\">{{ \"yms.int.wms_register_document_invoice_serial_number\" | translate }}</label>\n <input id=\"invoiceSerialNumber\" pInputText type=\"text\" formControlName=\"invoiceSerialNumber\" />\n </div>\n <div class=\"ui-g-8\">\n <label for=\"razaoSocialEmitente\">{{ \"yms.int.wms_expedicao_razao_social_emitente\" | translate }}</label>\n <input id=\"razaoSocialEmitente\" pInputText type=\"text\" formControlName=\"razaoSocialEmitente\" />\n </div>\n <div class=\"ui-g-4\">\n <label for=\"cnpjEmitente\">{{ \"yms.int.wms_expedicao_cnpj_emitente\" | translate }}</label>\n <input id=\"cnpjEmitente\" pInputText type=\"text\" formControlName=\"cnpjEmitente\" />\n </div>\n <div class=\"ui-g-8\">\n <label for=\"nomeRazaoSocialDestinatario\">{{ \"yms.int.wms_expedicao_nome_razao_social_destinatario\" | translate }}</label>\n <input id=\"nomeRazaoSocialDestinatario\" pInputText type=\"text\" formControlName=\"nomeRazaoSocialDestinatario\" />\n </div>\n <div class=\"ui-g-4\">\n <label for=\"cnpjCpfDestinatario\">{{ \"yms.int.wms_expedicao_cnpj_cpf_destinatario\" | translate }}</label>\n <input id=\"cnpjCpfDestinatario\" pInputText type=\"text\" formControlName=\"cnpjCpfDestinatario\" />\n </div>\n <div class=\"ui-g-12\">\n <label for=\"enderecoDestinatario\">{{ \"yms.int.wms_expedicao_endereco_destinatario\" | translate }}</label>\n <input id=\"enderecoDestinatario\" pInputText type=\"text\" formControlName=\"enderecoDestinatario\" />\n </div>\n <div class=\"ui-g-12\">\n <label for=\"numeroColetaWMS\">{{ \"yms.int.wms_expedicao_collection_number\" | translate }}</label>\n <input id=\"numeroColetaWMS\" pInputText type=\"text\" formControlName=\"numeroColetaWMS\" />\n </div>\n </div>\n \n <!-- Layout padr\u00E3o para outros processos -->\n <div class=\"ui-g ui-fluid\" *ngIf=\"!isExpedicaoWms()\">\n <div class=\"ui-g-6\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"key\">{{ \"yms.int.wms_purchaseOrder\" | translate }}</label>\n <input id=\"key\" pInputText type=\"text\" formControlName=\"key\" />\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"invoiceKey\">{{\n \"yms.int.wms_register_document_invoice_key\" | translate\n }}</label>\n <input\n id=\"invoiceKey\"\n pInputText\n type=\"text\"\n formControlName=\"invoiceKey\"\n />\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"invoiceNumber\">{{\n \"yms.int.wms_register_document_invoice_number\" | translate\n }}</label>\n <input\n id=\"invoiceNumber\"\n pInputText\n type=\"text\"\n formControlName=\"invoiceNumber\"\n />\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"invoiceSerialNumber\">\n {{\n \"yms.int.wms_register_document_invoice_serial_number\" | translate\n }}\n </label>\n <input\n id=\"invoiceSerialNumber\"\n pInputText\n type=\"text\"\n formControlName=\"invoiceSerialNumber\"\n />\n </div>\n <div class=\"ui-g-8\" *ngIf=\"!isWmsPartner()\">\n <label for=\"logistcUnitName\">{{\n \"yms.int.wms_register_document_logistc_unit_name\" | translate\n }}</label>\n <input\n id=\"logistcUnitName\"\n pInputText\n type=\"text\"\n formControlName=\"logistcUnitName\"\n />\n </div>\n <div class=\"ui-g-4\" *ngIf=\"!isWmsPartner()\">\n <label for=\"logistcUnitDocument\">\n {{\n \"yms.int.wms_register_document_logistc_unit_document\" | translate\n }}\n </label>\n <input\n id=\"logistcUnitDocument\"\n pInputText\n type=\"text\"\n formControlName=\"logistcUnitDocument\"\n />\n </div>\n <div\n class=\"ui-g-8\"\n *ngIf=\"!isWmsSeniorConnect() && !isWmsWis() && !isWmsPartner()\"\n >\n <label for=\"documentOwnerName\">{{\n \"yms.int.wms_register_document_owner_name\" | translate\n }}</label>\n <input\n id=\"documentOwnerName\"\n pInputText\n type=\"text\"\n formControlName=\"ownerName\"\n />\n </div>\n <div\n class=\"ui-g-4\"\n *ngIf=\"!isWmsSeniorConnect() && !isWmsWis() && !isWmsPartner()\"\n >\n <label for=\"ownerDocument\">{{\n \"yms.int.wms_register_document_owner_document\" | translate\n }}</label>\n <input\n id=\"ownerDocument\"\n pInputText\n type=\"text\"\n formControlName=\"ownerDocument\"\n />\n </div>\n <div class=\"ui-g-8\">\n <label for=\"partnerName\">{{\n \"yms.int.wms_register_document_partner_name\" | translate\n }}</label>\n <input\n id=\"partnerName\"\n pInputText\n type=\"text\"\n formControlName=\"partnerName\"\n />\n </div>\n <div class=\"ui-g-4\">\n <label for=\"partnerDocument\">{{\n \"yms.int.wms_register_document_partner_document\" | translate\n }}</label>\n <input\n id=\"partnerDocument\"\n pInputText\n type=\"text\"\n formControlName=\"partnerDocument\"\n />\n </div>\n <div class=\"ui-g-12\">\n <label for=\"notes\" id=\"notes\">{{\n \"yms.int.wms_register_document_notes\" | translate\n }}</label>\n <textarea\n id=\"notes\"\n rows=\"4\"\n pInputTextarea\n autoResize=\"autoResize\"\n formControlName=\"notes\"\n ></textarea>\n </div>\n <div class=\"ui-g-4\" *ngIf=\"isWmsSenior() || isWmsWis()\">\n <label for=\"code\">\n {{ (isExpedicaoWms() ? \"yms.int.wms_expedicao_collection_number\" : \"yms.int.wms_register_document_order_receiving_code\") | translate }}\n </label>\n <input id=\"code\" pInputText type=\"text\" formControlName=\"code\" />\n </div>\n <div\n class=\"ui-g-4\"\n *ngIf=\"!isClienteExterno && (isWmsWis() || isWmsPartner())\"\n >\n <label for=\"invoiceCondition\" id=\"invoiceCondition\">\n {{ \"yms.int.wms_grid_document_invoice_condition\" | translate }}\n </label>\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"invoiceCondition\"\n formControlName=\"invoiceCondition\"\n ></p-dropdown>\n </div>\n </div> <!-- Fim do layout padr\u00E3o -->\n </form>\n <div class=\"space-between\">\n <button\n pButton\n label=\"{{ 'save' | translate }}\"\n (click)=\"save()\"\n [attr.data-hidden]=\"hideSaveButton\"\n [disabled]=\"!isSaveFormValid\"\n ></button>\n <button\n type=\"button\"\n class=\"ui-button-link\"\n pButton\n label=\"{{ 'cancel' | translate }}\"\n (click)=\"close()\"\n ></button>\n </div>\n</s-sidebar>\n",
|
|
4772
|
+
providers: [CpfCnpjFormatPipe],
|
|
4773
|
+
styles: [".form-value-display{min-height:30px;padding:.429em;border:1px solid #a6a6a6;background-color:#efefef;color:#666;border-radius:3px;line-height:1.5;font-family:inherit;font-size:inherit}.form-value-display:empty::before{content:'\\00a0'}.space-between{display:flex;justify-content:space-between;margin-top:1rem;gap:.5rem}"]
|
|
4450
4774
|
}),
|
|
4451
4775
|
__metadata("design:paramtypes", [forms.FormBuilder,
|
|
4452
4776
|
core$1.TranslateService,
|
|
4453
|
-
DocumentGridFacade
|
|
4777
|
+
DocumentGridFacade,
|
|
4778
|
+
CpfCnpjFormatPipe])
|
|
4454
4779
|
], RegisterDocumentComponent);
|
|
4455
4780
|
return RegisterDocumentComponent;
|
|
4456
4781
|
}());
|
|
4457
4782
|
|
|
4783
|
+
var CpfCnpjFormatModule = /** @class */ (function () {
|
|
4784
|
+
function CpfCnpjFormatModule() {
|
|
4785
|
+
}
|
|
4786
|
+
CpfCnpjFormatModule = __decorate([
|
|
4787
|
+
core.NgModule({
|
|
4788
|
+
declarations: [CpfCnpjFormatPipe],
|
|
4789
|
+
imports: [common.CommonModule],
|
|
4790
|
+
exports: [CpfCnpjFormatPipe]
|
|
4791
|
+
})
|
|
4792
|
+
], CpfCnpjFormatModule);
|
|
4793
|
+
return CpfCnpjFormatModule;
|
|
4794
|
+
}());
|
|
4795
|
+
|
|
4458
4796
|
var RegisterDocumentModule = /** @class */ (function () {
|
|
4459
4797
|
function RegisterDocumentModule() {
|
|
4460
4798
|
}
|
|
@@ -4472,6 +4810,7 @@
|
|
|
4472
4810
|
primeng.InputTextareaModule,
|
|
4473
4811
|
forms.ReactiveFormsModule,
|
|
4474
4812
|
primeng.DropdownModule,
|
|
4813
|
+
CpfCnpjFormatModule,
|
|
4475
4814
|
],
|
|
4476
4815
|
exports: [RegisterDocumentComponent],
|
|
4477
4816
|
declarations: [RegisterDocumentComponent],
|
|
@@ -4727,42 +5066,14 @@
|
|
|
4727
5066
|
return InsertKeyModule;
|
|
4728
5067
|
}());
|
|
4729
5068
|
|
|
4730
|
-
var CpfCnpjFormatPipe = /** @class */ (function () {
|
|
4731
|
-
function CpfCnpjFormatPipe() {
|
|
4732
|
-
}
|
|
4733
|
-
CpfCnpjFormatPipe.prototype.transform = function (value) {
|
|
4734
|
-
if (!value) {
|
|
4735
|
-
return '';
|
|
4736
|
-
}
|
|
4737
|
-
var numeros = value.replace(/\D/g, ''); // Remove não dígitos
|
|
4738
|
-
var cpfLength = 11;
|
|
4739
|
-
var cnpjLength = 14;
|
|
4740
|
-
if (numeros.length === cpfLength) {
|
|
4741
|
-
return numeros.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, "$1.$2.$3-$4");
|
|
4742
|
-
}
|
|
4743
|
-
else if (numeros.length === cnpjLength) {
|
|
4744
|
-
return numeros.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, "$1.$2.$3/$4-$5");
|
|
4745
|
-
}
|
|
4746
|
-
else {
|
|
4747
|
-
return value;
|
|
4748
|
-
}
|
|
4749
|
-
};
|
|
4750
|
-
CpfCnpjFormatPipe = __decorate([
|
|
4751
|
-
core.Pipe({
|
|
4752
|
-
name: 'cpfCnpjFormat'
|
|
4753
|
-
})
|
|
4754
|
-
], CpfCnpjFormatPipe);
|
|
4755
|
-
return CpfCnpjFormatPipe;
|
|
4756
|
-
}());
|
|
4757
|
-
|
|
4758
5069
|
var DocumentGridModule = /** @class */ (function () {
|
|
4759
5070
|
function DocumentGridModule() {
|
|
4760
5071
|
}
|
|
4761
5072
|
DocumentGridModule = __decorate([
|
|
4762
5073
|
core.NgModule({
|
|
4763
|
-
declarations: [DocumentGridComponent
|
|
5074
|
+
declarations: [DocumentGridComponent],
|
|
4764
5075
|
entryComponents: [DocumentGridComponent],
|
|
4765
|
-
exports: [DocumentGridComponent
|
|
5076
|
+
exports: [DocumentGridComponent],
|
|
4766
5077
|
providers: [
|
|
4767
5078
|
ExternalTenantService,
|
|
4768
5079
|
DocumentGridFacade,
|
|
@@ -4783,6 +5094,7 @@
|
|
|
4783
5094
|
primeng.DropdownModule,
|
|
4784
5095
|
forms.FormsModule,
|
|
4785
5096
|
primeng.ConfirmDialogModule,
|
|
5097
|
+
CpfCnpjFormatModule,
|
|
4786
5098
|
],
|
|
4787
5099
|
})
|
|
4788
5100
|
], DocumentGridModule);
|
|
@@ -6014,6 +6326,7 @@
|
|
|
6014
6326
|
}
|
|
6015
6327
|
_this.disabled = false;
|
|
6016
6328
|
if (!response || !response.documentos[0]) {
|
|
6329
|
+
_this.botaoDesabilitado = false;
|
|
6017
6330
|
return;
|
|
6018
6331
|
}
|
|
6019
6332
|
var value = response.documentos[0];
|
|
@@ -6038,6 +6351,7 @@
|
|
|
6038
6351
|
_this.formGroup.get("serieLegalNotaFiscal").setValue(value.serieLegal);
|
|
6039
6352
|
_this.formGroup.get("numeroNotaFiscal").setValue(value.numero);
|
|
6040
6353
|
_this.desabilitaCamposNotaFiscal();
|
|
6354
|
+
_this.botaoDesabilitado = false;
|
|
6041
6355
|
};
|
|
6042
6356
|
this.camposPreenchidosValidation = function (control) {
|
|
6043
6357
|
var chave = control.get("chaveNotaFiscal").value;
|
|
@@ -6053,11 +6367,15 @@
|
|
|
6053
6367
|
}, { validators: this.camposPreenchidosValidation });
|
|
6054
6368
|
}
|
|
6055
6369
|
NotaFormComponent.prototype.ngOnInit = function () {
|
|
6370
|
+
var _this = this;
|
|
6056
6371
|
this.filialId = this.dialogConfig.data.filial.id;
|
|
6057
6372
|
this.fornecedor = this.dialogConfig.data.fornecedor;
|
|
6058
6373
|
this.produto = this.dialogConfig.data.produto;
|
|
6059
6374
|
this.fornecedorNotasTokens = this.dialogConfig.data.fornecedorNotasTokens;
|
|
6060
6375
|
this.contratos = this.dialogConfig.data.contratos;
|
|
6376
|
+
this.formGroup.get("chaveNotaFiscal").valueChanges
|
|
6377
|
+
.pipe(operators.takeUntil(this.unsubscribe$))
|
|
6378
|
+
.subscribe(function () { _this.botaoDesabilitado = true; });
|
|
6061
6379
|
};
|
|
6062
6380
|
NotaFormComponent.prototype.ngOnDestroy = function () {
|
|
6063
6381
|
this.unsubscribe$.next();
|
|
@@ -6087,18 +6405,18 @@
|
|
|
6087
6405
|
this.botaoDesabilitado = true;
|
|
6088
6406
|
return;
|
|
6089
6407
|
}
|
|
6408
|
+
this.botaoDesabilitado = true;
|
|
6090
6409
|
this.removeErrorChaveNota();
|
|
6091
6410
|
this.loading = true;
|
|
6092
6411
|
this.notaValidatorService.pesquisarDocumentoValidaNotaEmUso({
|
|
6093
6412
|
chaveDocumento: (chaveNotaFiscal || "").replace(/\s/g, ""),
|
|
6094
6413
|
filialId: this.filialId
|
|
6095
6414
|
})
|
|
6096
|
-
.pipe(operators.takeUntil(this.unsubscribe$), operators.
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
this.botaoDesabilitado = false;
|
|
6415
|
+
.pipe(operators.takeUntil(this.unsubscribe$), operators.finalize(function () { return _this.loading = false; }))
|
|
6416
|
+
.subscribe({
|
|
6417
|
+
next: this.validateNotaFiscal,
|
|
6418
|
+
error: function () { _this.disabled = false; }
|
|
6419
|
+
});
|
|
6102
6420
|
};
|
|
6103
6421
|
NotaFormComponent.prototype.validaProdutoNaNotaFiscal = function (produtos) {
|
|
6104
6422
|
if (produtos != null && produtos.length > 0) {
|
|
@@ -15235,52 +15553,54 @@
|
|
|
15235
15553
|
exports.ɵbc = EntityService$1;
|
|
15236
15554
|
exports.ɵbd = UtilsMessageService;
|
|
15237
15555
|
exports.ɵbe = WmsIntegrationStrategyFactory;
|
|
15238
|
-
exports.ɵbf =
|
|
15556
|
+
exports.ɵbf = DadosColetaService;
|
|
15239
15557
|
exports.ɵbg = ExternalTenantService;
|
|
15240
15558
|
exports.ɵbh = RegisterDocumentModule;
|
|
15241
|
-
exports.ɵbi =
|
|
15242
|
-
exports.ɵbj =
|
|
15243
|
-
exports.ɵbk =
|
|
15244
|
-
exports.ɵbl =
|
|
15245
|
-
exports.ɵbm =
|
|
15246
|
-
exports.ɵbn =
|
|
15247
|
-
exports.ɵbo =
|
|
15248
|
-
exports.ɵbp =
|
|
15249
|
-
exports.ɵbq =
|
|
15250
|
-
exports.ɵbr =
|
|
15251
|
-
exports.ɵbs =
|
|
15252
|
-
exports.ɵbt =
|
|
15253
|
-
exports.ɵbu =
|
|
15254
|
-
exports.ɵbv =
|
|
15255
|
-
exports.ɵbw =
|
|
15256
|
-
exports.ɵbx =
|
|
15257
|
-
exports.ɵby =
|
|
15258
|
-
exports.ɵbz =
|
|
15559
|
+
exports.ɵbi = CpfCnpjFormatModule;
|
|
15560
|
+
exports.ɵbj = CpfCnpjFormatPipe;
|
|
15561
|
+
exports.ɵbk = RegisterDocumentComponent;
|
|
15562
|
+
exports.ɵbl = InsertKeyModule;
|
|
15563
|
+
exports.ɵbm = InsertKeyComponent;
|
|
15564
|
+
exports.ɵbn = IntegrationService$1;
|
|
15565
|
+
exports.ɵbo = RecebimentoFormComponent;
|
|
15566
|
+
exports.ɵbp = DerivacaoService;
|
|
15567
|
+
exports.ɵbq = NotaValidatorService;
|
|
15568
|
+
exports.ɵbr = TransgeniaService;
|
|
15569
|
+
exports.ɵbs = VerificaNotafiscal;
|
|
15570
|
+
exports.ɵbt = BuildFormField;
|
|
15571
|
+
exports.ɵbu = ExpedicaoFormComponent;
|
|
15572
|
+
exports.ɵbv = ExpedicaoInfoComponent;
|
|
15573
|
+
exports.ɵbw = RecebimentoInfoComponent;
|
|
15574
|
+
exports.ɵbx = DevolucaoFormComponent;
|
|
15575
|
+
exports.ɵby = DevolucaoService;
|
|
15576
|
+
exports.ɵbz = DevolucaoChegadaVeiculoOverride;
|
|
15259
15577
|
exports.ɵc = ViewImageComponent;
|
|
15260
|
-
exports.ɵca =
|
|
15261
|
-
exports.ɵcb =
|
|
15262
|
-
exports.ɵcc =
|
|
15263
|
-
exports.ɵcd =
|
|
15264
|
-
exports.ɵce =
|
|
15265
|
-
exports.ɵcf =
|
|
15266
|
-
exports.ɵcg =
|
|
15267
|
-
exports.ɵch =
|
|
15268
|
-
exports.ɵci =
|
|
15269
|
-
exports.ɵcj =
|
|
15270
|
-
exports.ɵck =
|
|
15271
|
-
exports.ɵcl =
|
|
15272
|
-
exports.ɵcm =
|
|
15273
|
-
exports.ɵcn =
|
|
15274
|
-
exports.ɵco =
|
|
15275
|
-
exports.ɵcp =
|
|
15276
|
-
exports.ɵcq =
|
|
15277
|
-
exports.ɵcr =
|
|
15278
|
-
exports.ɵcs =
|
|
15279
|
-
exports.ɵct =
|
|
15280
|
-
exports.ɵcu =
|
|
15281
|
-
exports.ɵcv =
|
|
15282
|
-
exports.ɵcw =
|
|
15283
|
-
exports.ɵcx =
|
|
15578
|
+
exports.ɵca = RecebimentoOrdemCompraFormComponent;
|
|
15579
|
+
exports.ɵcb = OrdemCompraService;
|
|
15580
|
+
exports.ɵcc = RecebimentoOrdemCompraService;
|
|
15581
|
+
exports.ɵcd = RecebimentoOrdemCompraChegadaVeiculoOverride;
|
|
15582
|
+
exports.ɵce = RecebimentoOrdemCompraInfoComponent;
|
|
15583
|
+
exports.ɵcf = DevolucaoInfoComponent;
|
|
15584
|
+
exports.ɵcg = ContratoFormComponent;
|
|
15585
|
+
exports.ɵch = OrdemCompraFormComponent;
|
|
15586
|
+
exports.ɵci = ProcessoAvulsoFormComponent;
|
|
15587
|
+
exports.ɵcj = ProcessoAvulsoService;
|
|
15588
|
+
exports.ɵck = ProcessoAvulsoChegadaVeiculoOverride;
|
|
15589
|
+
exports.ɵcl = ProcessoAvulsoInfoComponent;
|
|
15590
|
+
exports.ɵcm = LogIntegracaoDescritor;
|
|
15591
|
+
exports.ɵcn = LogIntegracaoComponent;
|
|
15592
|
+
exports.ɵco = LogIntegracaoService;
|
|
15593
|
+
exports.ɵcp = DerivacaoModule;
|
|
15594
|
+
exports.ɵcq = DevolucaoModule;
|
|
15595
|
+
exports.ɵcr = OrdemCompraModule;
|
|
15596
|
+
exports.ɵcs = RecebimentoOrdemCompraModule;
|
|
15597
|
+
exports.ɵct = TransgeniaModule;
|
|
15598
|
+
exports.ɵcu = ProcessoAvulsoModule;
|
|
15599
|
+
exports.ɵcv = LogIntegracaoModule;
|
|
15600
|
+
exports.ɵcw = NotaFormModule;
|
|
15601
|
+
exports.ɵcx = DirectivesModule;
|
|
15602
|
+
exports.ɵcy = TrimDirective;
|
|
15603
|
+
exports.ɵcz = NotaFormComponent;
|
|
15284
15604
|
exports.ɵd = LogDescritor;
|
|
15285
15605
|
exports.ɵe = LogsComponent;
|
|
15286
15606
|
exports.ɵf = PortariasService;
|