/*ALIAS>prop_db*/

/*SQLStart>2732*/
alter table persons
add PER_EDITDATE DATE;
/*SQLStop*/

/*SQLStart>2733*/
CREATE OR ALTER TRIGGER PERSONS_BU FOR PERSONS
ACTIVE BEFORE UPDATE POSITION 0
AS
BEGIN
  New.Per_Name = ATrimEx(New.Per_Name);
  New.Per_CLEARNAME = ACLearStr(New.Per_Name);
  New.Per_CLEAREGN = ACLearStr(New.Per_EGN);
  if (new.Per_EDITDATE is null) then
  begin
	New.Per_EDITDATE = CURRENT_TIMESTAMP;
  end
END;
/*SQLStop*/

/*SQLStart>2734*/
CREATE OR ALTER TRIGGER SET_PER_ID FOR PERSONS
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  if ((new.PER_ID is null) or (new.PER_ID = 0))  then
  begin
    NEW.Per_ID=GEN_ID(Per_ID_GEN,1);
  end
  New.Per_Name = ATrimEx(New.Per_Name);
  New.Per_CLEARNAME = ACLearStr(New.Per_Name);
  New.Per_CLEAREGN = ACLearStr(New.Per_EGN);
  if (new.Per_EDITDATE is null) then
  begin
	New.Per_EDITDATE = CURRENT_TIMESTAMP;
  end
END;
/*SQLStop*/

/*SQLStart>2735*/
alter table renttypes
alter rt_noddsdescr type VARCHAR(200);
/*SQLStop*/

/*SQLStart>2736*/
alter table renttypes
alter rt_noddsdescr_smet type VARCHAR(200);
/*SQLStop*/

/*SQLStart>2737*/
update system_strings set sys_str = '6.7.227.1' where sys_id = 1401;  /*BackOffice*/
/*SQLStop*/

