Skip to content

Instantly share code, notes, and snippets.

@mattiaswolff
Created September 25, 2012 12:23
Show Gist options
  • Save mattiaswolff/3781457 to your computer and use it in GitHub Desktop.
Save mattiaswolff/3781457 to your computer and use it in GitHub Desktop.
Mediusflow: Handlde errands where integration status not in sync
DECLARE @intErrandId integer
DECLARE @intPaymenttransferred integer
DECLARE @strVerificationIdentity nvarchar (20)
SET @intErrandId = [[Errand Id]]
SET @strVerificationIdentity = '[[Verification Identity]]'
-- Get payment transsferred status based on statusId
SELECT @intPaymenttransferred = CASE (e.statusid)
WHEN 57 THEN 15
WHEN 9 THEN 2
ELSE 1
END
FROM ERRAND e
WHERE ID = @intErrandId
UPDATE INVOICE_HEAD
SET VerificationIdentity = @strVerificationIdentity,
PaymentTransferred = @intPaymenttransferred WHERE ID IN
(SELECT invoiceid
FROM ERRAND
WHERE id = @intErrandId)
UPDATE ERRAND
SET VISIBLE = -1 WHERE id = @intErrandId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment