@seniorsistemas/yms-integration 1.38.0-84525130-8955-4de4-9dbd-cbae08fb1cda → 1.39.0-b18a63fd-cce0-4144-98f4-dfcd1d6f5b8d
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 +79 -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 +65 -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 +8 -31
- package/esm2015/src/wms/entities/document/document.service.js +3 -3
- package/esm5/src/wms/components/document-grid/document-grid.component.js +69 -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 +8 -32
- package/esm5/src/wms/entities/document/document.service.js +3 -3
- package/fesm2015/seniorsistemas-yms-integration.js +75 -52
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +79 -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9jdW1lbnQuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzZW5pb3JzaXN0ZW1hcy95bXMtaW50ZWdyYXRpb24vIiwic291cmNlcyI6WyJzcmMvd21zL2VudGl0aWVzL2RvY3VtZW50L2RvY3VtZW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBSTdDO0lBQXFDLDJDQUEwQjtJQUMzRCx5QkFBc0IsSUFBZ0IsRUFBWSxjQUE4QjtRQUFoRixZQUNJLGtCQUFNLElBQUksRUFBRSxjQUFjLEVBQUUsK0JBQStCLEVBQUUsRUFBRSxDQUFDLFNBQ25FO1FBRnFCLFVBQUksR0FBSixJQUFJLENBQVk7UUFBWSxvQkFBYyxHQUFkLGNBQWMsQ0FBZ0I7O0lBRWhGLENBQUM7SUFFTSx1Q0FBYSxHQUFwQixVQUFxQixLQUF5QjtRQUMxQyxPQUFPL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pY2U8RG9jdW1lbnREdG8+IHtcbiAgICBjb25zdHJ1Y3Rvcihwcm90ZWN0ZWQgaHR0cDogSHR0cENsaWVudCwgcHJvdGVjdGVkIG1lc3NhZ2VTZXJ2aWNlOiBNZXNzYWdlU2VydmljZSkge1xuICAgICAgICBzdXBlcihodHRwLCBtZXNzYWdlU2VydmljZSwgJ3ltc19pbnQvd21zL2VudGl0aWVzL2RvY3VtZW50JywgJycpO1xuICAgIH1cblxuICAgIHB1YmxpYyBmaW5kRG9jdW1lbnRzKGlucHV0OiBGaW5kRG9jdW1lbnRzSW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaHR0cC5wb3N0KCd5bXNfaW50L3dtcy9xdWVyaWVzL2ZpbmREb2N1bWVudHMnLCBpbnB1dCk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldFN5c3RlbUludGVncmF0aW9uKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5odHRwLmdldCgneW1zX2ludC93bXMvcXVlcmllcy9nZXRTeXN0ZW1JbnRlZ3JhdGlvbicpO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXRZYXJkKHlhcmRJZDogc3RyaW5nKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmh0dHAuZ2V0KCd5bXMvcGF0aW8vZW50aXRpZXMvcGxhbnRhLycgKyB5YXJkSWQpO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -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,38 @@ let DocumentGridComponent = class DocumentGridComponent {
|
|
|
3117
3118
|
this.verifyClienteExterno();
|
|
3118
3119
|
this.getProcessTypeByScheduling();
|
|
3119
3120
|
this.listDocuments(false);
|
|
3121
|
+
if (!this.wmsSystem) {
|
|
3122
|
+
this.wmsService.getSystemIntegration()
|
|
3123
|
+
.subscribe(({ system }) => {
|
|
3124
|
+
this.wmsSystem = system;
|
|
3125
|
+
if (this.isWmsSeniorConnect()) {
|
|
3126
|
+
this.getYard();
|
|
3127
|
+
this.getSchedule();
|
|
3128
|
+
}
|
|
3129
|
+
});
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
getYard() {
|
|
3133
|
+
this.documentService.getYard(this.agenda.planta.id)
|
|
3134
|
+
.pipe(catchError(err => {
|
|
3135
|
+
return throwError(err);
|
|
3136
|
+
}))
|
|
3137
|
+
.subscribe((content) => {
|
|
3138
|
+
this.yard = content;
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
getSchedule() {
|
|
3142
|
+
if (this.agenda.externalTenant && this.agenda.externalTenant.cnpj) {
|
|
3143
|
+
this.schedule = this.agenda;
|
|
3144
|
+
return;
|
|
3145
|
+
}
|
|
3146
|
+
this.agendaService.get(this.agenda.id)
|
|
3147
|
+
.pipe(catchError(err => {
|
|
3148
|
+
return throwError(err);
|
|
3149
|
+
}))
|
|
3150
|
+
.subscribe((content) => {
|
|
3151
|
+
this.schedule = content;
|
|
3152
|
+
});
|
|
3120
3153
|
}
|
|
3121
3154
|
verifyClienteExterno() {
|
|
3122
3155
|
this.agendaService.isClienteExterno()
|
|
@@ -3251,7 +3284,7 @@ let DocumentGridComponent = class DocumentGridComponent {
|
|
|
3251
3284
|
accept: () => {
|
|
3252
3285
|
this.removeDocumentIfIdUndfined();
|
|
3253
3286
|
if (this.selection.length < 1) {
|
|
3254
|
-
return
|
|
3287
|
+
return null;
|
|
3255
3288
|
}
|
|
3256
3289
|
return forkJoin(this.selection.map(document => this.documentService.delete(document.id)))
|
|
3257
3290
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
@@ -3376,6 +3409,30 @@ let DocumentGridComponent = class DocumentGridComponent {
|
|
|
3376
3409
|
sucessMessage() {
|
|
3377
3410
|
return this.utils.message("success", this.summary, "saved_message_content");
|
|
3378
3411
|
}
|
|
3412
|
+
validateDocument(document) {
|
|
3413
|
+
if (this.isWmsSeniorConnect()) {
|
|
3414
|
+
if (!this.yard.codigo) {
|
|
3415
|
+
this.buildMessage("yms.int.yard_code_not_found_warning_description");
|
|
3416
|
+
return false;
|
|
3417
|
+
}
|
|
3418
|
+
if (document.logistcUnitDocument !== this.yard.codigo) {
|
|
3419
|
+
this.buildMessage("yms.int.document_yard_mismatch_agenda_warning_description");
|
|
3420
|
+
return false;
|
|
3421
|
+
}
|
|
3422
|
+
if (!this.schedule.externalTenant) {
|
|
3423
|
+
this.buildMessage("yms.int.partner_not_informed_agenda_warning_description");
|
|
3424
|
+
return false;
|
|
3425
|
+
}
|
|
3426
|
+
if (document.partnerDocument !== this.schedule.externalTenant.cnpj) {
|
|
3427
|
+
this.buildMessage("yms.int.partner_differs_from_agenda_warning_description");
|
|
3428
|
+
return false;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
return true;
|
|
3432
|
+
}
|
|
3433
|
+
buildMessage(description) {
|
|
3434
|
+
this.utils.message("warn", "yms.int.documento_invalido_warning_header", description);
|
|
3435
|
+
}
|
|
3379
3436
|
};
|
|
3380
3437
|
__decorate([
|
|
3381
3438
|
Input(),
|
|
@@ -3432,7 +3489,8 @@ DocumentGridComponent = __decorate([
|
|
|
3432
3489
|
ConfirmationService,
|
|
3433
3490
|
IntegrationService,
|
|
3434
3491
|
AgendaService,
|
|
3435
|
-
UtilsMessageService
|
|
3492
|
+
UtilsMessageService,
|
|
3493
|
+
FormWmsService])
|
|
3436
3494
|
], DocumentGridComponent);
|
|
3437
3495
|
|
|
3438
3496
|
const moment$4 = _moment;
|
|
@@ -3475,11 +3533,10 @@ class Document {
|
|
|
3475
3533
|
}
|
|
3476
3534
|
|
|
3477
3535
|
let RegisterDocumentComponent = class RegisterDocumentComponent {
|
|
3478
|
-
constructor(fb, translate,
|
|
3536
|
+
constructor(fb, translate, documentGridComponent) {
|
|
3479
3537
|
this.fb = fb;
|
|
3480
3538
|
this.translate = translate;
|
|
3481
|
-
this.
|
|
3482
|
-
this.documentService = documentService;
|
|
3539
|
+
this.documentGridComponent = documentGridComponent;
|
|
3483
3540
|
this.document = new EventEmitter();
|
|
3484
3541
|
this.visible = new EventEmitter();
|
|
3485
3542
|
this.visibleChange = new EventEmitter();
|
|
@@ -3487,22 +3544,12 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
|
|
|
3487
3544
|
this.invoiceCondition = getInvoiceConditions(this.translate);
|
|
3488
3545
|
}
|
|
3489
3546
|
ngOnInit() {
|
|
3490
|
-
this.getYard();
|
|
3491
3547
|
this.getFormGroup();
|
|
3492
3548
|
this.watchFormChanges();
|
|
3493
3549
|
}
|
|
3494
3550
|
ngOnChanges() {
|
|
3495
3551
|
this.visibilityConfig();
|
|
3496
3552
|
}
|
|
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
3553
|
visibilityConfig() {
|
|
3507
3554
|
if (!this.edit && this.visible) {
|
|
3508
3555
|
this.formGroup.disable();
|
|
@@ -3553,18 +3600,10 @@ let RegisterDocumentComponent = class RegisterDocumentComponent {
|
|
|
3553
3600
|
});
|
|
3554
3601
|
}
|
|
3555
3602
|
save() {
|
|
3556
|
-
if (this.isWmsSeniorConnect()) {
|
|
3557
|
-
if (!this.planta.codigo) {
|
|
3558
|
-
this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
|
|
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
|
-
}
|
|
3566
|
-
}
|
|
3567
3603
|
this.document.emit(Document.fromDto(this.formGroup.getRawValue()));
|
|
3604
|
+
if (!this.documentGridComponent.validateDocument(document)) {
|
|
3605
|
+
return;
|
|
3606
|
+
}
|
|
3568
3607
|
this.formGroup.reset();
|
|
3569
3608
|
}
|
|
3570
3609
|
isWmsWis() {
|
|
@@ -3622,8 +3661,7 @@ RegisterDocumentComponent = __decorate([
|
|
|
3622
3661
|
}),
|
|
3623
3662
|
__metadata("design:paramtypes", [FormBuilder,
|
|
3624
3663
|
TranslateService,
|
|
3625
|
-
|
|
3626
|
-
DocumentService])
|
|
3664
|
+
DocumentGridComponent])
|
|
3627
3665
|
], RegisterDocumentComponent);
|
|
3628
3666
|
|
|
3629
3667
|
let RegisterDocumentModule = class RegisterDocumentModule {
|
|
@@ -3662,13 +3700,14 @@ ExternalTenantService = __decorate([
|
|
|
3662
3700
|
], ExternalTenantService);
|
|
3663
3701
|
|
|
3664
3702
|
let InsertKeyComponent = class InsertKeyComponent {
|
|
3665
|
-
constructor(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
|
|
3703
|
+
constructor(formBuilder, documentService, utils, confirmationService, translate, externalTenantService, documentGridComponent) {
|
|
3666
3704
|
this.formBuilder = formBuilder;
|
|
3667
3705
|
this.documentService = documentService;
|
|
3668
3706
|
this.utils = utils;
|
|
3669
3707
|
this.confirmationService = confirmationService;
|
|
3670
3708
|
this.translate = translate;
|
|
3671
3709
|
this.externalTenantService = externalTenantService;
|
|
3710
|
+
this.documentGridComponent = documentGridComponent;
|
|
3672
3711
|
this.visible = new EventEmitter();
|
|
3673
3712
|
this.document = new EventEmitter();
|
|
3674
3713
|
this.visibleChange = new EventEmitter();
|
|
@@ -3677,7 +3716,6 @@ let InsertKeyComponent = class InsertKeyComponent {
|
|
|
3677
3716
|
this.ngUnsubscribe = new Subject();
|
|
3678
3717
|
}
|
|
3679
3718
|
ngOnInit() {
|
|
3680
|
-
this.getYard();
|
|
3681
3719
|
this.formGroup = this.formBuilder.group({
|
|
3682
3720
|
key: [undefined],
|
|
3683
3721
|
purchaseOrder: [undefined],
|
|
@@ -3689,15 +3727,6 @@ let InsertKeyComponent = class InsertKeyComponent {
|
|
|
3689
3727
|
this.validateKeyDetails(nf);
|
|
3690
3728
|
});
|
|
3691
3729
|
}
|
|
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
3730
|
isWmsWis() {
|
|
3702
3731
|
return this.wmsSystem === WmsSystem.WIS;
|
|
3703
3732
|
}
|
|
@@ -3740,15 +3769,8 @@ let InsertKeyComponent = class InsertKeyComponent {
|
|
|
3740
3769
|
return;
|
|
3741
3770
|
}
|
|
3742
3771
|
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
|
-
}
|
|
3772
|
+
if (!this.documentGridComponent.validateDocument(document)) {
|
|
3773
|
+
return;
|
|
3752
3774
|
}
|
|
3753
3775
|
document.invoiceKey = this.formGroup.get('key').value;
|
|
3754
3776
|
document.invoiceCondition = InvoiceCondition.AUTHORIZED;
|
|
@@ -3869,7 +3891,8 @@ InsertKeyComponent = __decorate([
|
|
|
3869
3891
|
UtilsMessageService,
|
|
3870
3892
|
ConfirmationService,
|
|
3871
3893
|
TranslateService,
|
|
3872
|
-
ExternalTenantService
|
|
3894
|
+
ExternalTenantService,
|
|
3895
|
+
DocumentGridComponent])
|
|
3873
3896
|
], InsertKeyComponent);
|
|
3874
3897
|
|
|
3875
3898
|
let InsertKeyModule = class InsertKeyModule {
|