|
|
@@ -8,21 +8,24 @@ import {
|
|
|
export function buildMetricCards(summary, options = {}) {
|
|
|
const { isAllPropertiesSelected = false, referenceLabel = "" } = options;
|
|
|
|
|
|
- const totalExpenses = Number(summary.expenses ?? 0);
|
|
|
- const netBalance = Number(
|
|
|
- summary.net_revenue ??
|
|
|
- summary.net_balance_amount ??
|
|
|
- Number(summary.reserve_total ?? 0) -
|
|
|
- Number(summary.total_forward_fee_all ?? 0),
|
|
|
- );
|
|
|
- const grossRevenue = Number(summary.reserve_total ?? 0);
|
|
|
- const netRevenue = netBalance;
|
|
|
- const netPayout = Number(summary.final_payout_amount ?? 0);
|
|
|
+ // const totalExpenses = Number(summary.expenses ?? 0);
|
|
|
+
|
|
|
+ // const netBalance = Number(
|
|
|
+ // summary.net_revenue ??
|
|
|
+ // summary.net_balance_amount ??
|
|
|
+ // Number(summary.reserve_total ?? 0) -
|
|
|
+ // Number(summary.total_forward_fee_all ?? 0),
|
|
|
+ // );
|
|
|
+
|
|
|
+ // const grossRevenue = Number(summary.reserve_total ?? 0);
|
|
|
+ // const netRevenue = netBalance;
|
|
|
+ // const netPayout = Number(summary.final_payout_amount ?? 0);
|
|
|
|
|
|
const occupancyCaption = isAllPropertiesSelected
|
|
|
? "percentual consolidado do período"
|
|
|
: `${formatInteger(summary.occupied_nights_in_month)} de ${formatInteger(summary.days_in_month)} dias`;
|
|
|
|
|
|
+ /*
|
|
|
return [
|
|
|
{
|
|
|
label: "Faturamento Bruto",
|
|
|
@@ -79,4 +82,99 @@ export function buildMetricCards(summary, options = {}) {
|
|
|
caption: "manutenção e operação",
|
|
|
},
|
|
|
];
|
|
|
+ */
|
|
|
+
|
|
|
+ return [
|
|
|
+ // INDICADORES
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Ocupação",
|
|
|
+ value: formatPercent(summary.occupancy_rate, 1),
|
|
|
+ caption: occupancyCaption,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Total de Reservas",
|
|
|
+ value: formatInteger(summary.reservations_count),
|
|
|
+ caption: "no período",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Dias por Reserva",
|
|
|
+ value: formatDecimal(summary.average_nights_per_reservation),
|
|
|
+ caption: "média de permanência",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Diária Média",
|
|
|
+ value: formatCurrency(summary.average_price_per_night),
|
|
|
+ caption: "Bruto ÷ diárias",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Limpezas",
|
|
|
+ value: formatInteger(summary.cleanings_count),
|
|
|
+ caption: "total no período",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Manutenção",
|
|
|
+ value: formatInteger(summary.maintenance_days),
|
|
|
+ caption: "dias bloqueados",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Ticket Médio/Reserva",
|
|
|
+ value: formatCurrency(summary.average_reservation_ticket),
|
|
|
+ caption: isAllPropertiesSelected
|
|
|
+ ? "Todos apartamentos"
|
|
|
+ : "No imóvel selecionado",
|
|
|
+ },
|
|
|
+
|
|
|
+ // FINANCEIRO
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Faturamento Bruto",
|
|
|
+ value: formatCurrency(summary.gross_revenue),
|
|
|
+ caption: referenceLabel || "Mês selecionado",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "OTA",
|
|
|
+ value: formatCurrency(summary.ota_amount),
|
|
|
+ caption: "taxas plataformas",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Faturamento Líquido",
|
|
|
+ value: formatCurrency(summary.net_revenue_amount),
|
|
|
+ caption: "Bruto - OTA",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Total Limpeza",
|
|
|
+ value: formatCurrency(summary.cleaning_total_amount),
|
|
|
+ caption: "taxa de limpeza",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Gestão Kizzo",
|
|
|
+ value: formatCurrency(summary.management_fee_amount),
|
|
|
+ caption: "comissão gestão",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Despesas",
|
|
|
+ value: formatCurrency(summary.expenses_amount),
|
|
|
+ caption: "manutenção e operação",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "Repasse",
|
|
|
+ value: formatCurrency(summary.payout_amount),
|
|
|
+ caption: isAllPropertiesSelected
|
|
|
+ ? "Todos apartamentos"
|
|
|
+ : "No imóvel selecionado",
|
|
|
+ },
|
|
|
+ ];
|
|
|
}
|