diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-06-09 16:50:17 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-06-09 16:50:17 +0200 |
commit | 352e23dbbc9a83b522964f3ba7fb06295d38c835 (patch) | |
tree | 05792a1747593465669710c9cdd196009182566d /packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx | |
parent | d626559c46437e94a853562162fbf5bf29fd806f (diff) | |
download | merchant-backoffice-352e23dbbc9a83b522964f3ba7fb06295d38c835.tar.gz merchant-backoffice-352e23dbbc9a83b522964f3ba7fb06295d38c835.tar.bz2 merchant-backoffice-352e23dbbc9a83b522964f3ba7fb06295d38c835.zip |
edit strings
Diffstat (limited to 'packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx')
-rw-r--r-- | packages/frontend/src/paths/instance/orders/create/InventoryProductForm.tsx | 8 |
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) |