Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

feasso

Criar PROCEDURE

Recommended Posts

<%

 

SQL = " SELECT TBI.Quantidade_BeneficiamentoItem, TBI.Quantidade_BeneficiamentoItem - TBRI.QuantidadeRecebida_BeneficiamentoRetornoItem AS DIFERENCA, TBI.ID_PRODUTO " &_

" FROM TBeneficiamentoItem TBI " &_

" LEFT JOIN TBeneficiamentoRetornoItem TBRI ON (TBRI.ID_BeneficiamentoItem = TBI.ID_Beneficiamento) " &_

" WHERE TBI.id_beneficiamento = " & Request.QueryString("ID_Beneficiamento")

set rsQuery = Conn.Execute(SQL)

 

IF isnull (rsQuery("DIFERENCA")) then

QuantDevolver = rsQuery("Quantidade_BeneficiamentoItem")

ELSE

QuantDevolver = rsQuery("DIFERENCA")

END IF

 

' DEVOLUÇÃO DO PRODUTO NO ESTOQUE

SQL = " UPDATE TProduto " &_

" SET Estoque_Produto = Estoque_Produto + " & Replace(Replace(QuantDevolver,".",""),",",".") &_

" WHERE ID_Produto = "& rsQuery("ID_PRODUTO")

 

Conn.Execute(SQL)

 

' MUDAR O STATUS DE ABERTTO -> CANCELADO

SQL = "UPDATE TBeneficiamento " & _

" SET ID_BeneficiamentoStatus= '6' " & _

" WHERE ID_Beneficiamento = " & Request.QueryString("ID_Beneficiamento")

 

Conn.Execute(SQL)

 

Conn.Close

Set Conn = Nothing

 

%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

feasso, de uma lida aki:

http://forum.imasters.com.br/index.php?showtopic=154967

 

que vai te dar uma luz ^^

 

Abçs

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.