Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carodromo de Turma + Novo Modelo de Carteirinha + Bugfix Boletim Aluno #151

Open
wants to merge 7 commits into
base: 2.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

use Illuminate\Database\Migrations\Migration;
use App\Menu;

class AddStudentCarodromoReportMenu extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Menu::query()->updateOrCreate([
'old' => 999700,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Carodromo',
'order' => 4,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate(['old' => 999603], [
'parent_id' => Menu::query()->where('old', 999700)->firstOrFail()->getKey(),
'process' => 999603,
'title' => 'Carodromo de Turma',
'order' => 0,
'parent_old' => 999700,
'link' => '/module/Reports/StudentCarodromo'
]);
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Menu::query()->where('old', 999603)->delete();
}
};
1 change: 1 addition & 0 deletions ieducar/Queries/QueryStudentCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protected function query()
matricula.ano AS ano_letivo,
educacenso_cod_aluno.cod_aluno_inep AS inep,
pessoa.nome AS nome_aluno,
pessoa.email AS email_aluno,
to_char(fisica.data_nasc,'dd/mm/yyyy') AS data_nasc,
fone_pessoa.fone AS fone,
fone_pessoa.ddd AS fone_ddd,
Expand Down
86 changes: 86 additions & 0 deletions ieducar/Queries/QueryStudentCarodromo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

class QueryStudentCarodromo extends QueryBridge
{
/**
* @inheritdoc
*/
protected function query()
{
return <<<'SQL'
SELECT
instituicao.nm_instituicao AS nm_instituicao,
instituicao.nm_responsavel AS nm_responsavel,
relatorio.get_nome_escola(escola.cod_escola) AS nm_escola,
curso.nm_curso AS nome_curso,
turma.nm_turma AS nome_turma,
serie.nm_serie AS nome_serie,
aluno.cod_aluno AS cod_aluno,
aluno.aluno_estado_id AS aluno_estado_id,
matricula.ano AS ano_letivo,
educacenso_cod_aluno.cod_aluno_inep AS inep,
pessoa.nome AS nome_aluno,
to_char(fisica.data_nasc,'dd/mm/yyyy') AS data_nasc,
fone_pessoa.fone AS fone,
fone_pessoa.ddd AS fone_ddd,
documento.rg AS rg,
fisica_foto.caminho AS foto,
CASE WHEN fisica_foto.caminho IS NULL THEN 0 ELSE 1 END AS existe_foto
FROM pmieducar.instituicao
INNER JOIN pmieducar.escola ON (escola.ref_cod_instituicao = instituicao.cod_instituicao)
INNER JOIN pmieducar.escola_ano_letivo ON (escola_ano_letivo.ref_cod_escola = escola.cod_escola)
INNER JOIN pmieducar.escola_curso ON (escola_curso.ref_cod_escola = escola.cod_escola AND escola_curso.ativo = 1)
INNER JOIN pmieducar.escola_serie ON (escola_serie.ref_cod_escola = escola.cod_escola AND escola_serie.ativo = 1)
INNER JOIN pmieducar.curso ON (curso.cod_curso = escola_curso.ref_cod_curso AND curso.ativo = 1)
INNER JOIN pmieducar.serie ON (serie.cod_serie = escola_serie.ref_cod_serie AND serie.ativo = 1)
INNER JOIN pmieducar.turma ON (turma.ref_ref_cod_escola = escola.cod_escola
AND turma.ref_cod_curso = curso.cod_curso
AND turma.ano = escola_ano_letivo.ano
AND turma.ativo = 1)
INNER JOIN pmieducar.matricula_turma ON (matricula_turma.ref_cod_turma = turma.cod_turma)
INNER JOIN pmieducar.matricula ON (matricula.cod_matricula = matricula_turma.ref_cod_matricula
AND matricula.ref_ref_cod_escola = escola.cod_escola
AND matricula.ref_cod_curso = curso.cod_curso
AND matricula.ref_ref_cod_serie = serie.cod_serie
AND matricula.ano = escola_ano_letivo.ano)

INNER JOIN relatorio.view_situacao ON (view_situacao.cod_matricula = matricula.cod_matricula
AND view_situacao.cod_turma = turma.cod_turma
AND view_situacao.sequencial = matricula_turma.sequencial)
INNER JOIN pmieducar.aluno ON (matricula.ref_cod_aluno = aluno.cod_aluno)
INNER JOIN cadastro.pessoa ON (pessoa.idpes = aluno.ref_idpes)
INNER JOIN cadastro.fisica ON (fisica.idpes = aluno.ref_idpes)
LEFT JOIN cadastro.fisica_foto ON fisica_foto.idpes = aluno.ref_idpes
LEFT JOIN cadastro.documento ON (documento.idpes = aluno.ref_idpes)
LEFT JOIN modules.educacenso_cod_aluno ON (educacenso_cod_aluno.cod_aluno = aluno.cod_aluno)
LEFT JOIN LATERAL (
SELECT
idpes,
fone,
ddd
FROM cadastro.fone_pessoa
WHERE fone_pessoa.idpes = escola.ref_idpes
ORDER BY tipo
LIMIT 1
) fone_pessoa ON (true)
WHERE true
AND instituicao.cod_instituicao = $P{instituicao}
AND escola_ano_letivo.ano = $P{ano}
AND escola.cod_escola = $P{escola}
AND curso.cod_curso = $P{curso}
AND serie.cod_serie = $P{serie}
AND turma.cod_turma = $P{turma}
AND ($P{matricula} = 0 OR matricula.cod_matricula = $P{matricula})
AND (CASE WHEN $P{situacao_matricula} = 16 THEN EXISTS (
SELECT 1
FROM modules.nota_componente_curricular_media nccm
JOIN modules.nota_aluno ON (nota_aluno.matricula_id = matricula.cod_matricula)
WHERE nccm.nota_aluno_id = nota_aluno.id
AND nccm.situacao = 8
) AND view_situacao.cod_situacao IN (1, 12, 13)
ELSE view_situacao.cod_situacao = $P{situacao_matricula}
END)
ORDER BY sequencial_fechamento;
SQL;
}
}
177 changes: 177 additions & 0 deletions ieducar/ReportSources/student-card-model4.jrxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.21.2.final using JasperReports Library version 6.21.2-8434a0bd7c3bbc37cbf916f2968d35e4b165821a -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="153" pageHeight="242" columnWidth="143" leftMargin="5" rightMargin="5" topMargin="5" bottomMargin="5" uuid="f6182683-9cc0-4750-b796-348e9dbfb102">
<property name="ireport.zoom" value="2.196150000000014"/>
<property name="ireport.x" value="96"/>
<property name="ireport.y" value="39"/>
<parameter name="ano" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="instituicao" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="escola" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="curso" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="serie" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="turma" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="matricula" class="java.lang.Integer">
<defaultValueExpression><![CDATA[new java.lang.Integer(0)]]></defaultValueExpression>
</parameter>
<parameter name="validade" class="java.lang.String">
<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
</parameter>
<parameter name="logo" class="java.lang.String"/>
<parameter name="leiestudante" class="java.lang.String"/>
<parameter name="diretorioimg" class="java.lang.String"/>
<parameter name="codigo" class="java.lang.Integer">
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<parameter name="imprimir_serie" class="java.lang.Integer">
<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
</parameter>
<parameter name="cor_de_fundo" class="java.lang.Integer">
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<parameter name="situacao_matricula" class="java.lang.String"/>
<parameter name="modelo" class="java.lang.String"/>
<parameter name="database" class="java.lang.String">
<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
</parameter>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
</parameter>
<parameter name="data_emissao" class="java.lang.Integer">
<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
</parameter>
<parameter name="source" class="java.lang.String"/>
<field name="nm_instituicao" class="java.lang.String"/>
<field name="nm_responsavel" class="java.lang.String"/>
<field name="cod_aluno" class="java.lang.Integer"/>
<field name="aluno_estado_id" class="java.lang.String"/>
<field name="ano_letivo" class="java.lang.Integer"/>
<field name="inep" class="java.lang.Long"/>
<field name="nome_aluno" class="java.lang.String"/>
<field name="email_aluno" class="java.lang.String"/>
<field name="data_nasc" class="java.lang.String"/>
<field name="nome_curso" class="java.lang.String"/>
<field name="nome_turma" class="java.lang.String"/>
<field name="nome_serie" class="java.lang.String"/>
<field name="nm_escola" class="java.lang.String"/>
<field name="fone_ddd" class="java.math.BigDecimal"/>
<field name="fone" class="java.lang.String"/>
<field name="cor_fundo" class="java.lang.String"/>
<field name="foto" class="java.lang.String"/>
<field name="existe_foto" class="java.lang.Integer"/>
<variable name="tot_alunos" class="java.lang.Integer" calculation="Count">
<variableExpression><![CDATA[$F{cod_aluno}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="85" splitType="Stretch">
<textField>
<reportElement x="0" y="5" width="109" height="30" uuid="d302068a-f778-4ee0-8f47-bc8b5e6af3a0"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{nm_instituicao}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement x="-5" y="40" width="153" height="31" forecolor="#FFFFFF" backcolor="#2961B8" uuid="edbb8eec-66f6-4705-a2f4-a12b74e48dc2"/>
<graphicElement>
<pen lineWidth="1.0"/>
</graphicElement>
</rectangle>
<image>
<reportElement x="110" y="0" width="30" height="30" uuid="55f91ea5-27b3-4e29-a8f3-af89755a3ec1"/>
<imageExpression><![CDATA[$P{logo}]]></imageExpression>
</image>
<image>
<reportElement x="48" y="27" width="50" height="55" uuid="d457460a-e539-4058-8504-d37e94050f3f"/>
<imageExpression><![CDATA[$F{foto}]]></imageExpression>
</image>
</band>
<band height="140" splitType="Stretch">
<componentElement>
<reportElement x="30" y="0" width="80" height="80" uuid="40747dd1-543b-4d42-a323-10b7c16eeda7"/>
<jr:QRCode xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<jr:codeExpression><![CDATA[$F{cod_aluno}]]></jr:codeExpression>
</jr:QRCode>
</componentElement>
<staticText>
<reportElement x="0" y="75" width="30" height="14" uuid="5fc4b12c-0cf5-4b48-978f-3e03f7f04f7a"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[Turma:]]></text>
</staticText>
<textField>
<reportElement x="30" y="75" width="108" height="14" uuid="8cc0308c-d8ba-4578-b33f-c2ce6d96ede4"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{nome_turma}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="85" width="45" height="13" uuid="f72c255c-d328-4a90-88df-cb244fd08dc9"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[Matricula:]]></text>
</staticText>
<textField>
<reportElement x="45" y="85" width="100" height="13" uuid="becd3744-c949-4a60-932e-98f829a2cfb3"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{cod_aluno}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="95" width="140" height="27" uuid="e3cf9ff7-464a-4041-9fcd-c2f11cf5cdf6"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{nome_aluno}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="115" width="29" height="12" uuid="192b0daa-7e13-4eca-89cf-a90a24c7472d"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[E-mail:]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="29" y="115" width="130" height="12" uuid="0afa0435-b07d-49ca-b158-1b72ed6c54e9"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{email_aluno}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="75" y="128" width="40" height="12" uuid="ed0e6963-92f8-4738-a547-e06c8b8d85cd"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Validade:]]></text>
</staticText>
<textField>
<reportElement x="110" y="128" width="40" height="12" uuid="2a68a9b5-b6d9-4741-bfe8-5d7d5c63b340">
<printWhenExpression><![CDATA[$P{validade} != ""]]></printWhenExpression>
</reportElement>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{validade}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Loading