ALTER TABLE `postulation_student_form` 
ADD COLUMN `id_altiora_invoice_psf` VARCHAR(100) NULL AFTER `updated_at`,
ADD COLUMN `number_psf` VARCHAR(100) NULL AFTER `id_altiora_invoice_psf`,
ADD COLUMN `invoice_procces_psf` ENUM('INVOICE', 'POSTING') NULL AFTER `number_psf`,
ADD COLUMN `date_invoice_altiora_psf` DATETIME NULL AFTER `invoice_procces_psf`,
ADD COLUMN `date_posting_altiora_psf` DATETIME NULL AFTER `date_invoice_altiora_psf`;

ALTER TABLE `postulation_payment_detail` 
ADD COLUMN `processed_in_ppd` ENUM('YES', 'NO') NULL AFTER `payment_date_ppd`,
ADD COLUMN `proccessed_date_register_ppd` DATETIME NULL AFTER `processed_in_ppd`,
ADD COLUMN `id_register_altiora_ppd` VARCHAR(45) NULL AFTER `proccessed_date_register_ppd`,
ADD COLUMN `entry_number_ppd` VARCHAR(45) NULL AFTER `id_register_altiora_ppd`,
ADD COLUMN `date_register_altiora_ppd` DATETIME NULL AFTER `entry_number_ppd`,
ADD COLUMN `date_posting_altiora_ppd` DATETIME NULL AFTER `date_register_altiora_ppd`,
ADD COLUMN `status_register_ppd` ENUM('REGISTER', 'POSTING', 'APLICATION') NULL AFTER `date_posting_altiora_ppd`;

ALTER TABLE `postulation_payment_concept` 
ADD COLUMN `code_ppy` VARCHAR(100) NULL AFTER `name_apy`;

ALTER TABLE `postulation_student` 
ADD COLUMN `id_shipping_address_pst` VARCHAR(100) NULL AFTER `email_pst`,
ADD COLUMN `id_emai_altiora_pst` VARCHAR(100) NULL AFTER `id_shipping_address_pst`,
ADD COLUMN `id_altiora_pst` VARCHAR(100) NULL AFTER `status_pst`;

ALTER TABLE `postulation_student_form` 
ADD COLUMN `invoice_result_text_psf` TEXT NULL AFTER `date_posting_altiora_psf`;
ALTER TABLE `postulation_student_form` 
CHANGE COLUMN `taxes_psf` `taxes_psf` DECIMAL(5,2) NULL DEFAULT NULL ;

ALTER TABLE `postulation_student_form` 
CHANGE COLUMN `created_at` `created_at` DATETIME NULL DEFAULT NULL AFTER `number_invoice_psf`,
CHANGE COLUMN `updated_at` `updated_at` DATETIME NULL DEFAULT NULL AFTER `created_at`;

INSERT INTO `process` (`serial_prc`, `prc_serial_prc`, `name_prc`, `link_prc`, `weight_prc`, `status_prc`) VALUES ('873', '156', 'Facturación examenes de suficiencia', 'laravel/public/invoicealtioraaltioraSuffiencetest', '1.00', 'LOCKABLE');

insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@getindex');
insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@postdates');
insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@getstudents');
insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@postinvoicedata');
insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@postsaveinvoicedata');
insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@postinvoice');
insert into allowed_pages_by_process values(873,'invoicealtiorasuffiencetestcontroller@postreport');

ALTER TABLE `postulation_payment_detail` 
ADD COLUMN `processed_serial_usr` INT NULL AFTER `status_register_ppd`,
ADD INDEX `fk_ppd_usr_idx` (`processed_serial_usr` ASC);
ALTER TABLE `postulation_payment_detail` 
ADD CONSTRAINT `fk_ppd_usr`
  FOREIGN KEY (`processed_serial_usr`)
  REFERENCES `user` (`serial_usr`)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;


ALTER TABLE `postulation_student_form` 
CHANGE COLUMN `number_invoice_psf` `number_invoice_psf` VARCHAR(100) NULL DEFAULT NULL ;