--ABS-119053/ ABS-119533
create or replace procedure tempCreateSS as
begin
CreateSystemSetting('Billing', 'RECHARGELOSSAFTERCREDITNG', '0', 'I', '0', 'N', 'N', 0, 2, '0', 'This setting controls if NON GARMENT loss charge invoices lines that are credited on the RA will be charged again or not.'|| chr(10) ||''|| chr(10) ||'If an invoice line is full credited'|| chr(10) ||'   0 = do not set the returned value so loss charges will be raised again'|| chr(10) ||'   1 = do not set the returned value so loss charges will be raised again'|| chr(10) ||'   2 = set the returned value so loss charges will not be raised again'|| chr(10) ||'If an invoice line is partially credited'|| chr(10) ||'   0 = set the returned value so loss charges will not be raised again'|| chr(10) ||'   1 = set the returned value so loss charges will not be raised again for the quantity credited'|| chr(10) ||'   2 = set the returned value to total value so loss charges will not be raised again'|| chr(10) ||''|| chr(10) ||''|| chr(10) ||'This setting is only applicable when SETTLEMENTACTIVE = Y.', 'N');
end tempCreateSS;
/
execute tempCreateSS;
drop procedure tempCreateSS;

UPDATE SYSTEMSETTING SN
   SET SN.VALUE=(SELECT SS.VALUE FROM SYSTEMSETTING SS WHERE SS.NAME = 'RECHARGELOSSAFTERCREDIT' AND SN.PLANT_ID = SS.PLANT_ID)
 WHERE SN.NAME= 'RECHARGELOSSAFTERCREDITNG';
COMMIT;

