feat: rename 'fee' to 'unitPrice' across purchase components and models
- Updated form component to use 'unitPrice' instead of 'fee'. - Adjusted product charge row form fields and templates to reflect the new naming. - Modified receipt template and related components to utilize 'unitPrice'. - Changed models and interfaces to replace 'fee' with 'unitPrice'. - Updated supplier invoice and statistics components to align with the new naming convention. - Added new API routes for dashboard and statistics modules.
This commit is contained in:
@@ -72,7 +72,7 @@ export class POSStore {
|
||||
|
||||
readonly orderPricingInfo = computed(() => {
|
||||
const totalAmount = this.inOrderProducts().reduce(
|
||||
(acc, curr) => acc + curr.fee * curr.count,
|
||||
(acc, curr) => acc + curr.unitPrice * curr.count,
|
||||
0,
|
||||
);
|
||||
const taxAmount = totalAmount * 0.1;
|
||||
@@ -188,7 +188,7 @@ export class POSStore {
|
||||
product,
|
||||
productId: product.id,
|
||||
count: 1,
|
||||
fee: parseFloat(product.salePrice),
|
||||
unitPrice: parseFloat(product.salePrice),
|
||||
maxQuantity: productStock.quantity,
|
||||
},
|
||||
],
|
||||
@@ -220,13 +220,13 @@ export class POSStore {
|
||||
}
|
||||
}
|
||||
|
||||
updateInOrderProductFee(productId: number, fee: number) {
|
||||
updateInOrderProductFee(productId: number, unitPrice: number) {
|
||||
const inOrderProducts = this.state$().inOrderProducts;
|
||||
|
||||
if (inOrderProducts.some((p) => p.productId === productId)) {
|
||||
const updatedProducts = inOrderProducts.map((p) => {
|
||||
if (p.productId === productId) {
|
||||
return { ...p, fee: fee };
|
||||
return { ...p, unitPrice: unitPrice };
|
||||
}
|
||||
return p;
|
||||
});
|
||||
@@ -255,7 +255,7 @@ export class POSStore {
|
||||
items: this.inOrderProducts()?.map((item) => ({
|
||||
productId: item.productId,
|
||||
count: item.count,
|
||||
fee: item.fee,
|
||||
unitPrice: item.unitPrice,
|
||||
})),
|
||||
};
|
||||
this.service.submitOrder(this.posId, orderPayload).subscribe();
|
||||
|
||||
Reference in New Issue
Block a user