Skip to content

Commit

Permalink
fix: rollover
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusantguerrero committed Dec 18, 2023
1 parent f6aa184 commit c3ab683
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/Domains/Budget/Services/BudgetRolloverService.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ private function setMonthBudget($category, $month) {
'name' => $month,
])->first();

if (!$budgetMonth) {
return;
}

if ($budgetMonth->category->account_id) {
$available = (- $budgetMonth->payments);
$available = Money::of($budgetMonth->funded_spending, $category->account->currency_code)
Expand Down
2 changes: 1 addition & 1 deletion app/Domains/Transaction/Services/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ public function getCreditCardSpentTransactions(int $teamId) {
->orderByRaw('g.index,categories.index, accounts.index,accounts.number')
->where(fn ($q) => $q->where([
'transactions.status' => Transaction::STATUS_VERIFIED,
'accounts.team_id' => $teamId
])->orWhereNull('transactions.status')
)
->where([
'accounts.team_id' => $teamId,
'g.display_id' => 'liabilities',
])
->get();
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Finance/Budget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const goToday = () => {
const budgetAccountsTotal = computed(() => {
return props.accounts.reduce((total, account) => {
console.log(account);
console.log(account.balance_type, account.name);
return account.balance_type == 'CREDIT'
? total
: exactMath.add(total, account?.balance)
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Journal/Statements/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const { customPrint } = usePrint("report");
<article class="w-full px-5" v-for="categories in group.categories">
<header class="flex justify-between py-2">
<span class="font-semibold text-blue-500">
{{ categories.alias ?? categories.name }}
{{ categories.alias || (categories.label ?? categories.name) }}
</span>
<div class="space-x-4">
<span class="font-bold text-success">
Expand All @@ -163,7 +163,7 @@ const { customPrint } = usePrint("report");
<article class="w-full px-5" v-for="account in categories.accounts">
<header class="flex justify-between py-2">
<span class="font-semibold text-blue-500">
{{ account.alias ?? account.name }}
{{ account.alias || (account.name ?? account) }}
</span>
<div class="space-x-4">
<span class="font-bold text-success">
Expand Down

0 comments on commit c3ab683

Please sign in to comment.