summaryrefslogtreecommitdiff
path: root/packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx')
-rw-r--r--packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx b/packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx
index 5bb69f1..6cf48f8 100644
--- a/packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx
+++ b/packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx
@@ -41,27 +41,27 @@ export function InventoryProductForm({ currentProducts, onAddProduct }: Props):
const submit = (): void => {
if (!state.product) {
- setErrors({ product: i18n`select a product first` });
+ setErrors({ product: i18n`You must enter a valid product identifier.` });
return;
}
if (state.product.total_stock === -1) {
onAddProduct(state.product, 1)
} else {
if (!state.quantity || state.quantity <= 0) {
- setErrors({ quantity: i18n`should be greater than 0` });
+ setErrors({ quantity: i18n`Quantity must be greater than 0!` });
return;
}
const currentStock = state.product.total_stock - state.product.total_lost - state.product.total_sold
const p = currentProducts[state.product.id]
if (p) {
if (state.quantity + p.quantity > currentStock) {
- setErrors({ quantity: i18n`cannot be greater than current stock and quantity previously added. max: ${currentStock - p.quantity}` });
+ setErrors({ quantity: i18n`This quantity exceeds remaining stock. The current maximum value is ${currentStock - p.quantity}.` });
return;
}
onAddProduct(state.product, state.quantity + p.quantity)
} else {
if (state.quantity > currentStock) {
- setErrors({ quantity: i18n`cannot be greater than current stock ${currentStock}` });
+ setErrors({ quantity: i18n`This quantity exceeds remaining stock. The current maximum value is ${currentStock}.` });
return;
}
onAddProduct(state.product, state.quantity)