@seniorsistemas/yms-integration 1.32.0 → 1.33.0-c2e82ccb-741e-4184-8c6e-a7197ff2bc08
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 +320 -103
- 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 +44 -43
- package/esm2015/src/wms/components/document-grid/document-grid.component.js +84 -19
- package/esm2015/src/wms/components/document-grid/document-grid.module.js +8 -3
- package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +100 -8
- package/esm2015/src/wms/components/document-grid/insert-key/insert-key.module.js +4 -2
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +21 -7
- package/esm2015/src/wms/components/document-grid/register-document/register-document.module.js +4 -3
- package/esm2015/src/wms/components/document-list/document-list.component.js +49 -28
- package/esm2015/src/wms/entities/document/document-dto.js +1 -1
- package/esm2015/src/wms/entities/document/document.js +2 -1
- package/esm2015/src/wms/entities/external-tenant/external-tenant-dto.js +1 -0
- package/esm2015/src/wms/entities/external-tenant/external-tenant.service.js +18 -0
- package/esm2015/src/wms/entities/invoice-condition/invoice-condition.js +9 -0
- package/esm5/seniorsistemas-yms-integration.js +44 -43
- package/esm5/src/wms/components/document-grid/document-grid.component.js +81 -18
- package/esm5/src/wms/components/document-grid/document-grid.module.js +8 -3
- package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +103 -8
- package/esm5/src/wms/components/document-grid/insert-key/insert-key.module.js +4 -2
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +21 -7
- package/esm5/src/wms/components/document-grid/register-document/register-document.module.js +4 -3
- package/esm5/src/wms/components/document-list/document-list.component.js +52 -30
- package/esm5/src/wms/entities/document/document-dto.js +1 -1
- package/esm5/src/wms/entities/document/document.js +2 -1
- package/esm5/src/wms/entities/external-tenant/external-tenant-dto.js +1 -0
- package/esm5/src/wms/entities/external-tenant/external-tenant.service.js +21 -0
- package/esm5/src/wms/entities/invoice-condition/invoice-condition.js +9 -0
- package/fesm2015/seniorsistemas-yms-integration.js +271 -60
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +277 -61
- package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-yms-integration.d.ts +43 -42
- package/seniorsistemas-yms-integration.metadata.json +1 -1
- package/src/wms/components/document-grid/document-grid.component.d.ts +22 -8
- package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +17 -1
- package/src/wms/components/document-grid/register-document/register-document.component.d.ts +9 -3
- package/src/wms/components/document-list/document-list.component.d.ts +10 -5
- package/src/wms/entities/document/document-dto.d.ts +1 -0
- package/src/wms/entities/document/document.d.ts +2 -0
- package/src/wms/entities/external-tenant/external-tenant-dto.d.ts +7 -0
- package/src/wms/entities/external-tenant/external-tenant.service.d.ts +9 -0
- package/src/wms/entities/invoice-condition/invoice-condition.d.ts +7 -0
|
@@ -3288,6 +3288,15 @@ var ProcessType;
|
|
|
3288
3288
|
ProcessType["RECEBIMENTO_WMS"] = "RECEBIMENTO_WMS";
|
|
3289
3289
|
})(ProcessType || (ProcessType = {}));
|
|
3290
3290
|
|
|
3291
|
+
var InvoiceCondition;
|
|
3292
|
+
(function (InvoiceCondition) {
|
|
3293
|
+
InvoiceCondition["AUTHORIZED"] = "AUTHORIZED";
|
|
3294
|
+
InvoiceCondition["PARTIAL_AUTHORIZED"] = "PARTIAL_AUTHORIZED";
|
|
3295
|
+
InvoiceCondition["MANUAL_AUTHORIZED"] = "MANUAL_AUTHORIZED";
|
|
3296
|
+
InvoiceCondition["DEVOLUTION"] = "DEVOLUTION";
|
|
3297
|
+
InvoiceCondition["REJECTED"] = "REJECTED";
|
|
3298
|
+
})(InvoiceCondition || (InvoiceCondition = {}));
|
|
3299
|
+
|
|
3291
3300
|
var DocumentGridComponent = /** @class */ (function () {
|
|
3292
3301
|
function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils) {
|
|
3293
3302
|
this.translate = translate;
|
|
@@ -3299,22 +3308,37 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3299
3308
|
this.viewDocument = new EventEmitter();
|
|
3300
3309
|
this.gridData = [];
|
|
3301
3310
|
this.enableButtonIsClienteExterno = true;
|
|
3311
|
+
this.summary = "yms.int.wms_saved_document_message_title";
|
|
3302
3312
|
this.ngUnsubscribe = new Subject();
|
|
3313
|
+
this.invoiceConditions = [
|
|
3314
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3315
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3316
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3317
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3318
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
|
|
3319
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
|
|
3320
|
+
];
|
|
3303
3321
|
this.selection = [];
|
|
3304
3322
|
}
|
|
3323
|
+
DocumentGridComponent.prototype.getFilteredInvoiceConditions = function (invoiceConditions) {
|
|
3324
|
+
if (invoiceConditions === InvoiceCondition.AUTHORIZED) {
|
|
3325
|
+
return this.invoiceConditions.filter(function (cond) { return cond.value === InvoiceCondition.AUTHORIZED; });
|
|
3326
|
+
}
|
|
3327
|
+
else {
|
|
3328
|
+
return this.invoiceConditions.filter(function (cond) { return cond.value !== InvoiceCondition.AUTHORIZED; });
|
|
3329
|
+
}
|
|
3330
|
+
};
|
|
3305
3331
|
DocumentGridComponent.prototype.ngOnInit = function () {
|
|
3306
3332
|
this.verifyClienteExterno();
|
|
3307
3333
|
this.getProcessTypeByScheduling();
|
|
3308
3334
|
this.listDocuments(false);
|
|
3309
3335
|
};
|
|
3310
|
-
DocumentGridComponent.prototype.ngAfterContentChecked = function () {
|
|
3311
|
-
this.gridColumns = this.getGridColumns();
|
|
3312
|
-
};
|
|
3313
3336
|
DocumentGridComponent.prototype.verifyClienteExterno = function () {
|
|
3314
3337
|
var _this = this;
|
|
3315
3338
|
this.agendaService.isClienteExterno()
|
|
3316
3339
|
.subscribe(function (result) {
|
|
3317
3340
|
_this.isClienteExterno = result.isClienteExterno;
|
|
3341
|
+
_this.gridColumns = _this.getGridColumns();
|
|
3318
3342
|
_this.cantEditStatus();
|
|
3319
3343
|
});
|
|
3320
3344
|
};
|
|
@@ -3336,7 +3360,7 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3336
3360
|
}
|
|
3337
3361
|
this.gridData.push(document);
|
|
3338
3362
|
this.disabled = false;
|
|
3339
|
-
this.utils.message("success",
|
|
3363
|
+
this.utils.message("success", this.summary, "yms.int.wms_success_message_description");
|
|
3340
3364
|
this.visibleDocumentRegister = false;
|
|
3341
3365
|
this.visibleInvoiceKey = false;
|
|
3342
3366
|
};
|
|
@@ -3416,12 +3440,18 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3416
3440
|
}
|
|
3417
3441
|
data.key = _this.updateKeyByWms(data);
|
|
3418
3442
|
_this.documentService.insert(data).subscribe(function () {
|
|
3419
|
-
_this.
|
|
3443
|
+
_this.sucessMessage();
|
|
3420
3444
|
});
|
|
3421
3445
|
_this.disabled = true;
|
|
3422
|
-
|
|
3446
|
+
}
|
|
3447
|
+
else {
|
|
3448
|
+
_this.documentService.update(data.id, data).subscribe(function () {
|
|
3449
|
+
_this.sucessMessage();
|
|
3450
|
+
_this.disabled = true;
|
|
3451
|
+
});
|
|
3423
3452
|
}
|
|
3424
3453
|
});
|
|
3454
|
+
this.listDocuments(false);
|
|
3425
3455
|
}
|
|
3426
3456
|
};
|
|
3427
3457
|
DocumentGridComponent.prototype.updateKeyByWms = function (data) {
|
|
@@ -3462,10 +3492,14 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3462
3492
|
}
|
|
3463
3493
|
});
|
|
3464
3494
|
};
|
|
3495
|
+
DocumentGridComponent.prototype.notSavedDocuments = function () {
|
|
3496
|
+
return this.gridData.some(function (document) { return !document.id; });
|
|
3497
|
+
};
|
|
3465
3498
|
DocumentGridComponent.prototype.listDocuments = function (isDelete) {
|
|
3466
3499
|
var _this = this;
|
|
3467
3500
|
this.documentService.list({
|
|
3468
|
-
filterQuery: "schedulingId eq '" + this.agenda.id + "'"
|
|
3501
|
+
filterQuery: "schedulingId eq '" + this.agenda.id + "'",
|
|
3502
|
+
size: 100
|
|
3469
3503
|
})
|
|
3470
3504
|
.subscribe(function (contents) {
|
|
3471
3505
|
var _a;
|
|
@@ -3484,20 +3518,46 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3484
3518
|
});
|
|
3485
3519
|
};
|
|
3486
3520
|
DocumentGridComponent.prototype.getGridColumns = function () {
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3521
|
+
var result;
|
|
3522
|
+
switch (this.wmsSystem) {
|
|
3523
|
+
case WmsSystem.SENIOR_CONNECT:
|
|
3524
|
+
result = this.wmsSeniorConnectIntegration();
|
|
3525
|
+
break;
|
|
3526
|
+
case WmsSystem.WIS:
|
|
3527
|
+
result = this.wmsWisIntegration();
|
|
3528
|
+
break;
|
|
3529
|
+
case WmsSystem.SENIOR:
|
|
3530
|
+
result = this.wmsSiltIntegration();
|
|
3531
|
+
break;
|
|
3532
|
+
default:
|
|
3533
|
+
result = [];
|
|
3534
|
+
}
|
|
3535
|
+
return result;
|
|
3536
|
+
};
|
|
3537
|
+
DocumentGridComponent.prototype.wmsSeniorConnectIntegration = function () {
|
|
3538
|
+
var columns = __spread([
|
|
3539
|
+
{ field: "key", header: this.translate.instant("yms.int.wms_purchaseOrder") }
|
|
3540
|
+
], this.getColumnPartner());
|
|
3541
|
+
this.addInvoiceSituationIfNotClienteExterno(columns);
|
|
3542
|
+
return columns;
|
|
3543
|
+
};
|
|
3544
|
+
DocumentGridComponent.prototype.wmsWisIntegration = function () {
|
|
3545
|
+
var columns = __spread(this.getColumnInvoiceAndlogistcUnit());
|
|
3546
|
+
this.addInvoiceSituationIfNotClienteExterno(columns);
|
|
3547
|
+
return columns;
|
|
3548
|
+
};
|
|
3549
|
+
DocumentGridComponent.prototype.wmsSiltIntegration = function () {
|
|
3550
|
+
var columns = __spread([
|
|
3496
3551
|
{ field: "invoiceKey", header: this.translate.instant("yms.int.wms_register_document_invoice_key") }
|
|
3497
3552
|
], this.getColumnInvoiceAndlogistcUnit(), [
|
|
3498
3553
|
{ field: "ownerName", header: this.translate.instant("yms.int.wms_register_document_owner_name") },
|
|
3499
3554
|
{ field: "ownerDocument", header: this.translate.instant("yms.int.wms_register_document_owner_document") },
|
|
3500
3555
|
]);
|
|
3556
|
+
this.addInvoiceSituationIfNotClienteExterno(columns);
|
|
3557
|
+
return columns;
|
|
3558
|
+
};
|
|
3559
|
+
DocumentGridComponent.prototype.getColumninvoiceCondition = function () {
|
|
3560
|
+
return { field: "invoiceCondition", header: this.translate.instant("yms.int.wms_grid_document_invoice_condition") };
|
|
3501
3561
|
};
|
|
3502
3562
|
DocumentGridComponent.prototype.getColumnInvoiceAndlogistcUnit = function () {
|
|
3503
3563
|
return __spread([
|
|
@@ -3514,12 +3574,23 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3514
3574
|
{ field: "partnerDocument", header: this.translate.instant("yms.int.wms_register_document_partner_document") },
|
|
3515
3575
|
];
|
|
3516
3576
|
};
|
|
3577
|
+
DocumentGridComponent.prototype.addInvoiceSituationIfNotClienteExterno = function (columns) {
|
|
3578
|
+
if (!this.isClienteExterno) {
|
|
3579
|
+
columns.push(this.getColumninvoiceCondition());
|
|
3580
|
+
}
|
|
3581
|
+
};
|
|
3517
3582
|
DocumentGridComponent.prototype.isWmsSeniorConnect = function () {
|
|
3518
3583
|
return this.wmsSystem === WmsSystem.SENIOR_CONNECT;
|
|
3519
3584
|
};
|
|
3520
3585
|
DocumentGridComponent.prototype.isWmsWIS = function () {
|
|
3521
3586
|
return this.wmsSystem === WmsSystem.WIS;
|
|
3522
3587
|
};
|
|
3588
|
+
DocumentGridComponent.prototype.isWmsSilt = function () {
|
|
3589
|
+
return this.wmsSystem === WmsSystem.SENIOR;
|
|
3590
|
+
};
|
|
3591
|
+
DocumentGridComponent.prototype.sucessMessage = function () {
|
|
3592
|
+
return this.utils.message("success", this.summary, "saved_message_content");
|
|
3593
|
+
};
|
|
3523
3594
|
__decorate([
|
|
3524
3595
|
Input(),
|
|
3525
3596
|
__metadata("design:type", Object)
|
|
@@ -3567,8 +3638,8 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3567
3638
|
DocumentGridComponent = __decorate([
|
|
3568
3639
|
Component({
|
|
3569
3640
|
selector: 'document-grid',
|
|
3570
|
-
template: "<div *ngIf=\"this.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\">\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]=\"!enableButtonIsClienteExterno\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length || !enableButtonIsClienteExterno\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments(false)\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"key\" [
|
|
3571
|
-
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}"]
|
|
3641
|
+
template: "<div *ngIf=\"this.processType === 'RECEBIMENTO_WMS'; else processNotConfigured\">\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]=\"!enableButtonIsClienteExterno\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length || !enableButtonIsClienteExterno\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments(false)\"\n [disabled]=\"notSavedDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"key\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n [paginator]=\"true\" [totalRecords]=\"documentTotalRecords\" rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [(selection)]=\"selection\"\n [loading]=\"loading\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\"/>\n </colgroup>\n </ng-template>\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 pTemplate=\"body\" let-rowData let-columns let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"key\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceKey\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"invoiceSerialNumber\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSeniorConnect() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"partnerDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitDocument\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsSilt()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"ownerDocument\"]}}</span>\n </td>\n <td *ngIf=\"!isClienteExterno\" (click)=\"selection = [rowData]\">\n <p-dropdown\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"getFilteredInvoiceConditions(rowData?.invoiceCondition)\"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"disabled = false\">\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [translate]=\"'yms.main.total_records'\" \n [translateParams]=\"{ value: documentTotalRecords }\">\n </span>\n </ng-template>\n </p-table> \n </div>\n </div>\n <register-document\n [wmsSystem]=\"wmsSystem\"\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\"\n [isClienteExterno]=\"isClienteExterno\">\n </register-document> \n <insert-key\n [wmsSystem]=\"wmsSystem\" \n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleInvoiceKey\">\n </insert-key>\n </p-panel>\n</div>\n <div class=\"button-save\">\n <s-button \n priority=\"primary\" [label]=\"'save' | translate\"\n [disabled]=\"disabled || !this.gridData || !enableButtonIsClienteExterno\"\n (click)=\"save()\">\n </s-button>\n </div>\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\" [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\">\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]=\"'yms.int.wms_there_no_process_type_configured_for_this_type_scheduling' | translate\">\n </s-empty-state>\n </div>\n</ng-template>",
|
|
3642
|
+
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}"]
|
|
3572
3643
|
}),
|
|
3573
3644
|
__metadata("design:paramtypes", [TranslateService,
|
|
3574
3645
|
DocumentService,
|
|
@@ -3602,6 +3673,7 @@ var Document = /** @class */ (function () {
|
|
|
3602
3673
|
"ownerDocument",
|
|
3603
3674
|
"partnerName",
|
|
3604
3675
|
"partnerDocument",
|
|
3676
|
+
"invoiceCondition",
|
|
3605
3677
|
"notes",
|
|
3606
3678
|
"code",
|
|
3607
3679
|
"createdBy",
|
|
@@ -3622,13 +3694,21 @@ var Document = /** @class */ (function () {
|
|
|
3622
3694
|
}());
|
|
3623
3695
|
|
|
3624
3696
|
var RegisterDocumentComponent = /** @class */ (function () {
|
|
3625
|
-
function RegisterDocumentComponent(fb,
|
|
3697
|
+
function RegisterDocumentComponent(fb, translate) {
|
|
3626
3698
|
this.fb = fb;
|
|
3627
|
-
this.
|
|
3699
|
+
this.translate = translate;
|
|
3628
3700
|
this.document = new EventEmitter();
|
|
3629
3701
|
this.visible = new EventEmitter();
|
|
3630
3702
|
this.visibleChange = new EventEmitter();
|
|
3631
3703
|
this.isSaveFormValid = false;
|
|
3704
|
+
this.invoiceCondition = [
|
|
3705
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3706
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3707
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3708
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3709
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolution"), value: InvoiceCondition.DEVOLUTION },
|
|
3710
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_rejected"), value: InvoiceCondition.REJECTED },
|
|
3711
|
+
];
|
|
3632
3712
|
}
|
|
3633
3713
|
RegisterDocumentComponent.prototype.ngOnInit = function () {
|
|
3634
3714
|
this.getFormGroup();
|
|
@@ -3666,6 +3746,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3666
3746
|
this.formGroup.get('partnerDocument').setValue(document.partnerDocument);
|
|
3667
3747
|
this.formGroup.get('ownerDocument').setValue(document.ownerDocument);
|
|
3668
3748
|
this.formGroup.get('ownerName').setValue(document.ownerName);
|
|
3749
|
+
this.formGroup.get('invoiceCondition').setValue(document.invoiceCondition);
|
|
3669
3750
|
};
|
|
3670
3751
|
RegisterDocumentComponent.prototype.getFormGroup = function () {
|
|
3671
3752
|
this.formGroup = this.fb.group({
|
|
@@ -3682,6 +3763,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3682
3763
|
partnerDocument: [undefined],
|
|
3683
3764
|
notes: [undefined],
|
|
3684
3765
|
code: [undefined],
|
|
3766
|
+
invoiceCondition: [undefined],
|
|
3685
3767
|
});
|
|
3686
3768
|
};
|
|
3687
3769
|
RegisterDocumentComponent.prototype.save = function () {
|
|
@@ -3713,6 +3795,10 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3713
3795
|
Input(),
|
|
3714
3796
|
__metadata("design:type", Agenda)
|
|
3715
3797
|
], RegisterDocumentComponent.prototype, "agenda", void 0);
|
|
3798
|
+
__decorate([
|
|
3799
|
+
Input(),
|
|
3800
|
+
__metadata("design:type", Boolean)
|
|
3801
|
+
], RegisterDocumentComponent.prototype, "isClienteExterno", void 0);
|
|
3716
3802
|
__decorate([
|
|
3717
3803
|
Output(),
|
|
3718
3804
|
__metadata("design:type", EventEmitter)
|
|
@@ -3732,10 +3818,9 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3732
3818
|
RegisterDocumentComponent = __decorate([
|
|
3733
3819
|
Component({
|
|
3734
3820
|
selector: "register-document",
|
|
3735
|
-
template: "<s-sidebar\n [visible]=\"visible\"\n header=\"{{ 'yms.int.wms_register_document_add_document' | translate }} {{ wmsSystem }}\"\n (visibleChange)=\"close()\"\n (onclose)=\"close()\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\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\">{{'yms.int.wms_register_document_invoice_key' | translate}}</label>\n <input id=\"invoiceKey\" pInputText type=\"text\" formControlName=\"invoiceKey\">\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect()\">\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\" *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"invoiceSerialNumber\">\n {{'yms.int.wms_register_document_invoice_serial_number' | translate}}\n </label>\n <input id=\"invoiceSerialNumber\" pInputText type=\"text\" formControlName=\"invoiceSerialNumber\">\n </div>\n <div class=\"ui-g-8\">\n <label for=\"logistcUnitName\">{{'yms.int.wms_register_document_logistc_unit_name' | translate}}</label>\n <input id=\"logistcUnitName\" pInputText type=\"text\" formControlName=\"logistcUnitName\">\n </div>\n <div class=\"ui-g-4\">\n <label for=\"logistcUnitDocument\">\n {{'yms.int.wms_register_document_logistc_unit_document' | translate}}\n </label>\n <input id=\"logistcUnitDocument\" pInputText type=\"text\" formControlName=\"logistcUnitDocument\">\n </div>\n <div class=\"ui-g-8\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"documentOwnerName\">{{'yms.int.wms_register_document_owner_name' | translate}}</label>\n <input id=\"documentOwnerName\" pInputText type=\"text\" formControlName=\"ownerName\">\n </div>\n <div class=\"ui-g-4\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"ownerDocument\">{{'yms.int.wms_register_document_owner_document' | translate}}</label>\n <input id=\"ownerDocument\" pInputText type=\"text\" formControlName=\"ownerDocument\">\n </div>\n <div class=\"ui-g-8\">\n <label for=\"partnerName\">{{'yms.int.wms_register_document_partner_name' | translate}}</label>\n <input id=\"partnerName\" pInputText type=\"text\" formControlName=\"partnerName\">\n </div>\n <div class=\"ui-g-4\">\n <label for=\"partnerDocument\">{{'yms.int.wms_register_document_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"ui-g-12\">\n <label for=\"notes\" id=\"notes\">{{'yms.int.wms_register_document_notes' | translate}}</label>\n <textarea id=\"notes\" rows=\"4\" pInputTextarea autoResize=\"autoResize\" formControlName=\"notes\"></textarea>\n </div>\n <div class=\"ui-g-4\">\n <label for=\"code\">\n {{'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 </form>\n <div class=\"space-between\">\n <button\n pButton label=\"{{'save' | translate}}\"\n (click)=\"save()\"\n [attr.data-hidden]=\"hideSaveButton\"\n [disabled]=\"!isSaveFormValid\">\n </button>\n <button\n type=\"button\" class=\"ui-button-link\" pButton label=\"{{'cancel' | translate}}\" (click)=\"close()\">\n </button>\n </div>\n</s-sidebar>"
|
|
3821
|
+
template: "<s-sidebar\n [visible]=\"visible\"\n header=\"{{ 'yms.int.wms_register_document_add_document' | translate }} {{ wmsSystem }}\"\n (visibleChange)=\"close()\"\n (onclose)=\"close()\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\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\">{{'yms.int.wms_register_document_invoice_key' | translate}}</label>\n <input id=\"invoiceKey\" pInputText type=\"text\" formControlName=\"invoiceKey\">\n </div>\n <div class=\"ui-g-6\" *ngIf=\"!isWmsSeniorConnect()\">\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\" *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"invoiceSerialNumber\">\n {{'yms.int.wms_register_document_invoice_serial_number' | translate}}\n </label>\n <input id=\"invoiceSerialNumber\" pInputText type=\"text\" formControlName=\"invoiceSerialNumber\">\n </div>\n <div class=\"ui-g-8\">\n <label for=\"logistcUnitName\">{{'yms.int.wms_register_document_logistc_unit_name' | translate}}</label>\n <input id=\"logistcUnitName\" pInputText type=\"text\" formControlName=\"logistcUnitName\">\n </div>\n <div class=\"ui-g-4\">\n <label for=\"logistcUnitDocument\">\n {{'yms.int.wms_register_document_logistc_unit_document' | translate}}\n </label>\n <input id=\"logistcUnitDocument\" pInputText type=\"text\" formControlName=\"logistcUnitDocument\">\n </div>\n <div class=\"ui-g-8\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"documentOwnerName\">{{'yms.int.wms_register_document_owner_name' | translate}}</label>\n <input id=\"documentOwnerName\" pInputText type=\"text\" formControlName=\"ownerName\">\n </div>\n <div class=\"ui-g-4\" *ngIf=\"!isWmsSeniorConnect() && !isWmsWis()\">\n <label for=\"ownerDocument\">{{'yms.int.wms_register_document_owner_document' | translate}}</label>\n <input id=\"ownerDocument\" pInputText type=\"text\" formControlName=\"ownerDocument\">\n </div>\n <div class=\"ui-g-8\">\n <label for=\"partnerName\">{{'yms.int.wms_register_document_partner_name' | translate}}</label>\n <input id=\"partnerName\" pInputText type=\"text\" formControlName=\"partnerName\">\n </div>\n <div class=\"ui-g-4\">\n <label for=\"partnerDocument\">{{'yms.int.wms_register_document_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"ui-g-12\">\n <label for=\"notes\" id=\"notes\">{{'yms.int.wms_register_document_notes' | translate}}</label>\n <textarea id=\"notes\" rows=\"4\" pInputTextarea autoResize=\"autoResize\" formControlName=\"notes\"></textarea>\n </div>\n <div class=\"ui-g-4\">\n <label for=\"code\">\n {{'yms.int.wms_register_document_order_receiving_code' | translate}}\n </label>\n <input id=\"code\" pInputText type=\"text\" formControlName=\"code\">\n </div>\n <div class=\"ui-g-4\" *ngIf=\"!isClienteExterno\">\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>\n </form>\n <div class=\"space-between\">\n <button\n pButton label=\"{{'save' | translate}}\"\n (click)=\"save()\"\n [attr.data-hidden]=\"hideSaveButton\"\n [disabled]=\"!isSaveFormValid\">\n </button>\n <button\n type=\"button\" class=\"ui-button-link\" pButton label=\"{{'cancel' | translate}}\" (click)=\"close()\">\n </button>\n </div>\n</s-sidebar>"
|
|
3736
3822
|
}),
|
|
3737
|
-
__metadata("design:paramtypes", [FormBuilder,
|
|
3738
|
-
UtilsMessageService])
|
|
3823
|
+
__metadata("design:paramtypes", [FormBuilder, TranslateService])
|
|
3739
3824
|
], RegisterDocumentComponent);
|
|
3740
3825
|
return RegisterDocumentComponent;
|
|
3741
3826
|
}());
|
|
@@ -3755,7 +3840,8 @@ var RegisterDocumentModule = /** @class */ (function () {
|
|
|
3755
3840
|
InputTextModule$1,
|
|
3756
3841
|
ControlErrorsModule,
|
|
3757
3842
|
InputTextareaModule,
|
|
3758
|
-
ReactiveFormsModule
|
|
3843
|
+
ReactiveFormsModule,
|
|
3844
|
+
DropdownModule,
|
|
3759
3845
|
],
|
|
3760
3846
|
exports: [RegisterDocumentComponent],
|
|
3761
3847
|
declarations: [RegisterDocumentComponent],
|
|
@@ -3765,17 +3851,38 @@ var RegisterDocumentModule = /** @class */ (function () {
|
|
|
3765
3851
|
return RegisterDocumentModule;
|
|
3766
3852
|
}());
|
|
3767
3853
|
|
|
3854
|
+
var ExternalTenantService = /** @class */ (function (_super) {
|
|
3855
|
+
__extends(ExternalTenantService, _super);
|
|
3856
|
+
function ExternalTenantService(http, messageService) {
|
|
3857
|
+
var _this = _super.call(this, http, messageService, 'yms/agenda/entities/externalTenant', '') || this;
|
|
3858
|
+
_this.http = http;
|
|
3859
|
+
_this.messageService = messageService;
|
|
3860
|
+
return _this;
|
|
3861
|
+
}
|
|
3862
|
+
ExternalTenantService = __decorate([
|
|
3863
|
+
Injectable(),
|
|
3864
|
+
__metadata("design:paramtypes", [HttpClient, MessageService])
|
|
3865
|
+
], ExternalTenantService);
|
|
3866
|
+
return ExternalTenantService;
|
|
3867
|
+
}(EntityService));
|
|
3868
|
+
|
|
3768
3869
|
var InsertKeyComponent = /** @class */ (function () {
|
|
3769
|
-
function InsertKeyComponent(formBuilder, documentService, utils) {
|
|
3870
|
+
function InsertKeyComponent(formBuilder, documentService, utils, confirmationService, translate, externalTenantService) {
|
|
3770
3871
|
this.formBuilder = formBuilder;
|
|
3771
3872
|
this.documentService = documentService;
|
|
3772
3873
|
this.utils = utils;
|
|
3874
|
+
this.confirmationService = confirmationService;
|
|
3875
|
+
this.translate = translate;
|
|
3876
|
+
this.externalTenantService = externalTenantService;
|
|
3773
3877
|
this.document = new EventEmitter();
|
|
3774
3878
|
this.visible = new EventEmitter();
|
|
3775
3879
|
this.visibleChange = new EventEmitter();
|
|
3776
3880
|
this.isLoading = false;
|
|
3881
|
+
this.isPartnerloading = false;
|
|
3882
|
+
this.ngUnsubscribe = new Subject();
|
|
3777
3883
|
}
|
|
3778
3884
|
InsertKeyComponent.prototype.ngOnInit = function () {
|
|
3885
|
+
var _this = this;
|
|
3779
3886
|
this.formGroup = this.formBuilder.group({
|
|
3780
3887
|
key: [undefined],
|
|
3781
3888
|
purchaseOrder: [undefined],
|
|
@@ -3783,6 +3890,9 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3783
3890
|
invoiceSerie: [undefined],
|
|
3784
3891
|
partnerDocument: [undefined]
|
|
3785
3892
|
});
|
|
3893
|
+
this.formGroup.get('key').valueChanges.subscribe(function (nf) {
|
|
3894
|
+
_this.validateKeyDetails(nf);
|
|
3895
|
+
});
|
|
3786
3896
|
};
|
|
3787
3897
|
InsertKeyComponent.prototype.isWmsWis = function () {
|
|
3788
3898
|
return this.wmsSystem === WmsSystem.WIS;
|
|
@@ -3815,6 +3925,7 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3815
3925
|
else {
|
|
3816
3926
|
_this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content" + err.error.message);
|
|
3817
3927
|
}
|
|
3928
|
+
_this.confirmInvoiceDialog();
|
|
3818
3929
|
return throwError(err);
|
|
3819
3930
|
}), finalize(function () {
|
|
3820
3931
|
_this.isLoading = false;
|
|
@@ -3824,10 +3935,88 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3824
3935
|
_this.utils.message("warn", "yms.int.wms_insert_key_warning_message_header", "yms.int.wms_insert_key_warning_message_description");
|
|
3825
3936
|
return;
|
|
3826
3937
|
}
|
|
3827
|
-
|
|
3938
|
+
var document = content.contents[0];
|
|
3939
|
+
document.invoiceKey = _this.formGroup.get('key').value;
|
|
3940
|
+
document.invoiceCondition = InvoiceCondition.AUTHORIZED;
|
|
3941
|
+
_this.document.emit(document);
|
|
3942
|
+
_this.formGroup.reset();
|
|
3943
|
+
});
|
|
3944
|
+
};
|
|
3945
|
+
InsertKeyComponent.prototype.confirmInvoiceDialog = function () {
|
|
3946
|
+
var _this = this;
|
|
3947
|
+
this.confirmationService.confirm({
|
|
3948
|
+
message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
|
|
3949
|
+
acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
|
|
3950
|
+
rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
|
|
3951
|
+
header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
|
|
3952
|
+
accept: function () { return _this.buildInvoice(); }
|
|
3953
|
+
});
|
|
3954
|
+
};
|
|
3955
|
+
InsertKeyComponent.prototype.buildInvoice = function () {
|
|
3956
|
+
var _this = this;
|
|
3957
|
+
this.isPartnerloading = true;
|
|
3958
|
+
var partnerDocument = this.formGroup.get('partnerDocument').value;
|
|
3959
|
+
this.externalTenantService.list({
|
|
3960
|
+
filterQuery: "cnpj eq '" + partnerDocument + "'"
|
|
3961
|
+
})
|
|
3962
|
+
.pipe(takeUntil(this.ngUnsubscribe), finalize(function () {
|
|
3963
|
+
_this.isPartnerloading = false;
|
|
3964
|
+
}))
|
|
3965
|
+
.subscribe(function (contents) {
|
|
3966
|
+
var documentInvoice = _this.createDocumentInvoice(contents);
|
|
3967
|
+
_this.document.emit(documentInvoice);
|
|
3828
3968
|
_this.formGroup.reset();
|
|
3829
3969
|
});
|
|
3830
3970
|
};
|
|
3971
|
+
InsertKeyComponent.prototype.createDocumentInvoice = function (partners) {
|
|
3972
|
+
var documentInvoice = {
|
|
3973
|
+
invoiceKey: this.formGroup.get('key').value,
|
|
3974
|
+
invoiceNumber: this.formGroup.get('invoiceNumber').value,
|
|
3975
|
+
invoiceSerialNumber: this.formGroup.get('invoiceSerie').value,
|
|
3976
|
+
partnerDocument: this.formGroup.get('partnerDocument').value,
|
|
3977
|
+
partnerName: null,
|
|
3978
|
+
type: null,
|
|
3979
|
+
key: null,
|
|
3980
|
+
schedulingId: null
|
|
3981
|
+
};
|
|
3982
|
+
if (partners.totalElements > 0) {
|
|
3983
|
+
var partner = partners.contents[0];
|
|
3984
|
+
documentInvoice.partnerName = partner.descricao;
|
|
3985
|
+
}
|
|
3986
|
+
return documentInvoice;
|
|
3987
|
+
};
|
|
3988
|
+
InsertKeyComponent.prototype.validateKeyDetails = function (nf) {
|
|
3989
|
+
if (!nf) {
|
|
3990
|
+
this.keyErrorMessage = null;
|
|
3991
|
+
this.setValuesOfKey(undefined, undefined, undefined);
|
|
3992
|
+
return;
|
|
3993
|
+
}
|
|
3994
|
+
var nfLength = 44;
|
|
3995
|
+
if (nf.length === nfLength) {
|
|
3996
|
+
this.keyErrorMessage = null;
|
|
3997
|
+
this.extractKeyDetails(nf);
|
|
3998
|
+
}
|
|
3999
|
+
else {
|
|
4000
|
+
this.keyErrorMessage = "yms.int.wms_error_key_message";
|
|
4001
|
+
}
|
|
4002
|
+
};
|
|
4003
|
+
InsertKeyComponent.prototype.extractKeyDetails = function (nf) {
|
|
4004
|
+
var startCnpj = 6;
|
|
4005
|
+
var endCnpj = 20;
|
|
4006
|
+
var cnpj = nf.substring(startCnpj, endCnpj);
|
|
4007
|
+
var startSerie = 22;
|
|
4008
|
+
var endSerie = 25;
|
|
4009
|
+
var serie = nf.substring(startSerie, endSerie);
|
|
4010
|
+
var startInvoice = 25;
|
|
4011
|
+
var endInvoice = 34;
|
|
4012
|
+
var invoice = nf.substring(startInvoice, endInvoice);
|
|
4013
|
+
this.setValuesOfKey(invoice, serie, cnpj);
|
|
4014
|
+
};
|
|
4015
|
+
InsertKeyComponent.prototype.setValuesOfKey = function (invoiceNumber, invoiceSerie, partnerDocument) {
|
|
4016
|
+
this.formGroup.get('invoiceNumber').setValue(invoiceNumber);
|
|
4017
|
+
this.formGroup.get('invoiceSerie').setValue(invoiceSerie);
|
|
4018
|
+
this.formGroup.get('partnerDocument').setValue(partnerDocument);
|
|
4019
|
+
};
|
|
3831
4020
|
InsertKeyComponent.prototype.cancel = function () {
|
|
3832
4021
|
this.visibleChange.emit(false);
|
|
3833
4022
|
};
|
|
@@ -3853,12 +4042,15 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3853
4042
|
InsertKeyComponent = __decorate([
|
|
3854
4043
|
Component({
|
|
3855
4044
|
selector: "insert-key",
|
|
3856
|
-
template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" \n [draggable]=\"false\" (visibleChange)=\"cancel()\" (onShow)=\"onDialogShow()\">\n <p-header>{{'yms.int.wms_search_document' | translate}} {{ wmsSystem }}</p-header>\n <s-loading-state [loading]=\"isLoading\">\n <div class=\"flex py-2 justify-content-center spacing-bottom\"
|
|
3857
|
-
styles: [".spacing-top{margin-top:10px}.spacing-bottom{margin-bottom:10px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.size-input{width:480px}"]
|
|
4045
|
+
template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" \n [draggable]=\"false\" (visibleChange)=\"cancel()\" (onShow)=\"onDialogShow()\">\n <p-header>{{'yms.int.wms_search_document' | translate}} {{ wmsSystem }}</p-header>\n <s-loading-state [loading]=\"isLoading || isPartnerloading\">\n <div class=\"flex py-2 justify-content-center spacing-bottom\"\n *ngIf=\"!isWmsSeniorConnect()\">\n <label for=\"key\">{{'yms.int.wms_insert_key_label' | translate}}</label>\n <input id=\"key\" class=\"size-input\" pInputText type=\"text\" formControlName=\"key\">\n <span class=\"error-message\">{{keyErrorMessage | translate}}</span>\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsSeniorConnect()\">\n <label for=\"purchaseOrder\">{{'yms.int.wms_purchaseOrder' | translate}} </label>\n <input id=\"purchaseOrder\" class=\"size-input\" pInputText type=\"text\" formControlName=\"purchaseOrder\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceNumber\">{{'yms.int.wms_invoice_number' | translate}}</label>\n <input id=\"invoiceNumber\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceNumber\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"invoiceSerie\">{{'yms.int.wms_invoice_serie' | translate}}</label>\n <input id=\"invoiceSerie\" class=\"size-input\" pInputText type=\"text\" formControlName=\"invoiceSerie\">\n </div>\n <div class=\"flex py-2 justify-content-center spacing-bottom\" *ngIf=\"isWmsWis()\">\n <label for=\"partnerDocument\">{{'yms.int.wms_partner_document' | translate}}</label>\n <input id=\"partnerDocument\" class=\"size-input\" pInputText type=\"text\" formControlName=\"partnerDocument\">\n </div>\n <div class=\"separator\"></div>\n <div class=\"spacing-top\">\n <s-button pButton label=\"{{'yms.int.wms_search' | translate}}\" (click)=\"add()\"></s-button>\n <s-button\n type=\"button\"\n class=\"ui-button-link\"\n pButton label=\"{{'cancel' | translate}}\"\n (click)=\"cancel()\">\n </s-button>\n </div>\n </s-loading-state>\n </p-dialog>\n\n</form>\n",
|
|
4046
|
+
styles: [".spacing-top{margin-top:10px}.spacing-bottom{margin-bottom:10px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.size-input{width:480px}.error-message{color:#c13018;display:flex}"]
|
|
3858
4047
|
}),
|
|
3859
4048
|
__metadata("design:paramtypes", [FormBuilder,
|
|
3860
4049
|
DocumentService,
|
|
3861
|
-
UtilsMessageService
|
|
4050
|
+
UtilsMessageService,
|
|
4051
|
+
ConfirmationService,
|
|
4052
|
+
TranslateService,
|
|
4053
|
+
ExternalTenantService])
|
|
3862
4054
|
], InsertKeyComponent);
|
|
3863
4055
|
return InsertKeyComponent;
|
|
3864
4056
|
}());
|
|
@@ -3878,7 +4070,8 @@ var InsertKeyModule = /** @class */ (function () {
|
|
|
3878
4070
|
LoadingStateModule
|
|
3879
4071
|
],
|
|
3880
4072
|
exports: [InsertKeyComponent],
|
|
3881
|
-
declarations: [InsertKeyComponent]
|
|
4073
|
+
declarations: [InsertKeyComponent],
|
|
4074
|
+
providers: [ExternalTenantService]
|
|
3882
4075
|
})
|
|
3883
4076
|
], InsertKeyModule);
|
|
3884
4077
|
return InsertKeyModule;
|
|
@@ -3892,6 +4085,7 @@ var DocumentGridModule = /** @class */ (function () {
|
|
|
3892
4085
|
declarations: [DocumentGridComponent],
|
|
3893
4086
|
entryComponents: [DocumentGridComponent],
|
|
3894
4087
|
exports: [DocumentGridComponent],
|
|
4088
|
+
providers: [ExternalTenantService],
|
|
3895
4089
|
imports: [
|
|
3896
4090
|
CommonModule,
|
|
3897
4091
|
TranslateModule,
|
|
@@ -3902,7 +4096,9 @@ var DocumentGridModule = /** @class */ (function () {
|
|
|
3902
4096
|
InsertKeyModule,
|
|
3903
4097
|
ButtonModule$1,
|
|
3904
4098
|
ComponentsModule,
|
|
3905
|
-
EmptyStateModule
|
|
4099
|
+
EmptyStateModule,
|
|
4100
|
+
DropdownModule,
|
|
4101
|
+
FormsModule
|
|
3906
4102
|
],
|
|
3907
4103
|
})
|
|
3908
4104
|
], DocumentGridModule);
|
|
@@ -3981,42 +4177,31 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
3981
4177
|
_this.getColumns = [];
|
|
3982
4178
|
_this.documents = [];
|
|
3983
4179
|
_this.labels = [];
|
|
4180
|
+
_this.selected = [];
|
|
4181
|
+
_this.gridLoading = true;
|
|
4182
|
+
_this.ngUnsubscribe = new Subject();
|
|
3984
4183
|
return _this;
|
|
3985
4184
|
}
|
|
3986
|
-
DocumentListComponent.prototype.ngOnInit = function () {
|
|
3987
|
-
this.getSystemIntegration();
|
|
3988
|
-
};
|
|
3989
|
-
DocumentListComponent.prototype.getSystemIntegration = function () {
|
|
3990
|
-
var _this = this;
|
|
3991
|
-
this.documentService.getSystemIntegration().subscribe(function (system) {
|
|
3992
|
-
_this.wmsSystem = system.system;
|
|
3993
|
-
_this.getDocumentBySchedulingId();
|
|
3994
|
-
});
|
|
3995
|
-
};
|
|
3996
|
-
DocumentListComponent.prototype.getDocumentBySchedulingId = function () {
|
|
3997
|
-
var _this = this;
|
|
3998
|
-
this.documentService.list({
|
|
3999
|
-
filterQuery: "schedulingId eq '" + this.agenda.id + "'"
|
|
4000
|
-
}).subscribe(function (contents) {
|
|
4001
|
-
if (contents.totalElements > 0) {
|
|
4002
|
-
_this.documents = contents.contents;
|
|
4003
|
-
_this.getColumns = _this.getColumnLabels();
|
|
4004
|
-
}
|
|
4005
|
-
});
|
|
4006
|
-
};
|
|
4007
4185
|
DocumentListComponent.prototype.getColumnLabels = function () {
|
|
4008
4186
|
if (this.isWmsWIS()) {
|
|
4009
|
-
return __spread(this.getLabelsInvoice()
|
|
4187
|
+
return __spread(this.getLabelsInvoice(), [
|
|
4188
|
+
{ field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_invoice_key' },
|
|
4189
|
+
{ field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
|
|
4190
|
+
{ field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
|
|
4191
|
+
{ field: "code", label: 'yms.int.wms_register_document_invoice_code' },
|
|
4192
|
+
{ field: "invoiceCondition", label: 'yms.int.wms_register_document_invoice_condition' },
|
|
4193
|
+
{ field: "notes", label: 'yms.int.wms_register_document_invoice_notes' },
|
|
4194
|
+
]);
|
|
4010
4195
|
}
|
|
4011
4196
|
if (this.isWmsSeniorConnect()) {
|
|
4012
4197
|
return [
|
|
4013
|
-
{ label: 'yms.int.wms_purchaseOrder' },
|
|
4014
|
-
{ label: 'yms.int.
|
|
4015
|
-
{ label: 'yms.int.
|
|
4198
|
+
{ field: "key", label: 'yms.int.wms_purchaseOrder' },
|
|
4199
|
+
{ field: "partnerName", label: 'yms.int.wms_register_document_invoice_partner_name' },
|
|
4200
|
+
{ field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partner_document' },
|
|
4016
4201
|
];
|
|
4017
4202
|
}
|
|
4018
4203
|
return __spread([
|
|
4019
|
-
{ label: 'yms.int.wms_register_document_invoice_key' }
|
|
4204
|
+
{ field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_key' }
|
|
4020
4205
|
], this.getLabelsInvoice());
|
|
4021
4206
|
};
|
|
4022
4207
|
DocumentListComponent.prototype.isWmsSeniorConnect = function () {
|
|
@@ -4027,10 +4212,40 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
4027
4212
|
};
|
|
4028
4213
|
DocumentListComponent.prototype.getLabelsInvoice = function () {
|
|
4029
4214
|
return [
|
|
4030
|
-
{ label: 'yms.int.wms_register_document_invoice_number' },
|
|
4031
|
-
{ label: 'yms.int.wms_register_document_invoice_serial_number' }
|
|
4215
|
+
{ field: "invoiceNumber", label: 'yms.int.wms_register_document_invoice_number' },
|
|
4216
|
+
{ field: "invoiceSerialNumber", label: 'yms.int.wms_register_document_invoice_serial_number' },
|
|
4032
4217
|
];
|
|
4033
4218
|
};
|
|
4219
|
+
DocumentListComponent.prototype.getInvoiceConditionTranslation = function (invoiceCondition) {
|
|
4220
|
+
return invoiceCondition ? "yms.int.wms_document_invoice_condition_" + invoiceCondition : 'N/A';
|
|
4221
|
+
};
|
|
4222
|
+
DocumentListComponent.prototype.updateGridData = function (event) {
|
|
4223
|
+
var _this = this;
|
|
4224
|
+
this.documentService.getSystemIntegration().subscribe(function (system) {
|
|
4225
|
+
_this.wmsSystem = system.system;
|
|
4226
|
+
_this.searchDocument(event);
|
|
4227
|
+
});
|
|
4228
|
+
};
|
|
4229
|
+
DocumentListComponent.prototype.searchDocument = function (event) {
|
|
4230
|
+
var _this = this;
|
|
4231
|
+
var size = event.rows;
|
|
4232
|
+
var page = event.first / size;
|
|
4233
|
+
var sort = event.multiSortMeta;
|
|
4234
|
+
this.gridLoading = true;
|
|
4235
|
+
this.documentService.list({ page: page, size: size, sort: sort,
|
|
4236
|
+
filterQuery: "schedulingId eq '" + this.agenda.id + "'"
|
|
4237
|
+
})
|
|
4238
|
+
.pipe(takeUntil(this.ngUnsubscribe), finalize(function () {
|
|
4239
|
+
_this.gridLoading = false;
|
|
4240
|
+
}))
|
|
4241
|
+
.subscribe(function (contents) {
|
|
4242
|
+
if (contents.totalElements > 0) {
|
|
4243
|
+
_this.documents = contents.contents;
|
|
4244
|
+
_this.getColumns = _this.getColumnLabels();
|
|
4245
|
+
_this.gridTotalRecords = contents.totalElements;
|
|
4246
|
+
}
|
|
4247
|
+
});
|
|
4248
|
+
};
|
|
4034
4249
|
__decorate([
|
|
4035
4250
|
Input(),
|
|
4036
4251
|
__metadata("design:type", Object)
|
|
@@ -4041,7 +4256,8 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
4041
4256
|
], DocumentListComponent.prototype, "wmsSystem", void 0);
|
|
4042
4257
|
DocumentListComponent = __decorate([
|
|
4043
4258
|
Component({
|
|
4044
|
-
template: "<div
|
|
4259
|
+
template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n selectionMode=\"single\"\n [(selection)]=\"selected\"\n [value]=\"documents\"\n [columns]=\"getColumns\"\n dataKey=\"id\"\n rows=\"10\"\n [paginator]=\"true\"\n [totalRecords]=\"gridTotalRecords\"\n [lazy]=\"true\"\n [resizableColumns]=\"true\"\n (onLazyLoad)=\"updateGridData($event)\"\n *sLoadingState=\"gridLoading\"\n sortMode=\"multiple\"\n styleClass=\"sds-table-scrollable\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100, 200]\"\n paginatorDropdownScrollHeight=\"250px\"\n [scrollable]=\"true\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" class=\"table-col-width\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" pResizableColumn [pSortableColumn]=\"col.field\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label | translate }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr *ngIf=\"isWmsWIS()\">\n <td>{{ rowData?.invoiceNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceSerialNumber || 'N/A' }}</td>\n <td>{{ rowData?.invoiceKey || 'N/A' }}</td>\n <td>{{ rowData?.partnerName || 'N/A' }}</td>\n <td>{{ rowData?.partnerDocument || 'N/A' }}</td>\n <td>{{ rowData?.code || 'N/A' }}</td>\n <td>\n {{ getInvoiceConditionTranslation(rowData?.invoiceCondition) | translate }}\n </td>\n <td>{{ rowData?.notes || 'N/A' }}</td>\n </tr>\n <tr *ngIf=\"isWmsSeniorConnect()\">\n <td>{{rowData?.key}}</td>\n <td>{{rowData?.partnerName}}</td>\n <td>{{rowData?.partnerDocument}}</td>\n </tr>\n <tr *ngIf=\"!isWmsWIS() && !isWmsSeniorConnect()\">\n <td>{{rowData?.invoiceKey}}</td>\n <td>{{rowData?.invoiceNumber}}</td>\n <td>{{rowData?.invoiceSerialNumber}}</td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords + \" \" + \n ('yms.int.wms_register_document_total_elements' | translate:{value: gridTotalRecords}) }}\n </span>\n </ng-template>\n </p-table>\n </div>\n</div>",
|
|
4260
|
+
styles: [".table-col-width{width:250px}"]
|
|
4045
4261
|
}),
|
|
4046
4262
|
__metadata("design:paramtypes", [DocumentService])
|
|
4047
4263
|
], DocumentListComponent);
|
|
@@ -14176,5 +14392,5 @@ var DockModule = /** @class */ (function () {
|
|
|
14176
14392
|
return DockModule;
|
|
14177
14393
|
}());
|
|
14178
14394
|
|
|
14179
|
-
export { AgendaModule, AgendaService$1 as AgendaService, BalancaModule, BalancasService, CamerasModule, CamerasService, CancelasModule, CidadeModule, CidadeService, ContratoCompraItemModule, ContratoCompraItemService, ContratoCompraModule, ContratoCompraService, ControladorCancelaComponent, ControladorCancelaDescritor, ControladorCancelasService, CoreModule, DockModule, DockService, DocumentListComponent, DocumentListModule, ERP_ENVIRONMENT, ERP_SENIOR_HEADER, EmpresaModule, EmpresaService, ErpFormConfigService, ErpProcessData, ErpProcessService, ErpSeniorModule, EstadoModule, EstadoService, ExpedicaoChegadaVeiculoOverride, ExpedicaoModule, ExpedicaoService, FamiliaProdutoModule, FamiliaProdutoService, FieldCustomizationService, FilialModule, FilialService, FormComponent, FormDescritor, FormSamComponent, FormSamDescritor, FormWmsComponent, FormWmsDescritor, HasChangeService, INFORMACAOES_ADICIONAIS_HEADER, InfoComponent, InfoDescritor, IntegrationWebSocket, LogsModule, LogsService, LprModule, LprService, PaisModule, PaisService, PedidoVendaItemModule, PedidoVendaItemService, PedidoVendaModule, PedidoVendaService, PessoaEnderecoModule, PessoaEnderecoService, PessoaFisicaModule, PessoaFisicaService, PessoaJuridicaModule, PessoaJuridicaService, PessoaModule, PessoaService, PortariasComponent, PortariasDescritor, PortariasModule, ProdutoModule, ProdutoService, RecebimentoChegadaVeiculoOverride, RecebimentoContratoModule, RecebimentoContratoService, RoyaltyModule, RoyaltyService, SAM_SENIOR_HEADER, SafraModule, SafraService, SamSeniorModule, SnapshotComponent, SnapshotDescritor, TransportadoraModule, TransportadoraService, UnidadeMedidaModule, UnidadeMedidaService, VisitorListComponent, VisitorListModule, VisitorListService, VisualizarBalancaComponent, VisualizarBalancaDescritor, WmsModule, highlightLanguages, Service as ɵa, CustomStompConfig as ɵb, EntityService$2 as ɵba, EntityService$1 as ɵbb, UtilsMessageService as ɵbc,
|
|
14395
|
+
export { AgendaModule, AgendaService$1 as AgendaService, BalancaModule, BalancasService, CamerasModule, CamerasService, CancelasModule, CidadeModule, CidadeService, ContratoCompraItemModule, ContratoCompraItemService, ContratoCompraModule, ContratoCompraService, ControladorCancelaComponent, ControladorCancelaDescritor, ControladorCancelasService, CoreModule, DockModule, DockService, DocumentListComponent, DocumentListModule, ERP_ENVIRONMENT, ERP_SENIOR_HEADER, EmpresaModule, EmpresaService, ErpFormConfigService, ErpProcessData, ErpProcessService, ErpSeniorModule, EstadoModule, EstadoService, ExpedicaoChegadaVeiculoOverride, ExpedicaoModule, ExpedicaoService, FamiliaProdutoModule, FamiliaProdutoService, FieldCustomizationService, FilialModule, FilialService, FormComponent, FormDescritor, FormSamComponent, FormSamDescritor, FormWmsComponent, FormWmsDescritor, HasChangeService, INFORMACAOES_ADICIONAIS_HEADER, InfoComponent, InfoDescritor, IntegrationWebSocket, LogsModule, LogsService, LprModule, LprService, PaisModule, PaisService, PedidoVendaItemModule, PedidoVendaItemService, PedidoVendaModule, PedidoVendaService, PessoaEnderecoModule, PessoaEnderecoService, PessoaFisicaModule, PessoaFisicaService, PessoaJuridicaModule, PessoaJuridicaService, PessoaModule, PessoaService, PortariasComponent, PortariasDescritor, PortariasModule, ProdutoModule, ProdutoService, RecebimentoChegadaVeiculoOverride, RecebimentoContratoModule, RecebimentoContratoService, RoyaltyModule, RoyaltyService, SAM_SENIOR_HEADER, SafraModule, SafraService, SamSeniorModule, SnapshotComponent, SnapshotDescritor, TransportadoraModule, TransportadoraService, UnidadeMedidaModule, UnidadeMedidaService, VisitorListComponent, VisitorListModule, VisitorListService, VisualizarBalancaComponent, VisualizarBalancaDescritor, WmsModule, highlightLanguages, Service as ɵa, CustomStompConfig as ɵb, EntityService$2 as ɵba, EntityService$1 as ɵbb, UtilsMessageService as ɵbc, ExternalTenantService as ɵbd, RegisterDocumentModule as ɵbe, RegisterDocumentComponent as ɵbf, InsertKeyModule as ɵbg, InsertKeyComponent as ɵbh, IntegrationService$1 as ɵbi, RecebimentoFormComponent as ɵbj, DerivacaoService as ɵbk, NotaValidatorService as ɵbl, TransgeniaService as ɵbm, VerificaNotafiscal as ɵbn, BuildFormField as ɵbo, ExpedicaoFormComponent as ɵbp, ExpedicaoInfoComponent as ɵbq, RecebimentoInfoComponent as ɵbr, DevolucaoFormComponent as ɵbs, DevolucaoService as ɵbt, DevolucaoChegadaVeiculoOverride as ɵbu, RecebimentoOrdemCompraFormComponent as ɵbv, OrdemCompraService as ɵbw, RecebimentoOrdemCompraService as ɵbx, RecebimentoOrdemCompraChegadaVeiculoOverride as ɵby, RecebimentoOrdemCompraInfoComponent as ɵbz, ViewImageComponent as ɵc, DevolucaoInfoComponent as ɵca, ContratoFormComponent as ɵcb, OrdemCompraFormComponent as ɵcc, ProcessoAvulsoFormComponent as ɵcd, ProcessoAvulsoService as ɵce, ProcessoAvulsoChegadaVeiculoOverride as ɵcf, ProcessoAvulsoInfoComponent as ɵcg, LogIntegracaoDescritor as ɵch, LogIntegracaoComponent as ɵci, LogIntegracaoService as ɵcj, DerivacaoModule as ɵck, DevolucaoModule as ɵcl, OrdemCompraModule as ɵcm, RecebimentoOrdemCompraModule as ɵcn, TransgeniaModule as ɵco, ProcessoAvulsoModule as ɵcp, LogIntegracaoModule as ɵcq, NotaFormModule as ɵcr, DirectivesModule as ɵcs, TrimDirective as ɵct, NotaFormComponent as ɵcu, LogDescritor as ɵd, LogsComponent as ɵe, PortariasService as ɵf, EntradaComponent as ɵg, AgendasComponent as ɵh, ConfirmacaoComponent as ɵi, VisitedInfoDescritor as ɵj, VisitedInfoComponent as ɵk, VisitedInfoService as ɵl, SchedulingComponent as ɵm, LobbyService as ɵn, EntityService as ɵo, SchedulingService as ɵp, VisitanteComponent as ɵq, VisitanteFormComponent as ɵr, CredencialFormComponent as ɵs, FocusService as ɵt, FormWmsService as ɵu, DocumentGridModule as ɵv, DocumentGridComponent as ɵw, DocumentService as ɵx, IntegrationService as ɵy, AgendaService as ɵz };
|
|
14180
14396
|
//# sourceMappingURL=seniorsistemas-yms-integration.js.map
|