-- GÖNDERİLDİ
UPDATE LG_222_01_EARCHIVEDET SET EARCHIVESTATUS=6
WHERE INVOICEREF IN (SELECT TOP 1 LOGICALREF FROM LG_222_01_INVOICE WHERE FICHENO='GL32022000000232')

-- GÖNDERİLMEDİ
UPDATE LG_222_01_EARCHIVEDET SET EARCHIVESTATUS=0
WHERE INVOICEREF IN (SELECT TOP 1 LOGICALREF FROM LG_222_01_INVOICE WHERE FICHENO='GL32022000000232')
