Created
July 26, 2012 08:32
-
-
Save mattiaswolff/3180991 to your computer and use it in GitHub Desktop.
Mediusflow: Re-send integration postings (Final postings / paymenttransferred = 10)
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
-- Update rowstate to posted | |
UPDATE NAV_IN_MESSAGE_TAB_TRANS | |
SET ROWSTATE = 'Posted' | |
WHERE message_id IN | |
(SELECT message_id | |
FROM nav_in_message_tab_trans nimtt | |
INNER JOIN ERRAND e ON (e.ID = nimtt.ERRAND_ID) | |
INNER JOIN INVOICE_HEAD ih ON (e.INVOICEID = ih.ID) | |
WHERE ih.PaymentTransferred = 10 | |
AND e.VISIBLE = 0 | |
AND nimtt.MESSAGE_ID IN | |
(SELECT top 1 nimtt1.MESSAGE_ID | |
FROM NAV_IN_MESSAGE_TAB_TRANS nimtt1 | |
INNER JOIN NAV_IN_MESSAGE_LINE_TAB_TRANS nimltt1 ON (nimtt1.MESSAGE_ID = nimltt1.MESSAGE_ID) | |
WHERE ERRAND_ID = e.id | |
AND nimltt1.c56 = 'Finally' | |
ORDER BY nimtt.MESSAGE_ID DESC)) | |
-- Change payment transferred status | |
UPDATE INVOICE_HEAD | |
SET PaymentTransferred = 6 WHERE ID IN | |
(SELECT invoiceid | |
FROM ERRAND | |
WHERE VISIBLE = 0) | |
AND PaymentTransferred = 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment