@seniorsistemas/yms-integration 1.32.0 → 1.34.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 +182 -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 +69 -17
- package/esm2015/src/wms/components/document-grid/document-grid.module.js +6 -3
- package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +38 -3
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +20 -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 +48 -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/invoice-condition/invoice-condition.js +8 -0
- package/esm5/src/wms/components/document-grid/document-grid.component.js +66 -16
- package/esm5/src/wms/components/document-grid/document-grid.module.js +6 -3
- package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +39 -3
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +20 -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 +51 -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/invoice-condition/invoice-condition.js +8 -0
- package/fesm2015/seniorsistemas-yms-integration.js +181 -53
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +182 -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 +17 -8
- package/src/wms/components/document-grid/insert-key/insert-key.component.d.ts +4 -0
- 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/invoice-condition/invoice-condition.d.ts +6 -0
|
@@ -3288,6 +3288,14 @@ 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 || (InvoiceCondition = {}));
|
|
3298
|
+
|
|
3291
3299
|
var DocumentGridComponent = /** @class */ (function () {
|
|
3292
3300
|
function DocumentGridComponent(translate, documentService, confirmationService, integrationService, agendaService, utils) {
|
|
3293
3301
|
this.translate = translate;
|
|
@@ -3299,7 +3307,15 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3299
3307
|
this.viewDocument = new EventEmitter();
|
|
3300
3308
|
this.gridData = [];
|
|
3301
3309
|
this.enableButtonIsClienteExterno = true;
|
|
3310
|
+
this.summary = "yms.int.wms_saved_document_message_title";
|
|
3302
3311
|
this.ngUnsubscribe = new Subject();
|
|
3312
|
+
this.invoiceCondition = [
|
|
3313
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3314
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3315
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3316
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3317
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.DEVOLUTION },
|
|
3318
|
+
];
|
|
3303
3319
|
this.selection = [];
|
|
3304
3320
|
}
|
|
3305
3321
|
DocumentGridComponent.prototype.ngOnInit = function () {
|
|
@@ -3307,14 +3323,12 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3307
3323
|
this.getProcessTypeByScheduling();
|
|
3308
3324
|
this.listDocuments(false);
|
|
3309
3325
|
};
|
|
3310
|
-
DocumentGridComponent.prototype.ngAfterContentChecked = function () {
|
|
3311
|
-
this.gridColumns = this.getGridColumns();
|
|
3312
|
-
};
|
|
3313
3326
|
DocumentGridComponent.prototype.verifyClienteExterno = function () {
|
|
3314
3327
|
var _this = this;
|
|
3315
3328
|
this.agendaService.isClienteExterno()
|
|
3316
3329
|
.subscribe(function (result) {
|
|
3317
3330
|
_this.isClienteExterno = result.isClienteExterno;
|
|
3331
|
+
_this.gridColumns = _this.getGridColumns();
|
|
3318
3332
|
_this.cantEditStatus();
|
|
3319
3333
|
});
|
|
3320
3334
|
};
|
|
@@ -3336,7 +3350,7 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3336
3350
|
}
|
|
3337
3351
|
this.gridData.push(document);
|
|
3338
3352
|
this.disabled = false;
|
|
3339
|
-
this.utils.message("success",
|
|
3353
|
+
this.utils.message("success", this.summary, "yms.int.wms_success_message_description");
|
|
3340
3354
|
this.visibleDocumentRegister = false;
|
|
3341
3355
|
this.visibleInvoiceKey = false;
|
|
3342
3356
|
};
|
|
@@ -3416,11 +3430,17 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3416
3430
|
}
|
|
3417
3431
|
data.key = _this.updateKeyByWms(data);
|
|
3418
3432
|
_this.documentService.insert(data).subscribe(function () {
|
|
3419
|
-
_this.
|
|
3433
|
+
_this.sucessMessage();
|
|
3420
3434
|
});
|
|
3421
3435
|
_this.disabled = true;
|
|
3422
3436
|
_this.listDocuments(false);
|
|
3423
3437
|
}
|
|
3438
|
+
else {
|
|
3439
|
+
_this.documentService.update(data.id, data).subscribe(function () {
|
|
3440
|
+
_this.sucessMessage();
|
|
3441
|
+
_this.disabled = true;
|
|
3442
|
+
});
|
|
3443
|
+
}
|
|
3424
3444
|
});
|
|
3425
3445
|
}
|
|
3426
3446
|
};
|
|
@@ -3484,20 +3504,46 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3484
3504
|
});
|
|
3485
3505
|
};
|
|
3486
3506
|
DocumentGridComponent.prototype.getGridColumns = function () {
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3507
|
+
var result;
|
|
3508
|
+
switch (this.wmsSystem) {
|
|
3509
|
+
case WmsSystem.SENIOR_CONNECT:
|
|
3510
|
+
result = this.wmsSeniorConnectIntegration();
|
|
3511
|
+
break;
|
|
3512
|
+
case WmsSystem.WIS:
|
|
3513
|
+
result = this.wmsWisIntegration();
|
|
3514
|
+
break;
|
|
3515
|
+
case WmsSystem.SENIOR:
|
|
3516
|
+
result = this.wmsSiltIntegration();
|
|
3517
|
+
break;
|
|
3518
|
+
default:
|
|
3519
|
+
result = [];
|
|
3520
|
+
}
|
|
3521
|
+
return result;
|
|
3522
|
+
};
|
|
3523
|
+
DocumentGridComponent.prototype.wmsSeniorConnectIntegration = function () {
|
|
3524
|
+
var columns = __spread([
|
|
3525
|
+
{ field: "key", header: this.translate.instant("yms.int.wms_purchaseOrder") }
|
|
3526
|
+
], this.getColumnPartner());
|
|
3527
|
+
this.addInvoiceSituationIfNotClienteExterno(columns);
|
|
3528
|
+
return columns;
|
|
3529
|
+
};
|
|
3530
|
+
DocumentGridComponent.prototype.wmsWisIntegration = function () {
|
|
3531
|
+
var columns = __spread(this.getColumnInvoiceAndlogistcUnit());
|
|
3532
|
+
this.addInvoiceSituationIfNotClienteExterno(columns);
|
|
3533
|
+
return columns;
|
|
3534
|
+
};
|
|
3535
|
+
DocumentGridComponent.prototype.wmsSiltIntegration = function () {
|
|
3536
|
+
var columns = __spread([
|
|
3496
3537
|
{ field: "invoiceKey", header: this.translate.instant("yms.int.wms_register_document_invoice_key") }
|
|
3497
3538
|
], this.getColumnInvoiceAndlogistcUnit(), [
|
|
3498
3539
|
{ field: "ownerName", header: this.translate.instant("yms.int.wms_register_document_owner_name") },
|
|
3499
3540
|
{ field: "ownerDocument", header: this.translate.instant("yms.int.wms_register_document_owner_document") },
|
|
3500
3541
|
]);
|
|
3542
|
+
this.addInvoiceSituationIfNotClienteExterno(columns);
|
|
3543
|
+
return columns;
|
|
3544
|
+
};
|
|
3545
|
+
DocumentGridComponent.prototype.getColumninvoiceCondition = function () {
|
|
3546
|
+
return { field: "invoiceCondition", header: this.translate.instant("yms.int.wms_grid_document_invoice_condition") };
|
|
3501
3547
|
};
|
|
3502
3548
|
DocumentGridComponent.prototype.getColumnInvoiceAndlogistcUnit = function () {
|
|
3503
3549
|
return __spread([
|
|
@@ -3514,12 +3560,23 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3514
3560
|
{ field: "partnerDocument", header: this.translate.instant("yms.int.wms_register_document_partner_document") },
|
|
3515
3561
|
];
|
|
3516
3562
|
};
|
|
3563
|
+
DocumentGridComponent.prototype.addInvoiceSituationIfNotClienteExterno = function (columns) {
|
|
3564
|
+
if (!this.isClienteExterno) {
|
|
3565
|
+
columns.push(this.getColumninvoiceCondition());
|
|
3566
|
+
}
|
|
3567
|
+
};
|
|
3517
3568
|
DocumentGridComponent.prototype.isWmsSeniorConnect = function () {
|
|
3518
3569
|
return this.wmsSystem === WmsSystem.SENIOR_CONNECT;
|
|
3519
3570
|
};
|
|
3520
3571
|
DocumentGridComponent.prototype.isWmsWIS = function () {
|
|
3521
3572
|
return this.wmsSystem === WmsSystem.WIS;
|
|
3522
3573
|
};
|
|
3574
|
+
DocumentGridComponent.prototype.isWmsSilt = function () {
|
|
3575
|
+
return this.wmsSystem === WmsSystem.SENIOR;
|
|
3576
|
+
};
|
|
3577
|
+
DocumentGridComponent.prototype.sucessMessage = function () {
|
|
3578
|
+
return this.utils.message("success", this.summary, "saved_message_content");
|
|
3579
|
+
};
|
|
3523
3580
|
__decorate([
|
|
3524
3581
|
Input(),
|
|
3525
3582
|
__metadata("design:type", Object)
|
|
@@ -3567,8 +3624,8 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3567
3624
|
DocumentGridComponent = __decorate([
|
|
3568
3625
|
Component({
|
|
3569
3626
|
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\" [lazy]=\"true\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n sortMode=\"multiple\" [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\" [pSortableColumn]=\"col.field\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\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 *
|
|
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}"]
|
|
3627
|
+
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\" [lazy]=\"true\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n sortMode=\"multiple\" [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\" [pSortableColumn]=\"col.field\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\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]=\"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]=\"'total_records'\" [translateParams]=\"{ value: documentTotalRecords }\"></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>",
|
|
3628
|
+
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
3629
|
}),
|
|
3573
3630
|
__metadata("design:paramtypes", [TranslateService,
|
|
3574
3631
|
DocumentService,
|
|
@@ -3602,6 +3659,7 @@ var Document = /** @class */ (function () {
|
|
|
3602
3659
|
"ownerDocument",
|
|
3603
3660
|
"partnerName",
|
|
3604
3661
|
"partnerDocument",
|
|
3662
|
+
"invoiceCondition",
|
|
3605
3663
|
"notes",
|
|
3606
3664
|
"code",
|
|
3607
3665
|
"createdBy",
|
|
@@ -3622,13 +3680,20 @@ var Document = /** @class */ (function () {
|
|
|
3622
3680
|
}());
|
|
3623
3681
|
|
|
3624
3682
|
var RegisterDocumentComponent = /** @class */ (function () {
|
|
3625
|
-
function RegisterDocumentComponent(fb,
|
|
3683
|
+
function RegisterDocumentComponent(fb, translate) {
|
|
3626
3684
|
this.fb = fb;
|
|
3627
|
-
this.
|
|
3685
|
+
this.translate = translate;
|
|
3628
3686
|
this.document = new EventEmitter();
|
|
3629
3687
|
this.visible = new EventEmitter();
|
|
3630
3688
|
this.visibleChange = new EventEmitter();
|
|
3631
3689
|
this.isSaveFormValid = false;
|
|
3690
|
+
this.invoiceCondition = [
|
|
3691
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_no_way"), value: null },
|
|
3692
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_authorized"), value: InvoiceCondition.AUTHORIZED },
|
|
3693
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_manual_authorized"), value: InvoiceCondition.MANUAL_AUTHORIZED },
|
|
3694
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_partial_authorized"), value: InvoiceCondition.PARTIAL_AUTHORIZED },
|
|
3695
|
+
{ label: this.translate.instant("yms.int.wms_grid_document_invoice_condition_devolucion"), value: InvoiceCondition.DEVOLUTION },
|
|
3696
|
+
];
|
|
3632
3697
|
}
|
|
3633
3698
|
RegisterDocumentComponent.prototype.ngOnInit = function () {
|
|
3634
3699
|
this.getFormGroup();
|
|
@@ -3666,6 +3731,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3666
3731
|
this.formGroup.get('partnerDocument').setValue(document.partnerDocument);
|
|
3667
3732
|
this.formGroup.get('ownerDocument').setValue(document.ownerDocument);
|
|
3668
3733
|
this.formGroup.get('ownerName').setValue(document.ownerName);
|
|
3734
|
+
this.formGroup.get('invoiceCondition').setValue(document.invoiceCondition);
|
|
3669
3735
|
};
|
|
3670
3736
|
RegisterDocumentComponent.prototype.getFormGroup = function () {
|
|
3671
3737
|
this.formGroup = this.fb.group({
|
|
@@ -3682,6 +3748,7 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3682
3748
|
partnerDocument: [undefined],
|
|
3683
3749
|
notes: [undefined],
|
|
3684
3750
|
code: [undefined],
|
|
3751
|
+
invoiceCondition: [undefined],
|
|
3685
3752
|
});
|
|
3686
3753
|
};
|
|
3687
3754
|
RegisterDocumentComponent.prototype.save = function () {
|
|
@@ -3713,6 +3780,10 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3713
3780
|
Input(),
|
|
3714
3781
|
__metadata("design:type", Agenda)
|
|
3715
3782
|
], RegisterDocumentComponent.prototype, "agenda", void 0);
|
|
3783
|
+
__decorate([
|
|
3784
|
+
Input(),
|
|
3785
|
+
__metadata("design:type", Boolean)
|
|
3786
|
+
], RegisterDocumentComponent.prototype, "isClienteExterno", void 0);
|
|
3716
3787
|
__decorate([
|
|
3717
3788
|
Output(),
|
|
3718
3789
|
__metadata("design:type", EventEmitter)
|
|
@@ -3732,10 +3803,9 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3732
3803
|
RegisterDocumentComponent = __decorate([
|
|
3733
3804
|
Component({
|
|
3734
3805
|
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>"
|
|
3806
|
+
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
3807
|
}),
|
|
3737
|
-
__metadata("design:paramtypes", [FormBuilder,
|
|
3738
|
-
UtilsMessageService])
|
|
3808
|
+
__metadata("design:paramtypes", [FormBuilder, TranslateService])
|
|
3739
3809
|
], RegisterDocumentComponent);
|
|
3740
3810
|
return RegisterDocumentComponent;
|
|
3741
3811
|
}());
|
|
@@ -3755,7 +3825,8 @@ var RegisterDocumentModule = /** @class */ (function () {
|
|
|
3755
3825
|
InputTextModule$1,
|
|
3756
3826
|
ControlErrorsModule,
|
|
3757
3827
|
InputTextareaModule,
|
|
3758
|
-
ReactiveFormsModule
|
|
3828
|
+
ReactiveFormsModule,
|
|
3829
|
+
DropdownModule,
|
|
3759
3830
|
],
|
|
3760
3831
|
exports: [RegisterDocumentComponent],
|
|
3761
3832
|
declarations: [RegisterDocumentComponent],
|
|
@@ -3776,6 +3847,7 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3776
3847
|
this.isLoading = false;
|
|
3777
3848
|
}
|
|
3778
3849
|
InsertKeyComponent.prototype.ngOnInit = function () {
|
|
3850
|
+
var _this = this;
|
|
3779
3851
|
this.formGroup = this.formBuilder.group({
|
|
3780
3852
|
key: [undefined],
|
|
3781
3853
|
purchaseOrder: [undefined],
|
|
@@ -3783,6 +3855,9 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3783
3855
|
invoiceSerie: [undefined],
|
|
3784
3856
|
partnerDocument: [undefined]
|
|
3785
3857
|
});
|
|
3858
|
+
this.formGroup.get('key').valueChanges.subscribe(function (nf) {
|
|
3859
|
+
_this.validateKeyDetails(nf);
|
|
3860
|
+
});
|
|
3786
3861
|
};
|
|
3787
3862
|
InsertKeyComponent.prototype.isWmsWis = function () {
|
|
3788
3863
|
return this.wmsSystem === WmsSystem.WIS;
|
|
@@ -3828,6 +3903,38 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3828
3903
|
_this.formGroup.reset();
|
|
3829
3904
|
});
|
|
3830
3905
|
};
|
|
3906
|
+
InsertKeyComponent.prototype.validateKeyDetails = function (nf) {
|
|
3907
|
+
if (!nf) {
|
|
3908
|
+
this.keyErrorMessage = null;
|
|
3909
|
+
this.setValuesOfKey(undefined, undefined, undefined);
|
|
3910
|
+
return;
|
|
3911
|
+
}
|
|
3912
|
+
var nfLength = 44;
|
|
3913
|
+
if (nf.length === nfLength) {
|
|
3914
|
+
this.keyErrorMessage = null;
|
|
3915
|
+
this.extractKeyDetails(nf);
|
|
3916
|
+
}
|
|
3917
|
+
else {
|
|
3918
|
+
this.keyErrorMessage = "yms.int.wms_error_key_message";
|
|
3919
|
+
}
|
|
3920
|
+
};
|
|
3921
|
+
InsertKeyComponent.prototype.extractKeyDetails = function (nf) {
|
|
3922
|
+
var startCnpj = 6;
|
|
3923
|
+
var endCnpj = 20;
|
|
3924
|
+
var cnpj = nf.substring(startCnpj, endCnpj);
|
|
3925
|
+
var startSerie = 22;
|
|
3926
|
+
var endSerie = 25;
|
|
3927
|
+
var serie = nf.substring(startSerie, endSerie);
|
|
3928
|
+
var startInvoice = 25;
|
|
3929
|
+
var endInvoice = 34;
|
|
3930
|
+
var invoice = nf.substring(startInvoice, endInvoice);
|
|
3931
|
+
this.setValuesOfKey(invoice, serie, cnpj);
|
|
3932
|
+
};
|
|
3933
|
+
InsertKeyComponent.prototype.setValuesOfKey = function (invoiceNumber, invoiceSerie, partnerDocument) {
|
|
3934
|
+
this.formGroup.get('invoiceNumber').setValue(invoiceNumber);
|
|
3935
|
+
this.formGroup.get('invoiceSerie').setValue(invoiceSerie);
|
|
3936
|
+
this.formGroup.get('partnerDocument').setValue(partnerDocument);
|
|
3937
|
+
};
|
|
3831
3938
|
InsertKeyComponent.prototype.cancel = function () {
|
|
3832
3939
|
this.visibleChange.emit(false);
|
|
3833
3940
|
};
|
|
@@ -3853,8 +3960,8 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3853
3960
|
InsertKeyComponent = __decorate([
|
|
3854
3961
|
Component({
|
|
3855
3962
|
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}"]
|
|
3963
|
+
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\"\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",
|
|
3964
|
+
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
3965
|
}),
|
|
3859
3966
|
__metadata("design:paramtypes", [FormBuilder,
|
|
3860
3967
|
DocumentService,
|
|
@@ -3902,7 +4009,9 @@ var DocumentGridModule = /** @class */ (function () {
|
|
|
3902
4009
|
InsertKeyModule,
|
|
3903
4010
|
ButtonModule$1,
|
|
3904
4011
|
ComponentsModule,
|
|
3905
|
-
EmptyStateModule
|
|
4012
|
+
EmptyStateModule,
|
|
4013
|
+
DropdownModule,
|
|
4014
|
+
FormsModule
|
|
3906
4015
|
],
|
|
3907
4016
|
})
|
|
3908
4017
|
], DocumentGridModule);
|
|
@@ -3981,42 +4090,30 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
3981
4090
|
_this.getColumns = [];
|
|
3982
4091
|
_this.documents = [];
|
|
3983
4092
|
_this.labels = [];
|
|
4093
|
+
_this.selected = [];
|
|
4094
|
+
_this.gridLoading = true;
|
|
4095
|
+
_this.ngUnsubscribe = new Subject();
|
|
3984
4096
|
return _this;
|
|
3985
4097
|
}
|
|
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
4098
|
DocumentListComponent.prototype.getColumnLabels = function () {
|
|
4008
4099
|
if (this.isWmsWIS()) {
|
|
4009
|
-
return __spread(this.getLabelsInvoice()
|
|
4100
|
+
return __spread(this.getLabelsInvoice(), [
|
|
4101
|
+
{ field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
|
|
4102
|
+
{ field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
|
|
4103
|
+
{ field: "code", label: 'yms.int.wms_register_document_invoice_code' },
|
|
4104
|
+
{ field: "invoiceCondition", label: 'yms.int.wms_register_document_invoice_condition' },
|
|
4105
|
+
{ field: "notes", label: 'yms.int.wms_register_document_invoice_notes' },
|
|
4106
|
+
]);
|
|
4010
4107
|
}
|
|
4011
4108
|
if (this.isWmsSeniorConnect()) {
|
|
4012
4109
|
return [
|
|
4013
|
-
{ label: 'yms.int.wms_purchaseOrder' },
|
|
4014
|
-
{ label: 'yms.int.
|
|
4015
|
-
{ label: 'yms.int.
|
|
4110
|
+
{ field: "key", label: 'yms.int.wms_purchaseOrder' },
|
|
4111
|
+
{ field: "partnerName", label: 'yms.int.wms_register_document_invoice_partnerName' },
|
|
4112
|
+
{ field: "partnerDocument", label: 'yms.int.wms_register_document_invoice_partnerDocument' },
|
|
4016
4113
|
];
|
|
4017
4114
|
}
|
|
4018
4115
|
return __spread([
|
|
4019
|
-
{ label: 'yms.int.wms_register_document_invoice_key' }
|
|
4116
|
+
{ field: "invoiceKey", label: 'yms.int.wms_register_document_invoice_key' }
|
|
4020
4117
|
], this.getLabelsInvoice());
|
|
4021
4118
|
};
|
|
4022
4119
|
DocumentListComponent.prototype.isWmsSeniorConnect = function () {
|
|
@@ -4027,10 +4124,40 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
4027
4124
|
};
|
|
4028
4125
|
DocumentListComponent.prototype.getLabelsInvoice = function () {
|
|
4029
4126
|
return [
|
|
4030
|
-
{ label: 'yms.int.wms_register_document_invoice_number' },
|
|
4031
|
-
{ label: 'yms.int.wms_register_document_invoice_serial_number' }
|
|
4127
|
+
{ field: "invoiceNumber", label: 'yms.int.wms_register_document_invoice_number' },
|
|
4128
|
+
{ field: "invoiceSerialNumber", label: 'yms.int.wms_register_document_invoice_serial_number' },
|
|
4032
4129
|
];
|
|
4033
4130
|
};
|
|
4131
|
+
DocumentListComponent.prototype.getInvoiceConditionTranslation = function (invoiceCondition) {
|
|
4132
|
+
return invoiceCondition ? "yms.int.wms_document_invoice_condition_" + invoiceCondition : 'N/A';
|
|
4133
|
+
};
|
|
4134
|
+
DocumentListComponent.prototype.updateGridData = function (event) {
|
|
4135
|
+
var _this = this;
|
|
4136
|
+
this.documentService.getSystemIntegration().subscribe(function (system) {
|
|
4137
|
+
_this.wmsSystem = system.system;
|
|
4138
|
+
_this.searchDocument(event);
|
|
4139
|
+
});
|
|
4140
|
+
};
|
|
4141
|
+
DocumentListComponent.prototype.searchDocument = function (event) {
|
|
4142
|
+
var _this = this;
|
|
4143
|
+
var size = event.rows;
|
|
4144
|
+
var page = event.first / size;
|
|
4145
|
+
var sort = event.multiSortMeta;
|
|
4146
|
+
this.gridLoading = true;
|
|
4147
|
+
this.documentService.list({ page: page, size: size, sort: sort,
|
|
4148
|
+
filterQuery: "schedulingId eq '" + this.agenda.id + "'"
|
|
4149
|
+
})
|
|
4150
|
+
.pipe(takeUntil(this.ngUnsubscribe), finalize(function () {
|
|
4151
|
+
_this.gridLoading = false;
|
|
4152
|
+
}))
|
|
4153
|
+
.subscribe(function (contents) {
|
|
4154
|
+
if (contents.totalElements > 0) {
|
|
4155
|
+
_this.documents = contents.contents;
|
|
4156
|
+
_this.getColumns = _this.getColumnLabels();
|
|
4157
|
+
_this.gridTotalRecords = contents.totalElements;
|
|
4158
|
+
}
|
|
4159
|
+
});
|
|
4160
|
+
};
|
|
4034
4161
|
__decorate([
|
|
4035
4162
|
Input(),
|
|
4036
4163
|
__metadata("design:type", Object)
|
|
@@ -4041,7 +4168,8 @@ var DocumentListComponent = /** @class */ (function (_super) {
|
|
|
4041
4168
|
], DocumentListComponent.prototype, "wmsSystem", void 0);
|
|
4042
4169
|
DocumentListComponent = __decorate([
|
|
4043
4170
|
Component({
|
|
4044
|
-
template: "<div
|
|
4171
|
+
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?.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>",
|
|
4172
|
+
styles: [".table-col-width{width:250px}"]
|
|
4045
4173
|
}),
|
|
4046
4174
|
__metadata("design:paramtypes", [DocumentService])
|
|
4047
4175
|
], DocumentListComponent);
|