@seniorsistemas/yms-integration 1.39.0 → 1.40.0
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 +78 -54
- 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/src/wms/components/document-grid/document-grid.component.js +63 -6
- package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +8 -22
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +9 -31
- package/esm2015/src/wms/entities/document/document.service.js +3 -3
- package/esm5/src/wms/components/document-grid/document-grid.component.js +67 -6
- package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +8 -23
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +9 -32
- package/esm5/src/wms/entities/document/document.service.js +3 -3
- package/fesm2015/seniorsistemas-yms-integration.js +74 -52
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +78 -54
- package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-yms-integration.metadata.json +1 -1
- package/src/wms/components/document-grid/document-grid.component.d.ts +9 -1
- package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +3 -3
- package/src/wms/components/document-grid/register-document/register-document.component.d.ts +3 -7
- package/src/wms/entities/document/document.service.d.ts +1 -1
|
@@ -17,8 +17,8 @@ var DocumentService = /** @class */ (function (_super) {
|
|
|
17
17
|
DocumentService.prototype.getSystemIntegration = function () {
|
|
18
18
|
return this.http.get('yms_int/wms/queries/getSystemIntegration');
|
|
19
19
|
};
|
|
20
|
-
DocumentService.prototype.
|
|
21
|
-
return this.http.get('yms/patio/entities/planta/' +
|
|
20
|
+
DocumentService.prototype.getYard = function (yardId) {
|
|
21
|
+
return this.http.get('yms/patio/entities/planta/' + yardId);
|
|
22
22
|
};
|
|
23
23
|
DocumentService = tslib_1.__decorate([
|
|
24
24
|
Injectable(),
|
|
@@ -27,4 +27,4 @@ var DocumentService = /** @class */ (function (_super) {
|
|
|
27
27
|
return DocumentService;
|
|
28
28
|
}(EntityService));
|
|
29
29
|
export { DocumentService };
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9jdW1lbnQuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzZW5pb3JzaXN0ZW1hcy95bXMtaW50ZWdyYXRpb24vIiwic291cmNlcyI6WyJzcmMvd21zL2VudGl0aWVzL2RvY3VtZW50L2RvY3VtZW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBSTdDO0lBQXFDLDJDQUEwQjtJQUMzRCx5QkFBc0IsSUFBZ0IsRUFBWSxjQUE4QjtRQUFoRixZQUNJLGtCQUFNLElBQUksRUFBRSxjQUFjLEVBQUUsK0JBQStCLEVBQUUsRUFBRSxDQUFDLFNBQ25FO1FBRnFCLFVBQUksR0FBSixJQUFJLENBQVk7UUFBWSxvQkFBYyxHQUFkLGNBQWMsQ0FBZ0I7O0lBRWhGLENBQUM7SUFFTSx1Q0FBYSxHQUFwQixVQUFxQixLQUF5QjtRQUMxQyxPQUFPLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLG1DQUFtQyxFQUFFLEt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ZWQgaHR0cDogSHR0cENsaWVudCwgcHJvdGVjdGVkIG1lc3NhZ2VTZXJ2aWNlOiBNZXNzYWdlU2VydmljZSkge1xuICAgICAgICBzdXBlcihodHRwLCBtZXNzYWdlU2VydmljZSwgJ3ltc19pbnQvd21zL2VudGl0aWVzL2RvY3VtZW50JywgJycpO1xuICAgIH1cblxuICAgIHB1YmxpYyBmaW5kRG9jdW1lbnRzKGlucHV0OiBGaW5kRG9jdW1lbnRzSW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaHR0cC5wb3N0KCd5bXNfaW50L3dtcy9xdWVyaWVzL2ZpbmREb2N1bWVudHMnLCBpbnB1dCk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldFN5c3RlbUludGVncmF0aW9uKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5odHRwLmdldCgneW1zX2ludC93bXMvcXVlcmllcy9nZXRTeXN0ZW1JbnRlZ3JhdGlvbicpO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXRZYXJkKHlhcmRJZDogc3RyaW5nKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmh0dHAuZ2V0KCd5bXMvcGF0aW8vZW50aXRpZXMvcGxhbnRhLycgKyB5YXJkSWQpO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -3037,8 +3037,8 @@ let DocumentService = class DocumentService extends EntityService {
|
|
|
3037
3037
|
getSystemIntegration() {
|
|
3038
3038
|
return this.http.get('yms_int/wms/queries/getSystemIntegration');
|
|
3039
3039
|
}
|
|
3040
|
-
|
|
3041
|
-
return this.http.get('yms/patio/entities/planta/' +
|
|
3040
|
+
getYard(yardId) {
|
|
3041
|
+
return this.http.get('yms/patio/entities/planta/' + yardId);
|
|
3042
3042
|
}
|
|
3043
3043
|
};
|
|
3044
3044
|
DocumentService = __decorate([
|
|
@@ -3090,13 +3090,14 @@ function getInvoiceConditions(translate) {
|
|
|
3090
3090
|
}
|
|
3091
3091
|
|
|
3092
3092
|
let DocumentGridComponent = class DocumentGridComponent {
|
|
3093
|
-
constructor(translate, documentService, confirmationService, integrationService, agendaService, utils) {
|
|
3093
|
+
constructor(translate, documentService, confirmationService, integrationService, agendaService, utils, wmsService) {
|
|
3094
3094
|
this.translate = translate;
|
|
3095
3095
|
this.documentService = documentService;
|
|
3096
3096
|
this.confirmationService = confirmationService;
|
|
3097
3097
|
this.integrationService = integrationService;
|
|
3098
3098
|
this.agendaService = agendaService;
|
|
3099
3099
|
this.utils = utils;
|
|
3100
|
+
this.wmsService = wmsService;
|
|
3100
3101
|
this.viewDocument = new EventEmitter();
|
|
3101
3102
|
this.gridData = [];
|
|
3102
3103
|
this.enableButtonIsClienteExterno = true;
|
|
@@ -3117,6 +3118,36 @@ let DocumentGridComponent = class DocumentGridComponent {
|
|
|
3117
3118
|
this.verifyClienteExterno();
|
|
3118
3119
|
this.getProcessTypeByScheduling();
|
|
3119
3120
|
this.listDocuments(false);
|
|
3121
|
+
this.wmsService.getSystemIntegration()
|
|
3122
|
+
.subscribe(({ system }) => {
|
|
3123
|
+
this.wmsSystem = system;
|
|
3124
|
+
if (this.isWmsSeniorConnect()) {
|
|
3125
|
+
this.getYard();
|
|
3126
|
+
this.getSchedule();
|
|
3127
|
+
}
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
getYard() {
|
|
3131
|
+
this.documentService.getYard(this.agenda.planta.id)
|
|
3132
|
+
.pipe(catchError(err => {
|
|
3133
|
+
return throwError(err);
|
|
3134
|
+
}))
|
|
3135
|
+
.subscribe((content) => {
|
|
3136
|
+
this.yard = content;
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
getSchedule() {
|
|
3140
|
+
if (this.agenda.externalTenant && this.agenda.externalTenant.cnpj) {
|
|
3141
|
+
this.schedule = this.agenda;
|
|
3142
|
+
return;
|
|
3143
|
+
}
|
|
3144
|
+
this.agendaService.get(this.agenda.id)
|
|
3145
|
+
.pipe(catchError(err => {
|
|
3146
|
+
return throwError(err);
|
|
3147
|
+
}))
|
|
3148
|
+
.subscribe((content) => {
|
|
3149
|
+
this.schedule = content;
|
|
3150
|
+
});
|
|
3120
3151
|
}
|
|
3121
3152
|
verifyClienteExterno() {
|
|
3122
3153
|
this.agendaService.isClienteExterno()
|
|
@@ -3251,7 +3282,7 @@ let DocumentGridComponent = class DocumentGridComponent {
|
|
|
3251
3282
|
accept: () => {
|
|
3252
3283
|
this.removeDocumentIfIdUndfined();
|
|
3253
3284
|
if (this.selection.length < 1) {
|
|
3254
|
-
return
|
|
3285
|
+
return null;
|
|
3255
3286
|
}
|
|
3256
3287
|
return forkJoin(this.selection.map(document => this.documentService.delete(document.id)))
|
|
3257
3288
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
@@ -3376,6 +3407,30 @@ let DocumentGridComponent = class DocumentGridComponent {
|
|
|
3376
3407
|
sucessMessage() {
|
|
3377
3408
|
return this.utils.message("success", this.summary, "saved_message_content");
|
|
3378
3409
|
}
|
|
3410
|
+
validateDocument(document) {
|
|
3411
|
+
if (this.isWmsSeniorConnect()) {
|
|
3412
|
+
if (!this.yard.codigo) {
|
|
3413
|
+
this.buildMessage("yms.int.yard_code_not_found_warning_description");
|
|
3414
|
+
return false;
|
|
3415
|
+
}
|
|
3416
|
+
if (document.logistcUnitDocument !== this.yard.codigo) {
|
|
3417
|
+
this.buildMessage("yms.int.document_yard_mismatch_agenda_warning_description");
|
|
3418
|
+
return false;
|
|
3419
|
+
}
|
|
3420
|
+
if (!this.schedule.externalTenant) {
|
|
3421
|
+
this.buildMessage("yms.int.partner_not_informed_agenda_warning_description");
|
|
3422
|
+
return false;
|
|
3423
|
+
}
|
|
3424
|
+
if (document.partnerDocument !== this.schedule.externalTenant.cnpj) {
|
|
3425
|
+
this.buildMessage("yms.int.partner_differs_from_agenda_warning_description");
|
|
3426
|
+
return false;
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
return true;
|
|
3430
|
+
}
|
|
3431
|
+
buildMessage(description) {
|
|
3432
|
+
this.utils.message("warn", "yms.int.documento_invalido_warning_header", description);
|
|
3433
|
+
}
|
|
3379
3434
|
};
|
|
3380
3435
|
__decorate([
|
|
3381
3436
|
Input(),
|
|
@@ -3432,7 +3487,8 @@ DocumentGridComponent = __decorate([
|
|
|
3432
3487
|
ConfirmationService,
|
|
3433
3488
|
IntegrationService,
|
|
3434
3489
|
AgendaService,
|
|
3435
|
-
UtilsMessageService
|
|
3490
|
+
UtilsMessageService,
|
|
3491
|
+
FormWmsService])
|
|
3436
3492
|
], DocumentGridComponent);
|
|
3437
3493
|
|
|
3438
3494
|
const moment$4 = _moment;
|
|
@@ -3475,11 +3531,10 @@ class Document {
|
|
|
3475
3531
|
}
|
|
3476
3532
|
|
|
3477
3533
|
let RegisterDocumentComponent = class RegisterDocumentComponent {
|
|
3478
|
-
constructor(fb, translate,
|
|
3534
|
+
constructor(fb, translate, documentGridComponent) {
|
|
3479
3535
|
this.fb = fb;
|
|
3480
3536
|
this.translate = translate;
|
|
3481
|
-
this.
|
|
3482
|
-
this.documentService = documentService;
|
|
3537
|
+
this.documentGridComponent = documentGridComponent;
|
|
3483
3538
|
this.document = new EventEmitter();
|
|
3484
3539
|
this.visible = new EventEmitter();
|
|
3485
3540
|
this.visibleChange = new EventEmitter();
|
|
@@ -3487,22 +3542,12 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
|
|
|
3487
3542
|
this.invoiceCondition = getInvoiceConditions(this.translate);
|
|
3488
3543
|
}
|
|
3489
3544
|
ngOnInit() {
|
|
3490
|
-
this.getYard();
|
|
3491
3545
|
this.getFormGroup();
|
|
3492
3546
|
this.watchFormChanges();
|
|
3493
3547
|
}
|
|
3494
3548
|
ngOnChanges() {
|
|
3495
3549
|
this.visibilityConfig();
|
|
3496
3550
|
}
|
|
3497
|
-
getYard() {
|
|
3498
|
-
this.documentService.getPlanta(this.agenda.planta.id)
|
|
3499
|
-
.pipe(catchError(err => {
|
|
3500
|
-
return throwError(err);
|
|
3501
|
-
}))
|
|
3502
|
-
.subscribe((content) => {
|
|
3503
|
-
this.planta = content;
|
|
3504
|
-
});
|
|
3505
|
-
}
|
|
3506
3551
|
visibilityConfig() {
|
|
3507
3552
|
if (!this.edit && this.visible) {
|
|
3508
3553
|
this.formGroup.disable();
|
|
@@ -3553,18 +3598,11 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
|
|
|
3553
3598
|
});
|
|
3554
3599
|
}
|
|
3555
3600
|
save() {
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
return;
|
|
3560
|
-
}
|
|
3561
|
-
const logistcUnitDocument = this.formGroup.get("logistcUnitDocument").value;
|
|
3562
|
-
if (logistcUnitDocument !== this.planta.codigo) {
|
|
3563
|
-
this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
|
|
3564
|
-
return;
|
|
3565
|
-
}
|
|
3601
|
+
const document = Document.fromDto(this.formGroup.getRawValue());
|
|
3602
|
+
if (!this.documentGridComponent.validateDocument(document)) {
|
|
3603
|
+
return;
|
|
3566
3604
|
}
|
|
3567
|
-
this.document.emit(
|
|
3605
|
+
this.document.emit(document);
|
|
3568
3606
|
this.formGroup.reset();
|
|
3569
3607
|
}
|
|
3570
3608
|
isWmsWis() {
|
|
@@ -3622,8 +3660,7 @@ RegisterDocumentComponent = __decorate([
|
|
|
3622
3660
|
}),
|
|
3623
3661
|
__metadata("design:paramtypes", [FormBuilder,
|
|
3624
3662
|
TranslateService,
|
|
3625
|
-
|
|
3626
|
-
DocumentService])
|
|
3663
|
+
DocumentGridComponent])
|
|
3627
3664
|
], RegisterDocumentComponent);
|
|
3628
3665
|
|
|
3629
3666
|
let RegisterDocumentModule = class RegisterDocumentModule {
|
|
@@ -3662,13 +3699,14 @@ ExternalTenantService = __decorate([
|
|
|
3662
3699
|
], ExternalTenantService);
|
|
3663
3700
|
|
|
3664
3701
|
let InsertKeyComponent = class InsertKeyComponent {
|
|
3665
|
-
constructor(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
|
|
3702
|
+
constructor(formBuilder, documentService, utils, confirmationService, translate, externalTenantService, documentGridComponent) {
|
|
3666
3703
|
this.formBuilder = formBuilder;
|
|
3667
3704
|
this.documentService = documentService;
|
|
3668
3705
|
this.utils = utils;
|
|
3669
3706
|
this.confirmationService = confirmationService;
|
|
3670
3707
|
this.translate = translate;
|
|
3671
3708
|
this.externalTenantService = externalTenantService;
|
|
3709
|
+
this.documentGridComponent = documentGridComponent;
|
|
3672
3710
|
this.visible = new EventEmitter();
|
|
3673
3711
|
this.document = new EventEmitter();
|
|
3674
3712
|
this.visibleChange = new EventEmitter();
|
|
@@ -3677,7 +3715,6 @@ let InsertKeyComponent = class InsertKeyComponent {
|
|
|
3677
3715
|
this.ngUnsubscribe = new Subject();
|
|
3678
3716
|
}
|
|
3679
3717
|
ngOnInit() {
|
|
3680
|
-
this.getYard();
|
|
3681
3718
|
this.formGroup = this.formBuilder.group({
|
|
3682
3719
|
key: [undefined],
|
|
3683
3720
|
purchaseOrder: [undefined],
|
|
@@ -3689,15 +3726,6 @@ let InsertKeyComponent = class InsertKeyComponent {
|
|
|
3689
3726
|
this.validateKeyDetails(nf);
|
|
3690
3727
|
});
|
|
3691
3728
|
}
|
|
3692
|
-
getYard() {
|
|
3693
|
-
this.documentService.getPlanta(this.agenda.planta.id)
|
|
3694
|
-
.pipe(catchError(err => {
|
|
3695
|
-
return throwError(err);
|
|
3696
|
-
}))
|
|
3697
|
-
.subscribe((content) => {
|
|
3698
|
-
this.planta = content;
|
|
3699
|
-
});
|
|
3700
|
-
}
|
|
3701
3729
|
isWmsWis() {
|
|
3702
3730
|
return this.wmsSystem === WmsSystem.WIS;
|
|
3703
3731
|
}
|
|
@@ -3740,15 +3768,8 @@ let InsertKeyComponent = class InsertKeyComponent {
|
|
|
3740
3768
|
return;
|
|
3741
3769
|
}
|
|
3742
3770
|
const document = content.contents[0];
|
|
3743
|
-
if (this.
|
|
3744
|
-
|
|
3745
|
-
this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
|
|
3746
|
-
return;
|
|
3747
|
-
}
|
|
3748
|
-
if (document.logistcUnitDocument !== this.planta.codigo) {
|
|
3749
|
-
this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
|
|
3750
|
-
return;
|
|
3751
|
-
}
|
|
3771
|
+
if (!this.documentGridComponent.validateDocument(document)) {
|
|
3772
|
+
return;
|
|
3752
3773
|
}
|
|
3753
3774
|
document.invoiceKey = this.formGroup.get('key').value;
|
|
3754
3775
|
document.invoiceCondition = InvoiceCondition.AUTHORIZED;
|
|
@@ -3869,7 +3890,8 @@ InsertKeyComponent = __decorate([
|
|
|
3869
3890
|
UtilsMessageService,
|
|
3870
3891
|
ConfirmationService,
|
|
3871
3892
|
TranslateService,
|
|
3872
|
-
ExternalTenantService
|
|
3893
|
+
ExternalTenantService,
|
|
3894
|
+
DocumentGridComponent])
|
|
3873
3895
|
], InsertKeyComponent);
|
|
3874
3896
|
|
|
3875
3897
|
let InsertKeyModule = class InsertKeyModule {
|