@hitsoft/fbdocumentflow 0.0.1

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.
Files changed (108) hide show
  1. package/README.md +24 -0
  2. package/config/enums/index.d.ts +1 -0
  3. package/config/enums/route-names.d.ts +3 -0
  4. package/config/fbdocumentflow-config.module.d.ts +8 -0
  5. package/config/index.d.ts +5 -0
  6. package/config/providers/document-scenario-route.provider.d.ts +9 -0
  7. package/config/providers/document-transfer-route.provider.d.ts +9 -0
  8. package/config/providers/index.d.ts +6 -0
  9. package/config/providers/partner-mapping-route.provider.d.ts +9 -0
  10. package/config/providers/project-parameter-route.provider.d.ts +9 -0
  11. package/config/providers/route.provider.d.ts +8 -0
  12. package/config/providers/sap-company-profile-route.provider.d.ts +9 -0
  13. package/config/public-api.d.ts +3 -0
  14. package/esm2020/config/enums/index.mjs +2 -0
  15. package/esm2020/config/enums/route-names.mjs +2 -0
  16. package/esm2020/config/fbdocumentflow-config.module.mjs +30 -0
  17. package/esm2020/config/hitsoft-fbdocumentflow-config.mjs +5 -0
  18. package/esm2020/config/providers/document-scenario-route.provider.mjs +20 -0
  19. package/esm2020/config/providers/document-transfer-route.provider.mjs +20 -0
  20. package/esm2020/config/providers/index.mjs +7 -0
  21. package/esm2020/config/providers/partner-mapping-route.provider.mjs +20 -0
  22. package/esm2020/config/providers/project-parameter-route.provider.mjs +20 -0
  23. package/esm2020/config/providers/route.provider.mjs +24 -0
  24. package/esm2020/config/providers/sap-company-profile-route.provider.mjs +20 -0
  25. package/esm2020/config/public-api.mjs +4 -0
  26. package/esm2020/hitsoft-fbdocumentflow.mjs +5 -0
  27. package/esm2020/lib/components/fbdocumentflow.component.mjs +42 -0
  28. package/esm2020/lib/components/hit-document-scenarios/components/hit-document-scenario.component.mjs +151 -0
  29. package/esm2020/lib/components/hit-document-scenarios/hit-document-scenario-routing.module.mjs +26 -0
  30. package/esm2020/lib/components/hit-document-scenarios/hit-document-scenario.module.mjs +24 -0
  31. package/esm2020/lib/components/hit-document-transfers/components/hit-document-transfer-detail.component.mjs +474 -0
  32. package/esm2020/lib/components/hit-document-transfers/components/hit-document-transfer.component.mjs +241 -0
  33. package/esm2020/lib/components/hit-document-transfers/hit-document-transfer-routing.module.mjs +33 -0
  34. package/esm2020/lib/components/hit-document-transfers/hit-document-transfer.module.mjs +25 -0
  35. package/esm2020/lib/components/hit-partner-mappings/components/hit-partner-mapping.component.mjs +115 -0
  36. package/esm2020/lib/components/hit-partner-mappings/hit-partner-mapping-routing.module.mjs +26 -0
  37. package/esm2020/lib/components/hit-partner-mappings/hit-partner-mapping.module.mjs +24 -0
  38. package/esm2020/lib/components/hit-project-parameters/components/hit-project-parameter.component.mjs +125 -0
  39. package/esm2020/lib/components/hit-project-parameters/hit-project-parameter-routing.module.mjs +26 -0
  40. package/esm2020/lib/components/hit-project-parameters/hit-project-parameter.module.mjs +24 -0
  41. package/esm2020/lib/components/hit-sap-company-profiles/components/hit-sap-company-profile.component.mjs +88 -0
  42. package/esm2020/lib/components/hit-sap-company-profiles/hit-sap-company-profile-routing.module.mjs +26 -0
  43. package/esm2020/lib/components/hit-sap-company-profiles/hit-sap-company-profile.module.mjs +24 -0
  44. package/esm2020/lib/fbdocumentflow-routing.module.mjs +35 -0
  45. package/esm2020/lib/fbdocumentflow.module.mjs +29 -0
  46. package/esm2020/lib/proxy/document-scenarios/document-scenario.service.mjs +27 -0
  47. package/esm2020/lib/proxy/document-scenarios/index.mjs +3 -0
  48. package/esm2020/lib/proxy/document-scenarios/models.mjs +6 -0
  49. package/esm2020/lib/proxy/document-transfers/document-transfer.service.mjs +54 -0
  50. package/esm2020/lib/proxy/document-transfers/index.mjs +3 -0
  51. package/esm2020/lib/proxy/document-transfers/models.mjs +32 -0
  52. package/esm2020/lib/proxy/partner-mappings/index.mjs +3 -0
  53. package/esm2020/lib/proxy/partner-mappings/models.mjs +2 -0
  54. package/esm2020/lib/proxy/partner-mappings/partner-mapping.service.mjs +27 -0
  55. package/esm2020/lib/proxy/project-parameters/index.mjs +3 -0
  56. package/esm2020/lib/proxy/project-parameters/models.mjs +2 -0
  57. package/esm2020/lib/proxy/project-parameters/sap-project-parameter.service.mjs +25 -0
  58. package/esm2020/lib/proxy/sap-company-profiles/index.mjs +3 -0
  59. package/esm2020/lib/proxy/sap-company-profiles/models.mjs +7 -0
  60. package/esm2020/lib/proxy/sap-company-profiles/sap-company-profile.service.mjs +27 -0
  61. package/esm2020/lib/services/fbdocumentflow.service.mjs +21 -0
  62. package/esm2020/public-api.mjs +7 -0
  63. package/fesm2015/hitsoft-fbdocumentflow-config.mjs +144 -0
  64. package/fesm2015/hitsoft-fbdocumentflow-config.mjs.map +1 -0
  65. package/fesm2015/hitsoft-fbdocumentflow.mjs +1647 -0
  66. package/fesm2015/hitsoft-fbdocumentflow.mjs.map +1 -0
  67. package/fesm2020/hitsoft-fbdocumentflow-config.mjs +144 -0
  68. package/fesm2020/hitsoft-fbdocumentflow-config.mjs.map +1 -0
  69. package/fesm2020/hitsoft-fbdocumentflow.mjs +1621 -0
  70. package/fesm2020/hitsoft-fbdocumentflow.mjs.map +1 -0
  71. package/index.d.ts +5 -0
  72. package/lib/components/fbdocumentflow.component.d.ts +13 -0
  73. package/lib/components/hit-document-scenarios/components/hit-document-scenario.component.d.ts +41 -0
  74. package/lib/components/hit-document-scenarios/hit-document-scenario-routing.module.d.ts +7 -0
  75. package/lib/components/hit-document-scenarios/hit-document-scenario.module.d.ts +13 -0
  76. package/lib/components/hit-document-transfers/components/hit-document-transfer-detail.component.d.ts +88 -0
  77. package/lib/components/hit-document-transfers/components/hit-document-transfer.component.d.ts +61 -0
  78. package/lib/components/hit-document-transfers/hit-document-transfer-routing.module.d.ts +7 -0
  79. package/lib/components/hit-document-transfers/hit-document-transfer.module.d.ts +14 -0
  80. package/lib/components/hit-partner-mappings/components/hit-partner-mapping.component.d.ts +29 -0
  81. package/lib/components/hit-partner-mappings/hit-partner-mapping-routing.module.d.ts +7 -0
  82. package/lib/components/hit-partner-mappings/hit-partner-mapping.module.d.ts +13 -0
  83. package/lib/components/hit-project-parameters/components/hit-project-parameter.component.d.ts +36 -0
  84. package/lib/components/hit-project-parameters/hit-project-parameter-routing.module.d.ts +7 -0
  85. package/lib/components/hit-project-parameters/hit-project-parameter.module.d.ts +13 -0
  86. package/lib/components/hit-sap-company-profiles/components/hit-sap-company-profile.component.d.ts +28 -0
  87. package/lib/components/hit-sap-company-profiles/hit-sap-company-profile-routing.module.d.ts +7 -0
  88. package/lib/components/hit-sap-company-profiles/hit-sap-company-profile.module.d.ts +13 -0
  89. package/lib/fbdocumentflow-routing.module.d.ts +7 -0
  90. package/lib/fbdocumentflow.module.d.ts +13 -0
  91. package/lib/proxy/document-scenarios/document-scenario.service.d.ts +16 -0
  92. package/lib/proxy/document-scenarios/index.d.ts +2 -0
  93. package/lib/proxy/document-scenarios/models.d.ts +38 -0
  94. package/lib/proxy/document-transfers/document-transfer.service.d.ts +26 -0
  95. package/lib/proxy/document-transfers/index.d.ts +2 -0
  96. package/lib/proxy/document-transfers/models.d.ts +119 -0
  97. package/lib/proxy/partner-mappings/index.d.ts +2 -0
  98. package/lib/proxy/partner-mappings/models.d.ts +23 -0
  99. package/lib/proxy/partner-mappings/partner-mapping.service.d.ts +16 -0
  100. package/lib/proxy/project-parameters/index.d.ts +2 -0
  101. package/lib/proxy/project-parameters/models.d.ts +25 -0
  102. package/lib/proxy/project-parameters/sap-project-parameter.service.d.ts +14 -0
  103. package/lib/proxy/sap-company-profiles/index.d.ts +2 -0
  104. package/lib/proxy/sap-company-profiles/models.d.ts +26 -0
  105. package/lib/proxy/sap-company-profiles/sap-company-profile.service.d.ts +16 -0
  106. package/lib/services/fbdocumentflow.service.d.ts +10 -0
  107. package/package.json +41 -0
  108. package/public-api.d.ts +3 -0
@@ -0,0 +1,1647 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Injectable, NgModule, HostListener } from '@angular/core';
3
+ import * as i4 from '@angular/common';
4
+ import * as i1 from '@angular/router';
5
+ import { RouterModule } from '@angular/router';
6
+ import * as i1$1 from '@abp/ng.core';
7
+ import { AuthGuard, PermissionGuard, CoreModule, LazyModuleFactory } from '@abp/ng.core';
8
+ import * as i3 from '@abp/ng.theme.shared';
9
+ import { Confirmation, ThemeSharedModule } from '@abp/ng.theme.shared';
10
+ import * as i5 from '@angular/forms';
11
+ import { FormsModule } from '@angular/forms';
12
+ import * as i6 from 'devextreme-angular';
13
+ import { DxDataGridModule } from 'devextreme-angular';
14
+ import { finalize, filter, switchMap, concatMap, toArray } from 'rxjs/operators';
15
+ import * as i7 from 'devextreme-angular/ui/nested';
16
+ import * as i8 from 'devextreme-angular/core';
17
+ import { of, from } from 'rxjs';
18
+
19
+ class FBDocumentFlowComponent {
20
+ constructor() {
21
+ this.cards = [
22
+ {
23
+ titleKey: 'FBDocumentFlow::Menu:DocumentTransfers',
24
+ descriptionKey: 'FBDocumentFlow::DocumentTransfersCardDescription',
25
+ routerLink: '/fbdocumentflow/document-transfers',
26
+ permission: 'FBDocumentFlow.DocumentTransfers',
27
+ },
28
+ {
29
+ titleKey: 'FBDocumentFlow::Menu:DocumentScenarios',
30
+ descriptionKey: 'FBDocumentFlow::DocumentScenariosCardDescription',
31
+ routerLink: '/fbdocumentflow/document-scenarios',
32
+ permission: 'FBDocumentFlow.DocumentScenarios',
33
+ },
34
+ {
35
+ titleKey: 'FBDocumentFlow::Menu:ProjectParameters',
36
+ descriptionKey: 'FBDocumentFlow::ProjectParametersCardDescription',
37
+ routerLink: '/fbdocumentflow/project-parameters',
38
+ permission: 'FBDocumentFlow.ProjectParameters',
39
+ },
40
+ {
41
+ titleKey: 'FBDocumentFlow::Menu:PartnerMappings',
42
+ descriptionKey: 'FBDocumentFlow::PartnerMappingsCardDescription',
43
+ routerLink: '/fbdocumentflow/partner-mappings',
44
+ permission: 'FBDocumentFlow.PartnerMappings',
45
+ },
46
+ ];
47
+ }
48
+ }
49
+ FBDocumentFlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
50
+ FBDocumentFlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FBDocumentFlowComponent, selector: "lib-fbdocumentflow", ngImport: i0, template: "<div class=\"card mb-4\">\n <div class=\"card-body\">\n <h4 class=\"card-title mb-2\">{{ 'FBDocumentFlow::Menu:FBDocumentFlow' | abpLocalization }}</h4>\n <p class=\"text-muted mb-0\">{{ 'FBDocumentFlow::PortalDescription' | abpLocalization }}</p>\n <p class=\"text-muted mb-0\">{{ 'FBDocumentFlow::PortalSubDescription' | abpLocalization }}</p>\n </div>\n</div>\n\n<div class=\"row g-3\">\n <div class=\"col-md-6\" *ngFor=\"let card of cards\">\n <div class=\"card h-100\" *abpPermission=\"card.permission\" [routerLink]=\"card.routerLink\" style=\"cursor: pointer\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">{{ card.titleKey | abpLocalization }}</h5>\n <p class=\"card-text text-muted mb-0\">{{ card.descriptionKey | abpLocalization }}</p>\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "pipe", type: i1$1.LocalizationPipe, name: "abpLocalization" }] });
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowComponent, decorators: [{
52
+ type: Component,
53
+ args: [{ selector: 'lib-fbdocumentflow', template: "<div class=\"card mb-4\">\n <div class=\"card-body\">\n <h4 class=\"card-title mb-2\">{{ 'FBDocumentFlow::Menu:FBDocumentFlow' | abpLocalization }}</h4>\n <p class=\"text-muted mb-0\">{{ 'FBDocumentFlow::PortalDescription' | abpLocalization }}</p>\n <p class=\"text-muted mb-0\">{{ 'FBDocumentFlow::PortalSubDescription' | abpLocalization }}</p>\n </div>\n</div>\n\n<div class=\"row g-3\">\n <div class=\"col-md-6\" *ngFor=\"let card of cards\">\n <div class=\"card h-100\" *abpPermission=\"card.permission\" [routerLink]=\"card.routerLink\" style=\"cursor: pointer\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">{{ card.titleKey | abpLocalization }}</h5>\n <p class=\"card-text text-muted mb-0\">{{ card.descriptionKey | abpLocalization }}</p>\n </div>\n </div>\n </div>\n</div>\n" }]
54
+ }] });
55
+
56
+ class FBDocumentFlowService {
57
+ constructor(restService) {
58
+ this.restService = restService;
59
+ this.apiName = 'FBDocumentFlow';
60
+ }
61
+ sample() {
62
+ return this.restService.request({ method: 'GET', url: '/api/FBDocumentFlow/sample' }, { apiName: this.apiName });
63
+ }
64
+ }
65
+ FBDocumentFlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowService, deps: [{ token: i1$1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
66
+ FBDocumentFlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowService, providedIn: 'root' });
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowService, decorators: [{
68
+ type: Injectable,
69
+ args: [{
70
+ providedIn: 'root',
71
+ }]
72
+ }], ctorParameters: function () { return [{ type: i1$1.RestService }]; } });
73
+
74
+ var CompanyType;
75
+ (function (CompanyType) {
76
+ CompanyType[CompanyType["Source"] = 0] = "Source";
77
+ CompanyType[CompanyType["Intermediate"] = 1] = "Intermediate";
78
+ CompanyType[CompanyType["Construction"] = 2] = "Construction";
79
+ })(CompanyType || (CompanyType = {}));
80
+
81
+ class SapCompanyProfileService {
82
+ constructor(restService) {
83
+ this.restService = restService;
84
+ this.apiName = 'FBDocumentFlow';
85
+ this.create = (input) => this.restService.request({ method: 'POST', url: '/api/fbdocumentflow/sap-company-profiles', body: input }, { apiName: this.apiName });
86
+ this.update = (id, input) => this.restService.request({ method: 'PUT', url: `/api/fbdocumentflow/sap-company-profiles/${id}`, body: input }, { apiName: this.apiName });
87
+ this.delete = (id) => this.restService.request({ method: 'DELETE', url: `/api/fbdocumentflow/sap-company-profiles/${id}` }, { apiName: this.apiName });
88
+ this.get = (id) => this.restService.request({ method: 'GET', url: `/api/fbdocumentflow/sap-company-profiles/${id}` }, { apiName: this.apiName });
89
+ this.getList = (input) => this.restService.request({
90
+ method: 'GET',
91
+ url: '/api/fbdocumentflow/sap-company-profiles',
92
+ params: { filter: input.filter, isActive: input.isActive, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
93
+ }, { apiName: this.apiName });
94
+ }
95
+ }
96
+ SapCompanyProfileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SapCompanyProfileService, deps: [{ token: i1$1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
97
+ SapCompanyProfileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SapCompanyProfileService, providedIn: 'root' });
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SapCompanyProfileService, decorators: [{
99
+ type: Injectable,
100
+ args: [{
101
+ providedIn: 'root',
102
+ }]
103
+ }], ctorParameters: function () { return [{ type: i1$1.RestService }]; } });
104
+
105
+ class HitSapCompanyProfileComponent {
106
+ constructor(service, confirmation) {
107
+ this.service = service;
108
+ this.confirmation = confirmation;
109
+ this.data = [];
110
+ this.isLoading = false;
111
+ this.isModalOpen = false;
112
+ this.isSaving = false;
113
+ this.editingId = null;
114
+ this.companyTypes = [
115
+ { value: CompanyType.Source, label: 'Kaynak' },
116
+ { value: CompanyType.Intermediate, label: 'Ara Şirket' },
117
+ { value: CompanyType.Construction, label: 'Construction' },
118
+ ];
119
+ this.form = this.buildEmptyForm();
120
+ }
121
+ ngOnInit() {
122
+ this.loadData();
123
+ }
124
+ loadData() {
125
+ this.isLoading = true;
126
+ this.service
127
+ .getList({ maxResultCount: 1000, skipCount: 0, sorting: 'companyName asc' })
128
+ .pipe(finalize(() => (this.isLoading = false)))
129
+ .subscribe(result => (this.data = result.items));
130
+ }
131
+ openCreate() {
132
+ this.editingId = null;
133
+ this.form = this.buildEmptyForm();
134
+ this.isModalOpen = true;
135
+ }
136
+ openEdit(row) {
137
+ var _a, _b, _c, _d;
138
+ this.editingId = row.id;
139
+ this.form = {
140
+ companyCode: (_a = row.companyCode) !== null && _a !== void 0 ? _a : '',
141
+ companyName: (_b = row.companyName) !== null && _b !== void 0 ? _b : '',
142
+ sapCompanyDb: (_c = row.sapCompanyDb) !== null && _c !== void 0 ? _c : '',
143
+ serviceLayerUrl: (_d = row.serviceLayerUrl) !== null && _d !== void 0 ? _d : '',
144
+ companyType: row.companyType,
145
+ isActive: row.isActive,
146
+ };
147
+ this.isModalOpen = true;
148
+ }
149
+ save() {
150
+ this.isSaving = true;
151
+ const request$ = this.editingId ? this.service.update(this.editingId, this.form) : this.service.create(this.form);
152
+ request$.pipe(finalize(() => (this.isSaving = false))).subscribe(() => {
153
+ this.isModalOpen = false;
154
+ this.loadData();
155
+ });
156
+ }
157
+ delete(row) {
158
+ this.confirmation
159
+ .warn('FBDocumentFlow::DeleteConfirmationMessage', 'FBDocumentFlow::AreYouSure')
160
+ .pipe(filter(status => status === Confirmation.Status.confirm), switchMap(() => this.service.delete(row.id)))
161
+ .subscribe(() => this.loadData());
162
+ }
163
+ buildEmptyForm() {
164
+ return {
165
+ companyCode: '',
166
+ companyName: '',
167
+ sapCompanyDb: '',
168
+ serviceLayerUrl: '',
169
+ companyType: CompanyType.Intermediate,
170
+ isActive: true,
171
+ };
172
+ }
173
+ }
174
+ HitSapCompanyProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileComponent, deps: [{ token: SapCompanyProfileService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
175
+ HitSapCompanyProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HitSapCompanyProfileComponent, selector: "hit-sap-company-profile", ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">SAP \u015Eirket Profilleri</h5>\n </div>\n <div class=\"col-auto d-flex align-items-center gap-2\">\n <button class=\"btn btn-sm btn-primary\" (click)=\"openCreate()\">\n <i class=\"fa fa-plus me-1\"></i>Yeni \u015Eirket\n </button>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading\">\n <i class=\"fa fa-refresh me-1\"></i>{{ 'AbpUi::Refresh' | abpLocalization }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid *ngIf=\"!isLoading\" [dataSource]=\"data\" [showBorders]=\"true\" [showRowLines]=\"true\" [columnAutoWidth]=\"true\">\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n\n <dxi-column dataField=\"companyCode\" caption=\"\u015Eirket Kodu\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"companyName\" caption=\"\u015Eirket Ad\u0131\"></dxi-column>\n <dxi-column dataField=\"sapCompanyDb\" caption=\"SAP CompanyDB\"></dxi-column>\n <dxi-column dataField=\"companyType\" caption=\"Tip\" cellTemplate=\"typeTemplate\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"isActive\" caption=\"Aktif\" dataType=\"boolean\" [width]=\"80\"></dxi-column>\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"140\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'typeTemplate'\">\n <span *ngIf=\"cell.value === 0\">Kaynak</span>\n <span *ngIf=\"cell.value === 1\">Ara \u015Eirket</span>\n <span *ngIf=\"cell.value === 2\">Construction</span>\n </div>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary me-1\" (click)=\"openEdit(cell.data)\">\n <i class=\"fa fa-pencil\"></i>\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"delete(cell.data)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </dx-data-grid>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\">\n <ng-template #abpHeader>\n <h3>{{ editingId ? '\u015Eirket D\u00FCzenle' : 'Yeni \u015Eirket' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u015Eirket Kodu</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.companyCode\" name=\"companyCode\" required />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u015Eirket Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.companyName\" name=\"companyName\" required />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">SAP CompanyDB</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.sapCompanyDb\" name=\"sapCompanyDb\" required />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">Service Layer URL</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.serviceLayerUrl\" name=\"serviceLayerUrl\" />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u015Eirket Tipi</label>\n <select class=\"form-select\" [(ngModel)]=\"form.companyType\" name=\"companyType\">\n <option *ngFor=\"let t of companyTypes\" [ngValue]=\"t.value\">{{ t.label }}</option>\n </select>\n </div>\n <div class=\"form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [(ngModel)]=\"form.isActive\" name=\"isActive\" id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\">Aktif</label>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{ 'AbpUi::Cancel' | abpLocalization }}</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"save()\" [disabled]=\"isSaving\">\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ 'AbpUi::Save' | abpLocalization }}\n </button>\n </ng-template>\n</abp-modal>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "customizeExportData", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "focusStateEnabled", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExported", "onExporting", "onFileSaving", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "customizeExportDataChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "focusStateEnabledChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i7.DxiColumnComponent, selector: "dxi-column", inputs: ["alignment", "allowEditing", "allowExporting", "allowFiltering", "allowFixing", "allowGrouping", "allowHeaderFiltering", "allowHiding", "allowReordering", "allowResizing", "allowSearch", "allowSorting", "autoExpandGroup", "buttons", "calculateCellValue", "calculateDisplayValue", "calculateFilterExpression", "calculateGroupValue", "calculateSortValue", "caption", "cellTemplate", "columns", "cssClass", "customizeText", "dataField", "dataType", "editCellTemplate", "editorOptions", "encodeHtml", "falseText", "filterOperations", "filterType", "filterValue", "filterValues", "fixed", "fixedPosition", "format", "formItem", "groupCellTemplate", "groupIndex", "headerCellTemplate", "headerFilter", "hidingPriority", "isBand", "lookup", "minWidth", "name", "ownerBand", "renderAsync", "selectedFilterOperation", "setCellValue", "showEditorAlways", "showInColumnChooser", "showWhenGrouped", "sortIndex", "sortingMethod", "sortOrder", "trueText", "type", "validationRules", "visible", "visibleIndex", "width"], outputs: ["filterValueChange", "filterValuesChange", "groupIndexChange", "selectedFilterOperationChange", "sortIndexChange", "sortOrderChange", "visibleChange", "visibleIndexChange"] }, { kind: "component", type: i7.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "dataSource", "groupInterval", "height", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i7.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i7.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i7.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i7.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }, { kind: "directive", type: i8.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "pipe", type: i1$1.LocalizationPipe, name: "abpLocalization" }] });
176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileComponent, decorators: [{
177
+ type: Component,
178
+ args: [{ selector: 'hit-sap-company-profile', template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">SAP \u015Eirket Profilleri</h5>\n </div>\n <div class=\"col-auto d-flex align-items-center gap-2\">\n <button class=\"btn btn-sm btn-primary\" (click)=\"openCreate()\">\n <i class=\"fa fa-plus me-1\"></i>Yeni \u015Eirket\n </button>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading\">\n <i class=\"fa fa-refresh me-1\"></i>{{ 'AbpUi::Refresh' | abpLocalization }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid *ngIf=\"!isLoading\" [dataSource]=\"data\" [showBorders]=\"true\" [showRowLines]=\"true\" [columnAutoWidth]=\"true\">\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n\n <dxi-column dataField=\"companyCode\" caption=\"\u015Eirket Kodu\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"companyName\" caption=\"\u015Eirket Ad\u0131\"></dxi-column>\n <dxi-column dataField=\"sapCompanyDb\" caption=\"SAP CompanyDB\"></dxi-column>\n <dxi-column dataField=\"companyType\" caption=\"Tip\" cellTemplate=\"typeTemplate\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"isActive\" caption=\"Aktif\" dataType=\"boolean\" [width]=\"80\"></dxi-column>\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"140\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'typeTemplate'\">\n <span *ngIf=\"cell.value === 0\">Kaynak</span>\n <span *ngIf=\"cell.value === 1\">Ara \u015Eirket</span>\n <span *ngIf=\"cell.value === 2\">Construction</span>\n </div>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary me-1\" (click)=\"openEdit(cell.data)\">\n <i class=\"fa fa-pencil\"></i>\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"delete(cell.data)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </dx-data-grid>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\">\n <ng-template #abpHeader>\n <h3>{{ editingId ? '\u015Eirket D\u00FCzenle' : 'Yeni \u015Eirket' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u015Eirket Kodu</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.companyCode\" name=\"companyCode\" required />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u015Eirket Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.companyName\" name=\"companyName\" required />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">SAP CompanyDB</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.sapCompanyDb\" name=\"sapCompanyDb\" required />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">Service Layer URL</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.serviceLayerUrl\" name=\"serviceLayerUrl\" />\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u015Eirket Tipi</label>\n <select class=\"form-select\" [(ngModel)]=\"form.companyType\" name=\"companyType\">\n <option *ngFor=\"let t of companyTypes\" [ngValue]=\"t.value\">{{ t.label }}</option>\n </select>\n </div>\n <div class=\"form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [(ngModel)]=\"form.isActive\" name=\"isActive\" id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\">Aktif</label>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{ 'AbpUi::Cancel' | abpLocalization }}</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"save()\" [disabled]=\"isSaving\">\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ 'AbpUi::Save' | abpLocalization }}\n </button>\n </ng-template>\n</abp-modal>\n" }]
179
+ }], ctorParameters: function () { return [{ type: SapCompanyProfileService }, { type: i3.ConfirmationService }]; } });
180
+
181
+ const routes$5 = [
182
+ {
183
+ path: '',
184
+ component: HitSapCompanyProfileComponent,
185
+ canActivate: [AuthGuard, PermissionGuard],
186
+ },
187
+ ];
188
+ class HitSapCompanyProfileRoutingModule {
189
+ }
190
+ HitSapCompanyProfileRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
191
+ HitSapCompanyProfileRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
192
+ HitSapCompanyProfileRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileRoutingModule, imports: [RouterModule.forChild(routes$5), RouterModule] });
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileRoutingModule, decorators: [{
194
+ type: NgModule,
195
+ args: [{
196
+ imports: [RouterModule.forChild(routes$5)],
197
+ exports: [RouterModule],
198
+ }]
199
+ }] });
200
+
201
+ class HitSapCompanyProfileModule {
202
+ }
203
+ HitSapCompanyProfileModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
204
+ HitSapCompanyProfileModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileModule, declarations: [HitSapCompanyProfileComponent], imports: [HitSapCompanyProfileRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
205
+ HitSapCompanyProfileModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileModule, imports: [HitSapCompanyProfileRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitSapCompanyProfileModule, decorators: [{
207
+ type: NgModule,
208
+ args: [{
209
+ declarations: [HitSapCompanyProfileComponent],
210
+ imports: [HitSapCompanyProfileRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule],
211
+ }]
212
+ }] });
213
+ function loadHitSapCompanyProfileModuleAsChild() {
214
+ return Promise.resolve(HitSapCompanyProfileModule);
215
+ }
216
+
217
+ class PartnerMappingService {
218
+ constructor(restService) {
219
+ this.restService = restService;
220
+ this.apiName = 'FBDocumentFlow';
221
+ this.create = (input) => this.restService.request({ method: 'POST', url: '/api/fbdocumentflow/partner-mappings', body: input }, { apiName: this.apiName });
222
+ this.update = (id, input) => this.restService.request({ method: 'PUT', url: `/api/fbdocumentflow/partner-mappings/${id}`, body: input }, { apiName: this.apiName });
223
+ this.delete = (id) => this.restService.request({ method: 'DELETE', url: `/api/fbdocumentflow/partner-mappings/${id}` }, { apiName: this.apiName });
224
+ this.get = (id) => this.restService.request({ method: 'GET', url: `/api/fbdocumentflow/partner-mappings/${id}` }, { apiName: this.apiName });
225
+ this.getList = (input) => this.restService.request({
226
+ method: 'GET',
227
+ url: '/api/fbdocumentflow/partner-mappings',
228
+ params: { sourceCompanyId: input.sourceCompanyId, relatedCompanyId: input.relatedCompanyId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
229
+ }, { apiName: this.apiName });
230
+ }
231
+ }
232
+ PartnerMappingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PartnerMappingService, deps: [{ token: i1$1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
233
+ PartnerMappingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PartnerMappingService, providedIn: 'root' });
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PartnerMappingService, decorators: [{
235
+ type: Injectable,
236
+ args: [{
237
+ providedIn: 'root',
238
+ }]
239
+ }], ctorParameters: function () { return [{ type: i1$1.RestService }]; } });
240
+
241
+ class HitPartnerMappingComponent {
242
+ constructor(service, companyService, confirmation) {
243
+ this.service = service;
244
+ this.companyService = companyService;
245
+ this.confirmation = confirmation;
246
+ this.data = [];
247
+ this.companies = [];
248
+ this.isLoading = false;
249
+ this.isModalOpen = false;
250
+ this.isSaving = false;
251
+ this.editingId = null;
252
+ this.form = this.buildEmptyForm();
253
+ }
254
+ ngOnInit() {
255
+ this.companyService.getList({ maxResultCount: 1000, skipCount: 0, isActive: true }).subscribe(result => {
256
+ this.companies = result.items;
257
+ // Belge Aktarımı ekranından "muhatap eşleştirmesi bulunamadı" durumunda buraya yönlendirilmiş
258
+ // olabilir (spec §5) - şirket seçimini tekrar yaptırmadan doğrudan yeni kayıt formunu açar.
259
+ this.applyRedirectState();
260
+ });
261
+ this.loadData();
262
+ }
263
+ applyRedirectState() {
264
+ const state = history.state;
265
+ if (!(state === null || state === void 0 ? void 0 : state.sourceCompanyId)) {
266
+ return;
267
+ }
268
+ this.openCreate();
269
+ this.form.sourceCompanyId = state.sourceCompanyId;
270
+ if (state.relatedCompanyId) {
271
+ this.form.relatedCompanyId = state.relatedCompanyId;
272
+ }
273
+ // customerCardCode/customerCardName yalnızca ilk hedef çözümlemesi (kaynak OINV.CardCode) eksik
274
+ // olduğunda gelir - bu değerler tahmin değildir, doğrudan kaynak faturanın kendi CardCode/CardName
275
+ // bilgisidir (spec §3/§5). Satıcı CardCode için böyle bir varsayım yapılmaz; hedef şirketin SAP'ında
276
+ // kullanıcı tarafından aranmalıdır.
277
+ if (state.customerCardCode) {
278
+ this.form.customerCardCode = state.customerCardCode;
279
+ }
280
+ if (state.customerCardName) {
281
+ this.form.customerCardName = state.customerCardName;
282
+ }
283
+ }
284
+ loadData() {
285
+ this.isLoading = true;
286
+ this.service
287
+ .getList({ maxResultCount: 1000, skipCount: 0, sorting: 'creationTime desc' })
288
+ .pipe(finalize(() => (this.isLoading = false)))
289
+ .subscribe(result => (this.data = result.items));
290
+ }
291
+ companyName(id) {
292
+ var _a, _b;
293
+ return (_b = (_a = this.companies.find(c => c.id === id)) === null || _a === void 0 ? void 0 : _a.companyName) !== null && _b !== void 0 ? _b : id;
294
+ }
295
+ openCreate() {
296
+ this.editingId = null;
297
+ this.form = this.buildEmptyForm();
298
+ this.isModalOpen = true;
299
+ }
300
+ openEdit(row) {
301
+ this.editingId = row.id;
302
+ this.form = {
303
+ sourceCompanyId: row.sourceCompanyId,
304
+ relatedCompanyId: row.relatedCompanyId,
305
+ customerCardCode: row.customerCardCode,
306
+ customerCardName: row.customerCardName,
307
+ vendorCardCode: row.vendorCardCode,
308
+ vendorCardName: row.vendorCardName,
309
+ };
310
+ this.isModalOpen = true;
311
+ }
312
+ save() {
313
+ this.isSaving = true;
314
+ const request$ = this.editingId ? this.service.update(this.editingId, this.form) : this.service.create(this.form);
315
+ request$.pipe(finalize(() => (this.isSaving = false))).subscribe(() => {
316
+ this.isModalOpen = false;
317
+ this.loadData();
318
+ });
319
+ }
320
+ delete(row) {
321
+ this.confirmation
322
+ .warn('FBDocumentFlow::DeleteConfirmationMessage', 'FBDocumentFlow::AreYouSure')
323
+ .pipe(filter(status => status === Confirmation.Status.confirm), switchMap(() => this.service.delete(row.id)))
324
+ .subscribe(() => this.loadData());
325
+ }
326
+ buildEmptyForm() {
327
+ return {
328
+ sourceCompanyId: '',
329
+ relatedCompanyId: '',
330
+ customerCardCode: '',
331
+ customerCardName: '',
332
+ vendorCardCode: '',
333
+ vendorCardName: '',
334
+ };
335
+ }
336
+ }
337
+ HitPartnerMappingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingComponent, deps: [{ token: PartnerMappingService }, { token: SapCompanyProfileService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
338
+ HitPartnerMappingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HitPartnerMappingComponent, selector: "hit-partner-mapping", ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:PartnerMappings' | abpLocalization }}</h5>\n </div>\n <div class=\"col-auto d-flex align-items-center gap-2\">\n <button class=\"btn btn-sm btn-primary\" (click)=\"openCreate()\">\n <i class=\"fa fa-plus me-1\"></i>Yeni E\u015Fle\u015Ftirme\n </button>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading\">\n <i class=\"fa fa-refresh me-1\"></i>{{ 'AbpUi::Refresh' | abpLocalization }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid *ngIf=\"!isLoading\" [dataSource]=\"data\" [showBorders]=\"true\" [showRowLines]=\"true\" [columnAutoWidth]=\"true\">\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n\n <dxi-column dataField=\"sourceCompanyName\" caption=\"Bulunulan \u015Eirket\"></dxi-column>\n <dxi-column dataField=\"relatedCompanyName\" caption=\"\u0130li\u015Fkili \u015Eirket\"></dxi-column>\n <dxi-column dataField=\"customerCardCode\" caption=\"M\u00FC\u015Fteri CardCode\"></dxi-column>\n <dxi-column dataField=\"customerCardName\" caption=\"M\u00FC\u015Fteri Ad\u0131\"></dxi-column>\n <dxi-column dataField=\"vendorCardCode\" caption=\"Sat\u0131c\u0131 CardCode\"></dxi-column>\n <dxi-column dataField=\"vendorCardName\" caption=\"Sat\u0131c\u0131 Ad\u0131\"></dxi-column>\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"140\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary me-1\" (click)=\"openEdit(cell.data)\">\n <i class=\"fa fa-pencil\"></i>\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"delete(cell.data)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </dx-data-grid>\n\n <div class=\"alert alert-secondary mt-3 mb-0\">\n <strong>\u00C7al\u0131\u015Fma Kural\u0131</strong>\n <ul class=\"mb-0\">\n <li>Kaynak OINV.CardCode hedef \u015Firketin kim oldu\u011Funu belirler.</li>\n <li>Hedef \u015Firket DB'sindeki OPCH.CardCode, \"bulunulan \u015Firket + ili\u015Fkili \u015Firket\" e\u015Fle\u015Ftirmesindeki Sat\u0131c\u0131 CardCode de\u011Ferinden al\u0131n\u0131r.</li>\n <li>Ayn\u0131 \u015Firket i\u00E7inde sonraki OINV olu\u015Fturulacaksa, sonraki hedef \u015Firketin M\u00FC\u015Fteri CardCode e\u015Fle\u015Ftirmesi kullan\u0131l\u0131r.</li>\n <li>E\u015Fle\u015Ftirme bulunamazsa sistem rastgele CardCode se\u00E7mez; aktar\u0131m \u00F6ncesinde kullan\u0131c\u0131ya se\u00E7im yapt\u0131r\u0131l\u0131r.</li>\n </ul>\n </div>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\">\n <ng-template #abpHeader>\n <h3>{{ editingId ? 'E\u015Fle\u015Ftirme D\u00FCzenle' : 'Yeni Muhatap E\u015Fle\u015Ftirmesi' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form>\n <div class=\"mb-3\">\n <label class=\"form-label\">Bulunulan \u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"form.sourceCompanyId\" name=\"sourceCompanyId\" required>\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u0130li\u015Fkili \u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"form.relatedCompanyId\" name=\"relatedCompanyId\" required>\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"row\">\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">M\u00FC\u015Fteri CardCode</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.customerCardCode\" name=\"customerCardCode\" />\n </div>\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">M\u00FC\u015Fteri Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.customerCardName\" name=\"customerCardName\" />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">Sat\u0131c\u0131 CardCode</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.vendorCardCode\" name=\"vendorCardCode\" />\n </div>\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">Sat\u0131c\u0131 Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.vendorCardName\" name=\"vendorCardName\" />\n </div>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{ 'AbpUi::Cancel' | abpLocalization }}</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"save()\" [disabled]=\"isSaving\">\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ 'AbpUi::Save' | abpLocalization }}\n </button>\n </ng-template>\n</abp-modal>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "customizeExportData", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "focusStateEnabled", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExported", "onExporting", "onFileSaving", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "customizeExportDataChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "focusStateEnabledChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i7.DxiColumnComponent, selector: "dxi-column", inputs: ["alignment", "allowEditing", "allowExporting", "allowFiltering", "allowFixing", "allowGrouping", "allowHeaderFiltering", "allowHiding", "allowReordering", "allowResizing", "allowSearch", "allowSorting", "autoExpandGroup", "buttons", "calculateCellValue", "calculateDisplayValue", "calculateFilterExpression", "calculateGroupValue", "calculateSortValue", "caption", "cellTemplate", "columns", "cssClass", "customizeText", "dataField", "dataType", "editCellTemplate", "editorOptions", "encodeHtml", "falseText", "filterOperations", "filterType", "filterValue", "filterValues", "fixed", "fixedPosition", "format", "formItem", "groupCellTemplate", "groupIndex", "headerCellTemplate", "headerFilter", "hidingPriority", "isBand", "lookup", "minWidth", "name", "ownerBand", "renderAsync", "selectedFilterOperation", "setCellValue", "showEditorAlways", "showInColumnChooser", "showWhenGrouped", "sortIndex", "sortingMethod", "sortOrder", "trueText", "type", "validationRules", "visible", "visibleIndex", "width"], outputs: ["filterValueChange", "filterValuesChange", "groupIndexChange", "selectedFilterOperationChange", "sortIndexChange", "sortOrderChange", "visibleChange", "visibleIndexChange"] }, { kind: "component", type: i7.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "dataSource", "groupInterval", "height", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i7.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i7.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i7.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i7.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }, { kind: "directive", type: i8.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "pipe", type: i1$1.LocalizationPipe, name: "abpLocalization" }] });
339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingComponent, decorators: [{
340
+ type: Component,
341
+ args: [{ selector: 'hit-partner-mapping', template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:PartnerMappings' | abpLocalization }}</h5>\n </div>\n <div class=\"col-auto d-flex align-items-center gap-2\">\n <button class=\"btn btn-sm btn-primary\" (click)=\"openCreate()\">\n <i class=\"fa fa-plus me-1\"></i>Yeni E\u015Fle\u015Ftirme\n </button>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading\">\n <i class=\"fa fa-refresh me-1\"></i>{{ 'AbpUi::Refresh' | abpLocalization }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid *ngIf=\"!isLoading\" [dataSource]=\"data\" [showBorders]=\"true\" [showRowLines]=\"true\" [columnAutoWidth]=\"true\">\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n\n <dxi-column dataField=\"sourceCompanyName\" caption=\"Bulunulan \u015Eirket\"></dxi-column>\n <dxi-column dataField=\"relatedCompanyName\" caption=\"\u0130li\u015Fkili \u015Eirket\"></dxi-column>\n <dxi-column dataField=\"customerCardCode\" caption=\"M\u00FC\u015Fteri CardCode\"></dxi-column>\n <dxi-column dataField=\"customerCardName\" caption=\"M\u00FC\u015Fteri Ad\u0131\"></dxi-column>\n <dxi-column dataField=\"vendorCardCode\" caption=\"Sat\u0131c\u0131 CardCode\"></dxi-column>\n <dxi-column dataField=\"vendorCardName\" caption=\"Sat\u0131c\u0131 Ad\u0131\"></dxi-column>\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"140\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary me-1\" (click)=\"openEdit(cell.data)\">\n <i class=\"fa fa-pencil\"></i>\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"delete(cell.data)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </dx-data-grid>\n\n <div class=\"alert alert-secondary mt-3 mb-0\">\n <strong>\u00C7al\u0131\u015Fma Kural\u0131</strong>\n <ul class=\"mb-0\">\n <li>Kaynak OINV.CardCode hedef \u015Firketin kim oldu\u011Funu belirler.</li>\n <li>Hedef \u015Firket DB'sindeki OPCH.CardCode, \"bulunulan \u015Firket + ili\u015Fkili \u015Firket\" e\u015Fle\u015Ftirmesindeki Sat\u0131c\u0131 CardCode de\u011Ferinden al\u0131n\u0131r.</li>\n <li>Ayn\u0131 \u015Firket i\u00E7inde sonraki OINV olu\u015Fturulacaksa, sonraki hedef \u015Firketin M\u00FC\u015Fteri CardCode e\u015Fle\u015Ftirmesi kullan\u0131l\u0131r.</li>\n <li>E\u015Fle\u015Ftirme bulunamazsa sistem rastgele CardCode se\u00E7mez; aktar\u0131m \u00F6ncesinde kullan\u0131c\u0131ya se\u00E7im yapt\u0131r\u0131l\u0131r.</li>\n </ul>\n </div>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\">\n <ng-template #abpHeader>\n <h3>{{ editingId ? 'E\u015Fle\u015Ftirme D\u00FCzenle' : 'Yeni Muhatap E\u015Fle\u015Ftirmesi' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form>\n <div class=\"mb-3\">\n <label class=\"form-label\">Bulunulan \u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"form.sourceCompanyId\" name=\"sourceCompanyId\" required>\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">\u0130li\u015Fkili \u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"form.relatedCompanyId\" name=\"relatedCompanyId\" required>\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"row\">\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">M\u00FC\u015Fteri CardCode</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.customerCardCode\" name=\"customerCardCode\" />\n </div>\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">M\u00FC\u015Fteri Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.customerCardName\" name=\"customerCardName\" />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">Sat\u0131c\u0131 CardCode</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.vendorCardCode\" name=\"vendorCardCode\" />\n </div>\n <div class=\"col-6 mb-3\">\n <label class=\"form-label\">Sat\u0131c\u0131 Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.vendorCardName\" name=\"vendorCardName\" />\n </div>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{ 'AbpUi::Cancel' | abpLocalization }}</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"save()\" [disabled]=\"isSaving\">\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ 'AbpUi::Save' | abpLocalization }}\n </button>\n </ng-template>\n</abp-modal>\n" }]
342
+ }], ctorParameters: function () { return [{ type: PartnerMappingService }, { type: SapCompanyProfileService }, { type: i3.ConfirmationService }]; } });
343
+
344
+ const routes$4 = [
345
+ {
346
+ path: '',
347
+ component: HitPartnerMappingComponent,
348
+ canActivate: [AuthGuard, PermissionGuard],
349
+ },
350
+ ];
351
+ class HitPartnerMappingRoutingModule {
352
+ }
353
+ HitPartnerMappingRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
354
+ HitPartnerMappingRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
355
+ HitPartnerMappingRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingRoutingModule, imports: [RouterModule.forChild(routes$4), RouterModule] });
356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingRoutingModule, decorators: [{
357
+ type: NgModule,
358
+ args: [{
359
+ imports: [RouterModule.forChild(routes$4)],
360
+ exports: [RouterModule],
361
+ }]
362
+ }] });
363
+
364
+ class HitPartnerMappingModule {
365
+ }
366
+ HitPartnerMappingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
367
+ HitPartnerMappingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingModule, declarations: [HitPartnerMappingComponent], imports: [HitPartnerMappingRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
368
+ HitPartnerMappingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingModule, imports: [HitPartnerMappingRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitPartnerMappingModule, decorators: [{
370
+ type: NgModule,
371
+ args: [{
372
+ declarations: [HitPartnerMappingComponent],
373
+ imports: [HitPartnerMappingRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule],
374
+ }]
375
+ }] });
376
+ function loadHitPartnerMappingModuleAsChild() {
377
+ return Promise.resolve(HitPartnerMappingModule);
378
+ }
379
+
380
+ var LegBehavior;
381
+ (function (LegBehavior) {
382
+ LegBehavior[LegBehavior["IntermediateChain"] = 0] = "IntermediateChain";
383
+ LegBehavior[LegBehavior["ConstructionChain"] = 1] = "ConstructionChain";
384
+ })(LegBehavior || (LegBehavior = {}));
385
+
386
+ class DocumentScenarioService {
387
+ constructor(restService) {
388
+ this.restService = restService;
389
+ this.apiName = 'FBDocumentFlow';
390
+ this.create = (input) => this.restService.request({ method: 'POST', url: '/api/fbdocumentflow/document-scenarios', body: input }, { apiName: this.apiName });
391
+ this.update = (id, input) => this.restService.request({ method: 'PUT', url: `/api/fbdocumentflow/document-scenarios/${id}`, body: input }, { apiName: this.apiName });
392
+ this.delete = (id) => this.restService.request({ method: 'DELETE', url: `/api/fbdocumentflow/document-scenarios/${id}` }, { apiName: this.apiName });
393
+ this.get = (id) => this.restService.request({ method: 'GET', url: `/api/fbdocumentflow/document-scenarios/${id}` }, { apiName: this.apiName });
394
+ this.getList = (input) => this.restService.request({
395
+ method: 'GET',
396
+ url: '/api/fbdocumentflow/document-scenarios',
397
+ params: { filter: input.filter, isActive: input.isActive, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
398
+ }, { apiName: this.apiName });
399
+ }
400
+ }
401
+ DocumentScenarioService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DocumentScenarioService, deps: [{ token: i1$1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
402
+ DocumentScenarioService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DocumentScenarioService, providedIn: 'root' });
403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DocumentScenarioService, decorators: [{
404
+ type: Injectable,
405
+ args: [{
406
+ providedIn: 'root',
407
+ }]
408
+ }], ctorParameters: function () { return [{ type: i1$1.RestService }]; } });
409
+
410
+ class HitDocumentScenarioComponent {
411
+ constructor(service, companyService, confirmation) {
412
+ this.service = service;
413
+ this.companyService = companyService;
414
+ this.confirmation = confirmation;
415
+ this.data = [];
416
+ this.companies = [];
417
+ this.isLoading = false;
418
+ this.isModalOpen = false;
419
+ this.isSaving = false;
420
+ this.editingId = null;
421
+ this.selectedScenario = null;
422
+ this.selectedRowKeys = [];
423
+ this.legBehaviors = [
424
+ { value: LegBehavior.IntermediateChain, label: 'Ara Şirket' },
425
+ { value: LegBehavior.ConstructionChain, label: 'Construction' },
426
+ ];
427
+ this.form = this.buildEmptyForm();
428
+ }
429
+ ngOnInit() {
430
+ this.companyService.getList({ maxResultCount: 1000, skipCount: 0, isActive: true }).subscribe(result => (this.companies = result.items));
431
+ this.loadData();
432
+ }
433
+ loadData() {
434
+ this.isLoading = true;
435
+ this.service
436
+ .getList({ maxResultCount: 1000, skipCount: 0, sorting: 'name asc' })
437
+ .pipe(finalize(() => (this.isLoading = false)))
438
+ .subscribe(result => (this.data = result.items));
439
+ }
440
+ companyName(id) {
441
+ var _a, _b;
442
+ return (_b = (_a = this.companies.find(c => c.id === id)) === null || _a === void 0 ? void 0 : _a.companyName) !== null && _b !== void 0 ? _b : id;
443
+ }
444
+ selectRow(row) {
445
+ if (!row) {
446
+ return;
447
+ }
448
+ this.selectedScenario = row;
449
+ this.selectedRowKeys = [row.id];
450
+ }
451
+ // "Başlangıç / Devam Akışı" sütunu için: zincirin kaynak → hedef → hedef ... şeklinde kısa özeti.
452
+ flowSummary(scenario) {
453
+ var _a, _b, _c;
454
+ const legs = [...((_a = scenario.legs) !== null && _a !== void 0 ? _a : [])].sort((a, b) => a.sequenceNo - b.sequenceNo);
455
+ if (legs.length === 0) {
456
+ return '';
457
+ }
458
+ const chain = [(_b = legs[0].sourceCompanyName) !== null && _b !== void 0 ? _b : this.companyName(legs[0].sourceCompanyId)];
459
+ for (const leg of legs) {
460
+ const targetName = (_c = leg.targetCompanyName) !== null && _c !== void 0 ? _c : this.companyName(leg.targetCompanyId);
461
+ chain.push(leg.legBehavior === LegBehavior.ConstructionChain ? `${targetName} (Construction)` : targetName);
462
+ }
463
+ return chain.join(' → ');
464
+ }
465
+ legStepText(leg) {
466
+ const source = this.companyName(leg.sourceCompanyId);
467
+ const target = this.companyName(leg.targetCompanyId);
468
+ if (leg.legBehavior === LegBehavior.ConstructionChain) {
469
+ // Spec §7 - Construction bacağının tam belge zinciri: Satınalma Siparişi (OPOR) → Satınalma
470
+ // Siparişli Mal Girişi (OPDN) → Satıcı Faturası (OPCH). "Mal Girişi" kısaltması OPDN'nin tam
471
+ // adını yansıtmıyordu (kullanıcı geri bildirimiyle tespit edildi). SAP kısa tablo adları (OINV/OPCH
472
+ // dahil) tüm belge tiplerinde tutarlı şekilde gösterilir.
473
+ return `${source} Müşteri Faturası (OINV) → ${target} Satınalma Siparişi (OPOR) → Satınalma Siparişli Mal Girişi (OPDN) → Satıcı Faturası (OPCH)`;
474
+ }
475
+ return `${source} Müşteri Faturası (OINV) → ${target} Satıcı Faturası (OPCH) → ${target} Müşteri Faturası (OINV)`;
476
+ }
477
+ openCreate() {
478
+ this.editingId = null;
479
+ this.form = this.buildEmptyForm();
480
+ this.isModalOpen = true;
481
+ }
482
+ openEdit(row) {
483
+ var _a, _b;
484
+ this.editingId = row.id;
485
+ this.form = {
486
+ name: (_a = row.name) !== null && _a !== void 0 ? _a : '',
487
+ description: (_b = row.description) !== null && _b !== void 0 ? _b : '',
488
+ isActive: row.isActive,
489
+ legs: row.legs.map(l => ({
490
+ id: l.id,
491
+ sourceCompanyId: l.sourceCompanyId,
492
+ targetCompanyId: l.targetCompanyId,
493
+ legBehavior: l.legBehavior,
494
+ notes: l.notes,
495
+ })),
496
+ };
497
+ this.isModalOpen = true;
498
+ }
499
+ // İlk bacağın kaynağı senaryonun başlangıç noktası olduğu için serbestçe seçilir. Sonraki bacakların
500
+ // kaynağı ise DocumentTransfer çalışma kopyasındaki aynı kuralla (spec §4/§3) bir önceki bacağın
501
+ // hedefinden otomatik türetilir - aksi halde burada da (working copy'de düzeltilen hatanın aynısı)
502
+ // kaynak/hedef birbirinden bağımsız seçilip zincir tutarsız hale gelebilirdi.
503
+ addLeg() {
504
+ var _a;
505
+ const lastLeg = this.form.legs[this.form.legs.length - 1];
506
+ this.form.legs.push({
507
+ sourceCompanyId: (_a = lastLeg === null || lastLeg === void 0 ? void 0 : lastLeg.targetCompanyId) !== null && _a !== void 0 ? _a : '',
508
+ targetCompanyId: '',
509
+ legBehavior: LegBehavior.IntermediateChain,
510
+ notes: '',
511
+ });
512
+ }
513
+ removeLeg(leg) {
514
+ this.form.legs = this.form.legs.filter(l => l !== leg);
515
+ this.relinkLegSources();
516
+ }
517
+ updateLegTarget(index, targetCompanyId) {
518
+ this.form.legs[index].targetCompanyId = targetCompanyId;
519
+ this.relinkLegSources();
520
+ }
521
+ relinkLegSources() {
522
+ for (let i = 1; i < this.form.legs.length; i++) {
523
+ this.form.legs[i].sourceCompanyId = this.form.legs[i - 1].targetCompanyId;
524
+ }
525
+ }
526
+ save() {
527
+ this.isSaving = true;
528
+ const request$ = this.editingId ? this.service.update(this.editingId, this.form) : this.service.create(this.form);
529
+ request$.pipe(finalize(() => (this.isSaving = false))).subscribe(() => {
530
+ this.isModalOpen = false;
531
+ this.loadData();
532
+ });
533
+ }
534
+ delete(row) {
535
+ this.confirmation
536
+ .warn('FBDocumentFlow::DeleteConfirmationMessage', 'FBDocumentFlow::AreYouSure')
537
+ .pipe(filter(status => status === Confirmation.Status.confirm), switchMap(() => this.service.delete(row.id)))
538
+ .subscribe(() => this.loadData());
539
+ }
540
+ buildEmptyForm() {
541
+ return { name: '', description: '', isActive: true, legs: [] };
542
+ }
543
+ }
544
+ HitDocumentScenarioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioComponent, deps: [{ token: DocumentScenarioService }, { token: SapCompanyProfileService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
545
+ HitDocumentScenarioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HitDocumentScenarioComponent, selector: "hit-document-scenario", ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:DocumentScenarios' | abpLocalization }}</h5>\n </div>\n <div class=\"col-auto d-flex align-items-center gap-2\">\n <button class=\"btn btn-sm btn-primary\" (click)=\"openCreate()\">\n <i class=\"fa fa-plus me-1\"></i>Yeni Senaryo\n </button>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading\">\n <i class=\"fa fa-refresh me-1\"></i>{{ 'AbpUi::Refresh' | abpLocalization }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid\n *ngIf=\"!isLoading\"\n [dataSource]=\"data\"\n keyExpr=\"id\"\n [showBorders]=\"true\"\n [showRowLines]=\"true\"\n [columnAutoWidth]=\"true\"\n [(selectedRowKeys)]=\"selectedRowKeys\"\n [hoverStateEnabled]=\"true\"\n (onRowClick)=\"selectRow($event.data)\"\n (onSelectionChanged)=\"selectRow($event.selectedRowsData[0])\"\n >\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n <dxo-selection mode=\"single\"></dxo-selection>\n\n <dxi-column dataField=\"name\" caption=\"Senaryo Ad\u0131\"></dxi-column>\n <dxi-column caption=\"Ba\u015Flang\u0131\u00E7 / Devam Ak\u0131\u015F\u0131\" cellTemplate=\"flowTemplate\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n <dxi-column dataField=\"description\" caption=\"A\u00E7\u0131klama\"></dxi-column>\n <dxi-column caption=\"Bacak Say\u0131s\u0131\" cellTemplate=\"legCountTemplate\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"isActive\" caption=\"Aktif\" dataType=\"boolean\" [width]=\"80\"></dxi-column>\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"140\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'flowTemplate'\">{{ flowSummary(cell.data) }}</div>\n\n <div *dxTemplate=\"let cell of 'legCountTemplate'\">{{ cell.data.legs?.length || 0 }}</div>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary me-1\" (click)=\"openEdit(cell.data)\">\n <i class=\"fa fa-pencil\"></i>\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"delete(cell.data)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </dx-data-grid>\n\n <div class=\"card mt-3\" *ngIf=\"selectedScenario\">\n <div class=\"card-body\">\n <h6 class=\"mb-2\">Senaryo Detay\u0131 - {{ selectedScenario.name }}</h6>\n <p class=\"text-muted mb-2\" *ngIf=\"selectedScenario.description\">{{ selectedScenario.description }}</p>\n <ol class=\"mb-2\">\n <li *ngFor=\"let leg of selectedScenario.legs\">{{ legStepText(leg) }}</li>\n </ol>\n <small class=\"text-muted d-block\">\n Haz\u0131r senaryolar proje ba\u011F\u0131ms\u0131zd\u0131r. Kaynak belgenin header Project de\u011Feri her \u015Firkette ilgili OPRJ kayd\u0131 ile e\u015Fle\u015Ftirilir.\n </small>\n <small class=\"text-muted d-block\">\n Kullan\u0131c\u0131n\u0131n aktar\u0131m s\u0131ras\u0131nda yapt\u0131\u011F\u0131 manuel de\u011Fi\u015Fiklik yaln\u0131zca i\u015Flem \u00E7al\u0131\u015Fma kopyas\u0131n\u0131 etkiler; bu senaryo tan\u0131m\u0131 de\u011Fi\u015Fmez.\n </small>\n </div>\n </div>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\" [options]=\"{ size: 'lg' }\">\n <ng-template #abpHeader>\n <h3>{{ editingId ? 'Senaryo D\u00FCzenle' : 'Yeni Haz\u0131r Senaryo' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form>\n <div class=\"row\">\n <div class=\"col-8 mb-3\">\n <label class=\"form-label\">Senaryo Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.name\" name=\"name\" required />\n </div>\n <div class=\"col-4 mb-3 d-flex align-items-end\">\n <div class=\"form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [(ngModel)]=\"form.isActive\" name=\"isActive\" id=\"scIsActive\" />\n <label class=\"form-check-label\" for=\"scIsActive\">Aktif</label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">A\u00E7\u0131klama</label>\n <textarea class=\"form-control\" rows=\"2\" [(ngModel)]=\"form.description\" name=\"description\"></textarea>\n </div>\n\n <div class=\"d-flex justify-content-between align-items-center mb-2\">\n <label class=\"form-label mb-0\">Bacaklar</label>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"addLeg()\">\n <i class=\"fa fa-plus me-1\"></i>Bacak Ekle\n </button>\n </div>\n\n <table class=\"table table-sm align-middle\">\n <thead>\n <tr>\n <th>Kaynak \u015Eirket</th>\n <th>Hedef \u015Eirket</th>\n <th>Davran\u0131\u015F</th>\n <th>Not</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let leg of form.legs; let i = index\">\n <td>\n <select\n *ngIf=\"i === 0; else sourceText\"\n class=\"form-select form-select-sm\"\n [(ngModel)]=\"leg.sourceCompanyId\"\n [ngModelOptions]=\"{ standalone: true }\"\n >\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n <ng-template #sourceText>\n <span class=\"form-control form-control-sm bg-light\">{{ companyName(leg.sourceCompanyId) }}</span>\n </ng-template>\n </td>\n <td>\n <select\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.targetCompanyId\"\n (ngModelChange)=\"updateLegTarget(i, $event)\"\n [ngModelOptions]=\"{ standalone: true }\"\n >\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </td>\n <td>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"leg.legBehavior\" [ngModelOptions]=\"{ standalone: true }\">\n <option *ngFor=\"let b of legBehaviors\" [ngValue]=\"b.value\">{{ b.label }}</option>\n </select>\n </td>\n <td>\n <input type=\"text\" class=\"form-control form-control-sm\" [(ngModel)]=\"leg.notes\" [ngModelOptions]=\"{ standalone: true }\" />\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger\" (click)=\"removeLeg(leg)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{ 'AbpUi::Cancel' | abpLocalization }}</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"save()\" [disabled]=\"isSaving\">\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ 'AbpUi::Save' | abpLocalization }}\n </button>\n </ng-template>\n</abp-modal>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "customizeExportData", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "focusStateEnabled", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExported", "onExporting", "onFileSaving", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "customizeExportDataChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "focusStateEnabledChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i7.DxiColumnComponent, selector: "dxi-column", inputs: ["alignment", "allowEditing", "allowExporting", "allowFiltering", "allowFixing", "allowGrouping", "allowHeaderFiltering", "allowHiding", "allowReordering", "allowResizing", "allowSearch", "allowSorting", "autoExpandGroup", "buttons", "calculateCellValue", "calculateDisplayValue", "calculateFilterExpression", "calculateGroupValue", "calculateSortValue", "caption", "cellTemplate", "columns", "cssClass", "customizeText", "dataField", "dataType", "editCellTemplate", "editorOptions", "encodeHtml", "falseText", "filterOperations", "filterType", "filterValue", "filterValues", "fixed", "fixedPosition", "format", "formItem", "groupCellTemplate", "groupIndex", "headerCellTemplate", "headerFilter", "hidingPriority", "isBand", "lookup", "minWidth", "name", "ownerBand", "renderAsync", "selectedFilterOperation", "setCellValue", "showEditorAlways", "showInColumnChooser", "showWhenGrouped", "sortIndex", "sortingMethod", "sortOrder", "trueText", "type", "validationRules", "visible", "visibleIndex", "width"], outputs: ["filterValueChange", "filterValuesChange", "groupIndexChange", "selectedFilterOperationChange", "sortIndexChange", "sortOrderChange", "visibleChange", "visibleIndexChange"] }, { kind: "component", type: i7.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "dataSource", "groupInterval", "height", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i7.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i7.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i7.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i7.DxoSelectionComponent, selector: "dxo-selection", inputs: ["allowSelectAll", "deferred", "mode", "selectAllMode", "showCheckBoxesMode", "recursive"] }, { kind: "component", type: i7.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }, { kind: "directive", type: i8.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "pipe", type: i1$1.LocalizationPipe, name: "abpLocalization" }] });
546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioComponent, decorators: [{
547
+ type: Component,
548
+ args: [{ selector: 'hit-document-scenario', template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:DocumentScenarios' | abpLocalization }}</h5>\n </div>\n <div class=\"col-auto d-flex align-items-center gap-2\">\n <button class=\"btn btn-sm btn-primary\" (click)=\"openCreate()\">\n <i class=\"fa fa-plus me-1\"></i>Yeni Senaryo\n </button>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading\">\n <i class=\"fa fa-refresh me-1\"></i>{{ 'AbpUi::Refresh' | abpLocalization }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid\n *ngIf=\"!isLoading\"\n [dataSource]=\"data\"\n keyExpr=\"id\"\n [showBorders]=\"true\"\n [showRowLines]=\"true\"\n [columnAutoWidth]=\"true\"\n [(selectedRowKeys)]=\"selectedRowKeys\"\n [hoverStateEnabled]=\"true\"\n (onRowClick)=\"selectRow($event.data)\"\n (onSelectionChanged)=\"selectRow($event.selectedRowsData[0])\"\n >\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\n <dxo-selection mode=\"single\"></dxo-selection>\n\n <dxi-column dataField=\"name\" caption=\"Senaryo Ad\u0131\"></dxi-column>\n <dxi-column caption=\"Ba\u015Flang\u0131\u00E7 / Devam Ak\u0131\u015F\u0131\" cellTemplate=\"flowTemplate\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n <dxi-column dataField=\"description\" caption=\"A\u00E7\u0131klama\"></dxi-column>\n <dxi-column caption=\"Bacak Say\u0131s\u0131\" cellTemplate=\"legCountTemplate\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"isActive\" caption=\"Aktif\" dataType=\"boolean\" [width]=\"80\"></dxi-column>\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"140\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'flowTemplate'\">{{ flowSummary(cell.data) }}</div>\n\n <div *dxTemplate=\"let cell of 'legCountTemplate'\">{{ cell.data.legs?.length || 0 }}</div>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary me-1\" (click)=\"openEdit(cell.data)\">\n <i class=\"fa fa-pencil\"></i>\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"delete(cell.data)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </dx-data-grid>\n\n <div class=\"card mt-3\" *ngIf=\"selectedScenario\">\n <div class=\"card-body\">\n <h6 class=\"mb-2\">Senaryo Detay\u0131 - {{ selectedScenario.name }}</h6>\n <p class=\"text-muted mb-2\" *ngIf=\"selectedScenario.description\">{{ selectedScenario.description }}</p>\n <ol class=\"mb-2\">\n <li *ngFor=\"let leg of selectedScenario.legs\">{{ legStepText(leg) }}</li>\n </ol>\n <small class=\"text-muted d-block\">\n Haz\u0131r senaryolar proje ba\u011F\u0131ms\u0131zd\u0131r. Kaynak belgenin header Project de\u011Feri her \u015Firkette ilgili OPRJ kayd\u0131 ile e\u015Fle\u015Ftirilir.\n </small>\n <small class=\"text-muted d-block\">\n Kullan\u0131c\u0131n\u0131n aktar\u0131m s\u0131ras\u0131nda yapt\u0131\u011F\u0131 manuel de\u011Fi\u015Fiklik yaln\u0131zca i\u015Flem \u00E7al\u0131\u015Fma kopyas\u0131n\u0131 etkiler; bu senaryo tan\u0131m\u0131 de\u011Fi\u015Fmez.\n </small>\n </div>\n </div>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\" [options]=\"{ size: 'lg' }\">\n <ng-template #abpHeader>\n <h3>{{ editingId ? 'Senaryo D\u00FCzenle' : 'Yeni Haz\u0131r Senaryo' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form>\n <div class=\"row\">\n <div class=\"col-8 mb-3\">\n <label class=\"form-label\">Senaryo Ad\u0131</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.name\" name=\"name\" required />\n </div>\n <div class=\"col-4 mb-3 d-flex align-items-end\">\n <div class=\"form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [(ngModel)]=\"form.isActive\" name=\"isActive\" id=\"scIsActive\" />\n <label class=\"form-check-label\" for=\"scIsActive\">Aktif</label>\n </div>\n </div>\n </div>\n <div class=\"mb-3\">\n <label class=\"form-label\">A\u00E7\u0131klama</label>\n <textarea class=\"form-control\" rows=\"2\" [(ngModel)]=\"form.description\" name=\"description\"></textarea>\n </div>\n\n <div class=\"d-flex justify-content-between align-items-center mb-2\">\n <label class=\"form-label mb-0\">Bacaklar</label>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"addLeg()\">\n <i class=\"fa fa-plus me-1\"></i>Bacak Ekle\n </button>\n </div>\n\n <table class=\"table table-sm align-middle\">\n <thead>\n <tr>\n <th>Kaynak \u015Eirket</th>\n <th>Hedef \u015Eirket</th>\n <th>Davran\u0131\u015F</th>\n <th>Not</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let leg of form.legs; let i = index\">\n <td>\n <select\n *ngIf=\"i === 0; else sourceText\"\n class=\"form-select form-select-sm\"\n [(ngModel)]=\"leg.sourceCompanyId\"\n [ngModelOptions]=\"{ standalone: true }\"\n >\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n <ng-template #sourceText>\n <span class=\"form-control form-control-sm bg-light\">{{ companyName(leg.sourceCompanyId) }}</span>\n </ng-template>\n </td>\n <td>\n <select\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.targetCompanyId\"\n (ngModelChange)=\"updateLegTarget(i, $event)\"\n [ngModelOptions]=\"{ standalone: true }\"\n >\n <option [ngValue]=\"''\" disabled>Se\u00E7iniz</option>\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </td>\n <td>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"leg.legBehavior\" [ngModelOptions]=\"{ standalone: true }\">\n <option *ngFor=\"let b of legBehaviors\" [ngValue]=\"b.value\">{{ b.label }}</option>\n </select>\n </td>\n <td>\n <input type=\"text\" class=\"form-control form-control-sm\" [(ngModel)]=\"leg.notes\" [ngModelOptions]=\"{ standalone: true }\" />\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger\" (click)=\"removeLeg(leg)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{ 'AbpUi::Cancel' | abpLocalization }}</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"save()\" [disabled]=\"isSaving\">\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ 'AbpUi::Save' | abpLocalization }}\n </button>\n </ng-template>\n</abp-modal>\n" }]
549
+ }], ctorParameters: function () { return [{ type: DocumentScenarioService }, { type: SapCompanyProfileService }, { type: i3.ConfirmationService }]; } });
550
+
551
+ const routes$3 = [
552
+ {
553
+ path: '',
554
+ component: HitDocumentScenarioComponent,
555
+ canActivate: [AuthGuard, PermissionGuard],
556
+ },
557
+ ];
558
+ class HitDocumentScenarioRoutingModule {
559
+ }
560
+ HitDocumentScenarioRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
561
+ HitDocumentScenarioRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
562
+ HitDocumentScenarioRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioRoutingModule, imports: [RouterModule.forChild(routes$3), RouterModule] });
563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioRoutingModule, decorators: [{
564
+ type: NgModule,
565
+ args: [{
566
+ imports: [RouterModule.forChild(routes$3)],
567
+ exports: [RouterModule],
568
+ }]
569
+ }] });
570
+
571
+ class HitDocumentScenarioModule {
572
+ }
573
+ HitDocumentScenarioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
574
+ HitDocumentScenarioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioModule, declarations: [HitDocumentScenarioComponent], imports: [HitDocumentScenarioRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
575
+ HitDocumentScenarioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioModule, imports: [HitDocumentScenarioRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
576
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentScenarioModule, decorators: [{
577
+ type: NgModule,
578
+ args: [{
579
+ declarations: [HitDocumentScenarioComponent],
580
+ imports: [HitDocumentScenarioRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule],
581
+ }]
582
+ }] });
583
+ function loadHitDocumentScenarioModuleAsChild() {
584
+ return Promise.resolve(HitDocumentScenarioModule);
585
+ }
586
+
587
+ class SapProjectParameterService {
588
+ constructor(restService) {
589
+ this.restService = restService;
590
+ this.apiName = 'FBDocumentFlow';
591
+ this.getList = (input) => this.restService.request({
592
+ method: 'GET',
593
+ url: '/api/fbdocumentflow/sap-project-parameters',
594
+ params: { companyId: input.companyId, filter: input.filter },
595
+ }, { apiName: this.apiName });
596
+ this.create = (companyId, input) => this.restService.request({ method: 'POST', url: `/api/fbdocumentflow/sap-project-parameters/${companyId}`, body: input }, { apiName: this.apiName });
597
+ this.update = (companyId, prjCode, input) => this.restService.request({ method: 'PUT', url: `/api/fbdocumentflow/sap-project-parameters/${companyId}/${prjCode}`, body: input }, { apiName: this.apiName });
598
+ }
599
+ }
600
+ SapProjectParameterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SapProjectParameterService, deps: [{ token: i1$1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
601
+ SapProjectParameterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SapProjectParameterService, providedIn: 'root' });
602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SapProjectParameterService, decorators: [{
603
+ type: Injectable,
604
+ args: [{
605
+ providedIn: 'root',
606
+ }]
607
+ }], ctorParameters: function () { return [{ type: i1$1.RestService }]; } });
608
+
609
+ class HitProjectParameterComponent {
610
+ constructor(service, companyService) {
611
+ this.service = service;
612
+ this.companyService = companyService;
613
+ this.companies = [];
614
+ this.selectedCompanyId = '';
615
+ this.data = [];
616
+ this.isLoading = false;
617
+ this.isSaving = false;
618
+ // SAP'ta Code alanı benzersiz anahtardır ve oluşturulduktan sonra değiştirilemez (DevExtreme'in inline
619
+ // grid düzenlemesinde bu "E4017 - Keys cannot be modified" hatasına yol açıyordu). Bu yüzden ekleme/
620
+ // güncelleme artık ayrı bir modal üzerinden yapılır; güncellemede Proje Kodu/Adı salt-okunur gösterilir.
621
+ this.isModalOpen = false;
622
+ this.modalMode = 'create';
623
+ this.form = { prjCode: '', prjName: '' };
624
+ // DevExtreme grid buton sütunu, tıklama olayını { row: { data } } şeklinde bir event objesiyle çağırır.
625
+ this.onEditButtonClick = (e) => {
626
+ this.openUpdateModal(e.row.data);
627
+ };
628
+ }
629
+ ngOnInit() {
630
+ this.companyService.getList({ maxResultCount: 1000, skipCount: 0, isActive: true }).subscribe(result => {
631
+ this.companies = result.items;
632
+ if (this.companies.length > 0) {
633
+ this.selectedCompanyId = this.companies[0].id;
634
+ this.loadData();
635
+ }
636
+ });
637
+ }
638
+ loadData() {
639
+ if (!this.selectedCompanyId) {
640
+ return;
641
+ }
642
+ // Sorgu her tetiklendiğinde listeyi önce temizleriz: istek hata alırsa (önceki şirkete ait) eski veri
643
+ // ekranda kalıp "şirket değişmiyor" izlenimi vermesin.
644
+ this.data = [];
645
+ const requestedCompanyId = this.selectedCompanyId;
646
+ this.isLoading = true;
647
+ this.service
648
+ .getList({ companyId: requestedCompanyId })
649
+ .pipe(finalize(() => (this.isLoading = false)))
650
+ .subscribe(result => {
651
+ // Kullanıcı yanıt gelmeden şirketi tekrar değiştirmişse, artık geçersiz olan bu sonucu yok say.
652
+ if (requestedCompanyId === this.selectedCompanyId) {
653
+ this.data = result.items;
654
+ }
655
+ });
656
+ }
657
+ hasUndefinedIncreaseRate() {
658
+ return this.data.some(x => !x.increaseRate);
659
+ }
660
+ openCreateModal() {
661
+ this.modalMode = 'create';
662
+ this.form = { prjCode: '', prjName: '', ebaId: '', increaseRate: undefined, cardCode: '', currency: '' };
663
+ this.isModalOpen = true;
664
+ }
665
+ openUpdateModal(row) {
666
+ var _a, _b, _c, _d, _e;
667
+ this.modalMode = 'update';
668
+ // Formu mevcut SAP değerleriyle doldururuz; kullanıcı yalnızca değiştirmek istediği alanı düzenler,
669
+ // dokunmadığı alanlar olduğu gibi geri gönderilir (SAP'taki diğer alanları boşaltmaz).
670
+ this.form = {
671
+ prjCode: (_a = row.prjCode) !== null && _a !== void 0 ? _a : '',
672
+ prjName: (_b = row.prjName) !== null && _b !== void 0 ? _b : '',
673
+ ebaId: (_c = row.ebaId) !== null && _c !== void 0 ? _c : '',
674
+ increaseRate: row.increaseRate,
675
+ cardCode: (_d = row.cardCode) !== null && _d !== void 0 ? _d : '',
676
+ currency: (_e = row.currency) !== null && _e !== void 0 ? _e : '',
677
+ };
678
+ this.isModalOpen = true;
679
+ }
680
+ cancelModal() {
681
+ this.isModalOpen = false;
682
+ }
683
+ saveModal() {
684
+ if (!this.form.prjCode || !this.form.prjName) {
685
+ return;
686
+ }
687
+ this.isSaving = true;
688
+ const onSaved = () => {
689
+ this.isSaving = false;
690
+ this.isModalOpen = false;
691
+ this.loadData();
692
+ };
693
+ const onError = () => (this.isSaving = false);
694
+ if (this.modalMode === 'create') {
695
+ this.service
696
+ .create(this.selectedCompanyId, {
697
+ prjCode: this.form.prjCode,
698
+ prjName: this.form.prjName,
699
+ ebaId: this.form.ebaId || undefined,
700
+ increaseRate: this.form.increaseRate,
701
+ cardCode: this.form.cardCode || undefined,
702
+ currency: this.form.currency || undefined,
703
+ })
704
+ .subscribe({ next: onSaved, error: onError });
705
+ }
706
+ else {
707
+ this.service
708
+ .update(this.selectedCompanyId, this.form.prjCode, {
709
+ increaseRate: this.form.increaseRate,
710
+ cardCode: this.form.cardCode || undefined,
711
+ currency: this.form.currency || undefined,
712
+ })
713
+ .subscribe({ next: onSaved, error: onError });
714
+ }
715
+ }
716
+ }
717
+ HitProjectParameterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterComponent, deps: [{ token: SapProjectParameterService }, { token: SapCompanyProfileService }], target: i0.ɵɵFactoryTarget.Component });
718
+ HitProjectParameterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HitProjectParameterComponent, selector: "hit-project-parameter", ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:ProjectParameters' | abpLocalization }}</h5>\n </div>\n <div class=\"card-body pt-3\">\n <div class=\"row g-3 align-items-end mb-3\">\n <div class=\"col-md-4\">\n <label class=\"form-label\">\u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"selectedCompanyId\" (ngModelChange)=\"loadData()\">\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"col-auto\">\n <button class=\"btn btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading || !selectedCompanyId\" title=\"Listeyi yenile\">\n <i class=\"fa fa-refresh me-1\"></i>Yenile\n </button>\n </div>\n </div>\n\n <div class=\"d-flex justify-content-between align-items-center mb-2\">\n <h6 class=\"mb-0\">SAP B1 Proje Parametreleri</h6>\n <button class=\"btn btn-primary btn-sm\" (click)=\"openCreateModal()\" [disabled]=\"!selectedCompanyId\">\n <i class=\"fa fa-plus me-1\"></i>Yeni Proje Ekle\n </button>\n </div>\n\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">SAP B1 proje parametreleri y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid *ngIf=\"!isLoading\" [dataSource]=\"data\" [showBorders]=\"true\" [showRowLines]=\"true\" [columnAutoWidth]=\"true\" keyExpr=\"prjCode\">\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n\n <dxi-column dataField=\"prjCode\" caption=\"Proje Kodu\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"prjName\" caption=\"Proje Ad\u0131\"></dxi-column>\n <dxi-column dataField=\"ebaId\" caption=\"EBA ID\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"increaseRate\" caption=\"Art\u0131r\u0131m Oran\u0131\" dataType=\"number\" [width]=\"130\"></dxi-column>\n <dxi-column dataField=\"cardCode\" caption=\"Muhatap Kodu\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"currency\" caption=\"Para Birimi\" [width]=\"110\"></dxi-column>\n <dxi-column type=\"buttons\" caption=\"\" [width]=\"60\">\n <dxi-button icon=\"edit\" hint=\"D\u00FCzenle\" [onClick]=\"onEditButtonClick\"></dxi-button>\n </dxi-column>\n </dx-data-grid>\n\n <div class=\"alert alert-warning mt-3\" *ngIf=\"hasUndefinedIncreaseRate()\">\n 0 / NULL art\u0131r\u0131m oran\u0131 ak\u0131\u015F\u0131 bloklamaz. Aktar\u0131m baca\u011F\u0131nda k\u0131rm\u0131z\u0131 uyar\u0131 g\u00F6sterilir ve art\u0131r\u0131m uygulanmadan devam i\u00E7in kullan\u0131c\u0131 onay\u0131 al\u0131n\u0131r.\n </div>\n\n <small class=\"text-muted d-block mt-2\">\n Proje Kodu/Ad\u0131/EBA ID SAP'ta olu\u015Fturulduktan sonra bu ekrandan de\u011Fi\u015Ftirilemez (SAP anahtar/bilgi alanlar\u0131d\u0131r); yaln\u0131zca\n Art\u0131r\u0131m Oran\u0131, Muhatap Kodu ve Para Birimi g\u00FCncellenebilir.\n <br />\n U_CardCode varsay\u0131lan proje muhatab\u0131d\u0131r; Intercompany hedef OPCH.CardCode \u00E7\u00F6z\u00FCm\u00FCnde esas kaynak Muhatap E\u015Fle\u015Ftirmeleridir.\n </small>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\">\n <ng-template #abpHeader>\n <h3>{{ modalMode === 'create' ? 'Yeni Proje Ekle' : 'Proje Parametrelerini G\u00FCncelle' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <div class=\"row g-3\">\n <div class=\"col-md-6\">\n <label class=\"form-label\">Proje Kodu</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"form.prjCode\"\n [disabled]=\"modalMode === 'update'\"\n [readOnly]=\"modalMode === 'update'\"\n />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Proje Ad\u0131</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"form.prjName\"\n [disabled]=\"modalMode === 'update'\"\n [readOnly]=\"modalMode === 'update'\"\n />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">EBA ID</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"form.ebaId\"\n [disabled]=\"modalMode === 'update'\"\n [readOnly]=\"modalMode === 'update'\"\n />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Art\u0131r\u0131m Oran\u0131 (U_Oran)</label>\n <input type=\"number\" step=\"0.01\" class=\"form-control\" [(ngModel)]=\"form.increaseRate\" />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Muhatap Kodu (U_CardCode)</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.cardCode\" />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Para Birimi (U_Currency)</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.currency\" />\n </div>\n </div>\n\n <div class=\"alert alert-info small mt-3\" *ngIf=\"modalMode === 'update'\">\n Proje Kodu/Ad\u0131/EBA ID SAP'ta de\u011Fi\u015Ftirilemeyen alanlard\u0131r; yaln\u0131zca Art\u0131r\u0131m Oran\u0131, Muhatap Kodu ve Para Birimi g\u00FCncellenir.\n Dokunmad\u0131\u011F\u0131n\u0131z alanlar mevcut SAP de\u011Feriyle oldu\u011Fu gibi g\u00F6nderilir.\n </div>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancelModal()\">Vazge\u00E7</button>\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveModal()\"\n [disabled]=\"isSaving || !form.prjCode || !form.prjName\"\n >\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n Kaydet\n </button>\n </ng-template>\n</abp-modal>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "component", type: i6.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "customizeExportData", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "focusStateEnabled", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExported", "onExporting", "onFileSaving", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "customizeExportDataChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "focusStateEnabledChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i7.DxiColumnComponent, selector: "dxi-column", inputs: ["alignment", "allowEditing", "allowExporting", "allowFiltering", "allowFixing", "allowGrouping", "allowHeaderFiltering", "allowHiding", "allowReordering", "allowResizing", "allowSearch", "allowSorting", "autoExpandGroup", "buttons", "calculateCellValue", "calculateDisplayValue", "calculateFilterExpression", "calculateGroupValue", "calculateSortValue", "caption", "cellTemplate", "columns", "cssClass", "customizeText", "dataField", "dataType", "editCellTemplate", "editorOptions", "encodeHtml", "falseText", "filterOperations", "filterType", "filterValue", "filterValues", "fixed", "fixedPosition", "format", "formItem", "groupCellTemplate", "groupIndex", "headerCellTemplate", "headerFilter", "hidingPriority", "isBand", "lookup", "minWidth", "name", "ownerBand", "renderAsync", "selectedFilterOperation", "setCellValue", "showEditorAlways", "showInColumnChooser", "showWhenGrouped", "sortIndex", "sortingMethod", "sortOrder", "trueText", "type", "validationRules", "visible", "visibleIndex", "width"], outputs: ["filterValueChange", "filterValuesChange", "groupIndexChange", "selectedFilterOperationChange", "sortIndexChange", "sortOrderChange", "visibleChange", "visibleIndexChange"] }, { kind: "component", type: i7.DxiButtonComponent, selector: "dxi-button", inputs: ["location", "name", "options", "cssClass", "disabled", "hint", "icon", "onClick", "template", "text", "visible"] }, { kind: "component", type: i7.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "dataSource", "groupInterval", "height", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i7.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i7.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i7.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "pipe", type: i1$1.LocalizationPipe, name: "abpLocalization" }] });
719
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterComponent, decorators: [{
720
+ type: Component,
721
+ args: [{ selector: 'hit-project-parameter', template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:ProjectParameters' | abpLocalization }}</h5>\n </div>\n <div class=\"card-body pt-3\">\n <div class=\"row g-3 align-items-end mb-3\">\n <div class=\"col-md-4\">\n <label class=\"form-label\">\u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"selectedCompanyId\" (ngModelChange)=\"loadData()\">\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"col-auto\">\n <button class=\"btn btn-outline-primary\" (click)=\"loadData()\" [disabled]=\"isLoading || !selectedCompanyId\" title=\"Listeyi yenile\">\n <i class=\"fa fa-refresh me-1\"></i>Yenile\n </button>\n </div>\n </div>\n\n <div class=\"d-flex justify-content-between align-items-center mb-2\">\n <h6 class=\"mb-0\">SAP B1 Proje Parametreleri</h6>\n <button class=\"btn btn-primary btn-sm\" (click)=\"openCreateModal()\" [disabled]=\"!selectedCompanyId\">\n <i class=\"fa fa-plus me-1\"></i>Yeni Proje Ekle\n </button>\n </div>\n\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">SAP B1 proje parametreleri y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid *ngIf=\"!isLoading\" [dataSource]=\"data\" [showBorders]=\"true\" [showRowLines]=\"true\" [columnAutoWidth]=\"true\" keyExpr=\"prjCode\">\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n\n <dxi-column dataField=\"prjCode\" caption=\"Proje Kodu\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"prjName\" caption=\"Proje Ad\u0131\"></dxi-column>\n <dxi-column dataField=\"ebaId\" caption=\"EBA ID\" [width]=\"120\"></dxi-column>\n <dxi-column dataField=\"increaseRate\" caption=\"Art\u0131r\u0131m Oran\u0131\" dataType=\"number\" [width]=\"130\"></dxi-column>\n <dxi-column dataField=\"cardCode\" caption=\"Muhatap Kodu\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"currency\" caption=\"Para Birimi\" [width]=\"110\"></dxi-column>\n <dxi-column type=\"buttons\" caption=\"\" [width]=\"60\">\n <dxi-button icon=\"edit\" hint=\"D\u00FCzenle\" [onClick]=\"onEditButtonClick\"></dxi-button>\n </dxi-column>\n </dx-data-grid>\n\n <div class=\"alert alert-warning mt-3\" *ngIf=\"hasUndefinedIncreaseRate()\">\n 0 / NULL art\u0131r\u0131m oran\u0131 ak\u0131\u015F\u0131 bloklamaz. Aktar\u0131m baca\u011F\u0131nda k\u0131rm\u0131z\u0131 uyar\u0131 g\u00F6sterilir ve art\u0131r\u0131m uygulanmadan devam i\u00E7in kullan\u0131c\u0131 onay\u0131 al\u0131n\u0131r.\n </div>\n\n <small class=\"text-muted d-block mt-2\">\n Proje Kodu/Ad\u0131/EBA ID SAP'ta olu\u015Fturulduktan sonra bu ekrandan de\u011Fi\u015Ftirilemez (SAP anahtar/bilgi alanlar\u0131d\u0131r); yaln\u0131zca\n Art\u0131r\u0131m Oran\u0131, Muhatap Kodu ve Para Birimi g\u00FCncellenebilir.\n <br />\n U_CardCode varsay\u0131lan proje muhatab\u0131d\u0131r; Intercompany hedef OPCH.CardCode \u00E7\u00F6z\u00FCm\u00FCnde esas kaynak Muhatap E\u015Fle\u015Ftirmeleridir.\n </small>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"isModalOpen\">\n <ng-template #abpHeader>\n <h3>{{ modalMode === 'create' ? 'Yeni Proje Ekle' : 'Proje Parametrelerini G\u00FCncelle' }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <div class=\"row g-3\">\n <div class=\"col-md-6\">\n <label class=\"form-label\">Proje Kodu</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"form.prjCode\"\n [disabled]=\"modalMode === 'update'\"\n [readOnly]=\"modalMode === 'update'\"\n />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Proje Ad\u0131</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"form.prjName\"\n [disabled]=\"modalMode === 'update'\"\n [readOnly]=\"modalMode === 'update'\"\n />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">EBA ID</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"form.ebaId\"\n [disabled]=\"modalMode === 'update'\"\n [readOnly]=\"modalMode === 'update'\"\n />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Art\u0131r\u0131m Oran\u0131 (U_Oran)</label>\n <input type=\"number\" step=\"0.01\" class=\"form-control\" [(ngModel)]=\"form.increaseRate\" />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Muhatap Kodu (U_CardCode)</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.cardCode\" />\n </div>\n <div class=\"col-md-6\">\n <label class=\"form-label\">Para Birimi (U_Currency)</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"form.currency\" />\n </div>\n </div>\n\n <div class=\"alert alert-info small mt-3\" *ngIf=\"modalMode === 'update'\">\n Proje Kodu/Ad\u0131/EBA ID SAP'ta de\u011Fi\u015Ftirilemeyen alanlard\u0131r; yaln\u0131zca Art\u0131r\u0131m Oran\u0131, Muhatap Kodu ve Para Birimi g\u00FCncellenir.\n Dokunmad\u0131\u011F\u0131n\u0131z alanlar mevcut SAP de\u011Feriyle oldu\u011Fu gibi g\u00F6nderilir.\n </div>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancelModal()\">Vazge\u00E7</button>\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveModal()\"\n [disabled]=\"isSaving || !form.prjCode || !form.prjName\"\n >\n <span *ngIf=\"isSaving\" class=\"spinner-border spinner-border-sm me-1\"></span>\n Kaydet\n </button>\n </ng-template>\n</abp-modal>\n" }]
722
+ }], ctorParameters: function () { return [{ type: SapProjectParameterService }, { type: SapCompanyProfileService }]; } });
723
+
724
+ const routes$2 = [
725
+ {
726
+ path: '',
727
+ component: HitProjectParameterComponent,
728
+ canActivate: [AuthGuard, PermissionGuard],
729
+ },
730
+ ];
731
+ class HitProjectParameterRoutingModule {
732
+ }
733
+ HitProjectParameterRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
734
+ HitProjectParameterRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
735
+ HitProjectParameterRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterRoutingModule, imports: [RouterModule.forChild(routes$2), RouterModule] });
736
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterRoutingModule, decorators: [{
737
+ type: NgModule,
738
+ args: [{
739
+ imports: [RouterModule.forChild(routes$2)],
740
+ exports: [RouterModule],
741
+ }]
742
+ }] });
743
+
744
+ class HitProjectParameterModule {
745
+ }
746
+ HitProjectParameterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
747
+ HitProjectParameterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterModule, declarations: [HitProjectParameterComponent], imports: [HitProjectParameterRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
748
+ HitProjectParameterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterModule, imports: [HitProjectParameterRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
749
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitProjectParameterModule, decorators: [{
750
+ type: NgModule,
751
+ args: [{
752
+ declarations: [HitProjectParameterComponent],
753
+ imports: [HitProjectParameterRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule],
754
+ }]
755
+ }] });
756
+ function loadHitProjectParameterModuleAsChild() {
757
+ return Promise.resolve(HitProjectParameterModule);
758
+ }
759
+
760
+ var DocumentTransferStatus;
761
+ (function (DocumentTransferStatus) {
762
+ DocumentTransferStatus[DocumentTransferStatus["Draft"] = 0] = "Draft";
763
+ DocumentTransferStatus[DocumentTransferStatus["Running"] = 1] = "Running";
764
+ DocumentTransferStatus[DocumentTransferStatus["Completed"] = 2] = "Completed";
765
+ DocumentTransferStatus[DocumentTransferStatus["Failed"] = 3] = "Failed";
766
+ DocumentTransferStatus[DocumentTransferStatus["Cancelled"] = 4] = "Cancelled";
767
+ })(DocumentTransferStatus || (DocumentTransferStatus = {}));
768
+ var DocumentTransferLegStatus;
769
+ (function (DocumentTransferLegStatus) {
770
+ DocumentTransferLegStatus[DocumentTransferLegStatus["Pending"] = 0] = "Pending";
771
+ DocumentTransferLegStatus[DocumentTransferLegStatus["Success"] = 1] = "Success";
772
+ DocumentTransferLegStatus[DocumentTransferLegStatus["Failed"] = 2] = "Failed";
773
+ DocumentTransferLegStatus[DocumentTransferLegStatus["Skipped"] = 3] = "Skipped";
774
+ })(DocumentTransferLegStatus || (DocumentTransferLegStatus = {}));
775
+ // Spec §14 (18.09.2026 kararı) - süreç parametrik: DocumentTransferStatus.Draft (aktarım kaydının henüz
776
+ // çalıştırılmamış olması) ile KARIŞTIRILMAMALIDIR; bu, SAP B1 tarafındaki belge yaşam döngüsü tercihidir.
777
+ var SapDocumentLifecycle;
778
+ (function (SapDocumentLifecycle) {
779
+ SapDocumentLifecycle[SapDocumentLifecycle["Posted"] = 0] = "Posted";
780
+ SapDocumentLifecycle[SapDocumentLifecycle["Draft"] = 1] = "Draft";
781
+ })(SapDocumentLifecycle || (SapDocumentLifecycle = {}));
782
+ // Spec ek karar (18.09.2026) - hedef Taslak iken Construction bacağının (OPOR→OPDN→OPCH) taban belge
783
+ // zinciri taslaklar arasında çalışmaz; bu durumda kullanıcı üç belge tipinden yalnızca birinin taslak
784
+ // olarak oluşturulmasını seçer.
785
+ var ConstructionDraftDocumentType;
786
+ (function (ConstructionDraftDocumentType) {
787
+ ConstructionDraftDocumentType[ConstructionDraftDocumentType["PurchaseOrder"] = 0] = "PurchaseOrder";
788
+ ConstructionDraftDocumentType[ConstructionDraftDocumentType["GoodsReceipt"] = 1] = "GoodsReceipt";
789
+ ConstructionDraftDocumentType[ConstructionDraftDocumentType["APInvoice"] = 2] = "APInvoice";
790
+ })(ConstructionDraftDocumentType || (ConstructionDraftDocumentType = {}));
791
+
792
+ class DocumentTransferService {
793
+ constructor(restService) {
794
+ this.restService = restService;
795
+ this.apiName = 'FBDocumentFlow';
796
+ this.get = (id) => this.restService.request({ method: 'GET', url: `/api/fbdocumentflow/document-transfers/${id}` }, { apiName: this.apiName });
797
+ this.getList = (input) => this.restService.request({
798
+ method: 'GET',
799
+ url: '/api/fbdocumentflow/document-transfers',
800
+ params: { sourceCompanyId: input.sourceCompanyId, status: input.status, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
801
+ }, { apiName: this.apiName });
802
+ this.getEligibleSourceInvoices = (input) => this.restService.request({
803
+ method: 'GET',
804
+ url: '/api/fbdocumentflow/document-transfers/eligible-source-invoices',
805
+ params: {
806
+ sourceCompanyId: input.sourceCompanyId,
807
+ projectCode: input.projectCode,
808
+ numAtCard: input.numAtCard,
809
+ sourceDocumentLifecycle: input.sourceDocumentLifecycle,
810
+ },
811
+ }, { apiName: this.apiName });
812
+ this.resolveFirstTarget = (sourceCompanyId, sourceOinvDocEntry, sourceDocumentLifecycle) => this.restService.request({
813
+ method: 'GET',
814
+ url: '/api/fbdocumentflow/document-transfers/resolve-first-target',
815
+ params: { sourceCompanyId, sourceOinvDocEntry, sourceDocumentLifecycle },
816
+ }, { apiName: this.apiName });
817
+ this.findExistingDraft = (sourceCompanyId, sourceOinvDocEntry, sourceDocumentLifecycle) => this.restService.request({
818
+ method: 'GET',
819
+ url: '/api/fbdocumentflow/document-transfers/existing-draft',
820
+ params: { sourceCompanyId, sourceOinvDocEntry, sourceDocumentLifecycle },
821
+ }, { apiName: this.apiName });
822
+ this.deleteDraft = (id) => this.restService.request({ method: 'DELETE', url: `/api/fbdocumentflow/document-transfers/${id}/draft` }, { apiName: this.apiName });
823
+ this.delete = (id) => this.restService.request({ method: 'DELETE', url: `/api/fbdocumentflow/document-transfers/${id}` }, { apiName: this.apiName });
824
+ this.create = (input) => this.restService.request({ method: 'POST', url: '/api/fbdocumentflow/document-transfers', body: input }, { apiName: this.apiName });
825
+ this.addLeg = (transferId, input) => this.restService.request({ method: 'POST', url: `/api/fbdocumentflow/document-transfers/${transferId}/legs`, body: input }, { apiName: this.apiName });
826
+ this.updateLeg = (transferId, legId, input) => this.restService.request({ method: 'PUT', url: `/api/fbdocumentflow/document-transfers/${transferId}/legs/${legId}`, body: input }, { apiName: this.apiName });
827
+ this.applyScenario = (transferId, input) => this.restService.request({ method: 'POST', url: `/api/fbdocumentflow/document-transfers/${transferId}/apply-scenario`, body: input }, { apiName: this.apiName });
828
+ this.removeLeg = (transferId, legId) => this.restService.request({ method: 'DELETE', url: `/api/fbdocumentflow/document-transfers/${transferId}/legs/${legId}` }, { apiName: this.apiName });
829
+ this.executeLeg = (transferId, legId) => this.restService.request({ method: 'POST', url: `/api/fbdocumentflow/document-transfers/${transferId}/legs/${legId}/execute` }, { apiName: this.apiName });
830
+ this.executeAll = (transferId) => this.restService.request({ method: 'POST', url: `/api/fbdocumentflow/document-transfers/${transferId}/execute-all` }, { apiName: this.apiName });
831
+ this.cancelChain = (intercompanyId) => this.restService.request({ method: 'POST', url: `/api/fbdocumentflow/document-transfers/cancel-chain/${intercompanyId}` }, { apiName: this.apiName });
832
+ }
833
+ }
834
+ DocumentTransferService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DocumentTransferService, deps: [{ token: i1$1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
835
+ DocumentTransferService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DocumentTransferService, providedIn: 'root' });
836
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DocumentTransferService, decorators: [{
837
+ type: Injectable,
838
+ args: [{
839
+ providedIn: 'root',
840
+ }]
841
+ }], ctorParameters: function () { return [{ type: i1$1.RestService }]; } });
842
+
843
+ class HitDocumentTransferComponent {
844
+ constructor(service, companyService, router, confirmation) {
845
+ this.service = service;
846
+ this.companyService = companyService;
847
+ this.router = router;
848
+ this.confirmation = confirmation;
849
+ this.companies = [];
850
+ // Aktarıma uygun müşteri faturaları - Proje/NumAtCard/Belge No vb. daraltma tablonun kendi sütun
851
+ // filtreleriyle yapılır.
852
+ this.filterSourceCompanyId = '';
853
+ this.isListLoading = false;
854
+ this.eligibleInvoices = [];
855
+ // Spec §14 (18.09.2026 kararı) - süreç parametrik: Taslak seçilirse taslak faturalar, Kayıtlı
856
+ // seçilirse (varsayılan, mevcut/eski davranışla uyumlu) kayıtlı faturalar listelenir. Bu yalnızca
857
+ // KAYNAK faturanın modudur - hedefte oluşacak belgelerin modu (targetDocumentLifecycle) bundan
858
+ // BAĞIMSIZDIR ve aktarım oluşturma ekranında ayrıca seçilir (kullanıcı geri bildirimiyle netleştirildi).
859
+ this.sourceDocumentLifecycle = SapDocumentLifecycle.Posted;
860
+ // Kaynak HER ZAMAN bir Müşteri Faturasıdır (OINV) - etiket bunu netleştirir (kullanıcı geri
861
+ // bildirimiyle netleştirildi). İşlem Geçmişi tablosundaki "Hedef Belge Durumu" sütununda da (kullanıcı
862
+ // isteğiyle) AYNI etiketler kullanılır.
863
+ this.sourceDocumentLifecycleOptions = [
864
+ { value: SapDocumentLifecycle.Posted, label: 'Kayıtlı Müşteri Faturası' },
865
+ { value: SapDocumentLifecycle.Draft, label: 'Taslak Müşteri Faturası' },
866
+ ];
867
+ // İşlem Geçmişi - daha önce başlatılmış (işlem bekliyor/devam eden/tamamlanan/hatalı/iptal edilen) aktarımlar.
868
+ // "Kapat"/"Listeye Dön" sonrası kullanıcının bir zincire tekrar dönüp bakabilmesi için.
869
+ this.isTransfersLoading = false;
870
+ this.transfers = [];
871
+ this.isHistoryExpanded = true;
872
+ // Durum sütununun header-filter/filter-row açılır listesinde okunabilir Türkçe etiketler gösterebilmesi
873
+ // için (aksi halde DevExtreme ham sayısal enum değerlerini - 0/1/2/3/4 - listeler).
874
+ this.transferStatusLookup = [
875
+ { value: 0, text: 'İşlem Bekliyor' },
876
+ { value: 1, text: 'Devam Ediyor' },
877
+ { value: 2, text: 'Tamamlandı' },
878
+ { value: 3, text: 'Hatalı' },
879
+ { value: 4, text: 'İptal Edildi' },
880
+ ];
881
+ this.eligibleInvoicesRequestId = 0;
882
+ this.transfersRequestId = 0;
883
+ // Bu menü için üç farklı yaklaşım denendi ve hepsi DevExtreme grid hücresi içinde başarısız oldu:
884
+ // (1) Bootstrap'ın data-bs-toggle="dropdown"'ı - Bootstrap JS bundle'ı yüklü değil, hiç tepki vermedi.
885
+ // (2) Saf Angular *ngIf dropdown'ı - DOM'da doğru açılıp kapanıyordu ama hücrenin/rowsview'ın
886
+ // overflow:hidden'ı yüzünden görünmüyordu (z-index bunu aşamaz, gerçek ortamda doğrulandı).
887
+ // (3) dx-drop-down-button - görsel olarak grid'in dışına taşıp doğru görünüyordu, ama onItemClick
888
+ // olayı bu ortamda güvenilir tetiklenmedi (gerçek ortamda doğrulandı: hiçbir tıklama handler'ı
889
+ // çağırmadı).
890
+ // Çözüm: menüyü grid'in TAMAMEN DIŞINA, component şablonunun en üst seviyesine taşımak - böylece ne
891
+ // overflow:hidden kırpması ne de *dxTemplate içi olay bağlama sorunları yaşanır. Zaten çalıştığı
892
+ // kanıtlanmış tekli "İşlemler" butonuyla (actionsTemplate) birebir aynı, basit (click) mekanizması.
893
+ this.openActionsRow = null;
894
+ this.actionsMenuPosition = { top: 0, left: 0 };
895
+ }
896
+ ngOnInit() {
897
+ this.companyService.getList({ maxResultCount: 1000, skipCount: 0, isActive: true }).subscribe(result => {
898
+ var _a;
899
+ this.companies = result.items;
900
+ // Detay sayfasından "Listeye Dön"/"Kapat" ile geri gelindiğinde, kullanıcının o an üzerinde
901
+ // çalıştığı şirket kaybolmasın diye router state'teki şirket önceliklidir.
902
+ const returnedCompanyId = (_a = history.state) === null || _a === void 0 ? void 0 : _a.sourceCompanyId;
903
+ const preferredCompanyId = returnedCompanyId && this.companies.some(c => c.id === returnedCompanyId) ? returnedCompanyId : undefined;
904
+ if (this.companies.length > 0 && !this.filterSourceCompanyId) {
905
+ this.filterSourceCompanyId = preferredCompanyId !== null && preferredCompanyId !== void 0 ? preferredCompanyId : this.companies[0].id;
906
+ this.search();
907
+ }
908
+ });
909
+ }
910
+ companyName(id) {
911
+ var _a, _b;
912
+ return (_b = (_a = this.companies.find(c => c.id === id)) === null || _a === void 0 ? void 0 : _a.companyName) !== null && _b !== void 0 ? _b : id;
913
+ }
914
+ search() {
915
+ if (!this.filterSourceCompanyId) {
916
+ return;
917
+ }
918
+ this.loadEligibleInvoices();
919
+ this.loadTransfers();
920
+ }
921
+ loadEligibleInvoices() {
922
+ var _a;
923
+ (_a = this.eligibleInvoicesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
924
+ this.eligibleInvoices = [];
925
+ const requestId = ++this.eligibleInvoicesRequestId;
926
+ this.isListLoading = true;
927
+ this.eligibleInvoicesSubscription = this.service
928
+ .getEligibleSourceInvoices({ sourceCompanyId: this.filterSourceCompanyId, sourceDocumentLifecycle: this.sourceDocumentLifecycle })
929
+ .pipe(finalize(() => (this.isListLoading = false)))
930
+ .subscribe(result => {
931
+ if (requestId !== this.eligibleInvoicesRequestId) {
932
+ return;
933
+ }
934
+ this.eligibleInvoices = result.items.map(item => (Object.assign(Object.assign({}, item), { statusLabel: this.invoiceStatusLabel(item) })));
935
+ });
936
+ }
937
+ loadTransfers() {
938
+ var _a;
939
+ (_a = this.transfersSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
940
+ this.transfers = [];
941
+ const requestId = ++this.transfersRequestId;
942
+ this.isTransfersLoading = true;
943
+ this.transfersSubscription = this.service
944
+ .getList({ sourceCompanyId: this.filterSourceCompanyId, maxResultCount: 50, skipCount: 0, sorting: 'creationTime desc' })
945
+ .pipe(finalize(() => (this.isTransfersLoading = false)))
946
+ .subscribe(result => {
947
+ if (requestId !== this.transfersRequestId) {
948
+ return;
949
+ }
950
+ this.transfers = result.items;
951
+ });
952
+ }
953
+ invoiceStatusLabel(row) {
954
+ if (row.targetHasDuplicateNumAtCard) {
955
+ return 'Hedefte mevcut';
956
+ }
957
+ return row.isResolved ? 'Aktarılabilir' : 'Eşleştirme yok';
958
+ }
959
+ transferStatusLabel(status) {
960
+ var _a, _b;
961
+ return (_b = (_a = this.transferStatusLookup.find(s => s.value === status)) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : String(status);
962
+ }
963
+ // Aynı kaynak belge için daha önce başlatılmış ama henüz çalıştırılmamış bir taslak varsa, "İşlemler"
964
+ // her seferinde CreateAsync çağırıp mükerrer bir taslak daha oluşturmasın diye önce kontrol edilir.
965
+ openTransferPage(row) {
966
+ this.service.findExistingDraft(this.filterSourceCompanyId, row.docEntry, this.sourceDocumentLifecycle).subscribe(existing => {
967
+ if (existing) {
968
+ const creationDate = existing.creationTime ? new Date(existing.creationTime).toLocaleString('tr-TR') : '';
969
+ this.confirmation
970
+ .warn(`Bu belge (${row.docNum}) için zaten bir taslak aktarım var (oluşturulma: ${creationDate}).`, 'FBDocumentFlow::AreYouSure', {
971
+ yesText: 'Evet, Aç',
972
+ cancelText: 'Hayır, Yeni Oluştur',
973
+ })
974
+ .subscribe(status => {
975
+ if (status === Confirmation.Status.confirm) {
976
+ this.router.navigate(['/fbdocumentflow/document-transfers', existing.id]);
977
+ }
978
+ else if (status === Confirmation.Status.reject) {
979
+ // Kullanıcı "Hayır, Yeni Taslak Oluştur" butonuna bastı: önceki taslak hiç çalıştırılmadığından
980
+ // (henüz hiçbir SAP belgesi yok) sessizce siliniyor - aksi halde her "Hayır" bir taslak daha
981
+ // biriktirir ve kullanıcı zaten yalnızca en son oluşturduğu taslakla ilgileniyor.
982
+ this.service.deleteDraft(existing.id).subscribe(() => this.navigateToNewTransfer(row));
983
+ }
984
+ // status === dismiss: kullanıcı diyaloğu kapattı (ör. dışarı tıkladı) - hiçbir şey yapılmaz,
985
+ // ne mevcut taslak açılır ne de silinir; önceki davranışta bu durum yanlışlıkla silme
986
+ // dalına düşüyordu.
987
+ });
988
+ }
989
+ else {
990
+ this.navigateToNewTransfer(row);
991
+ }
992
+ });
993
+ }
994
+ navigateToNewTransfer(row) {
995
+ this.router.navigate(['/fbdocumentflow/document-transfers', 'new'], {
996
+ state: {
997
+ sourceCompanyId: this.filterSourceCompanyId,
998
+ sourceCompanyName: this.companyName(this.filterSourceCompanyId),
999
+ docEntry: row.docEntry,
1000
+ docNum: row.docNum,
1001
+ numAtCard: row.numAtCard,
1002
+ projectCode: row.projectCode,
1003
+ targetCompanyId: row.targetCompanyId,
1004
+ targetCompanyName: row.targetCompanyName,
1005
+ currency: row.currency,
1006
+ sourceDocumentLifecycle: this.sourceDocumentLifecycle,
1007
+ },
1008
+ });
1009
+ }
1010
+ openTransferDetail(row) {
1011
+ this.router.navigate(['/fbdocumentflow/document-transfers', row.id]);
1012
+ }
1013
+ // Tamamlanmış/Devam Eden kayıtlar silinemez (backend zaten TransferNotEditable ile reddeder); "Sil"
1014
+ // seçeneği yalnızca Taslak/Hatalı/İptal Edildi kayıtlarda görünür.
1015
+ canDeleteTransfer(row) {
1016
+ return row.status !== 1 && row.status !== 2; // 1=Devam Ediyor, 2=Tamamlandı
1017
+ }
1018
+ deleteTransfer(row) {
1019
+ this.confirmation
1020
+ .warn('FBDocumentFlow::DeleteConfirmationMessage', 'FBDocumentFlow::AreYouSure')
1021
+ .subscribe(status => {
1022
+ if (status === Confirmation.Status.confirm) {
1023
+ this.service.delete(row.id).subscribe(() => this.loadTransfers());
1024
+ }
1025
+ });
1026
+ }
1027
+ toggleActions(row, event) {
1028
+ event.stopPropagation();
1029
+ if (this.openActionsRow === row) {
1030
+ this.openActionsRow = null;
1031
+ return;
1032
+ }
1033
+ const rect = event.currentTarget.getBoundingClientRect();
1034
+ this.actionsMenuPosition = { top: rect.bottom + window.scrollY, left: rect.left + window.scrollX };
1035
+ this.openActionsRow = row;
1036
+ }
1037
+ closeActionsMenu() {
1038
+ this.openActionsRow = null;
1039
+ }
1040
+ selectAction(action, row) {
1041
+ this.openActionsRow = null;
1042
+ if (action === 'view') {
1043
+ this.openTransferDetail(row);
1044
+ }
1045
+ else {
1046
+ this.deleteTransfer(row);
1047
+ }
1048
+ }
1049
+ // Spec §5 - muhatap eşleştirmesi bulunamayan durumda kullanıcıdan hedef SAP şirketindeki doğru
1050
+ // Müşteri/Satıcı CardCode seçimi istenecektir; bu seçimin Muhatap Eşleştirmeleri ekranına
1051
+ // yönlendirilerek yaptırılması spec tarafından açıkça izin verilen bir arayüz seçeneğidir.
1052
+ // Müşteri CardCode burada tahmin değildir: ResolveFirstTargetAsync tam olarak
1053
+ // "SourceCompanyId + CustomerCardCode == OINV.CardCode" eşleşmesini aradığından, eksik olan
1054
+ // eşleştirmenin CustomerCardCode değeri zaten bu faturanın kendi CardCode'udur.
1055
+ goToPartnerMapping(customerCardCode, customerCardName) {
1056
+ this.router.navigate(['/fbdocumentflow/partner-mappings'], {
1057
+ state: { sourceCompanyId: this.filterSourceCompanyId, customerCardCode, customerCardName },
1058
+ });
1059
+ }
1060
+ toggleHistory() {
1061
+ this.isHistoryExpanded = !this.isHistoryExpanded;
1062
+ }
1063
+ }
1064
+ HitDocumentTransferComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferComponent, deps: [{ token: DocumentTransferService }, { token: SapCompanyProfileService }, { token: i1.Router }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
1065
+ HitDocumentTransferComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HitDocumentTransferComponent, selector: "hit-document-transfer", host: { listeners: { "document:click": "closeActionsMenu()" } }, ngImport: i0, template: "<div class=\"card mb-3\">\n <div class=\"card-header py-3\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:DocumentTransfers' | abpLocalization }}</h5>\n </div>\n <div class=\"card-body pt-3\">\n <div class=\"row g-3 align-items-end mb-3\">\n <div class=\"col-md-4\">\n <label class=\"form-label\">Kaynak \u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"filterSourceCompanyId\" (ngModelChange)=\"search()\">\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"col-md-3\">\n <label class=\"form-label\">Kaynak Belge Durumu</label>\n <select class=\"form-select\" [(ngModel)]=\"sourceDocumentLifecycle\" (ngModelChange)=\"search()\">\n <option *ngFor=\"let o of sourceDocumentLifecycleOptions\" [ngValue]=\"o.value\">{{ o.label }}</option>\n </select>\n </div>\n <div class=\"col-auto\">\n <button class=\"btn btn-outline-primary\" (click)=\"search()\" [disabled]=\"isListLoading || isTransfersLoading\" title=\"Listeyi yenile\">\n <i class=\"fa fa-refresh me-1\"></i>Yenile\n </button>\n </div>\n </div>\n\n <h6 class=\"mb-2\">Aktar\u0131ma Uygun M\u00FC\u015Fteri Faturalar\u0131</h6>\n <small class=\"text-muted d-block mb-2\">Belge No, NumAtCard, Proje vb. ile daraltmak i\u00E7in tablo ba\u015Fl\u0131klar\u0131ndaki arama kutular\u0131n\u0131 kullan\u0131n.</small>\n\n <div *ngIf=\"isListLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Faturalar SAP'tan y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid\n *ngIf=\"!isListLoading\"\n [dataSource]=\"eligibleInvoices\"\n [showBorders]=\"true\"\n [showRowLines]=\"true\"\n [columnAutoWidth]=\"true\"\n [height]=\"'45vh'\"\n [keyboardNavigation]=\"{ enabled: false }\"\n >\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"100\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n <dxi-column dataField=\"docNum\" caption=\"Belge No\" dataType=\"number\" sortOrder=\"desc\" [width]=\"100\"></dxi-column>\n <dxi-column dataField=\"numAtCard\" caption=\"NumAtCard\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"projectCode\" caption=\"Proje\" [width]=\"90\"></dxi-column>\n <dxi-column dataField=\"cardCode\" caption=\"OINV.CardCode\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"targetCompanyName\" caption=\"Hedef \u015Eirket\"></dxi-column>\n <dxi-column dataField=\"currency\" caption=\"D\u00F6viz\" [width]=\"80\"></dxi-column>\n <dxi-column dataField=\"statusLabel\" caption=\"Durum\" cellTemplate=\"statusTemplate\" [width]=\"130\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"openTransferPage(cell.data); $event.target.blur()\"\n [disabled]=\"!cell.data.isResolved || cell.data.targetHasDuplicateNumAtCard\"\n >\n \u0130\u015Flemler\n </button>\n </div>\n\n <div *dxTemplate=\"let cell of 'statusTemplate'\" class=\"d-flex flex-column align-items-start py-2\">\n <span\n class=\"badge\"\n [class.bg-success]=\"invoiceStatusLabel(cell.data) === 'Aktar\u0131labilir'\"\n [class.bg-secondary]=\"invoiceStatusLabel(cell.data) === 'Hedefte mevcut'\"\n [class.bg-warning]=\"invoiceStatusLabel(cell.data) === 'E\u015Fle\u015Ftirme yok'\"\n >\n {{ invoiceStatusLabel(cell.data) }}\n </span>\n <button\n *ngIf=\"!cell.data.isResolved\"\n type=\"button\"\n class=\"btn btn-outline-warning btn-sm mt-2 py-0 px-2\"\n style=\"font-size: 0.72rem\"\n (click)=\"goToPartnerMapping(cell.data.cardCode, cell.data.cardName)\"\n title=\"Muhatap E\u015Fle\u015Ftirmeleri ekran\u0131na git\"\n >\n <i class=\"fa fa-link me-1\"></i>E\u015Fle\u015Ftir\n </button>\n </div>\n </dx-data-grid>\n\n <small class=\"text-muted d-block mt-2\">\n \"Hedefte mevcut\" bilgisi, kaynak OINV.NumAtCard de\u011Ferinin hedef \u015Firkette OPCH.NumAtCard alan\u0131nda bulunmas\u0131 halinde g\u00F6sterilir.\n </small>\n </div>\n</div>\n\n<div class=\"card\">\n <div class=\"card-header py-3\" role=\"button\" (click)=\"toggleHistory()\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <h5 class=\"card-title mb-0\">\u0130\u015Flem Ge\u00E7mi\u015Fi</h5>\n <i class=\"fa\" [class.fa-chevron-up]=\"isHistoryExpanded\" [class.fa-chevron-down]=\"!isHistoryExpanded\"></i>\n </div>\n </div>\n <div class=\"card-body pt-3\" [hidden]=\"!isHistoryExpanded\">\n <small class=\"text-muted d-block mb-2\">Se\u00E7ili kaynak \u015Firket i\u00E7in daha \u00F6nce ba\u015Flat\u0131lm\u0131\u015F aktar\u0131mlar (i\u015Flem bekliyor, devam eden, tamamlanan, hatal\u0131, iptal edilen).</small>\n\n <div *ngIf=\"isTransfersLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid\n *ngIf=\"!isTransfersLoading\"\n [dataSource]=\"transfers\"\n [showBorders]=\"true\"\n [showRowLines]=\"true\"\n [columnAutoWidth]=\"true\"\n [height]=\"'40vh'\"\n [keyboardNavigation]=\"{ enabled: false }\"\n >\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"viewTemplate\" [width]=\"120\" [allowFiltering]=\"false\" [allowSorting]=\"false\" alignment=\"center\"></dxi-column>\n <dxi-column dataField=\"sourceOinvDocNum\" caption=\"Kaynak Belge\" [width]=\"110\"></dxi-column>\n <dxi-column dataField=\"projectCode\" caption=\"Proje\" [width]=\"90\"></dxi-column>\n <dxi-column dataField=\"intercompanyId\" caption=\"Intercompany Id\"></dxi-column>\n <!-- Kullan\u0131c\u0131 geri bildirimiyle tespit edildi: \u0130\u015Flem Ge\u00E7mi\u015Fi'nde bir kayd\u0131n normal (Kay\u0131tl\u0131) mi\n yoksa Taslak m\u0131 oldu\u011Fu hi\u00E7 g\u00F6r\u00FCnm\u00FCyordu - Aktar\u0131m Durumu (Durum s\u00FCtunu) ile kar\u0131\u015Ft\u0131r\u0131lmas\u0131n diye\n Kaynak/Hedef Belge Durumu ayr\u0131 s\u00FCtunlar olarak eklendi (bkz. spec \u00A714). -->\n <dxi-column dataField=\"sourceDocumentLifecycle\" caption=\"Kaynak Belge Durumu\" [width]=\"140\">\n <dxo-lookup [dataSource]=\"sourceDocumentLifecycleOptions\" valueExpr=\"value\" displayExpr=\"label\"></dxo-lookup>\n </dxi-column>\n <dxi-column dataField=\"targetDocumentLifecycle\" caption=\"Hedef Belge Durumu\" [width]=\"140\">\n <dxo-lookup [dataSource]=\"sourceDocumentLifecycleOptions\" valueExpr=\"value\" displayExpr=\"label\"></dxo-lookup>\n </dxi-column>\n <dxi-column dataField=\"status\" caption=\"Durum\" cellTemplate=\"transferStatusTemplate\" [width]=\"130\">\n <dxo-lookup [dataSource]=\"transferStatusLookup\" valueExpr=\"value\" displayExpr=\"text\"></dxo-lookup>\n </dxi-column>\n <dxi-column\n dataField=\"creationTime\"\n caption=\"Olu\u015Fturma Tarihi\"\n dataType=\"datetime\"\n format=\"dd.MM.yyyy HH:mm\"\n [width]=\"150\"\n sortOrder=\"desc\"\n ></dxi-column>\n\n <div *dxTemplate=\"let cell of 'viewTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary\" type=\"button\" (click)=\"toggleActions(cell.data, $event)\">\n \u0130\u015Flemler <i class=\"fa fa-caret-down ms-1\"></i>\n </button>\n </div>\n\n <div *dxTemplate=\"let cell of 'transferStatusTemplate'\">\n <span\n class=\"badge\"\n [class.bg-secondary]=\"cell.value === 0\"\n [class.bg-primary]=\"cell.value === 1\"\n [class.bg-success]=\"cell.value === 2\"\n [class.bg-danger]=\"cell.value === 3\"\n [class.bg-warning]=\"cell.value === 4\"\n >\n {{ transferStatusLabel(cell.value) }}\n </span>\n </div>\n </dx-data-grid>\n </div>\n</div>\n\n<!-- Grid'in DI\u015EINDA: dx-data-grid h\u00FCcrelerinin overflow:hidden k\u0131rpmas\u0131 ve *dxTemplate i\u00E7i olay ba\u011Flama\n sorunlar\u0131 ya\u015Fanmas\u0131n diye \"\u0130\u015Flemler\" men\u00FCs\u00FC buraya, component \u015Fablonunun en \u00FCst seviyesine ta\u015F\u0131nd\u0131. -->\n<ul\n *ngIf=\"openActionsRow as row\"\n class=\"list-unstyled m-0 bg-white border rounded shadow-sm\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"actionsMenuPosition.top\"\n [style.left.px]=\"actionsMenuPosition.left\"\n style=\"z-index: 1050; min-width: 140px; padding: 4px 0\"\n (click)=\"$event.stopPropagation()\"\n>\n <li>\n <button type=\"button\" class=\"d-block w-100 text-start border-0 bg-white px-3 py-1\" (click)=\"selectAction('view', row)\">\n <i class=\"fa fa-eye me-2\"></i>G\u00F6r\u00FCnt\u00FCle\n </button>\n </li>\n <li *ngIf=\"canDeleteTransfer(row)\">\n <button type=\"button\" class=\"d-block w-100 text-start border-0 bg-white px-3 py-1 text-danger\" (click)=\"selectAction('delete', row)\">\n <i class=\"fa fa-trash me-2\"></i>Sil\n </button>\n </li>\n</ul>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "customizeExportData", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "focusStateEnabled", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExported", "onExporting", "onFileSaving", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "customizeExportDataChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "focusStateEnabledChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i7.DxiColumnComponent, selector: "dxi-column", inputs: ["alignment", "allowEditing", "allowExporting", "allowFiltering", "allowFixing", "allowGrouping", "allowHeaderFiltering", "allowHiding", "allowReordering", "allowResizing", "allowSearch", "allowSorting", "autoExpandGroup", "buttons", "calculateCellValue", "calculateDisplayValue", "calculateFilterExpression", "calculateGroupValue", "calculateSortValue", "caption", "cellTemplate", "columns", "cssClass", "customizeText", "dataField", "dataType", "editCellTemplate", "editorOptions", "encodeHtml", "falseText", "filterOperations", "filterType", "filterValue", "filterValues", "fixed", "fixedPosition", "format", "formItem", "groupCellTemplate", "groupIndex", "headerCellTemplate", "headerFilter", "hidingPriority", "isBand", "lookup", "minWidth", "name", "ownerBand", "renderAsync", "selectedFilterOperation", "setCellValue", "showEditorAlways", "showInColumnChooser", "showWhenGrouped", "sortIndex", "sortingMethod", "sortOrder", "trueText", "type", "validationRules", "visible", "visibleIndex", "width"], outputs: ["filterValueChange", "filterValuesChange", "groupIndexChange", "selectedFilterOperationChange", "sortIndexChange", "sortOrderChange", "visibleChange", "visibleIndexChange"] }, { kind: "component", type: i7.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "dataSource", "groupInterval", "height", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i7.DxoLookupComponent, selector: "dxo-lookup", inputs: ["allowClearing", "calculateCellValue", "dataSource", "displayExpr", "valueExpr"] }, { kind: "component", type: i7.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i7.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i7.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "directive", type: i8.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "pipe", type: i1$1.LocalizationPipe, name: "abpLocalization" }] });
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferComponent, decorators: [{
1067
+ type: Component,
1068
+ args: [{ selector: 'hit-document-transfer', template: "<div class=\"card mb-3\">\n <div class=\"card-header py-3\">\n <h5 class=\"card-title mb-0\">{{ 'FBDocumentFlow::Menu:DocumentTransfers' | abpLocalization }}</h5>\n </div>\n <div class=\"card-body pt-3\">\n <div class=\"row g-3 align-items-end mb-3\">\n <div class=\"col-md-4\">\n <label class=\"form-label\">Kaynak \u015Eirket</label>\n <select class=\"form-select\" [(ngModel)]=\"filterSourceCompanyId\" (ngModelChange)=\"search()\">\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n </div>\n <div class=\"col-md-3\">\n <label class=\"form-label\">Kaynak Belge Durumu</label>\n <select class=\"form-select\" [(ngModel)]=\"sourceDocumentLifecycle\" (ngModelChange)=\"search()\">\n <option *ngFor=\"let o of sourceDocumentLifecycleOptions\" [ngValue]=\"o.value\">{{ o.label }}</option>\n </select>\n </div>\n <div class=\"col-auto\">\n <button class=\"btn btn-outline-primary\" (click)=\"search()\" [disabled]=\"isListLoading || isTransfersLoading\" title=\"Listeyi yenile\">\n <i class=\"fa fa-refresh me-1\"></i>Yenile\n </button>\n </div>\n </div>\n\n <h6 class=\"mb-2\">Aktar\u0131ma Uygun M\u00FC\u015Fteri Faturalar\u0131</h6>\n <small class=\"text-muted d-block mb-2\">Belge No, NumAtCard, Proje vb. ile daraltmak i\u00E7in tablo ba\u015Fl\u0131klar\u0131ndaki arama kutular\u0131n\u0131 kullan\u0131n.</small>\n\n <div *ngIf=\"isListLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Faturalar SAP'tan y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid\n *ngIf=\"!isListLoading\"\n [dataSource]=\"eligibleInvoices\"\n [showBorders]=\"true\"\n [showRowLines]=\"true\"\n [columnAutoWidth]=\"true\"\n [height]=\"'45vh'\"\n [keyboardNavigation]=\"{ enabled: false }\"\n >\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"actionsTemplate\" [width]=\"100\" [allowFiltering]=\"false\" [allowSorting]=\"false\"></dxi-column>\n <dxi-column dataField=\"docNum\" caption=\"Belge No\" dataType=\"number\" sortOrder=\"desc\" [width]=\"100\"></dxi-column>\n <dxi-column dataField=\"numAtCard\" caption=\"NumAtCard\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"projectCode\" caption=\"Proje\" [width]=\"90\"></dxi-column>\n <dxi-column dataField=\"cardCode\" caption=\"OINV.CardCode\" [width]=\"140\"></dxi-column>\n <dxi-column dataField=\"targetCompanyName\" caption=\"Hedef \u015Eirket\"></dxi-column>\n <dxi-column dataField=\"currency\" caption=\"D\u00F6viz\" [width]=\"80\"></dxi-column>\n <dxi-column dataField=\"statusLabel\" caption=\"Durum\" cellTemplate=\"statusTemplate\" [width]=\"130\"></dxi-column>\n\n <div *dxTemplate=\"let cell of 'actionsTemplate'\">\n <button\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"openTransferPage(cell.data); $event.target.blur()\"\n [disabled]=\"!cell.data.isResolved || cell.data.targetHasDuplicateNumAtCard\"\n >\n \u0130\u015Flemler\n </button>\n </div>\n\n <div *dxTemplate=\"let cell of 'statusTemplate'\" class=\"d-flex flex-column align-items-start py-2\">\n <span\n class=\"badge\"\n [class.bg-success]=\"invoiceStatusLabel(cell.data) === 'Aktar\u0131labilir'\"\n [class.bg-secondary]=\"invoiceStatusLabel(cell.data) === 'Hedefte mevcut'\"\n [class.bg-warning]=\"invoiceStatusLabel(cell.data) === 'E\u015Fle\u015Ftirme yok'\"\n >\n {{ invoiceStatusLabel(cell.data) }}\n </span>\n <button\n *ngIf=\"!cell.data.isResolved\"\n type=\"button\"\n class=\"btn btn-outline-warning btn-sm mt-2 py-0 px-2\"\n style=\"font-size: 0.72rem\"\n (click)=\"goToPartnerMapping(cell.data.cardCode, cell.data.cardName)\"\n title=\"Muhatap E\u015Fle\u015Ftirmeleri ekran\u0131na git\"\n >\n <i class=\"fa fa-link me-1\"></i>E\u015Fle\u015Ftir\n </button>\n </div>\n </dx-data-grid>\n\n <small class=\"text-muted d-block mt-2\">\n \"Hedefte mevcut\" bilgisi, kaynak OINV.NumAtCard de\u011Ferinin hedef \u015Firkette OPCH.NumAtCard alan\u0131nda bulunmas\u0131 halinde g\u00F6sterilir.\n </small>\n </div>\n</div>\n\n<div class=\"card\">\n <div class=\"card-header py-3\" role=\"button\" (click)=\"toggleHistory()\">\n <div class=\"d-flex justify-content-between align-items-center\">\n <h5 class=\"card-title mb-0\">\u0130\u015Flem Ge\u00E7mi\u015Fi</h5>\n <i class=\"fa\" [class.fa-chevron-up]=\"isHistoryExpanded\" [class.fa-chevron-down]=\"!isHistoryExpanded\"></i>\n </div>\n </div>\n <div class=\"card-body pt-3\" [hidden]=\"!isHistoryExpanded\">\n <small class=\"text-muted d-block mb-2\">Se\u00E7ili kaynak \u015Firket i\u00E7in daha \u00F6nce ba\u015Flat\u0131lm\u0131\u015F aktar\u0131mlar (i\u015Flem bekliyor, devam eden, tamamlanan, hatal\u0131, iptal edilen).</small>\n\n <div *ngIf=\"isTransfersLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <dx-data-grid\n *ngIf=\"!isTransfersLoading\"\n [dataSource]=\"transfers\"\n [showBorders]=\"true\"\n [showRowLines]=\"true\"\n [columnAutoWidth]=\"true\"\n [height]=\"'40vh'\"\n [keyboardNavigation]=\"{ enabled: false }\"\n >\n <dxo-paging [pageSize]=\"50\"></dxo-paging>\n <dxo-pager [visible]=\"true\" [showInfo]=\"true\" [showNavigationButtons]=\"true\"></dxo-pager>\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\n <dxo-header-filter [visible]=\"true\"></dxo-header-filter>\n\n <dxi-column caption=\"\u0130\u015Flemler\" cellTemplate=\"viewTemplate\" [width]=\"120\" [allowFiltering]=\"false\" [allowSorting]=\"false\" alignment=\"center\"></dxi-column>\n <dxi-column dataField=\"sourceOinvDocNum\" caption=\"Kaynak Belge\" [width]=\"110\"></dxi-column>\n <dxi-column dataField=\"projectCode\" caption=\"Proje\" [width]=\"90\"></dxi-column>\n <dxi-column dataField=\"intercompanyId\" caption=\"Intercompany Id\"></dxi-column>\n <!-- Kullan\u0131c\u0131 geri bildirimiyle tespit edildi: \u0130\u015Flem Ge\u00E7mi\u015Fi'nde bir kayd\u0131n normal (Kay\u0131tl\u0131) mi\n yoksa Taslak m\u0131 oldu\u011Fu hi\u00E7 g\u00F6r\u00FCnm\u00FCyordu - Aktar\u0131m Durumu (Durum s\u00FCtunu) ile kar\u0131\u015Ft\u0131r\u0131lmas\u0131n diye\n Kaynak/Hedef Belge Durumu ayr\u0131 s\u00FCtunlar olarak eklendi (bkz. spec \u00A714). -->\n <dxi-column dataField=\"sourceDocumentLifecycle\" caption=\"Kaynak Belge Durumu\" [width]=\"140\">\n <dxo-lookup [dataSource]=\"sourceDocumentLifecycleOptions\" valueExpr=\"value\" displayExpr=\"label\"></dxo-lookup>\n </dxi-column>\n <dxi-column dataField=\"targetDocumentLifecycle\" caption=\"Hedef Belge Durumu\" [width]=\"140\">\n <dxo-lookup [dataSource]=\"sourceDocumentLifecycleOptions\" valueExpr=\"value\" displayExpr=\"label\"></dxo-lookup>\n </dxi-column>\n <dxi-column dataField=\"status\" caption=\"Durum\" cellTemplate=\"transferStatusTemplate\" [width]=\"130\">\n <dxo-lookup [dataSource]=\"transferStatusLookup\" valueExpr=\"value\" displayExpr=\"text\"></dxo-lookup>\n </dxi-column>\n <dxi-column\n dataField=\"creationTime\"\n caption=\"Olu\u015Fturma Tarihi\"\n dataType=\"datetime\"\n format=\"dd.MM.yyyy HH:mm\"\n [width]=\"150\"\n sortOrder=\"desc\"\n ></dxi-column>\n\n <div *dxTemplate=\"let cell of 'viewTemplate'\">\n <button class=\"btn btn-sm btn-outline-secondary\" type=\"button\" (click)=\"toggleActions(cell.data, $event)\">\n \u0130\u015Flemler <i class=\"fa fa-caret-down ms-1\"></i>\n </button>\n </div>\n\n <div *dxTemplate=\"let cell of 'transferStatusTemplate'\">\n <span\n class=\"badge\"\n [class.bg-secondary]=\"cell.value === 0\"\n [class.bg-primary]=\"cell.value === 1\"\n [class.bg-success]=\"cell.value === 2\"\n [class.bg-danger]=\"cell.value === 3\"\n [class.bg-warning]=\"cell.value === 4\"\n >\n {{ transferStatusLabel(cell.value) }}\n </span>\n </div>\n </dx-data-grid>\n </div>\n</div>\n\n<!-- Grid'in DI\u015EINDA: dx-data-grid h\u00FCcrelerinin overflow:hidden k\u0131rpmas\u0131 ve *dxTemplate i\u00E7i olay ba\u011Flama\n sorunlar\u0131 ya\u015Fanmas\u0131n diye \"\u0130\u015Flemler\" men\u00FCs\u00FC buraya, component \u015Fablonunun en \u00FCst seviyesine ta\u015F\u0131nd\u0131. -->\n<ul\n *ngIf=\"openActionsRow as row\"\n class=\"list-unstyled m-0 bg-white border rounded shadow-sm\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"actionsMenuPosition.top\"\n [style.left.px]=\"actionsMenuPosition.left\"\n style=\"z-index: 1050; min-width: 140px; padding: 4px 0\"\n (click)=\"$event.stopPropagation()\"\n>\n <li>\n <button type=\"button\" class=\"d-block w-100 text-start border-0 bg-white px-3 py-1\" (click)=\"selectAction('view', row)\">\n <i class=\"fa fa-eye me-2\"></i>G\u00F6r\u00FCnt\u00FCle\n </button>\n </li>\n <li *ngIf=\"canDeleteTransfer(row)\">\n <button type=\"button\" class=\"d-block w-100 text-start border-0 bg-white px-3 py-1 text-danger\" (click)=\"selectAction('delete', row)\">\n <i class=\"fa fa-trash me-2\"></i>Sil\n </button>\n </li>\n</ul>\n" }]
1069
+ }], ctorParameters: function () { return [{ type: DocumentTransferService }, { type: SapCompanyProfileService }, { type: i1.Router }, { type: i3.ConfirmationService }]; }, propDecorators: { closeActionsMenu: [{
1070
+ type: HostListener,
1071
+ args: ['document:click']
1072
+ }] } });
1073
+
1074
+ const DOCUMENT_TRANSFER_STATUS_DRAFT = 0;
1075
+ const DOCUMENT_TRANSFER_STATUS_COMPLETED = 2;
1076
+ const DOCUMENT_TRANSFER_STATUS_CANCELLED = 4;
1077
+ const DOCUMENT_TRANSFER_LEG_STATUS_PENDING = 0;
1078
+ const DOCUMENT_TRANSFER_LEG_STATUS_SUCCESS = 1;
1079
+ const DOCUMENT_TRANSFER_LEG_STATUS_FAILED = 2;
1080
+ class HitDocumentTransferDetailComponent {
1081
+ constructor(route, router, service, scenarioService, companyService, confirmation) {
1082
+ this.route = route;
1083
+ this.router = router;
1084
+ this.service = service;
1085
+ this.scenarioService = scenarioService;
1086
+ this.companyService = companyService;
1087
+ this.confirmation = confirmation;
1088
+ this.isNew = false;
1089
+ this.newState = null;
1090
+ this.scenarios = [];
1091
+ this.scenarioId = '';
1092
+ this.isFetchingScenario = false;
1093
+ this.companies = [];
1094
+ this.legBehaviors = [
1095
+ { value: LegBehavior.IntermediateChain, label: 'Ara Şirket' },
1096
+ { value: LegBehavior.ConstructionChain, label: 'Construction' },
1097
+ ];
1098
+ // Spec §14 (18.09.2026 kararı) - süreç parametrik. Aktarım henüz oluşturulmadıysa (isNew) kullanıcı bu
1099
+ // ekranda "Hedef Belge Durumu"nu seçebilir (kaynaktan bağımsız). Aktarım oluştuktan sonra bu alan
1100
+ // backend'de sabitlenir (DocumentTransfer.TargetDocumentLifecycle immutable), bu yüzden workingCopy
1101
+ // varken salt-okunur gösterilir. Kullanıcı isteğiyle Kaynak Belge Durumu ile AYNI etiketler kullanılır.
1102
+ this.documentLifecycleOptions = [
1103
+ { value: SapDocumentLifecycle.Posted, label: 'Kayıtlı Müşteri Faturası' },
1104
+ { value: SapDocumentLifecycle.Draft, label: 'Taslak Müşteri Faturası' },
1105
+ ];
1106
+ // Spec ek karar (18.09.2026) - hedef Taslak iken Construction bacağının (OPOR→OPDN→OPCH) taban belge
1107
+ // zinciri taslaklar arasında çalışmaz; bu durumda kullanıcı üç belge tipinden yalnızca birini seçer.
1108
+ this.constructionDraftDocTypeOptions = [
1109
+ { value: ConstructionDraftDocumentType.PurchaseOrder, label: 'OPOR' },
1110
+ { value: ConstructionDraftDocumentType.GoodsReceipt, label: 'OPDN' },
1111
+ { value: ConstructionDraftDocumentType.APInvoice, label: 'OPCH' },
1112
+ ];
1113
+ this.workingCopy = null;
1114
+ this.isLoading = false;
1115
+ this.isStarting = false;
1116
+ this.isExecuting = false;
1117
+ this.isMutatingLegs = false;
1118
+ }
1119
+ ngOnInit() {
1120
+ var _a;
1121
+ this.scenarioService.getList({ maxResultCount: 1000, skipCount: 0, isActive: true }).subscribe(result => (this.scenarios = result.items));
1122
+ this.companyService.getList({ maxResultCount: 1000, skipCount: 0, isActive: true }).subscribe(result => (this.companies = result.items));
1123
+ const id = this.route.snapshot.paramMap.get('id');
1124
+ if (id === 'new') {
1125
+ this.isNew = true;
1126
+ const state = history.state;
1127
+ if (!(state === null || state === void 0 ? void 0 : state.sourceCompanyId) || state.docEntry == null) {
1128
+ // Sayfa doğrudan yenilenmiş/yeni sekmede açılmışsa router state kaybolur; kaynak faturanın
1129
+ // seçilmesi gereken listeye geri yönlendirilir.
1130
+ this.router.navigate(['/fbdocumentflow/document-transfers']);
1131
+ return;
1132
+ }
1133
+ // sourceDocumentLifecycle, Belge Aktarımı listesindeki filtreden gelir ve sabittir (router state hiç
1134
+ // taşınmadıysa - ör. doğrudan bağlantıyla gelinmişse - varsayılan Kayıtlı kabul edilir).
1135
+ // targetDocumentLifecycle ise kullanıcının bu ekranda seçeceği, kaynaktan bağımsız bir değerdir;
1136
+ // başlangıçta varsayılan olarak Kayıtlı gelir, kullanıcı isterse Taslak'a çevirir.
1137
+ this.newState = Object.assign(Object.assign({}, state), { sourceDocumentLifecycle: (_a = state.sourceDocumentLifecycle) !== null && _a !== void 0 ? _a : SapDocumentLifecycle.Posted, targetDocumentLifecycle: SapDocumentLifecycle.Posted });
1138
+ }
1139
+ else if (id) {
1140
+ this.loadWorkingCopy(id);
1141
+ }
1142
+ }
1143
+ companyName() {
1144
+ var _a, _b, _c, _d;
1145
+ return (_d = (_b = (_a = this.newState) === null || _a === void 0 ? void 0 : _a.sourceCompanyName) !== null && _b !== void 0 ? _b : (_c = this.workingCopy) === null || _c === void 0 ? void 0 : _c.sourceCompanyName) !== null && _d !== void 0 ? _d : '';
1146
+ }
1147
+ scenarioName() {
1148
+ var _a, _b, _c;
1149
+ if (!((_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.scenarioId)) {
1150
+ return 'Senaryosuz (yalnızca ilk hedef bacağı)';
1151
+ }
1152
+ return (_c = (_b = this.scenarios.find(s => { var _a; return s.id === ((_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.scenarioId); })) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : this.workingCopy.scenarioId;
1153
+ }
1154
+ // Bir senaryonun ilk bacağı belirli bir kaynak şirket ve hedef şirket için tanımlanmıştır. Spec §3 -
1155
+ // kaynak belgenin ilk hedefi her zaman OINV.CardCode + Muhatap Eşleştirmeleri ile tespit edilir; hazır
1156
+ // senaryo bu hedefi değiştiremez. Bu yüzden hem kaynak şirketi hem de zaten tespit edilmiş ilk hedefi
1157
+ // uyuşmayan senaryolar seçilebilir listeden çıkarılır - aksi halde backend
1158
+ // ScenarioSourceCompanyMismatch/ScenarioFirstTargetMismatch hatası verir.
1159
+ availableScenarios() {
1160
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1161
+ const sourceCompanyId = (_b = (_a = this.newState) === null || _a === void 0 ? void 0 : _a.sourceCompanyId) !== null && _b !== void 0 ? _b : (_c = this.workingCopy) === null || _c === void 0 ? void 0 : _c.sourceCompanyId;
1162
+ const resolvedTargetCompanyId = (_e = (_d = this.newState) === null || _d === void 0 ? void 0 : _d.targetCompanyId) !== null && _e !== void 0 ? _e : (_h = (_g = (_f = this.workingCopy) === null || _f === void 0 ? void 0 : _f.legs) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.targetCompanyId;
1163
+ if (!sourceCompanyId) {
1164
+ return this.scenarios;
1165
+ }
1166
+ return this.scenarios.filter(s => {
1167
+ const firstLeg = [...s.legs].sort((a, b) => a.sequenceNo - b.sequenceNo)[0];
1168
+ if (!firstLeg) {
1169
+ return true;
1170
+ }
1171
+ if (firstLeg.sourceCompanyId !== sourceCompanyId) {
1172
+ return false;
1173
+ }
1174
+ return !resolvedTargetCompanyId || firstLeg.targetCompanyId === resolvedTargetCompanyId;
1175
+ });
1176
+ }
1177
+ isDraft() {
1178
+ var _a, _b;
1179
+ return this.isNew || ((_b = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : DOCUMENT_TRANSFER_STATUS_DRAFT) === DOCUMENT_TRANSFER_STATUS_DRAFT;
1180
+ }
1181
+ // Bekleyen bacaklar ilk kez çalıştırılabilir; hatalı bacaklar da tekrar denenebilir çünkü bu noktada
1182
+ // henüz hiçbir SAP belgesi oluşmamıştır (aksi halde spec §13 gereği tüm zincir iptal edilip yeniden
1183
+ // kurulmalıdır, tek bacak tekrarı değil).
1184
+ // Spec §12-13 - iptal edilmiş (veya tamamlanmış) bir zincir tekrar çalıştırılmaz; kullanıcı yeniden
1185
+ // oluşturma sürecini (kaynak faturadan yeni bir aktarım başlatarak, yeni bir Intercompany Id ile)
1186
+ // başlatır. Bekleyen/Hatalı bir bacak kalmış olsa bile (zincir henüz tüm bacakları çalıştırmadan iptal
1187
+ // edildiyse) bu bacaklar artık çalıştırılamaz - backend da bunu TransferNotEditable ile reddeder,
1188
+ // burada buton en baştan devre dışı bırakılarak kullanıcıya net bir sinyal verilir.
1189
+ canExecuteLeg(leg) {
1190
+ var _a;
1191
+ const transferStatus = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.status;
1192
+ if (transferStatus === DOCUMENT_TRANSFER_STATUS_CANCELLED || transferStatus === DOCUMENT_TRANSFER_STATUS_COMPLETED) {
1193
+ return false;
1194
+ }
1195
+ if (this.isConstructionDraftSelectable(leg) && leg.selectedConstructionDraftDocType == null) {
1196
+ return false;
1197
+ }
1198
+ return leg.status === DOCUMENT_TRANSFER_LEG_STATUS_PENDING || leg.status === DOCUMENT_TRANSFER_LEG_STATUS_FAILED;
1199
+ }
1200
+ // Spec ek karar (18.09.2026) - hedef Taslak iken Construction bacağının OPOR→OPDN→OPCH taban belge
1201
+ // zinciri taslaklar arasında çalışmaz; bu bacaklarda kullanıcı zincir yerine TEK bir belge tipi seçer
1202
+ // (bkz. ExecuteSingleDraftDocumentAsync, backend). Hedef Kayıtlı iken (normal zincir) bu geçerli değildir.
1203
+ isConstructionDraftSelectable(leg) {
1204
+ var _a;
1205
+ return leg.legBehavior === LegBehavior.ConstructionChain && ((_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.targetDocumentLifecycle) === SapDocumentLifecycle.Draft;
1206
+ }
1207
+ hasMissingConstructionDraftSelection() {
1208
+ var _a, _b;
1209
+ return ((_b = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.legs) !== null && _b !== void 0 ? _b : []).some(l => this.isConstructionDraftSelectable(l) && l.selectedConstructionDraftDocType == null);
1210
+ }
1211
+ updateLegConstructionDraftDocType(leg, value) {
1212
+ if (!this.workingCopy) {
1213
+ return;
1214
+ }
1215
+ leg.selectedConstructionDraftDocType = value !== null && value !== void 0 ? value : undefined;
1216
+ this.persistLegChanges();
1217
+ }
1218
+ legTargetDocLabel(leg) {
1219
+ var _a, _b, _c, _d;
1220
+ const isLastLeg = leg.sequenceNo >= ((_b = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.legs.length) !== null && _b !== void 0 ? _b : 0);
1221
+ if (leg.legBehavior === LegBehavior.ConstructionChain) {
1222
+ if (this.isConstructionDraftSelectable(leg)) {
1223
+ const selectedLabel = (_d = (_c = this.constructionDraftDocTypeOptions.find(o => o.value === leg.selectedConstructionDraftDocType)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : 'Seçilmedi';
1224
+ return isLastLeg ? selectedLabel : `${selectedLabel} → OINV`;
1225
+ }
1226
+ return isLastLeg ? 'OPOR → OPDN → OPCH' : 'OPOR → OPDN → OPCH → OINV';
1227
+ }
1228
+ return isLastLeg ? 'OPCH' : 'OPCH → OINV';
1229
+ }
1230
+ // Spec §9 - artırım yalnızca IntermediateChain'de değil, ConstructionChain bacağının (sonraki bacak
1231
+ // varsa) oluşturduğu devam Müşteri Faturasında da uygulanır - önceden yalnızca IntermediateChain
1232
+ // kontrol ediliyordu, bu da bir Construction bacağının hedefinde artırım oranı tanımsızken kullanıcının
1233
+ // hiç uyarılmadan sessizce artırımsız devam edilmesine yol açıyordu (kod incelemesiyle tespit edildi).
1234
+ hasMissingIncreaseRate() {
1235
+ var _a, _b;
1236
+ return ((_b = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.legs) !== null && _b !== void 0 ? _b : []).some(l => (l.legBehavior === LegBehavior.IntermediateChain || l.legBehavior === LegBehavior.ConstructionChain) &&
1237
+ l.plannedIncreaseRate == null);
1238
+ }
1239
+ // NumAtCard girişi yalnızca ara şirket bacaklarından, zincirin SON bacağı OLMAYANLAR için anlamlıdır
1240
+ // (o bacakta aynı şirkette yeni bir Müşteri Faturası oluşuyor ve NumAtCard'ı kullanıcı belirler).
1241
+ hasIntermediateNumAtCardLegs() {
1242
+ var _a, _b;
1243
+ const legs = (_b = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.legs) !== null && _b !== void 0 ? _b : [];
1244
+ return legs.some(l => l.legBehavior === LegBehavior.IntermediateChain && l.sequenceNo < legs.length);
1245
+ }
1246
+ // Spec §4 - kullanıcı çalışma kopyasındaki bacakların hedef şirketini/davranışını (Ara Şirket veya
1247
+ // Construction) değiştirebilmeli; bu değişiklik yalnızca bu aktarımın çalışma kopyasını etkiler, ana
1248
+ // Hazır Senaryo tanımını (varsa) hiç değiştirmez. Kaynak şirket ayrıca düzenlenmez: zincirdeki her
1249
+ // bacağın kaynağı, bir önceki bacağın hedefinden (veya ilk bacaksa aktarımın kendi kaynağından) backend
1250
+ // tarafından otomatik türetilir (bkz. DocumentTransferAppService.AddLegAsync).
1251
+ updateLegTarget(leg, targetCompanyId) {
1252
+ var _a;
1253
+ if (!this.workingCopy) {
1254
+ return;
1255
+ }
1256
+ leg.targetCompanyId = targetCompanyId;
1257
+ leg.targetCompanyName = (_a = this.companies.find(c => c.id === targetCompanyId)) === null || _a === void 0 ? void 0 : _a.companyName;
1258
+ this.persistLegChanges();
1259
+ }
1260
+ updateLegBehavior(leg, legBehavior) {
1261
+ if (!this.workingCopy) {
1262
+ return;
1263
+ }
1264
+ leg.legBehavior = legBehavior;
1265
+ this.persistLegChanges();
1266
+ }
1267
+ // Hedef/Davranış dropdown'ı değiştiğinde yalnızca O bacağı kaydedip sunucudan dönen tam workingCopy'yi
1268
+ // olduğu gibi ekrana yansıtırsak, kullanıcının BAŞKA bir bacağa henüz yazdığı ama henüz senkronize
1269
+ // edilmemiş NumAtCard/Döviz/Kur değerleri (bunlar yalnızca "Çalıştır"/"Başlat" öncesi toplu gönderilir)
1270
+ // sunucudaki eski değerle geri gelen o bacak nesnesi tarafından sessizce ezilir/boşalır - gerçek
1271
+ // ortamda doğrulandı. Bu yüzden dropdown değişikliğinde de TÜM bacaklardaki mevcut değerler
1272
+ // (syncPendingLegChanges ile, sıralı/concurrency-safe) birlikte gönderilir.
1273
+ persistLegChanges() {
1274
+ if (!this.workingCopy) {
1275
+ return;
1276
+ }
1277
+ this.isMutatingLegs = true;
1278
+ this.syncPendingLegChanges(this.workingCopy.legs)
1279
+ .pipe(finalize(() => (this.isMutatingLegs = false)))
1280
+ .subscribe(results => {
1281
+ const last = results === null || results === void 0 ? void 0 : results[results.length - 1];
1282
+ if (last) {
1283
+ this.workingCopy = last;
1284
+ }
1285
+ });
1286
+ }
1287
+ // Zincire yeni bir bacak ekler: kaynağı otomatik olarak son bacağın hedefinden (ilk bacaksa aktarımın
1288
+ // kendi kaynak şirketinden) türetilir. Varsayılan hedef, henüz zincirde olmayan ilk şirkettir; kullanıcı
1289
+ // ekledikten sonra dropdown'lardan hedefi/davranışı değiştirebilir.
1290
+ addLeg() {
1291
+ var _a, _b, _c;
1292
+ if (!this.workingCopy || this.companies.length === 0) {
1293
+ return;
1294
+ }
1295
+ // Yeni bacağın kaynağı backend'de otomatik olarak son bacağın hedefinden türetilir (bkz.
1296
+ // DocumentTransferAppService.AddLegAsync). Varsayılan HEDEF seçilirken bu kaynakla AYNI şirket asla
1297
+ // önerilmemelidir - aksi halde bir şirketin kendi kendine fatura kestiği anlamsız bir bacak oluşur.
1298
+ // Önceden şirket havuzu tükendiğinde (tüm şirketler zaten bir bacakta hedef olarak kullanılmışsa)
1299
+ // fallback doğrudan companies[0]'a düşüyordu; bu tesadüfen kaynakla aynı şirkete denk gelip self-loop
1300
+ // (Kaynak=Hedef) bacak oluşturabiliyordu (kullanıcı geri bildirimiyle tespit edildi).
1301
+ const lastLeg = [...this.workingCopy.legs].sort((a, b) => a.sequenceNo - b.sequenceNo).slice(-1)[0];
1302
+ const newLegSourceCompanyId = (_a = lastLeg === null || lastLeg === void 0 ? void 0 : lastLeg.targetCompanyId) !== null && _a !== void 0 ? _a : this.workingCopy.sourceCompanyId;
1303
+ const usedCompanyIds = new Set(this.workingCopy.legs.map(l => l.targetCompanyId));
1304
+ const defaultTarget = (_c = (_b = this.companies.find(c => !usedCompanyIds.has(c.id) && c.id !== newLegSourceCompanyId)) !== null && _b !== void 0 ? _b : this.companies.find(c => c.id !== newLegSourceCompanyId)) !== null && _c !== void 0 ? _c : this.companies[0];
1305
+ // Önce mevcut bacaklardaki henüz senkronize edilmemiş NumAtCard/Döviz/Kur değerleri kaydedilir -
1306
+ // aksi halde yeni bacak eklendiğinde dönen tam workingCopy, kullanıcının az önce yazdığı ama hiç
1307
+ // sunucuya gönderilmemiş değerleri eski/boş DB değeriyle ezerdi (persistLegChanges ile aynı sorun).
1308
+ this.isMutatingLegs = true;
1309
+ this.syncPendingLegChanges(this.workingCopy.legs)
1310
+ .pipe(switchMap(() => this.service.addLeg(this.workingCopy.id, {
1311
+ targetCompanyId: defaultTarget.id,
1312
+ legBehavior: LegBehavior.IntermediateChain,
1313
+ })), finalize(() => (this.isMutatingLegs = false)))
1314
+ .subscribe(result => (this.workingCopy = result));
1315
+ }
1316
+ // Spec §5 - muhatap eşleştirmesi bulunamayan bacakta kullanıcıdan hedef SAP şirketindeki doğru
1317
+ // Müşteri/Satıcı CardCode seçimi istenecektir; bu, Muhatap Eşleştirmeleri ekranına yönlendirilerek
1318
+ // yaptırılabilir (spec tarafından açıkça izin verilen arayüz seçeneklerinden biri). "Bulunulan Şirket"
1319
+ // burada hedef (OPCH'nin oluşacağı) şirkettir, "İlişkili Şirket" ise kaynak şirkettir - bkz.
1320
+ // ResolveVendorCardCodeAsync(inCompanyId: hedef, forRelatedCompanyId: kaynak).
1321
+ goToPartnerMapping(leg) {
1322
+ this.router.navigate(['/fbdocumentflow/partner-mappings'], {
1323
+ state: { sourceCompanyId: leg.targetCompanyId, relatedCompanyId: leg.sourceCompanyId },
1324
+ });
1325
+ }
1326
+ removeLeg(leg) {
1327
+ if (!this.workingCopy || this.workingCopy.legs.length <= 1) {
1328
+ return;
1329
+ }
1330
+ // Aynı nedenle (bkz. addLeg) silinmeyen diğer bacaklardaki senkronize edilmemiş değerler önce kaydedilir.
1331
+ const remainingLegs = this.workingCopy.legs.filter(l => l.id !== leg.id);
1332
+ this.isMutatingLegs = true;
1333
+ this.syncPendingLegChanges(remainingLegs)
1334
+ .pipe(switchMap(() => this.service.removeLeg(this.workingCopy.id, leg.id)), finalize(() => (this.isMutatingLegs = false)))
1335
+ .subscribe(result => (this.workingCopy = result));
1336
+ }
1337
+ // Yeni bir aktarım için çalışma kopyasını ilk kez oluşturur. Zaten oluşturulmuş ama henüz
1338
+ // çalıştırılmamış (taslak) bir aktarımda senaryo değiştirmek için applyScenario() kullanılır -
1339
+ // örn. "İşlem Geçmişi"nden geri dönülen bir taslak kayıtta.
1340
+ fetchScenario() {
1341
+ if (!this.newState) {
1342
+ return;
1343
+ }
1344
+ this.isFetchingScenario = true;
1345
+ this.service
1346
+ .create({
1347
+ sourceCompanyId: this.newState.sourceCompanyId,
1348
+ sourceOinvDocEntry: this.newState.docEntry,
1349
+ scenarioId: this.scenarioId || undefined,
1350
+ sourceDocumentLifecycle: this.newState.sourceDocumentLifecycle,
1351
+ targetDocumentLifecycle: this.newState.targetDocumentLifecycle,
1352
+ })
1353
+ .pipe(finalize(() => (this.isFetchingScenario = false)))
1354
+ .subscribe(result => {
1355
+ this.workingCopy = result;
1356
+ this.isNew = false;
1357
+ // URL'i oluşan kayda göre değiştir - sayfa yenilenirse veya geri/ileri gidilirse doğru kayıt yüklensin.
1358
+ this.router.navigate(['/fbdocumentflow/document-transfers', result.id], { replaceUrl: true });
1359
+ });
1360
+ }
1361
+ applyScenario() {
1362
+ if (!this.workingCopy) {
1363
+ return;
1364
+ }
1365
+ this.isFetchingScenario = true;
1366
+ this.service
1367
+ .applyScenario(this.workingCopy.id, { scenarioId: this.scenarioId || undefined })
1368
+ .pipe(finalize(() => (this.isFetchingScenario = false)))
1369
+ .subscribe(result => {
1370
+ var _a;
1371
+ this.workingCopy = result;
1372
+ this.scenarioId = (_a = result.scenarioId) !== null && _a !== void 0 ? _a : '';
1373
+ });
1374
+ }
1375
+ loadWorkingCopy(id) {
1376
+ this.isLoading = true;
1377
+ this.service
1378
+ .get(id)
1379
+ .pipe(finalize(() => (this.isLoading = false)))
1380
+ .subscribe(result => {
1381
+ var _a;
1382
+ this.workingCopy = result;
1383
+ this.scenarioId = (_a = result.scenarioId) !== null && _a !== void 0 ? _a : '';
1384
+ });
1385
+ }
1386
+ buildLegUpdateInput(leg) {
1387
+ return {
1388
+ targetCompanyId: leg.targetCompanyId,
1389
+ legBehavior: leg.legBehavior,
1390
+ numAtCard: leg.numAtCard,
1391
+ currency: leg.currency,
1392
+ exchangeRate: leg.exchangeRate,
1393
+ freightAmount: leg.freightAmount,
1394
+ selectedConstructionDraftDocType: leg.selectedConstructionDraftDocType,
1395
+ };
1396
+ }
1397
+ // NumAtCard/Döviz/Kur alanları kullanıcı yazarken/alanı terk ederken ayrı bir "kaydet" isteği
1398
+ // göndermiyor (bu, art arda hızlı isteklerin ConcurrencyStamp yarış durumuna - AbpDbConcurrencyException,
1399
+ // "veri başka bir kullanıcı tarafından değiştirilmiş" - yol açtığı gerçek ortamda gözlemlendi). Bunun
1400
+ // yerine ekrandaki değerler yalnızca "Çalıştır"/"Belge Akışını Başlat" tetiklendiği anda, o çağrıdan
1401
+ // hemen önce tek seferde backend'e senkronize edilir. Spec §10 - döviz/kur her bacak için (Construction
1402
+ // dahil, son bacak dahil) geçerli olduğundan NumAtCard'ın aksine davranış/sıra bazlı filtrelenmez.
1403
+ syncPendingLegChanges(legs) {
1404
+ // Zaten Başarılı (Success) olmuş bir bacak backend'de artık düzenlenemez (EnsureLegIsEditable,
1405
+ // FBDocumentFlow:010017 "LegAlreadySucceeded" fırlatır) - bu fonksiyona önceden TÜM bacaklar
1406
+ // (zaten başarılı olanlar dahil) gönderiliyordu. Bu, örn. bir zincirde 1-2. bacak Başarılı, 3. bacak
1407
+ // Hatalı iken 3. bacağı tekrar "Çalıştır"a basmayı TAMAMEN imkansız hale getiriyordu - senkronizasyon
1408
+ // adımı, henüz 3. bacağa hiç sıra gelmeden, zaten başarılı 1. bacakta bu hatayla patlıyordu (gerçek
1409
+ // ortamda gözlemlendi). Yalnızca hâlâ düzenlenebilir (Success olmayan) bacaklar senkronize edilir.
1410
+ const editableLegs = legs.filter(l => l.status !== DOCUMENT_TRANSFER_LEG_STATUS_SUCCESS);
1411
+ if (!this.workingCopy || editableLegs.length === 0) {
1412
+ return of(null);
1413
+ }
1414
+ // Bacaklar aynı DocumentTransfer (aggregate root) kaydını paylaştığı için forkJoin ile paralel
1415
+ // gönderilirse her istek aynı ConcurrencyStamp'i yükler; ilk kaydeden dışındakiler
1416
+ // AbpDbConcurrencyException ("veri başka bir kullanıcı/istemci tarafından değiştirilmiş") alır -
1417
+ // gerçek ortamda doğrulandı. concatMap ile sırayla gönderilir, her istek bir öncekinin
1418
+ // kaydettiği güncel stamp üzerinden devam eder.
1419
+ return from(editableLegs).pipe(concatMap(leg => this.service.updateLeg(this.workingCopy.id, leg.id, this.buildLegUpdateInput(leg))), toArray());
1420
+ }
1421
+ backToList() {
1422
+ var _a, _b, _c;
1423
+ const sourceCompanyId = (_b = (_a = this.newState) === null || _a === void 0 ? void 0 : _a.sourceCompanyId) !== null && _b !== void 0 ? _b : (_c = this.workingCopy) === null || _c === void 0 ? void 0 : _c.sourceCompanyId;
1424
+ this.router.navigate(['/fbdocumentflow/document-transfers'], {
1425
+ state: sourceCompanyId ? { sourceCompanyId } : undefined,
1426
+ });
1427
+ }
1428
+ startFlow() {
1429
+ if (!this.workingCopy) {
1430
+ return;
1431
+ }
1432
+ // Spec §9 - U_Oran tanımsızken akış bloklanmaz; ancak kullanıcının bunu bilerek onaylaması gerekir.
1433
+ if (this.hasMissingIncreaseRate()) {
1434
+ this.confirmation
1435
+ .warn('Bu şirkette bu proje için artırım oranı tanımlı değildir. Artırım uygulanmadan devam etmek istiyor musunuz?', 'FBDocumentFlow::AreYouSure')
1436
+ .subscribe(status => {
1437
+ if (status === Confirmation.Status.confirm) {
1438
+ this.executeStartFlow();
1439
+ }
1440
+ });
1441
+ return;
1442
+ }
1443
+ this.executeStartFlow();
1444
+ }
1445
+ executeStartFlow() {
1446
+ if (!this.workingCopy) {
1447
+ return;
1448
+ }
1449
+ this.isStarting = true;
1450
+ this.syncPendingLegChanges(this.workingCopy.legs)
1451
+ .pipe(switchMap(() => this.service.executeAll(this.workingCopy.id)), finalize(() => (this.isStarting = false)))
1452
+ .subscribe({
1453
+ next: result => (this.workingCopy = result),
1454
+ // ABP zaten başarısız HTTP çağrılarında genel bir hata diyaloğu gösterir.
1455
+ error: () => {
1456
+ this.isStarting = false;
1457
+ },
1458
+ });
1459
+ }
1460
+ // Yalnızca [leg] (çalıştırılan bacak) senkronize edilirse, kullanıcının BAŞKA bir bacağa yazdığı ama
1461
+ // henüz gönderilmemiş NumAtCard/Döviz/Kur değerleri hiç kaydedilmeden kalır - ardından çağrılan
1462
+ // loadWorkingCopy() sunucudaki eski (boş) değerle o bacağı ezer, kullanıcı yazdığı değeri kaybeder
1463
+ // (gerçek ortamda doğrulandı, executeStartFlow'daki gibi TÜM bacaklar senkronize edilmeli).
1464
+ executeLeg(leg) {
1465
+ if (!this.workingCopy || !this.canExecuteLeg(leg)) {
1466
+ return;
1467
+ }
1468
+ this.isExecuting = true;
1469
+ this.syncPendingLegChanges(this.workingCopy.legs)
1470
+ .pipe(switchMap(() => this.service.executeLeg(this.workingCopy.id, leg.id)), finalize(() => (this.isExecuting = false)))
1471
+ .subscribe(() => this.loadWorkingCopy(this.workingCopy.id));
1472
+ }
1473
+ // "Zinciri İptal Et" yalnızca fiilen iptal edilecek bir şey varken (Devam Ediyor/Hatalı) anlamlıdır;
1474
+ // zaten İptal Edildi veya Tamamlandı durumundaki bir aktarımda tekrar gösterilmesi kullanıcıyı
1475
+ // yanıltır (spec §12-13 - iptal edilmiş bir zincir tekrar işleme alınmaz, yeniden oluşturma sürecine
1476
+ // kaynak faturadan yeni bir aktarımla girilir).
1477
+ canCancelChain() {
1478
+ var _a;
1479
+ const status = (_a = this.workingCopy) === null || _a === void 0 ? void 0 : _a.status;
1480
+ return status === 1 || status === 3; // 1=Devam Ediyor, 3=Hatalı
1481
+ }
1482
+ cancelChain() {
1483
+ if (!this.workingCopy) {
1484
+ return;
1485
+ }
1486
+ this.confirmation.warn('FBDocumentFlow::DeleteConfirmationMessage', 'FBDocumentFlow::AreYouSure').subscribe(status => {
1487
+ if (status === Confirmation.Status.confirm && this.workingCopy) {
1488
+ // İptalden sonra bu sayfada kalmak yerine listeye dönülür - backToList() zaten seçili kaynak
1489
+ // şirketi router state ile taşıyıp liste ekranında aynı şirketin seçili kalmasını sağlıyor.
1490
+ this.service.cancelChain(this.workingCopy.intercompanyId).subscribe(() => {
1491
+ this.backToList();
1492
+ });
1493
+ }
1494
+ });
1495
+ }
1496
+ statusLabel(status) {
1497
+ var _a;
1498
+ return (_a = ['İşlem Bekliyor', 'Devam Ediyor', 'Tamamlandı', 'Hatalı', 'İptal Edildi'][status]) !== null && _a !== void 0 ? _a : String(status);
1499
+ }
1500
+ // Spec §14 (18.09.2026 kararı) - süreç parametrik; Kaynak ve Hedef Belge Durumu için AYNI etiket
1501
+ // kullanılır (kullanıcı isteğiyle netleştirildi).
1502
+ sourceDocumentLifecycleLabel(lifecycle) {
1503
+ if (lifecycle == null) {
1504
+ return '';
1505
+ }
1506
+ return lifecycle === SapDocumentLifecycle.Draft ? 'Taslak Müşteri Faturası' : 'Kayıtlı Müşteri Faturası';
1507
+ }
1508
+ legStatusLabel(status) {
1509
+ var _a;
1510
+ return (_a = ['Bekliyor', 'Başarılı', 'Hatalı', 'Atlandı'][status]) !== null && _a !== void 0 ? _a : String(status);
1511
+ }
1512
+ // Bir bacakta (özellikle Construction: OPOR→OPDN→OPCH, veya Ara Şirket'te devam OINV oluştuğunda)
1513
+ // BİRDEN FAZLA SAP belgesi oluşabilir; önceden yalnızca "son" belge (leg.createdDocType/createdDocEntry)
1514
+ // gösteriliyordu, diğerleri (OPOR/OPDN, devam OINV) DTO'da vardı ama ekranda hiç görünmüyordu.
1515
+ // Sonuç belge etiketleri (spec §15 - Teknik SAP B1 Alanları tablosundaki nesne kısaltmalarıyla birebir):
1516
+ // OPOR/OPDN/OPCH/OINV. Önceden burada leg.createdDocType (backend'de her zaman ham SAP Service Layer
1517
+ // entity set adı "PurchaseInvoices" olarak sabit) doğrudan gösteriliyordu - OPOR/OPDN gibi kısa SAP
1518
+ // kodlarıyla aynı satırda karışık görünüp anlam karmaşasına yol açıyordu (kullanıcı geri bildirimiyle
1519
+ // tespit edildi). Artık tüm belge tipleri aynı kısaltma setiyle, tutarlı şekilde gösteriliyor.
1520
+ // Ekranda gösterilecek belge numarası her zaman DocNum üzerinden yürür (kullanıcı geri bildirimiyle
1521
+ // netleştirildi) - DocEntry (SAP'ın dahili anahtarı) yalnızca fallback'tir, DocNum bir sebeple
1522
+ // yakalanamadıysa (ör. çok eski bir kayıt) belge tamamen kaybolmuş görünmesin diye.
1523
+ createdDocumentsSummary(leg) {
1524
+ var _a, _b, _c, _d;
1525
+ const parts = [];
1526
+ if (leg.createdPurchaseOrderDocEntry) {
1527
+ parts.push(`OPOR ${(_a = leg.createdPurchaseOrderDocNum) !== null && _a !== void 0 ? _a : leg.createdPurchaseOrderDocEntry}`);
1528
+ }
1529
+ if (leg.createdGoodsReceiptDocEntry) {
1530
+ parts.push(`OPDN ${(_b = leg.createdGoodsReceiptDocNum) !== null && _b !== void 0 ? _b : leg.createdGoodsReceiptDocEntry}`);
1531
+ }
1532
+ if (leg.createdDocEntry) {
1533
+ parts.push(`OPCH ${(_c = leg.createdDocNum) !== null && _c !== void 0 ? _c : leg.createdDocEntry}`);
1534
+ }
1535
+ if (leg.createdInternalOinvDocEntry) {
1536
+ parts.push(`OINV ${(_d = leg.createdInternalOinvDocNum) !== null && _d !== void 0 ? _d : leg.createdInternalOinvDocEntry}`);
1537
+ }
1538
+ return parts.join(' → ');
1539
+ }
1540
+ }
1541
+ HitDocumentTransferDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferDetailComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1.Router }, { token: DocumentTransferService }, { token: DocumentScenarioService }, { token: SapCompanyProfileService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
1542
+ HitDocumentTransferDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HitDocumentTransferDetailComponent, selector: "hit-document-transfer-detail", ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">Belge Ak\u0131\u015F\u0131 / Intercompany Aktar\u0131m\u0131</h5>\n </div>\n <div class=\"col-auto\">\n <button class=\"btn btn-sm btn-outline-secondary\" (click)=\"backToList()\">\n <i class=\"fa fa-arrow-left me-1\"></i>Listeye D\u00F6n\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <ng-container *ngIf=\"!isLoading\">\n <!-- Bu sat\u0131r hem \"yeni\" (hen\u00FCz kay\u0131t olu\u015Fmam\u0131\u015F) hem de kay\u0131t olu\u015Ftuktan sonraki taslak durumunda\n AYNI alan setini g\u00F6sterir - kay\u0131t olu\u015Funca ekran\u0131n alan seti de\u011Fi\u015Fip kullan\u0131c\u0131da \"ba\u015Fka bir\n kay\u0131t m\u0131 bu\" izlenimi vermesin diye. De\u011Ferler \u00F6nce newState'ten (istemcide tutulan \u00F6nizleme),\n o yoksa olu\u015Fan kayd\u0131n ilk baca\u011F\u0131ndan (workingCopy.legs[0]) okunur - ilk bacak her zaman\n newState'in temsil etti\u011Fi \"ilk hedef\" ad\u0131m\u0131yla ayn\u0131 belgedir. -->\n <div class=\"row g-3 mb-3\" *ngIf=\"newState || workingCopy\">\n <div class=\"col-md-3\">\n <label class=\"form-label\">Kaynak \u015Eirket</label>\n <input type=\"text\" class=\"form-control\" [value]=\"companyName()\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">Belge No</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.docNum ?? workingCopy?.sourceOinvDocNum\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">NumAtCard</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.numAtCard ?? workingCopy?.sourceOinvNumAtCard\" disabled />\n </div>\n <div class=\"col-md-1\">\n <label class=\"form-label\">Proje</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.projectCode ?? workingCopy?.projectCode\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">\u0130lk Hedef</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.targetCompanyName ?? workingCopy?.legs?.[0]?.targetCompanyName\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">D\u00F6viz</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.currency ?? workingCopy?.legs?.[0]?.currency\" disabled />\n </div>\n </div>\n\n <!-- Belge Durumu her zaman (yeni kay\u0131tta da) g\u00F6r\u00FCn\u00FCr; Intercompany Id/Aktar\u0131m Durumu/Senaryo yaln\u0131zca\n kay\u0131t olu\u015Ftuktan sonra vard\u0131r - kullan\u0131c\u0131 iste\u011Fiyle hepsi ayn\u0131 sat\u0131rda, Belge Durumu'nun yan\u0131na\n topland\u0131 (\u00F6nceden Intercompany Id/Aktar\u0131m Durumu ayr\u0131 bir sat\u0131rdayd\u0131). -->\n <div class=\"row g-3 mb-3\" *ngIf=\"newState || workingCopy\">\n <div class=\"col-md-2\">\n <label class=\"form-label\">Kaynak Belge Durumu</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [value]=\"sourceDocumentLifecycleLabel(newState?.sourceDocumentLifecycle ?? workingCopy?.sourceDocumentLifecycle)\"\n disabled\n />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">Hedef Belge Durumu</label>\n <!-- Aktar\u0131m hen\u00FCz olu\u015Fturulmad\u0131ysa (isNew) burada se\u00E7ilebilir - kaynaktan ba\u011F\u0131ms\u0131z bir karard\u0131r\n (kullan\u0131c\u0131 geri bildirimiyle netle\u015Ftirildi: kayna\u011F\u0131n modu sabit, hedefin modu burada se\u00E7ilir).\n Olu\u015Ftuktan sonra backend'de sabitlendi\u011Fi i\u00E7in (workingCopy) salt-okunur g\u00F6sterilir. -->\n <select *ngIf=\"isNew && newState\" class=\"form-select\" [(ngModel)]=\"newState.targetDocumentLifecycle\">\n <option *ngFor=\"let o of documentLifecycleOptions\" [ngValue]=\"o.value\">{{ o.label }}</option>\n </select>\n <input\n *ngIf=\"!isNew || !newState\"\n type=\"text\"\n class=\"form-control\"\n [value]=\"sourceDocumentLifecycleLabel(newState?.targetDocumentLifecycle ?? workingCopy?.targetDocumentLifecycle)\"\n disabled\n />\n </div>\n <div class=\"col-md-3\" *ngIf=\"workingCopy\">\n <label class=\"form-label\">Intercompany Id</label>\n <input type=\"text\" class=\"form-control\" [value]=\"workingCopy.intercompanyId\" disabled />\n </div>\n <div class=\"col-md-2\" *ngIf=\"workingCopy\">\n <label class=\"form-label\">Aktar\u0131m Durumu</label>\n <input type=\"text\" class=\"form-control\" [value]=\"statusLabel(workingCopy.status)\" disabled />\n </div>\n <!-- Senaryo, aktar\u0131m hen\u00FCz \u00E7al\u0131\u015Ft\u0131r\u0131lmam\u0131\u015Fken (isDraft()) alt\u0131ndaki \"Haz\u0131r Senaryo\" dropdown'\u0131nda\n zaten d\u00FCzenlenebilir/g\u00F6r\u00FCn\u00FCr durumda - ayn\u0131 bilgiyi burada salt-okunur tekrar g\u00F6stermek\n (kullan\u0131c\u0131 geri bildirimiyle tespit edildi) kafa kar\u0131\u015Ft\u0131r\u0131yordu. Yaln\u0131zca aktar\u0131m art\u0131k\n d\u00FCzenlenemez hale geldi\u011Finde (dropdown kayboldu\u011Funda) burada g\u00F6sterilir. -->\n <div class=\"col-md-3\" *ngIf=\"workingCopy && !isDraft()\">\n <label class=\"form-label\">Senaryo</label>\n <input type=\"text\" class=\"form-control\" [value]=\"scenarioName()\" disabled />\n </div>\n </div>\n\n <!-- Taslak: haz\u0131r senaryo se\u00E7imi, hen\u00FCz \u00E7al\u0131\u015Ft\u0131r\u0131lmad\u0131. -->\n <ng-container *ngIf=\"isDraft()\">\n <div class=\"row g-3 align-items-end mb-3\">\n <div class=\"col-md-4\">\n <label class=\"form-label\">Haz\u0131r Senaryo</label>\n <select class=\"form-select\" [(ngModel)]=\"scenarioId\">\n <option [ngValue]=\"''\">Senaryosuz (yaln\u0131zca ilk hedef baca\u011F\u0131)</option>\n <option *ngFor=\"let s of availableScenarios()\" [ngValue]=\"s.id\">{{ s.name }}</option>\n </select>\n </div>\n <div class=\"col-md-2\">\n <button\n class=\"btn btn-outline-primary\"\n (click)=\"isNew ? fetchScenario() : applyScenario()\"\n [disabled]=\"isFetchingScenario\"\n >\n <span *ngIf=\"isFetchingScenario\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ isNew ? 'Senaryoyu Getir' : 'Senaryoyu Uygula' }}\n </button>\n </div>\n </div>\n </ng-container>\n\n <!-- NumAtCard alanlar\u0131 art\u0131k isDraft()'a ba\u011Fl\u0131 DE\u011E\u0130L: taslakta d\u00FCzenlenebilir, \u00E7al\u0131\u015Ft\u0131r\u0131ld\u0131ktan\n sonra (isDraft() false olsa da) salt-okunur olarak ekranda kal\u0131r - \"Haz\u0131r Senaryo\" blo\u011Fuyla\n birlikte tamamen kaybolmas\u0131n diye. -->\n <ng-container *ngIf=\"workingCopy\">\n <div class=\"row g-3 align-items-end mb-3\" *ngIf=\"hasIntermediateNumAtCardLegs()\">\n <div class=\"col-md-3\" *ngFor=\"let leg of workingCopy.legs\">\n <ng-container *ngIf=\"leg.legBehavior === 0 && leg.sequenceNo < workingCopy.legs.length\">\n <label class=\"form-label\">{{ leg.sequenceNo }}. Bacak - {{ leg.targetCompanyName }} M\u00FC\u015Fteri Faturas\u0131 NumAtCard</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"leg.numAtCard\" [disabled]=\"!isDraft()\" />\n </ng-container>\n </div>\n </div>\n\n <div class=\"alert alert-warning\" *ngIf=\"isDraft() && hasMissingIncreaseRate()\">\n Uyar\u0131: \u0130lgili \u015Firkette/projede art\u0131r\u0131m oran\u0131 0 / NULL. Art\u0131r\u0131m uygulanmadan devam etmek istiyor musunuz?\n </div>\n\n <div class=\"alert alert-warning\" *ngIf=\"isDraft() && hasMissingConstructionDraftSelection()\">\n Uyar\u0131: Hedef Belge Durumu Taslak oldu\u011Funda Construction bacaklar\u0131nda OPOR \u2192 OPDN \u2192 OPCH zinciri taslak belgeler aras\u0131nda\n \u00E7al\u0131\u015Fmaz. \"Hedefte Olu\u015Facak\" s\u00FCtunundan bu bacaklar i\u00E7in tek bir belge tipi (OPOR / OPDN / OPCH) se\u00E7melisiniz.\n </div>\n </ng-container>\n\n <!-- Tek tablo: taslakta da, \u00E7al\u0131\u015Ft\u0131r\u0131ld\u0131ktan sonra da AYNI s\u00FCtun seti (S\u0131ra..Art\u0131r\u0131m) korunur;\n Durum/Sonu\u00E7 Belge/Hata/\u00C7al\u0131\u015Ft\u0131r yaln\u0131zca \u00E7al\u0131\u015Ft\u0131r\u0131ld\u0131ktan sonra, her sat\u0131r\u0131n ALTINA ikinci bir\n sat\u0131r olarak eklenir - eskiden bu bilgiler ayr\u0131 ve daha dar bir tabloya ge\u00E7ilerek g\u00F6steriliyordu,\n bu da Kaynak Belge/Hedefte Olu\u015Facak gibi s\u00FCtunlar\u0131n \"kaybolmu\u015F\" g\u00F6r\u00FCnmesine yol a\u00E7\u0131yordu. -->\n <ng-container *ngIf=\"workingCopy\">\n <div class=\"d-flex justify-content-between align-items-center mb-2\">\n <div>\n <h6 class=\"mb-0\">{{ isDraft() ? 'Senaryo \u00C7al\u0131\u015Fma Kopyas\u0131' : 'Aktar\u0131m Sonucu' }}</h6>\n <small class=\"text-muted\" *ngIf=\"isDraft()\">Bu tablo yaln\u0131zca \u00E7al\u0131\u015Fma kopyas\u0131n\u0131 d\u00FCzenler; ana senaryoyu de\u011Fi\u015Ftirmez.</small>\n </div>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"addLeg()\" *ngIf=\"isDraft()\" [disabled]=\"isMutatingLegs\">\n <i class=\"fa fa-plus me-1\"></i>Bacak Ekle\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"cancelChain()\" *ngIf=\"canCancelChain()\">\n <i class=\"fa fa-ban me-1\"></i>Zinciri \u0130ptal Et\n </button>\n </div>\n\n <div class=\"alert alert-secondary small\" *ngIf=\"workingCopy.status === 4\">\n Bu zincir iptal edildi, bacaklar\u0131 art\u0131k \u00E7al\u0131\u015Ft\u0131r\u0131lamaz/d\u00FCzenlenemez. Yeniden denemek i\u00E7in\n \"Listeye D\u00F6n\"den kaynak faturay\u0131 tekrar se\u00E7ip yeni bir aktar\u0131m ba\u015Flat\u0131n - bu, yeni bir Intercompany Id ile\n \u00E7al\u0131\u015F\u0131r.\n </div>\n\n <div class=\"table-responsive\">\n <table class=\"table table-sm table-bordered align-middle\">\n <thead>\n <tr>\n <th>S\u0131ra</th>\n <th>Kaynak</th>\n <th>Kaynak Belge</th>\n <th>Hedef</th>\n <th>Davran\u0131\u015F</th>\n <th>Hedefte Olu\u015Facak</th>\n <th>OPCH CardCode</th>\n <th>D\u00F6viz</th>\n <th>Kur</th>\n <th>Art\u0131r\u0131m</th>\n <th *ngIf=\"isDraft()\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let leg of workingCopy.legs\">\n <tr>\n <td>{{ leg.sequenceNo }}</td>\n <td>{{ leg.sourceCompanyName }}</td>\n <td>OINV</td>\n <td>\n <select\n *ngIf=\"isDraft(); else targetText\"\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.targetCompanyId\"\n (ngModelChange)=\"updateLegTarget(leg, $event)\"\n [disabled]=\"isMutatingLegs\"\n >\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n <ng-template #targetText>{{ leg.targetCompanyName }}</ng-template>\n </td>\n <td>\n <select\n *ngIf=\"isDraft(); else behaviorText\"\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.legBehavior\"\n (ngModelChange)=\"updateLegBehavior(leg, $event)\"\n [disabled]=\"isMutatingLegs\"\n >\n <option *ngFor=\"let b of legBehaviors\" [ngValue]=\"b.value\">{{ b.label }}</option>\n </select>\n <ng-template #behaviorText>{{ legBehaviors[leg.legBehavior]?.label }}</ng-template>\n </td>\n <td>\n <select\n *ngIf=\"isDraft() && isConstructionDraftSelectable(leg); else targetDocText\"\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.selectedConstructionDraftDocType\"\n (ngModelChange)=\"updateLegConstructionDraftDocType(leg, $event)\"\n [disabled]=\"isMutatingLegs\"\n >\n <option [ngValue]=\"null\">Se\u00E7iniz...</option>\n <option *ngFor=\"let o of constructionDraftDocTypeOptions\" [ngValue]=\"o.value\">{{ o.label }}</option>\n </select>\n <ng-template #targetDocText>{{ legTargetDocLabel(leg) }}</ng-template>\n </td>\n <td>\n <span *ngIf=\"leg.resolvedOpchCardCode\">{{ leg.resolvedOpchCardCode }}</span>\n <div *ngIf=\"!leg.resolvedOpchCardCode\" class=\"d-flex flex-column align-items-start py-1\">\n <span class=\"badge bg-danger\">E\u015Fle\u015Ftirilmedi</span>\n <button\n type=\"button\"\n class=\"btn btn-outline-danger btn-sm mt-2 py-0 px-2\"\n style=\"font-size: 0.72rem\"\n (click)=\"goToPartnerMapping(leg)\"\n title=\"Muhatap E\u015Fle\u015Ftirmeleri ekran\u0131na git\"\n >\n <i class=\"fa fa-link me-1\"></i>E\u015Fle\u015Ftir\n </button>\n </div>\n </td>\n <td>\n <input\n *ngIf=\"isDraft(); else currencyText\"\n type=\"text\"\n class=\"form-control form-control-sm\"\n style=\"width: 5.5rem\"\n [(ngModel)]=\"leg.currency\"\n [placeholder]=\"newState?.currency || 'Kaynaktan'\"\n />\n <ng-template #currencyText>{{ leg.currency || newState?.currency }}</ng-template>\n </td>\n <td>\n <input\n *ngIf=\"isDraft(); else rateText\"\n type=\"number\"\n class=\"form-control form-control-sm\"\n style=\"width: 6rem\"\n [(ngModel)]=\"leg.exchangeRate\"\n placeholder=\"Kaynaktan\"\n />\n <ng-template #rateText>{{ leg.exchangeRate ?? '-' }}</ng-template>\n </td>\n <!-- Spec \u00A79 - art\u0131r\u0131m YALNIZCA bu baca\u011F\u0131n olu\u015Fturdu\u011Fu devam M\u00FC\u015Fteri Faturas\u0131na (bir\n sonraki bacak varsa) uygulan\u0131r; bu hem IntermediateChain hem ConstructionChain i\u00E7in\n ge\u00E7erlidir (Construction'da da nextTargetCompanyId.HasValue ise devam OINV'i\n art\u0131r\u0131mla olu\u015Fturuluyor). \u00D6nceden Construction bacaklar\u0131 legBehavior'a bak\u0131larak\n KO\u015EULSUZ \"-\" g\u00F6steriyordu - zincirin SON baca\u011F\u0131 olmayan bir Construction baca\u011F\u0131n\u0131n\n hedefinde art\u0131r\u0131m oran\u0131 tan\u0131ms\u0131zken kullan\u0131c\u0131 hi\u00E7 uyar\u0131lm\u0131yordu (kod incelemesiyle\n tespit edildi). Do\u011Fru ko\u015Ful \"zincirin son baca\u011F\u0131 m\u0131\" (legTargetDocLabel'daki\n isLastLeg ile ayn\u0131 mant\u0131k), legBehavior de\u011Fil. -->\n <td>\n <span *ngIf=\"leg.sequenceNo >= (workingCopy?.legs?.length ?? 0)\">-</span>\n <ng-container *ngIf=\"leg.sequenceNo < (workingCopy?.legs?.length ?? 0)\">\n <span *ngIf=\"leg.increaseRateApplied ?? leg.plannedIncreaseRate as rate\">{{ rate | number: '1.2-2' }}</span>\n <span\n class=\"text-danger\"\n *ngIf=\"!(leg.increaseRateApplied ?? leg.plannedIncreaseRate)\"\n title=\"Bu \u015Firkette bu proje i\u00E7in art\u0131r\u0131m oran\u0131 tan\u0131ml\u0131 de\u011Fildir. Art\u0131r\u0131m uygulanmadan devam edilecektir.\"\n >\n Tan\u0131ms\u0131z\n </span>\n </ng-container>\n </td>\n <td *ngIf=\"isDraft()\">\n <button\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"removeLeg(leg)\"\n [disabled]=\"isMutatingLegs || workingCopy.legs.length <= 1\"\n title=\"Baca\u011F\u0131 Sil\"\n >\n <i class=\"fa fa-trash\"></i>\n </button>\n </td>\n </tr>\n <tr class=\"table-light\" *ngIf=\"!isDraft()\">\n <td></td>\n <td colspan=\"9\">\n <div class=\"d-flex align-items-center flex-wrap gap-3\">\n <span>\n <strong>Durum:</strong>\n <span\n class=\"badge ms-1\"\n [class.bg-secondary]=\"leg.status === 0\"\n [class.bg-success]=\"leg.status === 1\"\n [class.bg-danger]=\"leg.status === 2\"\n [class.bg-warning]=\"leg.status === 3\"\n >\n {{ legStatusLabel(leg.status) }}\n </span>\n </span>\n <span *ngIf=\"createdDocumentsSummary(leg) as docs\"><strong>Sonu\u00E7 Belge(ler):</strong> {{ docs }}</span>\n <span class=\"text-danger\" *ngIf=\"leg.errorMessage\"><strong>Hata:</strong> {{ leg.errorMessage }}</span>\n <button\n class=\"btn btn-sm btn-outline-primary ms-auto\"\n (click)=\"executeLeg(leg)\"\n [disabled]=\"isExecuting || !canExecuteLeg(leg)\"\n >\n <span *ngIf=\"isExecuting\" class=\"spinner-border spinner-border-sm me-1\"></span>\n \u00C7al\u0131\u015Ft\u0131r\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <ul class=\"text-muted small\" *ngIf=\"isDraft()\">\n <li>\u015Eirketler aras\u0131 OINV \u2192 OPCH ge\u00E7i\u015Finde kaynak NumAtCard hedef OPCH.NumAtCard alan\u0131na aynen ta\u015F\u0131n\u0131r.</li>\n <li>Art\u0131r\u0131m yaln\u0131zca ayn\u0131 \u015Firket i\u00E7inde olu\u015Fturulan yeni M\u00FC\u015Fteri Faturas\u0131na uygulan\u0131r; navlun art\u0131r\u0131m oran\u0131ndan etkilenmez.</li>\n <li>Muhatap kodlar\u0131 Muhatap E\u015Fle\u015Ftirmeleri \u00FCzerinden \u00E7\u00F6z\u00FCl\u00FCr. Kur kaynak belgeden gelir ve kullan\u0131c\u0131 taraf\u0131ndan de\u011Fi\u015Ftirilebilir.</li>\n </ul>\n </ng-container>\n\n <div class=\"d-flex justify-content-end gap-2 mt-3\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"backToList()\">{{ isDraft() ? 'Vazge\u00E7' : 'Kapat' }}</button>\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"startFlow()\"\n *ngIf=\"isDraft() && workingCopy\"\n [disabled]=\"isStarting || hasMissingConstructionDraftSelection()\"\n >\n <span *ngIf=\"isStarting\" class=\"spinner-border spinner-border-sm me-1\"></span>\n Belge Ak\u0131\u015F\u0131n\u0131 Ba\u015Flat\n </button>\n </div>\n </ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i4.DecimalPipe, name: "number" }] });
1543
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferDetailComponent, decorators: [{
1544
+ type: Component,
1545
+ args: [{ selector: 'hit-document-transfer-detail', template: "<div class=\"card\">\n <div class=\"card-header py-3\">\n <div class=\"row align-items-center\">\n <div class=\"col\">\n <h5 class=\"card-title mb-0\">Belge Ak\u0131\u015F\u0131 / Intercompany Aktar\u0131m\u0131</h5>\n </div>\n <div class=\"col-auto\">\n <button class=\"btn btn-sm btn-outline-secondary\" (click)=\"backToList()\">\n <i class=\"fa fa-arrow-left me-1\"></i>Listeye D\u00F6n\n </button>\n </div>\n </div>\n </div>\n <div class=\"card-body pt-3\">\n <div *ngIf=\"isLoading\" class=\"text-center py-5\">\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\n <div class=\"mt-2 text-muted\">Y\u00FCkleniyor...</div>\n </div>\n\n <ng-container *ngIf=\"!isLoading\">\n <!-- Bu sat\u0131r hem \"yeni\" (hen\u00FCz kay\u0131t olu\u015Fmam\u0131\u015F) hem de kay\u0131t olu\u015Ftuktan sonraki taslak durumunda\n AYNI alan setini g\u00F6sterir - kay\u0131t olu\u015Funca ekran\u0131n alan seti de\u011Fi\u015Fip kullan\u0131c\u0131da \"ba\u015Fka bir\n kay\u0131t m\u0131 bu\" izlenimi vermesin diye. De\u011Ferler \u00F6nce newState'ten (istemcide tutulan \u00F6nizleme),\n o yoksa olu\u015Fan kayd\u0131n ilk baca\u011F\u0131ndan (workingCopy.legs[0]) okunur - ilk bacak her zaman\n newState'in temsil etti\u011Fi \"ilk hedef\" ad\u0131m\u0131yla ayn\u0131 belgedir. -->\n <div class=\"row g-3 mb-3\" *ngIf=\"newState || workingCopy\">\n <div class=\"col-md-3\">\n <label class=\"form-label\">Kaynak \u015Eirket</label>\n <input type=\"text\" class=\"form-control\" [value]=\"companyName()\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">Belge No</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.docNum ?? workingCopy?.sourceOinvDocNum\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">NumAtCard</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.numAtCard ?? workingCopy?.sourceOinvNumAtCard\" disabled />\n </div>\n <div class=\"col-md-1\">\n <label class=\"form-label\">Proje</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.projectCode ?? workingCopy?.projectCode\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">\u0130lk Hedef</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.targetCompanyName ?? workingCopy?.legs?.[0]?.targetCompanyName\" disabled />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">D\u00F6viz</label>\n <input type=\"text\" class=\"form-control\" [value]=\"newState?.currency ?? workingCopy?.legs?.[0]?.currency\" disabled />\n </div>\n </div>\n\n <!-- Belge Durumu her zaman (yeni kay\u0131tta da) g\u00F6r\u00FCn\u00FCr; Intercompany Id/Aktar\u0131m Durumu/Senaryo yaln\u0131zca\n kay\u0131t olu\u015Ftuktan sonra vard\u0131r - kullan\u0131c\u0131 iste\u011Fiyle hepsi ayn\u0131 sat\u0131rda, Belge Durumu'nun yan\u0131na\n topland\u0131 (\u00F6nceden Intercompany Id/Aktar\u0131m Durumu ayr\u0131 bir sat\u0131rdayd\u0131). -->\n <div class=\"row g-3 mb-3\" *ngIf=\"newState || workingCopy\">\n <div class=\"col-md-2\">\n <label class=\"form-label\">Kaynak Belge Durumu</label>\n <input\n type=\"text\"\n class=\"form-control\"\n [value]=\"sourceDocumentLifecycleLabel(newState?.sourceDocumentLifecycle ?? workingCopy?.sourceDocumentLifecycle)\"\n disabled\n />\n </div>\n <div class=\"col-md-2\">\n <label class=\"form-label\">Hedef Belge Durumu</label>\n <!-- Aktar\u0131m hen\u00FCz olu\u015Fturulmad\u0131ysa (isNew) burada se\u00E7ilebilir - kaynaktan ba\u011F\u0131ms\u0131z bir karard\u0131r\n (kullan\u0131c\u0131 geri bildirimiyle netle\u015Ftirildi: kayna\u011F\u0131n modu sabit, hedefin modu burada se\u00E7ilir).\n Olu\u015Ftuktan sonra backend'de sabitlendi\u011Fi i\u00E7in (workingCopy) salt-okunur g\u00F6sterilir. -->\n <select *ngIf=\"isNew && newState\" class=\"form-select\" [(ngModel)]=\"newState.targetDocumentLifecycle\">\n <option *ngFor=\"let o of documentLifecycleOptions\" [ngValue]=\"o.value\">{{ o.label }}</option>\n </select>\n <input\n *ngIf=\"!isNew || !newState\"\n type=\"text\"\n class=\"form-control\"\n [value]=\"sourceDocumentLifecycleLabel(newState?.targetDocumentLifecycle ?? workingCopy?.targetDocumentLifecycle)\"\n disabled\n />\n </div>\n <div class=\"col-md-3\" *ngIf=\"workingCopy\">\n <label class=\"form-label\">Intercompany Id</label>\n <input type=\"text\" class=\"form-control\" [value]=\"workingCopy.intercompanyId\" disabled />\n </div>\n <div class=\"col-md-2\" *ngIf=\"workingCopy\">\n <label class=\"form-label\">Aktar\u0131m Durumu</label>\n <input type=\"text\" class=\"form-control\" [value]=\"statusLabel(workingCopy.status)\" disabled />\n </div>\n <!-- Senaryo, aktar\u0131m hen\u00FCz \u00E7al\u0131\u015Ft\u0131r\u0131lmam\u0131\u015Fken (isDraft()) alt\u0131ndaki \"Haz\u0131r Senaryo\" dropdown'\u0131nda\n zaten d\u00FCzenlenebilir/g\u00F6r\u00FCn\u00FCr durumda - ayn\u0131 bilgiyi burada salt-okunur tekrar g\u00F6stermek\n (kullan\u0131c\u0131 geri bildirimiyle tespit edildi) kafa kar\u0131\u015Ft\u0131r\u0131yordu. Yaln\u0131zca aktar\u0131m art\u0131k\n d\u00FCzenlenemez hale geldi\u011Finde (dropdown kayboldu\u011Funda) burada g\u00F6sterilir. -->\n <div class=\"col-md-3\" *ngIf=\"workingCopy && !isDraft()\">\n <label class=\"form-label\">Senaryo</label>\n <input type=\"text\" class=\"form-control\" [value]=\"scenarioName()\" disabled />\n </div>\n </div>\n\n <!-- Taslak: haz\u0131r senaryo se\u00E7imi, hen\u00FCz \u00E7al\u0131\u015Ft\u0131r\u0131lmad\u0131. -->\n <ng-container *ngIf=\"isDraft()\">\n <div class=\"row g-3 align-items-end mb-3\">\n <div class=\"col-md-4\">\n <label class=\"form-label\">Haz\u0131r Senaryo</label>\n <select class=\"form-select\" [(ngModel)]=\"scenarioId\">\n <option [ngValue]=\"''\">Senaryosuz (yaln\u0131zca ilk hedef baca\u011F\u0131)</option>\n <option *ngFor=\"let s of availableScenarios()\" [ngValue]=\"s.id\">{{ s.name }}</option>\n </select>\n </div>\n <div class=\"col-md-2\">\n <button\n class=\"btn btn-outline-primary\"\n (click)=\"isNew ? fetchScenario() : applyScenario()\"\n [disabled]=\"isFetchingScenario\"\n >\n <span *ngIf=\"isFetchingScenario\" class=\"spinner-border spinner-border-sm me-1\"></span>\n {{ isNew ? 'Senaryoyu Getir' : 'Senaryoyu Uygula' }}\n </button>\n </div>\n </div>\n </ng-container>\n\n <!-- NumAtCard alanlar\u0131 art\u0131k isDraft()'a ba\u011Fl\u0131 DE\u011E\u0130L: taslakta d\u00FCzenlenebilir, \u00E7al\u0131\u015Ft\u0131r\u0131ld\u0131ktan\n sonra (isDraft() false olsa da) salt-okunur olarak ekranda kal\u0131r - \"Haz\u0131r Senaryo\" blo\u011Fuyla\n birlikte tamamen kaybolmas\u0131n diye. -->\n <ng-container *ngIf=\"workingCopy\">\n <div class=\"row g-3 align-items-end mb-3\" *ngIf=\"hasIntermediateNumAtCardLegs()\">\n <div class=\"col-md-3\" *ngFor=\"let leg of workingCopy.legs\">\n <ng-container *ngIf=\"leg.legBehavior === 0 && leg.sequenceNo < workingCopy.legs.length\">\n <label class=\"form-label\">{{ leg.sequenceNo }}. Bacak - {{ leg.targetCompanyName }} M\u00FC\u015Fteri Faturas\u0131 NumAtCard</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"leg.numAtCard\" [disabled]=\"!isDraft()\" />\n </ng-container>\n </div>\n </div>\n\n <div class=\"alert alert-warning\" *ngIf=\"isDraft() && hasMissingIncreaseRate()\">\n Uyar\u0131: \u0130lgili \u015Firkette/projede art\u0131r\u0131m oran\u0131 0 / NULL. Art\u0131r\u0131m uygulanmadan devam etmek istiyor musunuz?\n </div>\n\n <div class=\"alert alert-warning\" *ngIf=\"isDraft() && hasMissingConstructionDraftSelection()\">\n Uyar\u0131: Hedef Belge Durumu Taslak oldu\u011Funda Construction bacaklar\u0131nda OPOR \u2192 OPDN \u2192 OPCH zinciri taslak belgeler aras\u0131nda\n \u00E7al\u0131\u015Fmaz. \"Hedefte Olu\u015Facak\" s\u00FCtunundan bu bacaklar i\u00E7in tek bir belge tipi (OPOR / OPDN / OPCH) se\u00E7melisiniz.\n </div>\n </ng-container>\n\n <!-- Tek tablo: taslakta da, \u00E7al\u0131\u015Ft\u0131r\u0131ld\u0131ktan sonra da AYNI s\u00FCtun seti (S\u0131ra..Art\u0131r\u0131m) korunur;\n Durum/Sonu\u00E7 Belge/Hata/\u00C7al\u0131\u015Ft\u0131r yaln\u0131zca \u00E7al\u0131\u015Ft\u0131r\u0131ld\u0131ktan sonra, her sat\u0131r\u0131n ALTINA ikinci bir\n sat\u0131r olarak eklenir - eskiden bu bilgiler ayr\u0131 ve daha dar bir tabloya ge\u00E7ilerek g\u00F6steriliyordu,\n bu da Kaynak Belge/Hedefte Olu\u015Facak gibi s\u00FCtunlar\u0131n \"kaybolmu\u015F\" g\u00F6r\u00FCnmesine yol a\u00E7\u0131yordu. -->\n <ng-container *ngIf=\"workingCopy\">\n <div class=\"d-flex justify-content-between align-items-center mb-2\">\n <div>\n <h6 class=\"mb-0\">{{ isDraft() ? 'Senaryo \u00C7al\u0131\u015Fma Kopyas\u0131' : 'Aktar\u0131m Sonucu' }}</h6>\n <small class=\"text-muted\" *ngIf=\"isDraft()\">Bu tablo yaln\u0131zca \u00E7al\u0131\u015Fma kopyas\u0131n\u0131 d\u00FCzenler; ana senaryoyu de\u011Fi\u015Ftirmez.</small>\n </div>\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"addLeg()\" *ngIf=\"isDraft()\" [disabled]=\"isMutatingLegs\">\n <i class=\"fa fa-plus me-1\"></i>Bacak Ekle\n </button>\n <button class=\"btn btn-sm btn-outline-danger\" (click)=\"cancelChain()\" *ngIf=\"canCancelChain()\">\n <i class=\"fa fa-ban me-1\"></i>Zinciri \u0130ptal Et\n </button>\n </div>\n\n <div class=\"alert alert-secondary small\" *ngIf=\"workingCopy.status === 4\">\n Bu zincir iptal edildi, bacaklar\u0131 art\u0131k \u00E7al\u0131\u015Ft\u0131r\u0131lamaz/d\u00FCzenlenemez. Yeniden denemek i\u00E7in\n \"Listeye D\u00F6n\"den kaynak faturay\u0131 tekrar se\u00E7ip yeni bir aktar\u0131m ba\u015Flat\u0131n - bu, yeni bir Intercompany Id ile\n \u00E7al\u0131\u015F\u0131r.\n </div>\n\n <div class=\"table-responsive\">\n <table class=\"table table-sm table-bordered align-middle\">\n <thead>\n <tr>\n <th>S\u0131ra</th>\n <th>Kaynak</th>\n <th>Kaynak Belge</th>\n <th>Hedef</th>\n <th>Davran\u0131\u015F</th>\n <th>Hedefte Olu\u015Facak</th>\n <th>OPCH CardCode</th>\n <th>D\u00F6viz</th>\n <th>Kur</th>\n <th>Art\u0131r\u0131m</th>\n <th *ngIf=\"isDraft()\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let leg of workingCopy.legs\">\n <tr>\n <td>{{ leg.sequenceNo }}</td>\n <td>{{ leg.sourceCompanyName }}</td>\n <td>OINV</td>\n <td>\n <select\n *ngIf=\"isDraft(); else targetText\"\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.targetCompanyId\"\n (ngModelChange)=\"updateLegTarget(leg, $event)\"\n [disabled]=\"isMutatingLegs\"\n >\n <option *ngFor=\"let c of companies\" [ngValue]=\"c.id\">{{ c.companyName }}</option>\n </select>\n <ng-template #targetText>{{ leg.targetCompanyName }}</ng-template>\n </td>\n <td>\n <select\n *ngIf=\"isDraft(); else behaviorText\"\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.legBehavior\"\n (ngModelChange)=\"updateLegBehavior(leg, $event)\"\n [disabled]=\"isMutatingLegs\"\n >\n <option *ngFor=\"let b of legBehaviors\" [ngValue]=\"b.value\">{{ b.label }}</option>\n </select>\n <ng-template #behaviorText>{{ legBehaviors[leg.legBehavior]?.label }}</ng-template>\n </td>\n <td>\n <select\n *ngIf=\"isDraft() && isConstructionDraftSelectable(leg); else targetDocText\"\n class=\"form-select form-select-sm\"\n [ngModel]=\"leg.selectedConstructionDraftDocType\"\n (ngModelChange)=\"updateLegConstructionDraftDocType(leg, $event)\"\n [disabled]=\"isMutatingLegs\"\n >\n <option [ngValue]=\"null\">Se\u00E7iniz...</option>\n <option *ngFor=\"let o of constructionDraftDocTypeOptions\" [ngValue]=\"o.value\">{{ o.label }}</option>\n </select>\n <ng-template #targetDocText>{{ legTargetDocLabel(leg) }}</ng-template>\n </td>\n <td>\n <span *ngIf=\"leg.resolvedOpchCardCode\">{{ leg.resolvedOpchCardCode }}</span>\n <div *ngIf=\"!leg.resolvedOpchCardCode\" class=\"d-flex flex-column align-items-start py-1\">\n <span class=\"badge bg-danger\">E\u015Fle\u015Ftirilmedi</span>\n <button\n type=\"button\"\n class=\"btn btn-outline-danger btn-sm mt-2 py-0 px-2\"\n style=\"font-size: 0.72rem\"\n (click)=\"goToPartnerMapping(leg)\"\n title=\"Muhatap E\u015Fle\u015Ftirmeleri ekran\u0131na git\"\n >\n <i class=\"fa fa-link me-1\"></i>E\u015Fle\u015Ftir\n </button>\n </div>\n </td>\n <td>\n <input\n *ngIf=\"isDraft(); else currencyText\"\n type=\"text\"\n class=\"form-control form-control-sm\"\n style=\"width: 5.5rem\"\n [(ngModel)]=\"leg.currency\"\n [placeholder]=\"newState?.currency || 'Kaynaktan'\"\n />\n <ng-template #currencyText>{{ leg.currency || newState?.currency }}</ng-template>\n </td>\n <td>\n <input\n *ngIf=\"isDraft(); else rateText\"\n type=\"number\"\n class=\"form-control form-control-sm\"\n style=\"width: 6rem\"\n [(ngModel)]=\"leg.exchangeRate\"\n placeholder=\"Kaynaktan\"\n />\n <ng-template #rateText>{{ leg.exchangeRate ?? '-' }}</ng-template>\n </td>\n <!-- Spec \u00A79 - art\u0131r\u0131m YALNIZCA bu baca\u011F\u0131n olu\u015Fturdu\u011Fu devam M\u00FC\u015Fteri Faturas\u0131na (bir\n sonraki bacak varsa) uygulan\u0131r; bu hem IntermediateChain hem ConstructionChain i\u00E7in\n ge\u00E7erlidir (Construction'da da nextTargetCompanyId.HasValue ise devam OINV'i\n art\u0131r\u0131mla olu\u015Fturuluyor). \u00D6nceden Construction bacaklar\u0131 legBehavior'a bak\u0131larak\n KO\u015EULSUZ \"-\" g\u00F6steriyordu - zincirin SON baca\u011F\u0131 olmayan bir Construction baca\u011F\u0131n\u0131n\n hedefinde art\u0131r\u0131m oran\u0131 tan\u0131ms\u0131zken kullan\u0131c\u0131 hi\u00E7 uyar\u0131lm\u0131yordu (kod incelemesiyle\n tespit edildi). Do\u011Fru ko\u015Ful \"zincirin son baca\u011F\u0131 m\u0131\" (legTargetDocLabel'daki\n isLastLeg ile ayn\u0131 mant\u0131k), legBehavior de\u011Fil. -->\n <td>\n <span *ngIf=\"leg.sequenceNo >= (workingCopy?.legs?.length ?? 0)\">-</span>\n <ng-container *ngIf=\"leg.sequenceNo < (workingCopy?.legs?.length ?? 0)\">\n <span *ngIf=\"leg.increaseRateApplied ?? leg.plannedIncreaseRate as rate\">{{ rate | number: '1.2-2' }}</span>\n <span\n class=\"text-danger\"\n *ngIf=\"!(leg.increaseRateApplied ?? leg.plannedIncreaseRate)\"\n title=\"Bu \u015Firkette bu proje i\u00E7in art\u0131r\u0131m oran\u0131 tan\u0131ml\u0131 de\u011Fildir. Art\u0131r\u0131m uygulanmadan devam edilecektir.\"\n >\n Tan\u0131ms\u0131z\n </span>\n </ng-container>\n </td>\n <td *ngIf=\"isDraft()\">\n <button\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"removeLeg(leg)\"\n [disabled]=\"isMutatingLegs || workingCopy.legs.length <= 1\"\n title=\"Baca\u011F\u0131 Sil\"\n >\n <i class=\"fa fa-trash\"></i>\n </button>\n </td>\n </tr>\n <tr class=\"table-light\" *ngIf=\"!isDraft()\">\n <td></td>\n <td colspan=\"9\">\n <div class=\"d-flex align-items-center flex-wrap gap-3\">\n <span>\n <strong>Durum:</strong>\n <span\n class=\"badge ms-1\"\n [class.bg-secondary]=\"leg.status === 0\"\n [class.bg-success]=\"leg.status === 1\"\n [class.bg-danger]=\"leg.status === 2\"\n [class.bg-warning]=\"leg.status === 3\"\n >\n {{ legStatusLabel(leg.status) }}\n </span>\n </span>\n <span *ngIf=\"createdDocumentsSummary(leg) as docs\"><strong>Sonu\u00E7 Belge(ler):</strong> {{ docs }}</span>\n <span class=\"text-danger\" *ngIf=\"leg.errorMessage\"><strong>Hata:</strong> {{ leg.errorMessage }}</span>\n <button\n class=\"btn btn-sm btn-outline-primary ms-auto\"\n (click)=\"executeLeg(leg)\"\n [disabled]=\"isExecuting || !canExecuteLeg(leg)\"\n >\n <span *ngIf=\"isExecuting\" class=\"spinner-border spinner-border-sm me-1\"></span>\n \u00C7al\u0131\u015Ft\u0131r\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <ul class=\"text-muted small\" *ngIf=\"isDraft()\">\n <li>\u015Eirketler aras\u0131 OINV \u2192 OPCH ge\u00E7i\u015Finde kaynak NumAtCard hedef OPCH.NumAtCard alan\u0131na aynen ta\u015F\u0131n\u0131r.</li>\n <li>Art\u0131r\u0131m yaln\u0131zca ayn\u0131 \u015Firket i\u00E7inde olu\u015Fturulan yeni M\u00FC\u015Fteri Faturas\u0131na uygulan\u0131r; navlun art\u0131r\u0131m oran\u0131ndan etkilenmez.</li>\n <li>Muhatap kodlar\u0131 Muhatap E\u015Fle\u015Ftirmeleri \u00FCzerinden \u00E7\u00F6z\u00FCl\u00FCr. Kur kaynak belgeden gelir ve kullan\u0131c\u0131 taraf\u0131ndan de\u011Fi\u015Ftirilebilir.</li>\n </ul>\n </ng-container>\n\n <div class=\"d-flex justify-content-end gap-2 mt-3\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"backToList()\">{{ isDraft() ? 'Vazge\u00E7' : 'Kapat' }}</button>\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"startFlow()\"\n *ngIf=\"isDraft() && workingCopy\"\n [disabled]=\"isStarting || hasMissingConstructionDraftSelection()\"\n >\n <span *ngIf=\"isStarting\" class=\"spinner-border spinner-border-sm me-1\"></span>\n Belge Ak\u0131\u015F\u0131n\u0131 Ba\u015Flat\n </button>\n </div>\n </ng-container>\n </div>\n</div>\n" }]
1546
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: DocumentTransferService }, { type: DocumentScenarioService }, { type: SapCompanyProfileService }, { type: i3.ConfirmationService }]; } });
1547
+
1548
+ const routes$1 = [
1549
+ {
1550
+ path: '',
1551
+ component: HitDocumentTransferComponent,
1552
+ canActivate: [AuthGuard, PermissionGuard],
1553
+ },
1554
+ {
1555
+ // ":id" - yeni aktarım için "new" (router state ile), mevcut bir kayıt için gerçek DocumentTransfer Id'si.
1556
+ path: ':id',
1557
+ component: HitDocumentTransferDetailComponent,
1558
+ canActivate: [AuthGuard, PermissionGuard],
1559
+ },
1560
+ ];
1561
+ class HitDocumentTransferRoutingModule {
1562
+ }
1563
+ HitDocumentTransferRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1564
+ HitDocumentTransferRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
1565
+ HitDocumentTransferRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferRoutingModule, imports: [RouterModule.forChild(routes$1), RouterModule] });
1566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferRoutingModule, decorators: [{
1567
+ type: NgModule,
1568
+ args: [{
1569
+ imports: [RouterModule.forChild(routes$1)],
1570
+ exports: [RouterModule],
1571
+ }]
1572
+ }] });
1573
+
1574
+ class HitDocumentTransferModule {
1575
+ }
1576
+ HitDocumentTransferModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1577
+ HitDocumentTransferModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferModule, declarations: [HitDocumentTransferComponent, HitDocumentTransferDetailComponent], imports: [HitDocumentTransferRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
1578
+ HitDocumentTransferModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferModule, imports: [HitDocumentTransferRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule] });
1579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HitDocumentTransferModule, decorators: [{
1580
+ type: NgModule,
1581
+ args: [{
1582
+ declarations: [HitDocumentTransferComponent, HitDocumentTransferDetailComponent],
1583
+ imports: [HitDocumentTransferRoutingModule, CoreModule, ThemeSharedModule, FormsModule, DxDataGridModule],
1584
+ }]
1585
+ }] });
1586
+ function loadHitDocumentTransferModuleAsChild() {
1587
+ return Promise.resolve(HitDocumentTransferModule);
1588
+ }
1589
+
1590
+ const routes = [
1591
+ {
1592
+ path: '',
1593
+ pathMatch: 'full',
1594
+ component: FBDocumentFlowComponent,
1595
+ },
1596
+ { path: 'sap-company-profiles', loadChildren: loadHitSapCompanyProfileModuleAsChild },
1597
+ { path: 'partner-mappings', loadChildren: loadHitPartnerMappingModuleAsChild },
1598
+ { path: 'document-scenarios', loadChildren: loadHitDocumentScenarioModuleAsChild },
1599
+ { path: 'project-parameters', loadChildren: loadHitProjectParameterModuleAsChild },
1600
+ { path: 'document-transfers', loadChildren: loadHitDocumentTransferModuleAsChild },
1601
+ ];
1602
+ class FBDocumentFlowRoutingModule {
1603
+ }
1604
+ FBDocumentFlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1605
+ FBDocumentFlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
1606
+ FBDocumentFlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
1607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowRoutingModule, decorators: [{
1608
+ type: NgModule,
1609
+ args: [{
1610
+ imports: [RouterModule.forChild(routes)],
1611
+ exports: [RouterModule],
1612
+ }]
1613
+ }] });
1614
+
1615
+ class FBDocumentFlowModule {
1616
+ static forChild() {
1617
+ return {
1618
+ ngModule: FBDocumentFlowModule,
1619
+ providers: [],
1620
+ };
1621
+ }
1622
+ static forLazy() {
1623
+ return new LazyModuleFactory(FBDocumentFlowModule.forChild());
1624
+ }
1625
+ }
1626
+ FBDocumentFlowModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1627
+ FBDocumentFlowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowModule, declarations: [FBDocumentFlowComponent], imports: [CoreModule, ThemeSharedModule, FBDocumentFlowRoutingModule], exports: [FBDocumentFlowComponent] });
1628
+ FBDocumentFlowModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowModule, imports: [CoreModule, ThemeSharedModule, FBDocumentFlowRoutingModule] });
1629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FBDocumentFlowModule, decorators: [{
1630
+ type: NgModule,
1631
+ args: [{
1632
+ declarations: [FBDocumentFlowComponent],
1633
+ imports: [CoreModule, ThemeSharedModule, FBDocumentFlowRoutingModule],
1634
+ exports: [FBDocumentFlowComponent],
1635
+ }]
1636
+ }] });
1637
+
1638
+ /*
1639
+ * Public API Surface of fbdocumentflow
1640
+ */
1641
+
1642
+ /**
1643
+ * Generated bundle index. Do not edit.
1644
+ */
1645
+
1646
+ export { FBDocumentFlowComponent, FBDocumentFlowModule, FBDocumentFlowService };
1647
+ //# sourceMappingURL=hitsoft-fbdocumentflow.mjs.map