<?php


trait ExtraGroupExpenseTrait
{
    public function checkExtraGroupExpense($extras, $expense_title)
    {
        $result = 99;
        $extras_value = 0;
        if (!empty($extras)) {
            $extras_array = explode("|", $extras);
            $extras_value = $extras_array[0];
        }
        if ($extras_value == 1 || $expense_title == 'Balance Expense') {
            $result = 1;
        } elseif ($extras_value == 2) {
            $result = 2;
        }
        return $result;
    }
}