ALTER TABLE `school_setup` 
ADD COLUMN `alternative_name_sst` VARCHAR(1024) NULL AFTER `name_sst`;

UPDATE `payment_concept_group` SET `order_payment`='1' WHERE `serial_pcg`='1';
UPDATE `payment_concept_group` SET `order_payment`='2' WHERE `serial_pcg`='2';
UPDATE `payment_concept_group` SET `order_payment`='3' WHERE `serial_pcg`='3';

CREATE TABLE `amount_of_fees` (
  `serial_aof` INT NOT NULL AUTO_INCREMENT,
  `name_aof` VARCHAR(250) NULL,
  `number_aof` INT NULL,
  `status_aof` ENUM('ACTIVE', 'INACTIVE') NULL,
  PRIMARY KEY (`serial_aof`));

ALTER TABLE `payment_concept` 
ADD COLUMN `order_pct` INT NULL AFTER `name_pct`;

UPDATE `payment_concept` SET `order_pct`='1' WHERE `serial_pct`='4';
UPDATE `payment_concept` SET `order_pct`='2' WHERE `serial_pct`='1';

CREATE TABLE `payment_concept_amount_of_fees` (
  `serial_pca` INT NOT NULL AUTO_INCREMENT,
  `serial_pct` INT NULL,
  `serial_aof` INT NULL,
  `status_pca` ENUM('ACTIVE', 'INACTIVE') NULL,
  PRIMARY KEY (`serial_pca`),
  INDEX `fk_pca_pct_idx` (`serial_pct` ASC),
  INDEX `fk_pca_aof_idx` (`serial_aof` ASC),
  CONSTRAINT `fk_pca_pct`
    FOREIGN KEY (`serial_pct`)
    REFERENCES `payment_concept` (`serial_pct`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_pca_aof`
    FOREIGN KEY (`serial_aof`)
    REFERENCES `amount_of_fees` (`serial_aof`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);

ALTER TABLE `list` 
CHANGE COLUMN `alias_lst` `alias_lst` ENUM('ENABLEDPREPAY', 'INSURANCE', 'FINALIZE', 'ACEPTPREAPROVED', 'TRAVEL', 'SHIFT', 'ENTERDECE', 'UPDATEDATA', 'SERVICES', 'HONORCODE', 'AUTHORIZATIONIMAGE', 'WITHDRAWALL', 'USEPOLICIES', 'TRAVEL_EXPORTED', 'ACEPTPREAPROVEDPAYMENT') NULL DEFAULT NULL ;


INSERT INTO `amount_of_fees` (`name_aof`, `number_aof`, `status_aof`) VALUES ('1 mes', '1', 'ACTIVE');
INSERT INTO `amount_of_fees` (`name_aof`, `number_aof`, `status_aof`) VALUES ('3 meses', '3', 'ACTIVE');
INSERT INTO `amount_of_fees` (`name_aof`, `number_aof`, `status_aof`) VALUES ('6 meses', '6', 'ACTIVE');
INSERT INTO `amount_of_fees` (`name_aof`, `number_aof`, `status_aof`) VALUES ('12 meses', '12', 'ACTIVE');
INSERT INTO `amount_of_fees` (`name_aof`, `number_aof`, `status_aof`) VALUES ('10 meses', '10', 'ACTIVE');

INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `status_pca`) VALUES ('4', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `status_pca`) VALUES ('4', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `status_pca`) VALUES ('4', '3', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `status_pca`) VALUES ('4', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `status_pca`) VALUES ('1', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `status_pca`) VALUES ('1', '5', 'ACTIVE');

ALTER TABLE `payment_concept` 
ADD COLUMN `text_in_registration_pct` TEXT NULL AFTER `name_pct`;

UPDATE `payment_concept` SET `text_in_registration_pct`='¿Para el pago correspondiente al próximo año lectivo usted autoriza utilizar la misma forma de pago arriba detallada? Si su respuesta es sí, a cuantos meses.' WHERE `serial_pct`='4';
UPDATE `payment_concept` SET `text_in_registration_pct`='Si desea mantener su forma de pago y poder beneficiarse de la posibilidad de diferirlo a los meses presentados, responda sí y a cuantos meses. Es importante indicar que el cambio en la forma de pago podría implicar un valor diferente de descuento. Además, si los pagos no se efectivizan dentro de los plazos estipulados, el valor del descuento se modificará y estará sujeto a la fecha en la que se realice el pago.' WHERE `serial_pct`='1';
INSERT INTO `list` (`name_lst`, `alias_lst`, `status_lst`) VALUES ('Respuesta por rubro si acepta o no pagar con la forma de pago que repoosa en el sistema', 'ACEPTPREAPROVEDPAYMENT', 'ACTIVE');

ALTER TABLE `list_student_year` 
ADD COLUMN `serial_pct` INT NULL AFTER `serial_scy`,
ADD COLUMN `serial_aof` INT NULL AFTER `serial_pct`,
ADD INDEX `fk_lsy_pct_idx` (`serial_pct` ASC),
ADD INDEX `fk_lsy_aof_idx` (`serial_aof` ASC);
ALTER TABLE `list_student_year` 
ADD CONSTRAINT `fk_lsy_pct`
  FOREIGN KEY (`serial_pct`)
  REFERENCES `payment_concept` (`serial_pct`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_lsy_aof`
  FOREIGN KEY (`serial_aof`)
  REFERENCES `amount_of_fees` (`serial_aof`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;
  
  INSERT INTO `authority_charge` (`serial_atc`, `name_atc`, `description_atc`, `status_atc`) VALUES ('8', 'Gerente de Operaciones Financieras', 'Gerente de Operaciones Financieras', 'ACTIVE');
  INSERT INTO `authority` (`serial_atc`, `id_aut`, `degree_aut`, `first_name_aut`, `last_name_aut`, `in_charge_aut`) VALUES ('8', '0000000', ' ', 'Leticia', 'Núñez', 'YES');
ALTER TABLE `authority` 
ADD COLUMN `email_aut` VARCHAR(100) NULL AFTER `in_charge_aut`;
UPDATE `authority` SET `email_aut`='lnunez@einstein.k12.ec' WHERE `serial_aut`='5';

UPDATE `authority` SET `degree_aut`='Dr.' WHERE `serial_aut`='3';
UPDATE `authority` SET `email_aut`='pmiller@einstein.k12.ec' WHERE `serial_aut`='3';

INSERT INTO `process` (`serial_prc`, `prc_serial_prc`, `name_prc`, `link_prc`, `weight_prc`, `status_prc`) VALUES ('731', '120', 'Registro de inscripción', 'laravel/public/registration', '4.00', 'LOCKABLE');

insert into allowed_pages_by_process values('731','wizardregistrationcontroller@getindex');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@poststudentsquota');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsavequota');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreviewquota');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postpreaprubedstudents');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsavepreaprovedstudents');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreport');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreportno');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreportcontractno');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreportpreaprovedsayno');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreportpreaprovedsayyes');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postreportblacklist');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsendmailno');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsendmailblacklist');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsendmailnocontract');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsendmailpreapruvedStdents');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsendmailnopreapruvedstudents');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postsendemails');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postamountoffees');
insert into allowed_pages_by_process values('731','wizardregistrationcontroller@postcheckmorestudents');
insert into allowed_pages_by_process values('731','wizardcontroller@postsaveservicescontract');
insert into allowed_pages_by_process values('731','wizardcontroller@postsaveservicescontract');

select * from student_year_quota where serial_scy=5 and status_syq='ACTIVE';
update student_year_quota set status_syq='INACTIVE' where serial_scy=5 and status_syq='ACTIVE';
select * from list_student_year where serial_lst in(15) and serial_scy=5 ;
update list_student_year set status_lsy='INACTIVE' where serial_lst in(4,15) and serial_scy=5 and status_lsy='ACTIVE';

select * from wizard_document_guardian_authorize where serial_wdy in(13,14);
update wizard_document_guardian_authorize set status_wdg='INACTIVE' where serial_wdy in(13,14);

ALTER TABLE `school_setup` 
ADD COLUMN `family_sst` VARCHAR(100) NULL AFTER `web_magazine_sst`;


ALTER TABLE `payment_concept_amount_of_fees` 
ADD COLUMN `serial_pym` INT NULL AFTER `serial_aof`,
ADD COLUMN `serial_fin` INT NULL AFTER `serial_pym`,
ADD COLUMN `serial_ccd` INT NULL AFTER `serial_fin`,
ADD INDEX `fk_pca_pym_idx` (`serial_pym` ASC),
ADD INDEX `fk_pca_fin_idx` (`serial_fin` ASC),
ADD INDEX `fk_pca_ccd_idx` (`serial_ccd` ASC);
ALTER TABLE `payment_concept_amount_of_fees` 
ADD CONSTRAINT `fk_pca_pym`
  FOREIGN KEY (`serial_pym`)
  REFERENCES `payment_method` (`serial_pym`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_pca_fin`
  FOREIGN KEY (`serial_fin`)
  REFERENCES `financial_institution` (`serial_fin`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_pca_ccd`
  FOREIGN KEY (`serial_ccd`)
  REFERENCES `credit_card` (`serial_ccd`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;


INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '1', '1', '10', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '1', '1', '10', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '1', '1', '10', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '2', '1', '10', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '2', '1', '10', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '2', '1', '10', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '3', '1', '10', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '3', '1', '10', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '3', '1', '10', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '4', '1', '10', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '4', '1', '10', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '4', '1', '10', '4', 'ACTIVE');

insert into payment_concept_amount_of_fees select null as serial_pca, 4 as serial_pct, 1 as serial_aof, 1 as serial_pym,serial_fin,serial_ccd,'ACTIVE' AS status_aof from financial_institution_card where credit_type_fic='CURRENT_DEFERRED' and serial_fic not in(1,2,212) ;

INSERT INTO `payment_concept_amount_of_fees` (`serial_pca`, `serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES (NULL, '4', '4', '1', '10', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pca`, `serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES (NULL, '4', '4', '1', '10', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pca`, `serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES (NULL, '4', '4', '1', '10', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '5', '1', '10', '1', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '5', '1', '10', '2', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '5', '1', '10', '4', 'ACTIVE');
UPDATE `payment_concept_amount_of_fees` SET `serial_pct`='1' WHERE `serial_pca`='274';
UPDATE `payment_concept_amount_of_fees` SET `serial_pct`='1' WHERE `serial_pca`='275';
UPDATE `payment_concept_amount_of_fees` SET `serial_pct`='1' WHERE `serial_pca`='276';
UPDATE `payment_concept_amount_of_fees` SET `serial_pct`='1' WHERE `serial_pca`='277';
UPDATE `payment_concept_amount_of_fees` SET `serial_pct`='1' WHERE `serial_pca`='278';
UPDATE `payment_concept_amount_of_fees` SET `serial_pct`='1' WHERE `serial_pca`='279';

insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    1 AS serial_pct,
    1 AS serial_aof,
    1 AS serial_pym,
    serial_fin,
    serial_ccd,
    'ACTIVE' AS status_aof
FROM
    financial_institution_card
WHERE
    credit_type_fic = 'CURRENT_DEFERRED'
        AND serial_fic NOT IN (1 , 2, 212);

-- para cheque matrícula
    insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    4 AS serial_pct,
    1 AS serial_aof,
    2 AS serial_pym,
    serial_fin,
    null as serial_ccd,
    'ACTIVE' AS status_aof from financial_institution;
-- para cheque pensión
    insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    1 AS serial_pct,
    5 AS serial_aof,
    2 AS serial_pym,
    serial_fin,
    null as serial_ccd,
    'ACTIVE' AS status_aof from financial_institution;

-- para debito bancario matricula
    insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    4 AS serial_pct,
    1 AS serial_aof,
    3 AS serial_pym,
    serial_fin,
    null as serial_ccd,
    'ACTIVE' AS status_aof from financial_institution;
-- para debito bancario pensión
insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    1 AS serial_pct,
    5 AS serial_aof,
    3 AS serial_pym,
    serial_fin,
    null as serial_ccd,
    'ACTIVE' AS status_aof from financial_institution;
    
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `status_pca`) VALUES ('4', '1', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `status_pca`) VALUES ('1', '5', '4', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `status_pca`) VALUES ('4', '1', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `status_pca`) VALUES ('1', '5', '5', 'ACTIVE');


ALTER TABLE `list_student_year` 
ADD COLUMN `serial_pdt` INT NULL AFTER `serial_aof`,
ADD INDEX `fk_lsy_pdt_idx` (`serial_pdt` ASC);
ALTER TABLE `list_student_year` 
ADD CONSTRAINT `fk_lsy_pdt`
  FOREIGN KEY (`serial_pdt`)
  REFERENCES `payment_detail` (`serial_pdt`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;


ALTER TABLE `payment_mode` 
ADD COLUMN `alternative_name` VARCHAR(45) NULL AFTER `status_ptm`;


UPDATE `payment_mode` SET `alternative_name`='DIFERIDO CORRIENTE' WHERE `serial_ptm`='1';
UPDATE `payment_mode` SET `alternative_name`='PREPAGO' WHERE `serial_ptm`='2';
UPDATE `payment_mode` SET `alternative_name`='CORRIENTE' WHERE `serial_ptm`='3';
UPDATE `payment_mode` SET `alternative_name`='DIFERIDO CORRIENTE' WHERE `serial_ptm`='4';

-- Matrícula entarjeta de crédito corriente
insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    4 AS serial_pct,
    1 AS serial_aof,
    6 AS serial_pym,
    serial_fin,
    serial_ccd,
    'ACTIVE' AS status_aof
FROM
    financial_institution_card
WHERE
    credit_type_fic = 'CURRENT' ; 


-- Pensión  entarjeta de crédito corriente
insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    1 AS serial_pct,
    5 AS serial_aof,
    6 AS serial_pym,
    serial_fin,
    serial_ccd,
    'ACTIVE' AS status_aof
FROM
    financial_institution_card
WHERE
    credit_type_fic = 'CURRENT' ; 
        

-- para cheque prepago matrícula
    insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    4 AS serial_pct,
    1 AS serial_aof,
    7 AS serial_pym,
    serial_fin,
    null as serial_ccd,
    'ACTIVE' AS status_aof from financial_institution;

-- para cheque prepago pensión 
    insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    1 AS serial_pct,
    1 AS serial_aof,
    7 AS serial_pym,
    serial_fin,
    null as serial_ccd,
    'ACTIVE' AS status_aof from financial_institution;

INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `status_pca`) VALUES ('4', '1', '8', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `status_pca`) VALUES ('1', '1', '8', 'ACTIVE');

-- MATRICULA DIFERIDO CORRIENTE INDIVIDUAL
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '1', '9', '10', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '1', '9', '10', '6', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '1', '9', '10', '7', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '2', '9', '10', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '2', '9', '10', '6', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '2', '9', '10', '7', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '3', '9', '10', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '3', '9', '10', '6', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '3', '9', '10', '7', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '4', '9', '10', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '4', '9', '10', '6', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('4', '4', '9', '10', '7', 'ACTIVE');

insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    4 AS serial_pct,
    1 AS serial_aof,
    9 AS serial_pym,
    serial_fin,
    serial_ccd,
    'ACTIVE' AS status_aof
FROM
    financial_institution_card
WHERE
    credit_type_fic = 'CURRENT'
        AND serial_fic NOT IN (215,316,422);

-- pensi'on diferido corriente individual
INSERT INTO `payment_concept_amount_of_fees` (`serial_pca`, `serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES (NULL, '1', '4', '9', '10', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pca`, `serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES (NULL, '1', '4', '9', '10', '6', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pca`, `serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES (NULL, '1', '4', '9', '10', '7', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('1', '5', '9', '10', '5', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('1', '5', '9', '10', '6', 'ACTIVE');
INSERT INTO `payment_concept_amount_of_fees` (`serial_pct`, `serial_aof`, `serial_pym`, `serial_fin`, `serial_ccd`, `status_pca`) VALUES ('1', '5', '9', '10', '7', 'ACTIVE');

insert into payment_concept_amount_of_fees SELECT 
    NULL AS serial_pca,
    4 AS serial_pct,
    5 AS serial_aof,
    9 AS serial_pym,
    serial_fin,
    serial_ccd,
    'ACTIVE' AS status_aof
FROM
    financial_institution_card
WHERE
    credit_type_fic = 'CURRENT'
        AND serial_fic NOT IN (215,316,422);

ALTER TABLE `school_setup` 
ADD COLUMN `help_desck_sst` TEXT NULL AFTER `family_sst`;


select * from student_year_quota where serial_scy=5 and status_syq='ACTIVE';
update student_year_quota set status_syq='INACTIVE' where serial_scy=5 and status_syq='ACTIVE';
select * from list_student_year where serial_lst in(15) and serial_scy=5 ;
update list_student_year set status_lsy='INACTIVE', serial_aof=null,serial_pdt=null where serial_lst in(4,15);and serial_scy=5 and status_lsy='ACTIVE';

select * from wizard_document_guardian_authorize where serial_wdy in(13,14) and status_wdg='ACTIVE';
update wizard_document_guardian_authorize set status_wdg='INACTIVE' where serial_wdy in(13,14);
