|
@@ -21,16 +21,34 @@
|
|
|
<div class="text-caption text-weight-bold text-primary q-mb-xs">PAVÃO</div>
|
|
<div class="text-caption text-weight-bold text-primary q-mb-xs">PAVÃO</div>
|
|
|
<div class="text-caption text-grey-8">Matrícula: {{ formatToBRLCurrency(pkg.pavao.registration_value) }}</div>
|
|
<div class="text-caption text-grey-8">Matrícula: {{ formatToBRLCurrency(pkg.pavao.registration_value) }}</div>
|
|
|
<div class="text-caption text-grey-8">Aulas: {{ formatToBRLCurrency(pkg.pavao.classes_value) }}</div>
|
|
<div class="text-caption text-grey-8">Aulas: {{ formatToBRLCurrency(pkg.pavao.classes_value) }}</div>
|
|
|
|
|
+ <div v-if="pkg.pavao.classes_discount_percentage" class="text-caption text-negative q-ml-sm">
|
|
|
|
|
+ - Pontualidade ({{ pkg.pavao.classes_discount_percentage }}%): {{ formatToBRLCurrency(getDiscountValue(pkg.pavao)) }}
|
|
|
|
|
+ </div>
|
|
|
<div class="text-caption text-grey-8">Materiais: {{ formatToBRLCurrency(pkg.pavao.materials_total_value) }}</div>
|
|
<div class="text-caption text-grey-8">Materiais: {{ formatToBRLCurrency(pkg.pavao.materials_total_value) }}</div>
|
|
|
- <div class="text-caption text-weight-bold q-mt-xs">Total: {{ formatToBRLCurrency(pkg.pavao.total_value) }}</div>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="text-caption text-weight-bold q-mt-xs">
|
|
|
|
|
+ Total (Normal): {{ formatToBRLCurrency(pkg.pavao.total_value) }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="pkg.pavao.classes_discount_percentage" class="text-caption text-weight-bold text-positive">
|
|
|
|
|
+ Total (c/ Pontualidade): {{ formatToBRLCurrency(getTotalWithDiscount(pkg.pavao)) }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div v-if="pkg.irrecusavel" class="col-12 col-md-6">
|
|
<div v-if="pkg.irrecusavel" class="col-12 col-md-6">
|
|
|
<div class="text-caption text-weight-bold text-secondary q-mb-xs">IRRECUSÁVEL</div>
|
|
<div class="text-caption text-weight-bold text-secondary q-mb-xs">IRRECUSÁVEL</div>
|
|
|
<div class="text-caption text-grey-8">Matrícula: {{ formatToBRLCurrency(pkg.irrecusavel.registration_value) }}</div>
|
|
<div class="text-caption text-grey-8">Matrícula: {{ formatToBRLCurrency(pkg.irrecusavel.registration_value) }}</div>
|
|
|
<div class="text-caption text-grey-8">Aulas: {{ formatToBRLCurrency(pkg.irrecusavel.classes_value) }}</div>
|
|
<div class="text-caption text-grey-8">Aulas: {{ formatToBRLCurrency(pkg.irrecusavel.classes_value) }}</div>
|
|
|
|
|
+ <div v-if="pkg.irrecusavel.classes_discount_percentage" class="text-caption text-negative q-ml-sm">
|
|
|
|
|
+ - Pontualidade ({{ pkg.irrecusavel.classes_discount_percentage }}%): {{ formatToBRLCurrency(getDiscountValue(pkg.irrecusavel)) }}
|
|
|
|
|
+ </div>
|
|
|
<div class="text-caption text-grey-8">Materiais: {{ formatToBRLCurrency(pkg.irrecusavel.materials_total_value) }}</div>
|
|
<div class="text-caption text-grey-8">Materiais: {{ formatToBRLCurrency(pkg.irrecusavel.materials_total_value) }}</div>
|
|
|
- <div class="text-caption text-weight-bold q-mt-xs">Total: {{ formatToBRLCurrency(pkg.irrecusavel.total_value) }}</div>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="text-caption text-weight-bold q-mt-xs">
|
|
|
|
|
+ Total (Normal): {{ formatToBRLCurrency(pkg.irrecusavel.total_value) }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="pkg.irrecusavel.classes_discount_percentage" class="text-caption text-weight-bold text-positive">
|
|
|
|
|
+ Total (c/ Pontualidade): {{ formatToBRLCurrency(getTotalWithDiscount(pkg.irrecusavel)) }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<span v-if="!pkg.pavao && !pkg.irrecusavel" class="col-12 text-caption text-grey-5">
|
|
<span v-if="!pkg.pavao && !pkg.irrecusavel" class="col-12 text-caption text-grey-5">
|
|
@@ -44,6 +62,14 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { formatToBRLCurrency } from "src/helpers/utils";
|
|
import { formatToBRLCurrency } from "src/helpers/utils";
|
|
|
|
|
|
|
|
|
|
+const getDiscountValue = (block) => {
|
|
|
|
|
+ return (Number(block.classes_value) || 0) * (Number(block.classes_discount_percentage) || 0) / 100;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const getTotalWithDiscount = (block) => {
|
|
|
|
|
+ return (Number(block.total_value) || 0) - getDiscountValue(block);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
defineProps({
|
|
defineProps({
|
|
|
pkg: {
|
|
pkg: {
|
|
|
type: Object,
|
|
type: Object,
|