Fix budget calculation error
Fixes an issue where entering a monthly budget resulted in incorrect daily, weekly, and monthly budget calculations, leading to incorrect display on the spending and analytics screens.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { CirclePlus, Save, Check } from 'lucide-react';
|
||||
import BudgetInputCard from './BudgetInputCard';
|
||||
@@ -132,13 +133,13 @@ const BudgetTabContent: React.FC<BudgetTabContentProps> = ({
|
||||
{showBudgetInput && <div className="mt-4">
|
||||
<div className="neuro-card p-4">
|
||||
<div>
|
||||
<h3 className="text-base font-medium mb-3">월간 예산 설정</h3>
|
||||
<p className="text-sm text-gray-500 mb-4">월간 예산을 설정하면 일일, 주간 예산이 자동으로 입력됩니다.</p>
|
||||
<h3 className="text-base font-medium mb-3">카테고리별 월간 예산 설정</h3>
|
||||
<p className="text-sm text-gray-500 mb-4">카테고리별로 월간 예산을 설정하세요. 일일, 주간 예산은 자동으로 계산됩니다.</p>
|
||||
<CategoryBudgetInputs categoryBudgets={categoryBudgets} handleCategoryInputChange={handleCategoryInputChange} />
|
||||
|
||||
<div className="mt-4 border-t border-gray-300 pt-3">
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<h3 className="font-medium text-sm px-[34px]">전체 예산:</h3>
|
||||
<h3 className="font-medium text-sm px-[34px]">월간 총 예산:</h3>
|
||||
<p className="font-bold text-neuro-income text-base px-[10px]">{formatCurrency(calculateTotalBudget())}</p>
|
||||
</div>
|
||||
|
||||
@@ -154,4 +155,4 @@ const BudgetTabContent: React.FC<BudgetTabContentProps> = ({
|
||||
</div>}
|
||||
</div>;
|
||||
};
|
||||
export default BudgetTabContent;
|
||||
export default BudgetTabContent;
|
||||
|
||||
Reference in New Issue
Block a user