HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux Bradford-Sitios 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/api_matriculas/database/seeders/PaymentConceptDetailsSeeder.php
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;


class PaymentConceptDetailsSeeder extends Seeder
{
    public function run()
    {

        $test = false;

        $payment_concept_details = [
            // === Matrícula ===
            [
                'description' => 'MATRÍCULA PK A IV MEDIO',
                'code' => 'ENROLLMENT',
                'code_toku' => $test ? 'Matrícula' : 'matricula',
                'price_regular' => 12.85,
                'price_exceptional' => null,
                'payment_concept_id' => 1, // MATRÍCULA
                'currency_type_id' => 2,   // UF
                'required_element' => 1,
                'requires_payment' => 1,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],

            // === Colegiaturas (en UF) ===
            [
                'description' => 'COLEGIATURA PRE-KINDER Y KINDER',
                'code' => 'COLEGIATURA_1',
                'code_toku' => $test ? 'Colegiatura Anual' : 'colegiatura-anual',
                'price_regular' => 154.62,
                'price_exceptional' => 157.72,
                'payment_concept_id' => 2, // COLEGIATURA
                'currency_type_id' => 2,   // UF
                'required_element' => 1,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],
            [
                'description' => 'COLEGIATURA 1° A 6° BÁSICO',
                'code' => 'COLEGIATURA_2',
                'code_toku' => $test ? 'Colegiatura Anual' : 'colegiatura-anual',
                'price_regular' => 182.74,
                'price_exceptional' => 188.39,
                'payment_concept_id' => 2,
                'currency_type_id' => 2,
                'required_element' => 1,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],
            [
                'description' => 'COLEGIATURA 7° A IV MEDIO',
                'code' => 'COLEGIATURA_3',
                'code_toku' => $test ? 'Colegiatura Anual' : 'colegiatura-anual',
                'price_regular' => 185.99,
                'price_exceptional' => 189.71,
                'payment_concept_id' => 2,
                'currency_type_id' => 2,
                'required_element' => 1,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],

            // === Playgroup ===
            [
                'description' => 'MATRÍCULA PLAYGROUP',
                'code' => 'ENROLLMENT_PG',
                'code_toku' => $test ? 'Matrícula' : 'matricula',
                'price_regular' => 13.80,
                'price_exceptional' => null,
                'payment_concept_id' => 1, // MATRÍCULA
                'currency_type_id' => 2,   // UF
                'required_element' => 1,
                'requires_payment' => 1,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],
            [
                'description' => 'COLEGIATURA PLAYGROUP',
                'code' => 'COLEGIATURA_4',
                'code_toku' => $test ? 'Colegiatura Anual' : 'colegiatura-anual',
                'price_regular' => 138.50,
                'price_exceptional' => null,
                'payment_concept_id' => 2, // COLEGIATURA
                'currency_type_id' => 2,   // UF
                'required_element' => 1,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],

            // === Seguros / Familia ===
            [
                'description' => 'CUOTA DE AFILIACIÓN CENTRO DE PADRES',
                'code' => 'CENTRO_PADRES',
                'code_toku' => $test ? 'Centro de Padres' : 'centro-padres',
                'price_regular' => 35000,
                'price_exceptional' => null,
                'payment_concept_id' => 3, // SEGUROS / FAMILIAR
                'currency_type_id' => 1,
                'required_element' => 0,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 1,
            ],
            [
                'description' => 'SEGURO DE ACCIDENTES CLÍNICA ALEMANA',
                'code' => 'CLINICA_ALEMANA',
                'code_toku' => $test ? 'Clínica Alemana' : 'clinica-alemana',
                'price_regular' => 36000,
                'price_exceptional' => null,
                'payment_concept_id' => 3, // SEGUROS / FAMILIAR
                'currency_type_id' => 1,
                'required_element' => 0,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],

            // === Seguros de vida ===
            [
                'description' => 'SEGURO DE VIDA APODERADO(A) DE CUENTAS',
                'code' => 'SEGURO_VIDA_1_APODERADO_CUENTAS',
                'code_toku' => $test ? 'Seguro de Vida 1' : 'seguro-de-vida-1',
                'price_regular' => 2.501,
                'price_exceptional' => null,
                'payment_concept_id' => 3,
                'currency_type_id' => 2,
                'required_element' => 0,
                'requires_payment' => 0,
                'requires_assignment' => 1, // individual
                'status' => 1,
                'family_payment' => 0,
            ],
            [
                'description' => 'SEGURO DE VIDA 2° APODERADO',
                'code' => 'SEGURO_VIDA_2_APODERADO',
                'code_toku' => $test ? 'Seguro de Vida 2' : 'seguro-de-vida-2',
                'price_regular' => 2.501,
                'price_exceptional' => null,
                'payment_concept_id' => 3,
                'currency_type_id' => 2,
                'required_element' => 0,
                'requires_payment' => 0,
                'requires_payment' => 0,
                'requires_assignment' => 1,
                'status' => 1,
                'family_payment' => 0,
            ],
            // === Aportes / Comunidad ===
            [
                'description' => 'CUOTA AFILIACIÓN CENTRO DE ALUMNOS',
                'code' => 'CENTRO_ALUMNOS',
                'code_toku' => $test ? 'Centro Alumnos' : 'centro-alumnos',
                'price_regular' => 1000,
                'price_exceptional' => null,
                'payment_concept_id' => 3,
                'currency_type_id' => 1,
                'required_element' => 0,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],
            [
                'description' => 'APORTE CLUB ALL BRADS',
                'code' => 'ALL_BRADS',
                'code_toku' => $test ? 'All Brads' : 'all-brads',
                'price_regular' => 10000,
                'price_exceptional' => null,
                'payment_concept_id' => 3,
                'currency_type_id' => 1,
                'required_element' => 0,
                'requires_payment' => 0,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 1,
            ],
            [
                'description' => 'CUOTA DE INCORPORACIÓN',
                'code' => 'CUOTA_INCORPORACION',
                'code_toku' => 'cuota-de-incorporacion',
                'price_regular' => 10000,
                'price_exceptional' => null,
                'payment_concept_id' => 1,
                'currency_type_id' => 2,
                'required_element' => 1,
                'requires_payment' => 1,
                'requires_assignment' => 0,
                'status' => 1,
                'family_payment' => 0,
            ],


        ];

        foreach ($payment_concept_details as $row) {
            DB::table('payment_concept_details')->updateOrInsert(
                ['code' => $row['code']],
                $row
            );
        }

        $this->command->info('✅ Se han procesado ' . count($payment_concept_details) . ' payment_concept_details correctamente.');
    }
}