Feature: Added product Stock Keeping Units to prevent duplicate products. A lot of refactoring because of this.
Removed: Reset Stock as it was never used and don't think it is even needed with this new batch system. Fix: Incentive update was not working
This commit is contained in:
@ -167,7 +167,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
return;
|
||||
}
|
||||
const oldFiltered = this.voucher.inventories.filter(
|
||||
(x) => x.product.id === (this.batch as Batch).product.id,
|
||||
(x) => x.batch.sku.id === (this.batch as Batch).sku.id,
|
||||
);
|
||||
const old = oldFiltered.length ? oldFiltered[0] : null;
|
||||
if (oldFiltered.length) {
|
||||
@ -192,7 +192,6 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
tax: this.batch.tax,
|
||||
discount: this.batch.discount,
|
||||
amount: quantity * this.batch.rate * (1 + this.batch.tax) * (1 - this.batch.discount),
|
||||
product: this.batch.product,
|
||||
batch: this.batch,
|
||||
}),
|
||||
);
|
||||
@ -238,8 +237,8 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
const j = result as Inventory;
|
||||
if (
|
||||
j.product.id !== row.product.id &&
|
||||
this.voucher.inventories.filter((x) => x.product.id === j.product.id).length
|
||||
j.batch.sku.id !== row.batch.sku.id &&
|
||||
this.voucher.inventories.filter((x) => x.batch.sku.id === j.batch.sku.id).length
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user