mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merge branch 'develop' of https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend into develop
This commit is contained in:
@@ -500,14 +500,12 @@ export class DomainRemissionService {
|
||||
return receipt;
|
||||
}
|
||||
|
||||
async completeReceipt(returnId: number, receiptId: number, packageCode: string): Promise<ReceiptDTO> {
|
||||
async completeReceipt(returnId: number, receiptId: number): Promise<ReceiptDTO> {
|
||||
const res = await this._returnService
|
||||
.ReturnFinalizeReceipt({
|
||||
returnId,
|
||||
receiptId,
|
||||
data: {
|
||||
packageCode,
|
||||
},
|
||||
data: {},
|
||||
})
|
||||
.toPromise();
|
||||
|
||||
|
||||
@@ -54,19 +54,11 @@ export class PriceUpdateItemComponent {
|
||||
inStock$ = combineLatest([this.defaultBranch$, this._item$]).pipe(
|
||||
debounceTime(100),
|
||||
filter(([defaultBranch, item]) => !!defaultBranch && !!item),
|
||||
switchMap(
|
||||
([defaultBranch, item]) =>
|
||||
this._stockService.getInStock$({
|
||||
itemId: Number(item?.product?.catalogProductNumber),
|
||||
branchId: defaultBranch?.id,
|
||||
})
|
||||
// TODO: Bugfixing INSTOCK
|
||||
// .pipe(
|
||||
// map((instock) => {
|
||||
// this.item.product.ean === '9783551775559' ? console.log({ item: this.item, instock }) : '';
|
||||
// return instock;
|
||||
// })
|
||||
// )
|
||||
switchMap(([defaultBranch, item]) =>
|
||||
this._stockService.getInStock$({
|
||||
itemId: Number(item?.product?.catalogProductNumber),
|
||||
branchId: defaultBranch?.id,
|
||||
})
|
||||
),
|
||||
shareReplay(1)
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ItemDTO } from '@swagger/cat';
|
||||
import { DateAdapter } from '@ui/common';
|
||||
import { isEqual } from 'lodash';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { debounceTime, switchMap, map, tap, shareReplay } from 'rxjs/operators';
|
||||
import { debounceTime, switchMap, map, shareReplay, filter } from 'rxjs/operators';
|
||||
import { ArticleSearchService } from '../article-search.store';
|
||||
|
||||
export interface SearchResultItemComponentState {
|
||||
@@ -110,9 +110,11 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
||||
|
||||
inStock$ = combineLatest([this.item$, this.selectedBranchId$, this.defaultBranch$]).pipe(
|
||||
debounceTime(100),
|
||||
filter(([item, branch, defaultBranch]) => !!item && !!defaultBranch),
|
||||
switchMap(([item, branch, defaultBranch]) =>
|
||||
this._stockService.getInStock$({ itemId: item.id, branchId: branch?.id ?? defaultBranch?.id })
|
||||
)
|
||||
),
|
||||
shareReplay(1)
|
||||
);
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -159,19 +159,18 @@ export class ShippingDocumentDetailsComponent extends ComponentStore<ShippingDoc
|
||||
}
|
||||
|
||||
async complete() {
|
||||
const packageNumber = await this.packageNumber$.pipe(first()).toPromise();
|
||||
if (await this.completeReceipt(packageNumber)) {
|
||||
if (await this.completeReceipt()) {
|
||||
await this.completeReturn();
|
||||
}
|
||||
}
|
||||
|
||||
async completeReceipt(packageCode: string) {
|
||||
async completeReceipt() {
|
||||
const returnId = this.return?.id;
|
||||
const receiptId = this.firstReceipt?.id;
|
||||
|
||||
if (receiptId) {
|
||||
try {
|
||||
await this._remissionService.completeReceipt(returnId, receiptId, packageCode);
|
||||
await this._remissionService.completeReceipt(returnId, receiptId);
|
||||
return true;
|
||||
} catch (err) {
|
||||
this._modal.open({
|
||||
|
||||
Reference in New Issue
Block a user