%form: tokutei_koubo_form_09.tex ; user: tokutei_koubo_09_budget.tex
%========== S-1-4 特定領域研究　継続領域　公募研究(新規) =========
%===== p. 9 設備備品費、消耗品費の明細 =============
\section{設備備品費、消耗品費の明細}
\KLBeginSinglePage{9}{}
%frame: f10_budget_Tk
\setcounter{KLMaxYearCount}{\研究期間の最終元号年度 - \研究開始元号年度 + 1}%

\newcommand{\KLSeparator}{%
	\KLShouKeiLine{2-7}%---------------------------------			
	& \KLTabC{計} & & & \KLMiniSum{KLequipments}{59pt} \\
	\hline
	
	\stepcounter{KLYearCount}
}

\begingroup
	\setlength{\tabcolsep}{2pt}
	
	\begin{\KLBudgetTableFontSize}
	     	\renewcommand{\KLCostCategory}{KLequipments}%
		\setcounter{KLYearCount}{1}%
		
		\KLNoMarginMinipage{54}{710}{550}{
			\begin{tabular}[t]{p{24pt}p{117pt}p{33pt}p{59pt}p{62pt}p{120pt}p{45pt}}
		         		\phantom{年} & \phantom{品名・仕様} & \phantom{1} &
				 \phantom{単価} &
				\phantom{金額} & \phantom{研究機関} & \phantom{購入時期}\\
				% Above two lines are used to allocate the width for the cost.  DO NOT REMOVE IT.

			\setcounter{KLPrintYear}{\１年目}
			%begin 設備備品費、単価、設置機関、購入時期１年目＝＝＝＝＝＝＝＝＝
			\備品自動年単価機関時期１年目
			%end 設備備品費、単価、設置機関、購入時期１年目　＝＝＝＝＝＝＝＝＝

			\KLSeparator%-------------
			
			\setcounter{KLPrintYear}{\２年目}
			\ifthenelse{\value{KLYearCount} > \value{KLMaxYearCount}}{%
			}{%
				%begin 設備備品費、単価、設置機関、購入時期２年目＝＝＝＝＝＝＝＝＝
				\備品自動年単価機関時期２年目
				%end 設備備品費、単価、設置機関、購入時期２年目　＝＝＝＝＝＝＝＝＝

				\KLSeparator%-----------------------------
			}
			\end{tabular}
		}
	\end{\KLBudgetTableFontSize}
\endgroup

%  消耗品費等の明細 =============================================
    \newcommand{\KLYi}{366}
    \newcommand{\KLYiSum}{238}
    \newcommand{\KLYii}{220}
    \newcommand{\KLYiiSum}{100}
        
    \newcommand{\KLBudgetItems}[3]{
	\stepcounter{KLYearCount}% Increment Year
	\KLNoMarginMinipage{\KLX}{#1}{\KLXa}{
		\begin{tabular}[t]{p{\KLCella}p{\KLCellb}}
			#3
	         		\phantom{品名} & \phantom{1}\\ % DO NOT REMOVE
		\end{tabular}
	    }
    }
    
    \newcommand{\KLBudgetSum}[1]{
	\KLNoMarginMinipage{\KLX}{#1}{\KLXa}{
		\begin{tabular}[t]{p{\KLCella}p{\KLCellb}}
			\KLTabC{計}& \KLTabR{\Number{\value{\KLCostCategory\arabic{KLYearCount}}}}\\
	         		\phantom{品名} & \phantom{1}\\ % DO NOT REMOVE
		\end{tabular}
	    }
    }
    
   \begingroup
	\setlength{\tabcolsep}{2pt}
	\begin{\KLBudgetTableFontSize}

\subsection{消耗品費}
     % 消耗品費 =================================================
	    \renewcommand{\KLX}{75}
	    \renewcommand{\KLXa}{188}
	    \setlength{\KLCella}{67pt}
	    \setlength{\KLCellb}{35pt}

	    \renewcommand{\KLCostCategory}{KLexpendables}
	    \setcounter{KLYearCount}{0}

	    \KLBudgetItems{\KLYi}{\KLHi}{
		%begin 消耗品費の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\消耗品費１年目
		%end 消耗品費の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	    }
	    \KLBudgetSum{\KLYiSum}
	    
	    \ifthenelse{\value{KLYearCount} < \value{KLMaxYearCount}}{%
%f:	    	Note that the KLYearCount has not been incremented at this moment yet.
%f:		 It is incremented in the next \KLBudgetItems.
		
		    \KLBudgetItems{\KLYii}{\KLHii}{
			%begin 消耗品費の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\消耗品費２年目
			%end 消耗品費の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		    }
	    }{%
	    	\stepcounter{KLYearCount}%
	    }
	    \KLBudgetSum{\KLYiiSum}
	    
\subsection{旅費}
%     % 旅費 =================================================
	\renewcommand{\KLX}{183}
	\renewcommand{\KLXa}{295}
	    \setlength{\KLCella}{65pt}
	    \setlength{\KLCellb}{35pt}

	    \renewcommand{\KLCostCategory}{KLtravel}
	    \setcounter{KLYearCount}{0}

	    \KLBudgetItems{\KLYi}{\KLHi}{
		%begin 旅費の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\旅費１年目
		%end 旅費の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	    }
	    \KLBudgetSum{\KLYiSum}

	    \ifthenelse{\value{KLYearCount} < \value{KLMaxYearCount}}{%
		    \KLBudgetItems{\KLYii}{\KLHii}{
			%begin 旅費の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\旅費２年目
			%end 旅費の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		    }
	    }{%
	    	\stepcounter{KLYearCount}%
	    }
	    \KLBudgetSum{\KLYiiSum}
	    
\subsection{謝金等}
%     % 謝金等 =================================================
	\renewcommand{\KLX}{288}
	\renewcommand{\KLXa}{420}
	    \setlength{\KLCella}{87pt}
	    \setlength{\KLCellb}{34pt}
%	    
	    \renewcommand{\KLCostCategory}{KLgratitude}
	    \setcounter{KLYearCount}{0}
	
	    \KLBudgetItems{\KLYi}{\KLHi}{
		%begin 謝金等の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\謝金等１年目
		%end 謝金等の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	    }
	    \KLBudgetSum{\KLYiSum}
	    
	    \ifthenelse{\value{KLYearCount} < \value{KLMaxYearCount}}{%
		    \KLBudgetItems{\KLYii}{\KLHii}{
			%begin 謝金等の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\謝金等２年目
			%end 謝金等の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		    }
	    }{%
	    	\stepcounter{KLYearCount}%
	    }
	    \KLBudgetSum{\KLYiiSum}
	    
\subsection{その他}
     % その他 =================================================
	\renewcommand{\KLX}{414}
	\renewcommand{\KLXa}{545}
	    \setlength{\KLCella}{86pt}
	    \setlength{\KLCellb}{35pt}
	    
	    \renewcommand{\KLCostCategory}{KLmisc}
	    \setcounter{KLYearCount}{0}

	    \KLBudgetItems{\KLYi}{\KLHi}{
		%begin その他の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\その他１年目
		%end その他の明細（１年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	    }
	    \KLBudgetSum{\KLYiSum}
	    
	    \ifthenelse{\value{KLYearCount} < \value{KLMaxYearCount}}{%
		    \KLBudgetItems{\KLYii}{\KLHii}{
			%begin その他の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\その他２年目
			%end その他の明細（２年目）＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		    }
	    }{%
	    	\stepcounter{KLYearCount}%
	    }
	    \KLBudgetSum{\KLYiiSum}
	    	    
	\end{\KLBudgetTableFontSize}
    \endgroup


	\KLBottomInfo{89}{62}{138}{218}{287}{387}{455}{539}
\KLEndSinglePage


