Created
September 25, 2012 12:23
-
-
Save mattiaswolff/3781457 to your computer and use it in GitHub Desktop.
Mediusflow: Handlde errands where integration status not in sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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