Skip to content

Commit

Permalink
generate 401 report
Browse files Browse the repository at this point in the history
  • Loading branch information
jing12345678910 committed Aug 14, 2024
1 parent 65efe77 commit 0c8e709
Show file tree
Hide file tree
Showing 9 changed files with 731 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iSunFA",
"version": "0.8.0+6",
"version": "0.8.0+7",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down Expand Up @@ -63,6 +63,7 @@
"@types/cookie": "^0.6.0",
"@types/jest": "^29.5.11",
"@types/jsonwebtoken": "^9.0.6",
"@types/next-auth": "^3.15.0",
"@types/node": "^20",
"@types/nodemailer": "^6.4.15",
"@types/react": "^18",
Expand Down
655 changes: 655 additions & 0 deletions src/components/tax_report_body_all/tax_report_body_all.tsx

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/constants/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export const FinancialReportTypesKeyReportSheetTypeMapping: {
[FinancialReportTypesKey.balance_sheet]: ReportSheetType.BALANCE_SHEET,
[FinancialReportTypesKey.comprehensive_income_statement]: ReportSheetType.INCOME_STATEMENT,
[FinancialReportTypesKey.cash_flow_statement]: ReportSheetType.CASH_FLOW_STATEMENT,
// Info: (20240814 - Anna) 增加401報表
[FinancialReportTypesKey.report_401]: ReportSheetType.REPORT_401,
// [FinancialReportTypesKey.change_in_equity_statement]: ReportSheetType.CHANGE_IN_EQUITY_STATEMENT,
};

Expand Down
7 changes: 7 additions & 0 deletions src/interfaces/report_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export enum FinancialReportTypesKey {
balance_sheet = 'balance_sheet',
comprehensive_income_statement = 'comprehensive_income_statement',
cash_flow_statement = 'cash_flow_statement',
// Info: (20240814 - Anna) 增加401報表
report_401 = 'report_401',
// change_in_equity_statement = 'change_in_equity_statement'
}

Expand Down Expand Up @@ -57,6 +59,11 @@ export const FinancialReportTypesMap: Record<
id: FinancialReportTypesKey.cash_flow_statement,
name: 'Cash Flow Statement',
},
// Info: (20240814 - Anna) 增加401報表
[FinancialReportTypesKey.report_401]: {
id: FinancialReportTypesKey.report_401,
name: 'report_401',
},
// [FinancialReportTypesKey.change_in_equity_statement]: {
// id: FinancialReportTypesKey.change_in_equity_statement,
// name: 'Change in Equity Statement',
Expand Down
2 changes: 2 additions & 0 deletions src/locales/cn/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@
"BALANCE_SHEET": "资产负债表",
"CASH_FLOW_STATEMENT": "现金流量表",
"STATEMENT_OF_CASH_FLOWS": "现金流量表",
"REPORT_401": "一般营业人销售额与税额申报书(401)",
"401_REPORT": "一般营业人销售额与税额申报书(401)",
"CHANGE_IN_EQUITY_STATEMENT": "权益变动表",
"RED_FLAG_ANALYSIS": "风险分析",
"POWERED_BY": "技术支持"
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@
"STATEMENT_OF_CASH_FLOWS": "Statement of Cash Flows",
"CHANGE_IN_EQUITY_STATEMENT": "Change in Equity Statement",
"RED_FLAG_ANALYSIS": "Red Flag Analysis",
"POWERED_BY": "Powered by"
"POWERED_BY": "Powered by",
"REPORT_401": "Business Tax Return(401)",
"401_REPORT": "Business Tax Return(401)"
},
"AUDIT_REPORT": {
"AUDIT_REPORT": "Audit Report",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/tw/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@
"BALANCE_SHEET": "資產負債表",
"CASH_FLOW_STATEMENT": "現金流量表",
"STATEMENT_OF_CASH_FLOWS": "現金流量表",
"REPORT_401": "一般營業人銷售額與稅額申報書(401)",
"401_REPORT": "一般營業人銷售額與稅額申報書(401)",
"CHANGE_IN_EQUITY_STATEMENT": "權益變動表",
"RED_FLAG_ANALYSIS": "風險分析",
"POWERED_BY": "技術支持"
Expand Down
55 changes: 55 additions & 0 deletions src/pages/users/reports/[reportId]/report_401/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Head from 'next/head';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { GetServerSideProps } from 'next';
import { useUserCtx } from '@/contexts/user_context';
import { DEFAULT_SKELETON_COUNT_FOR_PAGE } from '@/constants/display';
import { SkeletonList } from '@/components/skeleton/skeleton';
import TaxReportBodyAll from '@/components/tax_report_body_all/tax_report_body_all';

interface ITaxReportPageProps {
reportId: string;
}

const TaxReportPage = ({ reportId }: ITaxReportPageProps) => {
const { isAuthLoading } = useUserCtx();

const displayedBody = isAuthLoading ? (
<div className="flex h-screen w-full items-center justify-center bg-surface-neutral-main-background">
<SkeletonList count={DEFAULT_SKELETON_COUNT_FOR_PAGE} />
</div>
) : (
<div className="flex w-full flex-1 flex-col">
<TaxReportBodyAll reportId={reportId} />
</div>
);

return (
<>
<Head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon/favicon.ico" />
<title>Tax Report</title>
</Head>

<div className="h-full bg-white font-barlow">{displayedBody}</div>
</>
);
};

export const getServerSideProps: GetServerSideProps = async ({ params, locale }) => {
if (!params || !params.reportId || typeof params.reportId !== 'string') {
return {
notFound: true,
};
}

return {
props: {
reportId: params.reportId,
...(await serverSideTranslations(locale as string, ['common'])),
},
};
};

export default TaxReportPage;
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"**/*.ts",
"**/*.tsx",
"tailwind.config.ts",
"src/lib/utils/email.js"
, "scripts/update_version.js" ],
"src/lib/utils/email.js",
"scripts/update_version.js"
],
"exclude": ["node_modules"]
}

0 comments on commit 0c8e709

Please sign in to comment.