core-jgi/db/maintain/Maintenance/C_PaymentTerm_Check.sql

17 lines
785 B
MySQL
Raw Normal View History

2006-11-17 10:06:54 +07:00
/**
* PaymentTerm
*/
BEGIN
DBMS_OUTPUT.PUT_LINE('Adding missing PaymentTerm Translations');
INSERT INTO C_PaymentTerm_Trl (C_PaymentTerm_ID, AD_Language, AD_Client_ID, AD_Org_ID,
IsActive, Created, CreatedBy, Updated, UpdatedBy,
Name, Description, DocumentNote, IsTranslated)
SELECT m.C_PaymentTerm_ID, l.AD_Language, m.AD_Client_ID, m.AD_Org_ID,
m.IsActive, m.Created, m.CreatedBy, m.Updated, m.UpdatedBy,
m.Name, m.Description, m.DocumentNote, 'N'
FROM C_PaymentTerm m, AD_Language l
WHERE l.IsActive = 'Y' AND l.IsSystemLanguage = 'Y'
AND C_PaymentTerm_ID || AD_Language NOT IN
(SELECT C_PaymentTerm_ID || AD_Language FROM C_PaymentTerm_Trl);
DBMS_OUTPUT.PUT_LINE('Rows added: ' || SQL%ROWCOUNT);
END;