@seniorsistemas/yms-integration 1.37.0-b333af94-daee-455c-9c78-2797113c9974 → 1.38.0-591f5730-03b4-4f60-9cea-dcdc8ef07f02
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 +70 -18
- 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 +2 -2
- package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +41 -16
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +30 -3
- package/esm2015/src/wms/entities/document/document.service.js +4 -1
- package/esm5/src/wms/components/document-grid/document-grid.component.js +2 -2
- package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +42 -16
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +31 -3
- package/esm5/src/wms/entities/document/document.service.js +4 -1
- package/fesm2015/seniorsistemas-yms-integration.js +68 -18
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +70 -18
- 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/insert-key/insert-key.component.d.ts +6 -2
- package/src/wms/components/document-grid/register-document/register-document.component.d.ts +7 -1
- package/src/wms/entities/document/document.service.d.ts +1 -0
|
@@ -3257,6 +3257,9 @@ var DocumentService = /** @class */ (function (_super) {
|
|
|
3257
3257
|
DocumentService.prototype.getSystemIntegration = function () {
|
|
3258
3258
|
return this.http.get('yms_int/wms/queries/getSystemIntegration');
|
|
3259
3259
|
};
|
|
3260
|
+
DocumentService.prototype.getPlanta = function (plantaId) {
|
|
3261
|
+
return this.http.get('yms/patio/entities/planta/' + plantaId);
|
|
3262
|
+
};
|
|
3260
3263
|
DocumentService = __decorate([
|
|
3261
3264
|
Injectable(),
|
|
3262
3265
|
__metadata("design:paramtypes", [HttpClient, MessageService])
|
|
@@ -3644,7 +3647,7 @@ var DocumentGridComponent = /** @class */ (function () {
|
|
|
3644
3647
|
DocumentGridComponent = __decorate([
|
|
3645
3648
|
Component({
|
|
3646
3649
|
selector: 'document-grid',
|
|
3647
|
-
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() || isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt() || isWmsSeniorConnect()\" (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 && isWmsWIS()\" (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>",
|
|
3650
|
+
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() || isWmsSeniorConnect()\" (click)=\"selection = [rowData]\">\n <span>{{rowData[\"logistcUnitName\"]}}</span>\n </td>\n <td *ngIf=\"isWmsWIS() || isWmsSilt() || isWmsSeniorConnect()\" (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 && isWmsWIS()\" (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 [agenda]=\"agenda\"\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>",
|
|
3648
3651
|
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}"]
|
|
3649
3652
|
}),
|
|
3650
3653
|
__metadata("design:paramtypes", [TranslateService,
|
|
@@ -3700,9 +3703,11 @@ var Document = /** @class */ (function () {
|
|
|
3700
3703
|
}());
|
|
3701
3704
|
|
|
3702
3705
|
var RegisterDocumentComponent = /** @class */ (function () {
|
|
3703
|
-
function RegisterDocumentComponent(fb, translate) {
|
|
3706
|
+
function RegisterDocumentComponent(fb, translate, utils, documentService) {
|
|
3704
3707
|
this.fb = fb;
|
|
3705
3708
|
this.translate = translate;
|
|
3709
|
+
this.utils = utils;
|
|
3710
|
+
this.documentService = documentService;
|
|
3706
3711
|
this.document = new EventEmitter();
|
|
3707
3712
|
this.visible = new EventEmitter();
|
|
3708
3713
|
this.visibleChange = new EventEmitter();
|
|
@@ -3710,12 +3715,23 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3710
3715
|
this.invoiceCondition = getInvoiceConditions(this.translate);
|
|
3711
3716
|
}
|
|
3712
3717
|
RegisterDocumentComponent.prototype.ngOnInit = function () {
|
|
3718
|
+
this.getYard();
|
|
3713
3719
|
this.getFormGroup();
|
|
3714
3720
|
this.watchFormChanges();
|
|
3715
3721
|
};
|
|
3716
3722
|
RegisterDocumentComponent.prototype.ngOnChanges = function () {
|
|
3717
3723
|
this.visibilityConfig();
|
|
3718
3724
|
};
|
|
3725
|
+
RegisterDocumentComponent.prototype.getYard = function () {
|
|
3726
|
+
var _this = this;
|
|
3727
|
+
this.documentService.getPlanta(this.agenda.planta.id)
|
|
3728
|
+
.pipe(catchError(function (err) {
|
|
3729
|
+
return throwError(err);
|
|
3730
|
+
}))
|
|
3731
|
+
.subscribe(function (content) {
|
|
3732
|
+
_this.planta = content;
|
|
3733
|
+
});
|
|
3734
|
+
};
|
|
3719
3735
|
RegisterDocumentComponent.prototype.visibilityConfig = function () {
|
|
3720
3736
|
if (!this.edit && this.visible) {
|
|
3721
3737
|
this.formGroup.disable();
|
|
@@ -3766,6 +3782,15 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3766
3782
|
});
|
|
3767
3783
|
};
|
|
3768
3784
|
RegisterDocumentComponent.prototype.save = function () {
|
|
3785
|
+
if (!this.planta.codigo) {
|
|
3786
|
+
this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
|
|
3787
|
+
return;
|
|
3788
|
+
}
|
|
3789
|
+
var logistcUnitDocument = this.formGroup.get("logistcUnitDocument").value;
|
|
3790
|
+
if (logistcUnitDocument !== this.planta.codigo) {
|
|
3791
|
+
this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
|
|
3792
|
+
return;
|
|
3793
|
+
}
|
|
3769
3794
|
this.document.emit(Document.fromDto(this.formGroup.getRawValue()));
|
|
3770
3795
|
this.formGroup.reset();
|
|
3771
3796
|
};
|
|
@@ -3823,7 +3848,9 @@ var RegisterDocumentComponent = /** @class */ (function () {
|
|
|
3823
3848
|
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\" *ngIf=\"isWmsSenior() || isWmsWis()\">\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 && isWmsWis()\">\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>"
|
|
3824
3849
|
}),
|
|
3825
3850
|
__metadata("design:paramtypes", [FormBuilder,
|
|
3826
|
-
TranslateService
|
|
3851
|
+
TranslateService,
|
|
3852
|
+
UtilsMessageService,
|
|
3853
|
+
DocumentService])
|
|
3827
3854
|
], RegisterDocumentComponent);
|
|
3828
3855
|
return RegisterDocumentComponent;
|
|
3829
3856
|
}());
|
|
@@ -3877,8 +3904,8 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3877
3904
|
this.confirmationService = confirmationService;
|
|
3878
3905
|
this.translate = translate;
|
|
3879
3906
|
this.externalTenantService = externalTenantService;
|
|
3880
|
-
this.document = new EventEmitter();
|
|
3881
3907
|
this.visible = new EventEmitter();
|
|
3908
|
+
this.document = new EventEmitter();
|
|
3882
3909
|
this.visibleChange = new EventEmitter();
|
|
3883
3910
|
this.isLoading = false;
|
|
3884
3911
|
this.isPartnerloading = false;
|
|
@@ -3886,6 +3913,7 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3886
3913
|
}
|
|
3887
3914
|
InsertKeyComponent.prototype.ngOnInit = function () {
|
|
3888
3915
|
var _this = this;
|
|
3916
|
+
this.getYard();
|
|
3889
3917
|
this.formGroup = this.formBuilder.group({
|
|
3890
3918
|
key: [undefined],
|
|
3891
3919
|
purchaseOrder: [undefined],
|
|
@@ -3897,6 +3925,16 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3897
3925
|
_this.validateKeyDetails(nf);
|
|
3898
3926
|
});
|
|
3899
3927
|
};
|
|
3928
|
+
InsertKeyComponent.prototype.getYard = function () {
|
|
3929
|
+
var _this = this;
|
|
3930
|
+
this.documentService.getPlanta(this.agenda.planta.id)
|
|
3931
|
+
.pipe(catchError(function (err) {
|
|
3932
|
+
return throwError(err);
|
|
3933
|
+
}))
|
|
3934
|
+
.subscribe(function (content) {
|
|
3935
|
+
_this.planta = content;
|
|
3936
|
+
});
|
|
3937
|
+
};
|
|
3900
3938
|
InsertKeyComponent.prototype.isWmsWis = function () {
|
|
3901
3939
|
return this.wmsSystem === WmsSystem.WIS;
|
|
3902
3940
|
};
|
|
@@ -3927,7 +3965,7 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3927
3965
|
_this.utils.message("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_search_document_not_found_message_content");
|
|
3928
3966
|
}
|
|
3929
3967
|
else {
|
|
3930
|
-
_this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content" + err.error.message);
|
|
3968
|
+
_this.utils.translateMessage("error", "yms.int.wms_error_search_document_message_header", "yms.int.wms_error_unknown_search_document_message_content " + err.error.message);
|
|
3931
3969
|
}
|
|
3932
3970
|
_this.confirmInvoiceDialog();
|
|
3933
3971
|
return throwError(err);
|
|
@@ -3940,6 +3978,14 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3940
3978
|
return;
|
|
3941
3979
|
}
|
|
3942
3980
|
var document = content.contents[0];
|
|
3981
|
+
if (!_this.planta.codigo) {
|
|
3982
|
+
_this.utils.message("warn", "yms.int.yard_code_not_found_warning_header", "yms.int.yard_code_not_found_warning_description");
|
|
3983
|
+
return;
|
|
3984
|
+
}
|
|
3985
|
+
if (document.logistcUnitDocument !== _this.planta.codigo) {
|
|
3986
|
+
_this.utils.message("warn", "yms.int.document_yard_mismatch_agenda_warning_header", "yms.int.document_yard_mismatch_agenda_warning_description");
|
|
3987
|
+
return;
|
|
3988
|
+
}
|
|
3943
3989
|
document.invoiceKey = _this.formGroup.get('key').value;
|
|
3944
3990
|
document.invoiceCondition = InvoiceCondition.AUTHORIZED;
|
|
3945
3991
|
_this.document.emit(document);
|
|
@@ -3948,13 +3994,15 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
3948
3994
|
};
|
|
3949
3995
|
InsertKeyComponent.prototype.confirmInvoiceDialog = function () {
|
|
3950
3996
|
var _this = this;
|
|
3951
|
-
this.
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3997
|
+
if (this.isWmsWis()) {
|
|
3998
|
+
this.confirmationService.confirm({
|
|
3999
|
+
message: this.translate.instant("yms.int.wms_message_confirm_invoice_dialog"),
|
|
4000
|
+
acceptLabel: this.translate.instant("yms.int.wms_accept_confirm_invoice_dialog"),
|
|
4001
|
+
rejectLabel: this.translate.instant("yms.int.wms_reject_confirm_invoice_dialog"),
|
|
4002
|
+
header: this.translate.instant("yms.int.wms_header_content_confirm_invoice_dialog"),
|
|
4003
|
+
accept: function () { return _this.buildInvoice(); }
|
|
4004
|
+
});
|
|
4005
|
+
}
|
|
3958
4006
|
};
|
|
3959
4007
|
InsertKeyComponent.prototype.buildInvoice = function () {
|
|
3960
4008
|
var _this = this;
|
|
@@ -4027,18 +4075,22 @@ var InsertKeyComponent = /** @class */ (function () {
|
|
|
4027
4075
|
InsertKeyComponent.prototype.onDialogShow = function () {
|
|
4028
4076
|
this.formGroup.reset();
|
|
4029
4077
|
};
|
|
4030
|
-
__decorate([
|
|
4031
|
-
Output(),
|
|
4032
|
-
__metadata("design:type", EventEmitter)
|
|
4033
|
-
], InsertKeyComponent.prototype, "document", void 0);
|
|
4034
4078
|
__decorate([
|
|
4035
4079
|
Input(),
|
|
4036
|
-
__metadata("design:type",
|
|
4037
|
-
], InsertKeyComponent.prototype, "
|
|
4080
|
+
__metadata("design:type", Agenda)
|
|
4081
|
+
], InsertKeyComponent.prototype, "agenda", void 0);
|
|
4038
4082
|
__decorate([
|
|
4039
4083
|
Input(),
|
|
4040
4084
|
__metadata("design:type", String)
|
|
4041
4085
|
], InsertKeyComponent.prototype, "wmsSystem", void 0);
|
|
4086
|
+
__decorate([
|
|
4087
|
+
Input(),
|
|
4088
|
+
__metadata("design:type", EventEmitter)
|
|
4089
|
+
], InsertKeyComponent.prototype, "visible", void 0);
|
|
4090
|
+
__decorate([
|
|
4091
|
+
Output(),
|
|
4092
|
+
__metadata("design:type", EventEmitter)
|
|
4093
|
+
], InsertKeyComponent.prototype, "document", void 0);
|
|
4042
4094
|
__decorate([
|
|
4043
4095
|
Output(),
|
|
4044
4096
|
__metadata("design:type", Object)
|