[dbo].[MssWebUpdateOrderThirdPartyService]
CREATE PROCEDURE [dbo].[MssWebUpdateOrderThirdPartyService]
@inId int,
@inOrderId int,
@inVendorId varchar(15),
@inAmount money,
@inPONumber varchar(20),
@inInvoiceNumber varchar(20),
@inDescription varchar(60),
@inServiceDate datetime,
@inInvoiceReceivedDate datetime,
@inInvoiceApprovedDate datetime
AS
BEGIN
UPDATE OrderThirdPartys SET
VendorID = @inVendorId,
Amount = @inAmount,
PONumber = @inPONumber,
InvoiceNumber = @inInvoiceNumber,
Description = @inDescription,
Date = @inServiceDate,
InvoiceReceivedDate = @inInvoiceReceivedDate,
InvoiceApprovedDate = @inInvoiceApprovedDate
WHERE OrdThirdPartyPriKey = @inId AND OrdPriKey=@inOrderId
END
update Orders set
JobCostingCalculated = 0
from dbo.OrderThirdPartys
inner join Orders on Orders.PriKey=OrderThirdPartys.OrdPrikey and
Orders.PriKey=@inOrderId
where OrderThirdPartys.OrdThirdPartyPriKey = @inId and
Orders.ReleaseDate is null
GO
GRANT EXECUTE ON [dbo].[MssWebUpdateOrderThirdPartyService] TO [MssExec]
GO