--SO 20014815

CREATE OR REPLACE PROCEDURE insertForAccessRight is
begin

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtName',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblName', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtLegalName',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblLegalName', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtLegacyCode',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblLegacyCode', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'srfAccountReceivable',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblAccountReceivable', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'cmbNationalAccount',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblNationalAccount', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtMasterAccount',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblMasterAccount', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtCocNumber',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblCocNumber', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'btnCommentOnStatement',
     sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'rbPaymentMethod',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblPaymentMethod', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'cmbPaymentType', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblPayByCustomer', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'srfPayByCustomer', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtAddress1US',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblStreetHouseUS', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblAddress1US', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtHouseNrExtUS', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtHouseUS', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtAddress2US',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblAddress2US', sysdate);

  insert into fieldsperdialog
    (fieldsperdialog_id, dialog_id, field, timestamp)
  values
    (seq_fieldsperdialog.nextval,
     (select d.dialog_id from dialogs d where d.code = 'Customer'),
     'txtZipCodeUS',
     sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtCityUS', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'lblCity_State_ZipCodeUS', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtStateUS', sysdate);

  insert into fieldsrelations
    (fieldsperdialog_id, field_successor, timestamp)
  values
    (seq_fieldsperdialog.currval, 'txtCountyUS', sysdate);

end insertForAccessRight;


/

execute insertForAccessRight;

drop procedure insertForAccessRight;