@hitsoft/e-donusum 1.0.107 → 1.0.109

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.
@@ -9145,6 +9145,12 @@ function loadXsltRuleScenarioModuleAsChild() {
9145
9145
  return Promise.resolve(XsltRuleScenarioModule);
9146
9146
  }
9147
9147
 
9148
+ var InvoiceType;
9149
+ (function (InvoiceType) {
9150
+ InvoiceType[InvoiceType["efatura"] = 0] = "efatura";
9151
+ InvoiceType[InvoiceType["earsiv"] = 3] = "earsiv";
9152
+ })(InvoiceType || (InvoiceType = {}));
9153
+
9148
9154
  class HitInvoiceService {
9149
9155
  constructor(restService, devexService) {
9150
9156
  this.restService = restService;
@@ -9424,7 +9430,11 @@ class HitInvoiceComponent {
9424
9430
  }
9425
9431
  listActiveSeries(record) {
9426
9432
  debugger;
9427
- this.hitDocumentSerialService.ListActiveSeriesForDocument(0).subscribe(serials => {
9433
+ const type = record.profileId === "EARSIVFATURA"
9434
+ ? InvoiceType.earsiv
9435
+ : InvoiceType.efatura;
9436
+ console.log(type);
9437
+ this.hitDocumentSerialService.ListActiveSeriesForDocument(type).subscribe(serials => {
9428
9438
  this.invoiceSerialDataSource = serials.map(item => ({ Seri: item }));
9429
9439
  ;
9430
9440
  this.selectedInvoiceIds = [record.id];
@@ -9432,10 +9442,22 @@ class HitInvoiceComponent {
9432
9442
  });
9433
9443
  }
9434
9444
  listActiveSeriesForMultiple() {
9435
- this.hitDocumentSerialService.ListActiveSeriesForDocument(0).subscribe(serials => {
9445
+ const selectedRows = this.dxInvoiceInstance.instance.getSelectedRowsData();
9446
+ if (!selectedRows.length) {
9447
+ this.toasterService.warn("Lütfen en az bir fatura seçin.");
9448
+ return;
9449
+ }
9450
+ const types = [...new Set(selectedRows.map(r => r.profileId?.trim().toUpperCase() === "EARSIVFATURA"
9451
+ ? InvoiceType.earsiv
9452
+ : InvoiceType.efatura))];
9453
+ if (types.length > 1) {
9454
+ this.toasterService.warn("Farklı türdeki faturalar için aynı anda seri ataması yapılamaz. Lütfen aynı türdeki faturaları seçin.");
9455
+ return;
9456
+ }
9457
+ const type = types[0];
9458
+ this.hitDocumentSerialService.ListActiveSeriesForDocument(type).subscribe(serials => {
9436
9459
  this.invoiceSerialDataSource = serials.map(item => ({ Seri: item }));
9437
- ;
9438
- this.selectedInvoiceIds = this.dxInvoiceInstance.instance.getVisibleRows().filter(i => i.isSelected == true).map(p => p.data.id);
9460
+ this.selectedInvoiceIds = selectedRows.map(p => p.id);
9439
9461
  this.isSerialModalOpen = true;
9440
9462
  });
9441
9463
  }
@@ -10892,8 +10914,9 @@ class HitInboundInvoiceComponent {
10892
10914
  return;
10893
10915
  }
10894
10916
  // İş kuralı
10895
- const valid = rows.every(x => x.invoiceTypeCode !== 'IADE' &&
10896
- (x.status === 600 || x.status === 700));
10917
+ const valid = rows.every(x => !(x.profileId == 'TICARIFATURA' && x.status == 700 && x.receiverResponse == 2) &&
10918
+ (x.invoiceTypeCode !== 'IADE' &&
10919
+ (x.status === 600 || x.status === 700)));
10897
10920
  this.hasValidSelection = valid;
10898
10921
  }
10899
10922
  createMultipleEmptyDrafts() {