@hitsoft/uretim-yonetimi 1.0.10 → 1.0.12

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 (140) hide show
  1. package/.eslintrc.json +44 -0
  2. package/README.md +24 -24
  3. package/config/ng-package.json +7 -0
  4. package/config/src/enums/route-names.ts +3 -0
  5. package/config/src/providers/create-barcode-route.provider.ts +21 -0
  6. package/config/src/providers/issues-for-production-route.provider.ts +21 -0
  7. package/config/src/providers/production-order-route.provider.ts +21 -0
  8. package/config/src/providers/receipt-from-production-route.provider.ts +21 -0
  9. package/config/src/providers/route.provider.ts +26 -0
  10. package/config/src/uretim-yonetimi-config.module.ts +22 -0
  11. package/karma.conf.js +44 -0
  12. package/ng-package.json +7 -0
  13. package/package.json +14 -42
  14. package/src/lib/components/hit-create-barcodes/hit-create-barcodes-component.css +10 -0
  15. package/src/lib/components/hit-create-barcodes/hit-create-barcodes-routing.module.ts +19 -0
  16. package/src/lib/components/hit-create-barcodes/hit-create-barcodes.component.html +80 -0
  17. package/src/lib/components/hit-create-barcodes/hit-create-barcodes.component.ts +219 -0
  18. package/src/lib/components/hit-create-barcodes/hit-create-barcodes.module.ts +39 -0
  19. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions-routing.module.ts +19 -0
  20. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.componenet.css +7 -0
  21. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.html +96 -0
  22. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.ts +274 -0
  23. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.module.ts +46 -0
  24. package/src/lib/components/hit-production-orders/hit-production-orders-routing.module.ts +19 -0
  25. package/src/lib/components/hit-production-orders/hit-production-orders.component.html +79 -0
  26. package/src/lib/components/hit-production-orders/hit-production-orders.component.ts +214 -0
  27. package/src/lib/components/hit-production-orders/hit-production-orders.module.ts +39 -0
  28. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-production-component.css +10 -0
  29. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-production-routing.module.ts +19 -0
  30. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.html +101 -0
  31. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.ts +258 -0
  32. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.module.ts +38 -0
  33. package/src/lib/components/uretim-yonetimi.component.ts +9 -0
  34. package/src/lib/hit-proxy/devexpress-query-builder/devexpress-load-options.model.ts +20 -0
  35. package/src/lib/hit-proxy/devexpress-query-builder/devexpress-query-builder.ts +51 -0
  36. package/src/lib/hit-proxy/hit-create-barcodes/hit-create-barcodes.service.ts +41 -0
  37. package/src/lib/hit-proxy/hit-create-barcodes/models.ts +6 -0
  38. package/src/lib/hit-proxy/hit-issues-for-productions/hit-issues-for-productions.service.ts +39 -0
  39. package/src/lib/hit-proxy/hit-issues-for-productions/models.ts +42 -0
  40. package/src/lib/hit-proxy/hit-production-orders/hit-production-orders.service.ts +60 -0
  41. package/src/lib/hit-proxy/hit-production-orders/models.ts +137 -0
  42. package/src/lib/hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service.ts +32 -0
  43. package/src/lib/hit-proxy/hit-receipt-from-productions/models.ts +43 -0
  44. package/src/lib/hit-proxy/models.ts +105 -0
  45. package/src/lib/uretim-yonetimi-routing.module.ts +30 -0
  46. package/src/lib/uretim-yonetimi.component.spec.ts +24 -0
  47. package/src/lib/uretim-yonetimi.module.ts +52 -0
  48. package/src/lib/uretim-yonetimi.service.spec.ts +15 -0
  49. package/{public-api.d.ts → src/public-api.ts} +4 -0
  50. package/src/test.ts +29 -0
  51. package/tsconfig.lib.json +20 -0
  52. package/tsconfig.lib.prod.json +10 -0
  53. package/tsconfig.spec.json +17 -0
  54. package/config/enums/route-names.d.ts +0 -3
  55. package/config/index.d.ts +0 -5
  56. package/config/providers/create-barcode-route.provider.d.ts +0 -9
  57. package/config/providers/issues-for-production-route.provider.d.ts +0 -9
  58. package/config/providers/production-order-route.provider.d.ts +0 -9
  59. package/config/providers/receipt-from-production-route.provider.d.ts +0 -9
  60. package/config/providers/route.provider.d.ts +0 -8
  61. package/config/uretim-yonetimi-config.module.d.ts +0 -8
  62. package/esm2020/config/enums/index.mjs +0 -2
  63. package/esm2020/config/enums/route-names.mjs +0 -2
  64. package/esm2020/config/hitsoft-uretim-yonetimi-config.mjs +0 -5
  65. package/esm2020/config/providers/create-barcode-route.provider.mjs +0 -19
  66. package/esm2020/config/providers/index.mjs +0 -2
  67. package/esm2020/config/providers/issues-for-production-route.provider.mjs +0 -19
  68. package/esm2020/config/providers/production-order-route.provider.mjs +0 -19
  69. package/esm2020/config/providers/receipt-from-production-route.provider.mjs +0 -19
  70. package/esm2020/config/providers/route.provider.mjs +0 -24
  71. package/esm2020/config/public-api.mjs +0 -4
  72. package/esm2020/config/uretim-yonetimi-config.module.mjs +0 -28
  73. package/esm2020/hitsoft-uretim-yonetimi.mjs +0 -5
  74. package/esm2020/lib/components/hit-create-barcodes/hit-create-barcodes-routing.module.mjs +0 -26
  75. package/esm2020/lib/components/hit-create-barcodes/hit-create-barcodes.component.mjs +0 -186
  76. package/esm2020/lib/components/hit-create-barcodes/hit-create-barcodes.module.mjs +0 -65
  77. package/esm2020/lib/components/hit-issues-for-productions/hit-issues-for-productions-routing.module.mjs +0 -26
  78. package/esm2020/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.mjs +0 -250
  79. package/esm2020/lib/components/hit-issues-for-productions/hit-issues-for-productions.module.mjs +0 -68
  80. package/esm2020/lib/components/hit-production-orders/hit-production-orders-routing.module.mjs +0 -26
  81. package/esm2020/lib/components/hit-production-orders/hit-production-orders.component.mjs +0 -152
  82. package/esm2020/lib/components/hit-production-orders/hit-production-orders.module.mjs +0 -65
  83. package/esm2020/lib/components/hit-receipt-from-productions/hit-receipt-from-production-routing.module.mjs +0 -26
  84. package/esm2020/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.mjs +0 -215
  85. package/esm2020/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.module.mjs +0 -62
  86. package/esm2020/lib/components/uretim-yonetimi.component.mjs +0 -11
  87. package/esm2020/lib/hit-proxy/devexpress-query-builder/devexpress-load-options.model.mjs +0 -2
  88. package/esm2020/lib/hit-proxy/devexpress-query-builder/devexpress-query-builder.mjs +0 -54
  89. package/esm2020/lib/hit-proxy/hit-create-barcodes/hit-create-barcodes.service.mjs +0 -35
  90. package/esm2020/lib/hit-proxy/hit-create-barcodes/models.mjs +0 -3
  91. package/esm2020/lib/hit-proxy/hit-issues-for-productions/hit-issues-for-productions.service.mjs +0 -35
  92. package/esm2020/lib/hit-proxy/hit-issues-for-productions/models.mjs +0 -24
  93. package/esm2020/lib/hit-proxy/hit-production-orders/hit-production-orders.service.mjs +0 -44
  94. package/esm2020/lib/hit-proxy/hit-production-orders/models.mjs +0 -65
  95. package/esm2020/lib/hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service.mjs +0 -30
  96. package/esm2020/lib/hit-proxy/hit-receipt-from-productions/models.mjs +0 -20
  97. package/esm2020/lib/hit-proxy/models.mjs +0 -81
  98. package/esm2020/lib/services/uretim-yonetimi.service.mjs +0 -18
  99. package/esm2020/lib/uretim-yonetimi-routing.module.mjs +0 -33
  100. package/esm2020/lib/uretim-yonetimi.module.mjs +0 -55
  101. package/esm2020/public-api.mjs +0 -6
  102. package/fesm2015/hitsoft-uretim-yonetimi-config.mjs +0 -121
  103. package/fesm2015/hitsoft-uretim-yonetimi-config.mjs.map +0 -1
  104. package/fesm2015/hitsoft-uretim-yonetimi.mjs +0 -1539
  105. package/fesm2015/hitsoft-uretim-yonetimi.mjs.map +0 -1
  106. package/fesm2020/hitsoft-uretim-yonetimi-config.mjs +0 -121
  107. package/fesm2020/hitsoft-uretim-yonetimi-config.mjs.map +0 -1
  108. package/fesm2020/hitsoft-uretim-yonetimi.mjs +0 -1517
  109. package/fesm2020/hitsoft-uretim-yonetimi.mjs.map +0 -1
  110. package/index.d.ts +0 -5
  111. package/lib/components/hit-create-barcodes/hit-create-barcodes-routing.module.d.ts +0 -7
  112. package/lib/components/hit-create-barcodes/hit-create-barcodes.component.d.ts +0 -45
  113. package/lib/components/hit-create-barcodes/hit-create-barcodes.module.d.ts +0 -16
  114. package/lib/components/hit-issues-for-productions/hit-issues-for-productions-routing.module.d.ts +0 -7
  115. package/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.d.ts +0 -48
  116. package/lib/components/hit-issues-for-productions/hit-issues-for-productions.module.d.ts +0 -16
  117. package/lib/components/hit-production-orders/hit-production-orders-routing.module.d.ts +0 -7
  118. package/lib/components/hit-production-orders/hit-production-orders.component.d.ts +0 -44
  119. package/lib/components/hit-production-orders/hit-production-orders.module.d.ts +0 -16
  120. package/lib/components/hit-receipt-from-productions/hit-receipt-from-production-routing.module.d.ts +0 -7
  121. package/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.d.ts +0 -57
  122. package/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.module.d.ts +0 -16
  123. package/lib/components/uretim-yonetimi.component.d.ts +0 -5
  124. package/lib/hit-proxy/devexpress-query-builder/devexpress-load-options.model.d.ts +0 -17
  125. package/lib/hit-proxy/devexpress-query-builder/devexpress-query-builder.d.ts +0 -18
  126. package/lib/hit-proxy/hit-create-barcodes/hit-create-barcodes.service.d.ts +0 -23
  127. package/lib/hit-proxy/hit-create-barcodes/models.d.ts +0 -6
  128. package/lib/hit-proxy/hit-issues-for-productions/hit-issues-for-productions.service.d.ts +0 -17
  129. package/lib/hit-proxy/hit-issues-for-productions/models.d.ts +0 -30
  130. package/lib/hit-proxy/hit-production-orders/hit-production-orders.service.d.ts +0 -19
  131. package/lib/hit-proxy/hit-production-orders/models.d.ts +0 -85
  132. package/lib/hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service.d.ts +0 -16
  133. package/lib/hit-proxy/hit-receipt-from-productions/models.d.ts +0 -39
  134. package/lib/hit-proxy/models.d.ts +0 -21
  135. package/lib/services/uretim-yonetimi.service.d.ts +0 -9
  136. package/lib/uretim-yonetimi-routing.module.d.ts +0 -7
  137. package/lib/uretim-yonetimi.module.d.ts +0 -17
  138. /package/config/{enums/index.d.ts → src/enums/index.ts} +0 -0
  139. /package/config/{providers/index.d.ts → src/providers/index.ts} +0 -0
  140. /package/config/{public-api.d.ts → src/public-api.ts} +0 -0
@@ -0,0 +1,258 @@
1
+ import { ListService, TrackByService } from '@abp/ng.core';
2
+ import { ConfirmationService, Confirmation } from '@abp/ng.theme.shared';
3
+ import { DateAdapter } from '@abp/ng.theme.shared/extensions';
4
+ import {
5
+ AfterViewInit,
6
+ ChangeDetectionStrategy,
7
+ Component,
8
+ NgZone,
9
+ OnInit,
10
+ ViewChild,
11
+ } from '@angular/core';
12
+ import { NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap';
13
+ import { HitReceiptFromProductionsService } from '../../hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service';
14
+ import {
15
+ GetProductionOrderDto,
16
+ ReceiptFromProductionsBatchNumbers,
17
+ ReceiptFromProductionsLines,
18
+ ReceiptFromProductionsPostDto,
19
+ } from '../../hit-proxy/hit-receipt-from-productions/models';
20
+ import { HitProductionOrdersService } from '../../hit-proxy/hit-production-orders/hit-production-orders.service';
21
+ import { HitHelper } from '../../hit-proxy/models';
22
+ import { DxNumberBoxComponent, DxTextBoxComponent } from 'devextreme-angular';
23
+ import { Warehouse } from '../../hit-proxy/hit-production-orders/models';
24
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
25
+
26
+ @Component({
27
+ selector: 'lib-hit-receipt-from-productions',
28
+ changeDetection: ChangeDetectionStrategy.Default,
29
+ providers: [ListService, { provide: NgbDateAdapter, useClass: DateAdapter }],
30
+ templateUrl: './hit-receipt-from-productions.component.html',
31
+ styles: [],
32
+ styleUrls: ['./hit-receipt-from-production-component.css'],
33
+ })
34
+ export class HitReceiptFromProductionsComponent implements OnInit, AfterViewInit {
35
+ protected readonly HitHelper = HitHelper;
36
+ @ViewChild('barkodNumarasiRef', { static: false }) nmbBoxBarkodNumarasi: DxTextBoxComponent;
37
+ @ViewChild('toplananMiktarRef', { static: false }) nmbBoxToplananMiktar: DxNumberBoxComponent;
38
+ isLoading = false;
39
+ options: Partial<Confirmation.Options> = {
40
+ hideYesBtn: true,
41
+ cancelText: 'Kapat',
42
+ dismissible: false,
43
+ };
44
+
45
+ constructor(
46
+ private ngZone: NgZone,
47
+ public readonly list: ListService,
48
+ public readonly track: TrackByService,
49
+ public readonly service: HitReceiptFromProductionsService,
50
+ private confirmation: ConfirmationService,
51
+ private productionOrdersService: HitProductionOrdersService,
52
+ private sanitizer: DomSanitizer
53
+ ) {}
54
+
55
+ ngOnInit(): void {
56
+ this.clearAll();
57
+ this.getWarehouses();
58
+ }
59
+
60
+ ngAfterViewInit() {
61
+ this.focusOnBarkodNumarasi();
62
+ }
63
+
64
+ barkodNumarasi: number;
65
+ isProductionOrderValid: boolean = false;
66
+ searcheBasildiMi: boolean = false;
67
+ unitOfMeasure: string;
68
+ blobUrl: string;
69
+ showModal: boolean = false;
70
+ pdfSrc: SafeResourceUrl | null = null;
71
+ newRecordDocEntry: number;
72
+ isEmriNumarasiForBarcode: number;
73
+
74
+ generateReport() {
75
+ this.service
76
+ .getBarcodeInfo(this.isEmriNumarasiForBarcode, this.newRecordDocEntry, 1)
77
+ .subscribe({
78
+ next: response => {
79
+ const base64Data = response.base64; // base64 string (sadece veri kısmı, "data:application/pdf;base64,..." değilse)
80
+
81
+ // Base64'ü decode edip binary veriye çeviriyoruz
82
+ const byteCharacters = atob(base64Data);
83
+ const byteNumbers = new Array(byteCharacters.length);
84
+ for (let i = 0; i < byteCharacters.length; i++) {
85
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
86
+ }
87
+ const byteArray = new Uint8Array(byteNumbers);
88
+
89
+ // Blob oluşturuyoruz
90
+ const blob = new Blob([byteArray], { type: 'application/pdf' });
91
+
92
+ // Blob'tan URL oluşturup yeni sekmede açıyoruz (veya download edebilirsin)
93
+ this.blobUrl = URL.createObjectURL(blob);
94
+ this.pdfSrc = this.bypassAndSanitize(this.blobUrl);
95
+ },
96
+ });
97
+ }
98
+
99
+ bypassAndSanitize(url): SafeResourceUrl {
100
+ return this.sanitizer.bypassSecurityTrustResourceUrl(url);
101
+ }
102
+
103
+ downloadPdf(blobUrl) {
104
+ const a = document.createElement('a');
105
+ a.href = blobUrl;
106
+ const parts = blobUrl.split('/');
107
+ const lastPart = parts.pop(); // "myfile.pdf"
108
+ a.download = lastPart + '.pdf'; // Kaydedilecek dosya adı
109
+ a.style.display = 'none';
110
+
111
+ // iOS'ta desteklenmesi için target=_blank eklenebilir
112
+ a.target = '_blank';
113
+
114
+ // DOM'a ekleyip tıklat
115
+ document.body.appendChild(a);
116
+ a.click();
117
+ document.body.removeChild(a);
118
+ }
119
+
120
+ productionOrder: GetProductionOrderDto = new GetProductionOrderDto();
121
+
122
+ async getProductionOrder() {
123
+ this.clearForm();
124
+ this.isLoading = true;
125
+ this.searcheBasildiMi = true;
126
+ this.productionOrdersService.get(this.barkodNumarasi).subscribe({
127
+ next: result => {
128
+ if (result.isSuccessful) {
129
+ this.productionOrder = result.items;
130
+ this.receiptFromProductionsPostDtoQuantity =
131
+ result.items.plannedQuantity - result.items.completedQuantity;
132
+
133
+ this.receiptFromProductionsPostDtoDocumentLine.baseEntry = this.barkodNumarasi;
134
+ this.receiptFromProductionsPostDtoDocumentLine.baseType = 202;
135
+ this.receiptFromProductionsPostDtoDocumentLine.quantity =
136
+ this.receiptFromProductionsPostDtoQuantity;
137
+ this.receiptFromProductionsPostDtoDocumentLine.warehouseCode = result.items.warehouse;
138
+ this.receiptFromProductionsPostDtoBatchNumber.batchNumber = result.items.u_trkBatch;
139
+ this.receiptFromProductionsPostDtoBatchNumber.quantity =
140
+ this.receiptFromProductionsPostDtoQuantity;
141
+
142
+ this.unitOfMeasure = result.items.unitOfMeasurement;
143
+ this.isProductionOrderValid = true;
144
+ this.focusOnToplananMiktar();
145
+ } else {
146
+ if (result?.isSuccessful == false) {
147
+ this.confirmation.status$.subscribe({
148
+ next: () => {
149
+ this.clearAll();
150
+ },
151
+ });
152
+ }
153
+ }
154
+ },
155
+ });
156
+
157
+ this.isLoading = false;
158
+ }
159
+
160
+ receiptFromProductionsPostDtoQuantity: number = 0;
161
+ receiptFromProductionsPostDto: ReceiptFromProductionsPostDto =
162
+ new ReceiptFromProductionsPostDto();
163
+ receiptFromProductionsPostDtoDocumentLine: ReceiptFromProductionsLines =
164
+ new ReceiptFromProductionsLines();
165
+ receiptFromProductionsPostDtoBatchNumber: ReceiptFromProductionsBatchNumbers =
166
+ new ReceiptFromProductionsBatchNumbers();
167
+
168
+ async postReceiptFromProductions() {
169
+ this.isLoading = true;
170
+
171
+ this.receiptFromProductionsPostDtoDocumentLine.batchNumbers = [
172
+ this.receiptFromProductionsPostDtoBatchNumber,
173
+ ];
174
+ this.receiptFromProductionsPostDto.documentLines = [
175
+ this.receiptFromProductionsPostDtoDocumentLine,
176
+ ];
177
+
178
+ this.service.create(this.receiptFromProductionsPostDto).subscribe({
179
+ next: result => {
180
+ if (result.isSuccessful) {
181
+ this.confirmation.success('İşlem Başarılı', '', this.options).subscribe(() => {
182
+ this.newRecordDocEntry = result.items.docEntry;
183
+ this.isEmriNumarasiForBarcode = this.barkodNumarasi;
184
+ this.showModal = true;
185
+ this.clearAll();
186
+ });
187
+ } else {
188
+ this.confirmation.status$.subscribe(() => {
189
+ this.focusOnToplananMiktar();
190
+ });
191
+ }
192
+ },
193
+ error: () => {
194
+ this.confirmation.status$.subscribe(() => {
195
+ this.focusOnToplananMiktar();
196
+ });
197
+ },
198
+ });
199
+
200
+ this.isLoading = false;
201
+ }
202
+
203
+ clearAll() {
204
+ this.barkodNumarasi = null;
205
+ this.clearForm();
206
+ }
207
+
208
+ clearForm() {
209
+ this.productionOrder = new GetProductionOrderDto();
210
+ this.receiptFromProductionsPostDto = new ReceiptFromProductionsPostDto();
211
+ this.receiptFromProductionsPostDtoDocumentLine = new ReceiptFromProductionsLines();
212
+ this.receiptFromProductionsPostDtoBatchNumber = new ReceiptFromProductionsBatchNumbers();
213
+ this.unitOfMeasure = null;
214
+ this.isProductionOrderValid = false;
215
+ this.searcheBasildiMi = false;
216
+ this.focusOnBarkodNumarasi();
217
+ }
218
+
219
+ warehouses: Warehouse[] = [];
220
+
221
+ async getWarehouses() {
222
+ this.isLoading = true;
223
+ this.productionOrdersService.getWarehouses().subscribe({
224
+ next: result => {
225
+ if (result.items) {
226
+ this.warehouses = result.items.slice();
227
+ }
228
+ },
229
+ });
230
+ this.isLoading = false;
231
+ }
232
+
233
+ focusOnBarkodNumarasi() {
234
+ this.ngZone.run(() => {
235
+ setTimeout(() => {
236
+ this.nmbBoxBarkodNumarasi.instance.focus();
237
+ }, 0);
238
+ });
239
+ }
240
+
241
+ focusOnToplananMiktar() {
242
+ this.ngZone.run(() => {
243
+ setTimeout(() => {
244
+ this.nmbBoxToplananMiktar.instance.focus();
245
+ }, 0);
246
+ });
247
+ }
248
+
249
+ getWarehouseName(code: string): string {
250
+ const match = this.warehouses.find(x => x.whsCode === code);
251
+ return match ? match.whsName : '';
252
+ }
253
+
254
+ quantityChanged(e: any) {
255
+ this.receiptFromProductionsPostDtoBatchNumber.quantity = e.value;
256
+ this.receiptFromProductionsPostDtoDocumentLine.quantity = e.value;
257
+ }
258
+ }
@@ -0,0 +1,38 @@
1
+ import {CoreModule} from '@abp/ng.core';
2
+ import {ThemeSharedModule} from '@abp/ng.theme.shared';
3
+ import {NgModule} from '@angular/core';
4
+ import {
5
+ NgbCollapseModule,
6
+ NgbDatepickerModule,
7
+ NgbDropdownModule,
8
+ } from '@ng-bootstrap/ng-bootstrap';
9
+ import {NgxValidateCoreModule} from '@ngx-validate/core';
10
+ import {CommercialUiModule} from '@volo/abp.commercial.ng.ui';
11
+ import {PageModule} from '@abp/ng.components/page';
12
+ import {HitReceiptFromProductionsComponent} from "./hit-receipt-from-productions.component";
13
+ import {HitReceiptFromProductionRoutingModule} from "./hit-receipt-from-production-routing.module";
14
+ import {DevExtremeModule, DxButtonModule, DxNumberBoxModule} from "devextreme-angular";
15
+
16
+ @NgModule({
17
+ declarations: [HitReceiptFromProductionsComponent],
18
+ imports: [
19
+ HitReceiptFromProductionRoutingModule,
20
+ CoreModule,
21
+ ThemeSharedModule,
22
+ CommercialUiModule,
23
+ NgxValidateCoreModule,
24
+ NgbCollapseModule,
25
+ NgbDatepickerModule,
26
+ NgbDropdownModule,
27
+ PageModule,
28
+ DxButtonModule,
29
+ DxNumberBoxModule,
30
+ DevExtremeModule,
31
+ ],
32
+ })
33
+ export class HitReceiptFromProductionsModule {
34
+ }
35
+
36
+ export function loadHitReceiptFromProductionsAsChild() {
37
+ return Promise.resolve(HitReceiptFromProductionsModule);
38
+ }
@@ -0,0 +1,9 @@
1
+ import {Component} from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'lib-uretim-yonetimi',
5
+ template: ` <p>uretim-yonetimi works!</p> `,
6
+ styles: [],
7
+ })
8
+ export class UretimYonetimiComponent {
9
+ }
@@ -0,0 +1,20 @@
1
+ export interface LoadOptions{
2
+ key: string,
3
+ loadUrl: string,
4
+ params?: any,
5
+ insertUrl?: string,
6
+ updateUrl?: string,
7
+ deleteUrl?:string
8
+ }
9
+
10
+ export interface AbpSessionInfo {
11
+ language: string
12
+ tenant: Tenant
13
+ }
14
+
15
+ export interface Tenant {
16
+ id: any
17
+ name: any
18
+ isAvailable: boolean
19
+ }
20
+
@@ -0,0 +1,51 @@
1
+ import { EnvironmentService, LocalizationService } from "@abp/ng.core";
2
+ import { ToasterService } from "@abp/ng.theme.shared";
3
+ import { Injectable } from "@angular/core";
4
+ import * as AspNetData from 'devextreme-aspnet-data-nojquery';
5
+ import { AbpSessionInfo,LoadOptions } from "./devexpress-load-options.model";
6
+ @Injectable({
7
+ providedIn: 'root'
8
+ })
9
+ export class DevexpressRestService {
10
+
11
+ localizationKey: any = 'tr'
12
+ createStore = (options: LoadOptions) => AspNetData.createStore({
13
+ key: options.key,
14
+ loadParams: options.params,
15
+ loadUrl: `${this.envService.getEnvironment().apis.eDonusum.url + '/' + options.loadUrl}`,
16
+ insertUrl: `${this.envService.getEnvironment().apis.eDonusum.url + '/' + options.insertUrl}`,
17
+ insertMethod: 'POST',
18
+ updateUrl: `${this.envService.getEnvironment().apis.eDonusum.url + '/' + options.updateUrl}`,
19
+ updateMethod: 'PUT',
20
+ deleteUrl: `${this.envService.getEnvironment().apis.eDonusum.url + '/' + options.deleteUrl}`,
21
+ deleteMethod: 'DELETE',
22
+ onLoading(loadOptions) {
23
+ },
24
+ onBeforeSend(operation, ajaxSettings) {
25
+
26
+ let languages={} as AbpSessionInfo
27
+ languages= JSON.parse(localStorage.getItem('abpSession')) as AbpSessionInfo
28
+
29
+ if (operation === "insert" || operation === "update" || operation === "delete") {
30
+ console.log(ajaxSettings);
31
+ if (operation == "delete") {
32
+ ajaxSettings.url = ajaxSettings.url + "/" + localStorage.getItem("appointment-deleted-id")
33
+ }
34
+ ajaxSettings.contentType = "application/json"
35
+ ajaxSettings.data = ajaxSettings.data.values
36
+ }
37
+ ajaxSettings.headers = {
38
+ Authorization: 'Bearer ' + localStorage.getItem('access_token'),
39
+ 'Accept-Language': languages.language
40
+ };
41
+ }, onAjaxError: this.onAjaxError
42
+ });
43
+ onAjaxError(e: { xhr, error }) {
44
+ let jsonObj = e.xhr.responseJSON || JSON.parse(e.xhr.responseText);
45
+ e.error = jsonObj ? ` ${jsonObj.error.message} : ${jsonObj.error.details}` : 'null text';
46
+ }
47
+ constructor(private envService: EnvironmentService, private toaster: ToasterService) {
48
+
49
+
50
+ }
51
+ }
@@ -0,0 +1,41 @@
1
+ import {RestService} from '@abp/ng.core';
2
+ import {Injectable} from '@angular/core';
3
+ import {ResultBase} from "../models";
4
+ import {ReceiptFromProductions} from "./models";
5
+ import { HttpClient } from '@angular/common/http';
6
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
7
+
8
+ @Injectable({
9
+ providedIn: 'root',
10
+ })
11
+ export class HitCreateBarcodesService {
12
+ apiName = 'UretimYonetimi';
13
+ protected readonly resourceEndpoint: string;
14
+
15
+ constructor(private restService: RestService) {
16
+ this.resourceEndpoint = '/api/uretim-yonetimi/create-barcodes';
17
+ }
18
+
19
+ getReceiptFromProductions = (orderNo: string) =>
20
+ this.restService.request<any, ResultBase<ReceiptFromProductions[]>>({
21
+ method: 'GET',
22
+ url: `${this.resourceEndpoint}/get-receipt-from-productions?productionOrderId=${orderNo}`,
23
+ },
24
+ {apiName: this.apiName});
25
+
26
+ getBarcodeInfo = (productionOrderId, receiptId, barcodeNumber) =>
27
+ this.restService.request<any, any>({
28
+ method: 'POST',
29
+ url: `${this.resourceEndpoint}/get-barcode?productionOrderId=${productionOrderId}&receiptId=${receiptId}&barcodeNumber=${barcodeNumber}`,
30
+ },
31
+ {apiName: this.apiName});
32
+ }
33
+
34
+ export class BarcodeViewerComponent {
35
+ pdfSrc: SafeResourceUrl | null = null;
36
+ protected readonly resourceEndpoint: string;
37
+
38
+ constructor(private http: HttpClient, private sanitizer: DomSanitizer) {
39
+ this.resourceEndpoint = '/api/uretim-yonetimi/create-barcodes';
40
+ }
41
+ }
@@ -0,0 +1,6 @@
1
+ export class ReceiptFromProductions {
2
+ docEntry: number;
3
+ quantity: number;
4
+ docDate: Date;
5
+ docDateString: string;
6
+ }
@@ -0,0 +1,39 @@
1
+ import {RestService} from '@abp/ng.core';
2
+ import {Injectable} from '@angular/core';
3
+ import {DevexpressRestService} from '../devexpress-query-builder/devexpress-query-builder';
4
+ import {ResultBase} from "../models";
5
+ import {IssuesForProductionGetDto, IssuesForProductionPatchDto, IssuesForProductionPostDto} from "./models";
6
+
7
+ @Injectable({
8
+ providedIn: 'root',
9
+ })
10
+ export class HitIssuesForProductionsService {
11
+ apiName = 'UretimYonetimi';
12
+ protected readonly resourceEndpoint: string;
13
+
14
+ constructor(private restService: RestService, private devexService: DevexpressRestService) {
15
+ this.resourceEndpoint = '/api/uretim-yonetimi/issues-for-productions';
16
+ }
17
+
18
+ post = (input: IssuesForProductionPostDto) =>
19
+ this.restService.request<IssuesForProductionPostDto, ResultBase<IssuesForProductionPostDto>>({
20
+ method: 'POST',
21
+ url: `${this.resourceEndpoint}`,
22
+ body: input,
23
+ },
24
+ {apiName: this.apiName});
25
+ patch = (input: IssuesForProductionPatchDto) =>
26
+ this.restService.request<IssuesForProductionPatchDto, ResultBase<IssuesForProductionPatchDto>>({
27
+ method: 'POST',
28
+ url: `${this.resourceEndpoint}`,
29
+ body: input,
30
+ },
31
+ {apiName: this.apiName});
32
+
33
+ get = (itemCode: string, orderNo: string) =>
34
+ this.restService.request<string, ResultBase<IssuesForProductionGetDto>>({
35
+ method: 'GET',
36
+ url: `${this.resourceEndpoint}?itemCode=${itemCode}&orderNo=${orderNo}`,
37
+ },
38
+ {apiName: this.apiName});
39
+ }
@@ -0,0 +1,42 @@
1
+ export class IssuesForProductionPostDto {
2
+ DocumentLines: IssueLine[];
3
+
4
+ constructor(issueLines: IssueLine[] = []) {
5
+ this.DocumentLines = issueLines;
6
+ }
7
+ }
8
+
9
+ export class IssueLine {
10
+ ItemCode: string; // For mapping
11
+ IsQRReady: boolean = false;
12
+ WarehouseCode: string;
13
+ Quantity: number = 0;
14
+ BaseType: number = 202;
15
+ BaseEntry: number;
16
+ BaseLine: number;
17
+ BatchNumbers: BatchNumber[] = [];
18
+ }
19
+
20
+ export class BatchNumber {
21
+ BatchNumber: string;
22
+ Quantity: number;
23
+
24
+ constructor(batchNumber: string, quantity: number) {
25
+ this.BatchNumber = batchNumber;
26
+ this.Quantity = quantity;
27
+ }
28
+ }
29
+
30
+ export class IssuesForProductionPatchDto {
31
+
32
+ }
33
+
34
+ export class IssuesForProductionGetDto {
35
+ orderNo: string;
36
+ itemCode: string;
37
+ itemName: string;
38
+ warehouse: string;
39
+ lineNum: number;
40
+ plannedQty: number;
41
+ unitOfMeasurement: string;
42
+ }
@@ -0,0 +1,60 @@
1
+ import {RestService} from '@abp/ng.core';
2
+ import {Injectable} from '@angular/core';
3
+ import {HammaddeDepo, ItemInfos, ProductionOrderPatchDto, Warehouse} from "./models";
4
+ import {ResultBase} from "../models";
5
+ import {GetProductionOrderDto} from "../hit-receipt-from-productions/models";
6
+
7
+ @Injectable({
8
+ providedIn: 'root',
9
+ })
10
+ export class HitProductionOrdersService {
11
+ apiName = 'UretimYonetimi';
12
+ protected readonly resourceEndpoint: string;
13
+
14
+ constructor(private restService: RestService) {
15
+ this.resourceEndpoint = '/api/uretim-yonetimi/production-orders';
16
+ }
17
+
18
+ get = (id: number) =>
19
+ this.restService.request<string, ResultBase<GetProductionOrderDto>>({
20
+ method: 'GET',
21
+ url: `${this.resourceEndpoint}?id=${id + ''}`,
22
+ },
23
+ {apiName: this.apiName});
24
+ get2 = (id: number) =>
25
+ this.restService.request<string, GetProductionOrderDto>({
26
+ method: 'GET',
27
+ url: `${this.resourceEndpoint}?id=${id + ''}`,
28
+ },
29
+ {apiName: this.apiName});
30
+
31
+ patch = (input: ProductionOrderPatchDto) =>
32
+ this.restService.request<any, ResultBase<ProductionOrderPatchDto>>(
33
+ {
34
+ method: 'PATCH',
35
+ url: `${this.resourceEndpoint}`,
36
+ body: input
37
+ },
38
+ {apiName: this.apiName}
39
+ );
40
+ getWarehouses = () =>
41
+ this.restService.request<any, ResultBase<Warehouse[]>>({
42
+ method: 'GET',
43
+ url: `${this.resourceEndpoint}/get-warehouses`,
44
+ },
45
+ {apiName: this.apiName});
46
+
47
+ getWareHouseInfo = (itemCode: string, orderNo: string) =>
48
+ this.restService.request<any, ResultBase<HammaddeDepo>>({
49
+ method: 'GET',
50
+ url: `${this.resourceEndpoint}/get-warehouse-info?itemCode=${itemCode}&orderNo=${orderNo}`,
51
+ },
52
+ {apiName: this.apiName});
53
+
54
+ getItemInfo = (itemCode) =>
55
+ this.restService.request<any, ResultBase<ItemInfos>>({
56
+ method: 'GET',
57
+ url: `${this.resourceEndpoint}/get-item-info?itemCode=${itemCode}`,
58
+ },
59
+ {apiName: this.apiName});
60
+ }