🚀 Auto-deploy: TrackSteelAPP atualizado em 21/08/2026 21:03:35
This commit is contained in:
@@ -347,6 +347,12 @@ export const ItensRomaneioModal: React.FC<ItensRomaneioModalProps> = ({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const quantidade = parseInt(quantidadePeca);
|
const quantidade = parseInt(quantidadePeca);
|
||||||
|
|
||||||
|
if (quantidade > pecaSelecionada.quantidade_disponivel) {
|
||||||
|
toast.error(`Quantidade não autorizada! Saldo disponível é ${pecaSelecionada.quantidade_disponivel}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { error } = await supabase
|
const { error } = await supabase
|
||||||
.from('itens_romaneio_pecas')
|
.from('itens_romaneio_pecas')
|
||||||
.insert({
|
.insert({
|
||||||
@@ -619,6 +625,7 @@ export const ItensRomaneioModal: React.FC<ItensRomaneioModalProps> = ({
|
|||||||
<Input
|
<Input
|
||||||
type="number"
|
type="number"
|
||||||
min="1"
|
min="1"
|
||||||
|
max={pecasDisponiveis.find(p => p.id === pecaDisponivel)?.quantidade_disponivel || 1}
|
||||||
value={quantidadePeca}
|
value={quantidadePeca}
|
||||||
onChange={(e) => setQuantidadePeca(e.target.value)}
|
onChange={(e) => setQuantidadePeca(e.target.value)}
|
||||||
placeholder="Quantidade"
|
placeholder="Quantidade"
|
||||||
|
|||||||
Reference in New Issue
Block a user