https://github.com/b1f6c1c4/professionalaccounting

Accounting software with debit and credit. 使用借贷记帐法的记账软件

https://github.com/b1f6c1c4/professionalaccounting

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.3%) to scientific vocabulary

Keywords

accounting bookkeeping csharp double-entry-accounting double-entry-bookkeeping personal-accounting
Last synced: 5 months ago · JSON representation

Repository

Accounting software with debit and credit. 使用借贷记帐法的记账软件

Basic Info
  • Host: GitHub
  • Owner: b1f6c1c4
  • License: agpl-3.0
  • Language: C#
  • Default Branch: master
  • Homepage:
  • Size: 23.6 MB
Statistics
  • Stars: 35
  • Watchers: 4
  • Forks: 12
  • Open Issues: 0
  • Releases: 0
Topics
accounting bookkeeping csharp double-entry-accounting double-entry-bookkeeping personal-accounting
Created about 11 years ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

ProfessionalAccounting

使用借贷记帐法的记账软件 Accounting software with debit and credit

Appveyor Build Appveyor Tests Coveralls

简介 Introduction

  • Double-entry bookkeeping
  • Client/Server architecture
    • TLSv1.3, HTTP/3, WebAuthn + mTLS
    • Containerized, nginx + monolithic .NET 9.0 + MongoDB
  • Frontends:
    • A CLI portal for everyday tasks
      • Customized DSL (Domain Specfic Langauge) for easy CRUD
    • A GUI portal for splitting bills
    • A GUI portal for travel expenditures
    • A GUI portal for taobao orders

功能 Functionalities

安装与配置

本项目提供两种部署方式: 1. 本地/内网调试(无TLS加密,无认证,无鉴权,本地数据存储) 1. 网络部署(TLS加密,客户端证书/WebAuthn认证,RBAC鉴权,MongoDB Atlas数据库后端)

准备

首先准备一台Linux服务器,安装以下软件: - docker,推荐采用get.docker.com - (仅限网络部署)openssl(请自行检索安装方法)

配置记账系统功能

为了方便地从GitHub下载单独文件(而不用下载整个repo的整个历史), 此处推荐大家使用git-get来下载。

  1. ssh登录服务器
  2. 下载docker-compose.yml文件(网络部署)或者docker-compose.local.yml(本地部署): bash git get b1f6c1c4/ProfessionalAccounting -- docker-compose.yml git get b1f6c1c4/ProfessionalAccounting -- docker-compose.local.yml
  3. 下载示例配置文件夹,放在/data/accounting/config.d/(网络部署): bash mkdir -p /data/accounting git get -o /data/accounting/config.d b1f6c1c4/ProfessionalAccounting -- example/config.d/
  4. 修改必须修改的配置文件:
    • BaseCurrency.xml - 记账本位币
    • Symbol.xml - 货币符号表
    • Titles.xml - 记账科目列表
    • Carry.xml - 期末结转规则
    • Exchange.xml - 汇率查询API(fixer.ioCoinMarketCap)的配置
  5. 修改可选的配置文件:
    • Authn.xml - WebAuthn配置
    • ACL.xml - RBAC鉴权
    • Abbr.xml - 登记新记账凭证时使用的缩写列表
    • Cash.xml - 现金流插件相关配置
    • Composite.xml - 常用检索式列表
    • Util.xml - 快速登记记账凭证插件的配置
    • SpreadSheet.xml - 表格形式对账插件的配置

配置数据库(仅限网络部署)

  1. 注册 MongoDB Atlas
  2. 创建数据库实例并配置X509认证
    • 将connection string(以mongodb+srv://开头)保存到/data/accounting/atlas/url
    • 将证书保存到/data/accounting/atlas/cert.pem

配置TLS参数(仅限网络部署)

  1. 将服务器证书和私钥(server.crtserver.key)放在服务器的/data/accounting/certs目录下
    • 如果你没有服务器证书,推荐使用 acme.sh 来免费获得一个
    • 注意:WebAuthn只有在服务器证书有效的时候才能进行,所以一旦你的服务器证书失效,所有用户都将无法登录!
  2. 在服务器上创建dhparams: bash openssl dhparam -out /data/accounting/certs/dhparam.pem 2048
  3. 配置客户端证书CA
    • 若并不打算启用客户端证书(仅采用基于WebAuthn的身份验证流程),则执行以下命令骗过nginx: bash openssl req -newkey rsa:512 -x509 -days 1 -nodes -out /data/accounting/certs/client.crt -keyout /dev/null -subj "/CN=dummy"
    • 若打算使用基于客户端证书的身份验证流程,则请自行检索如何设立并维护CA

启动、停止

直接使用docker-compose启动:

  • 本地部署:访问http://localhost:18080/ bash docker compose -f docker-compose.local.yml up -d # start docker compose down # stop
  • 网络部署:访问https://<your-domain>:18080/ bash docker compose up -d # start docker compose down # stop

基本使用方法

记账(记账凭证的增加、修改与删除)

记账过程

  1. 在客户端上使用浏览器访问服务器的18080端口:http://<server>:18080/(本地)或https://<server>:18080/(网络)
  2. 可以看到用户界面分为两部分:上面的一行命令框和下面的编辑器
  3. 在命令框中,输入命令:login <entity>并按回车
    • <entity>是你在记账系统中的记账主体
    • 无需注册,没有密码,记账主体只是个代号而已
    • 当前操作的记账主体存储在浏览器的localstorage中,无需每次login
  4. 按tab可以在命令框和编辑器之间切换
  5. 执行空白命令会在编辑器中添加一个空的记账凭证模板(@new Voucher { }@
  6. 在模板中需要填写记账凭证的内容,也就是用什么货币关于什么、交易了多少钱
    • 例子:T1001 -5
      • 字面意思是:我(刚刚login的用户名)、用本位币(参考BaseCurrency.xml)、关于库存现金(参考Titles.xml)、交易了-5元
      • 翻译过来就是:现金少了5元人民币(假设你没有修改BaseCurrency.xml
    • 例子:sp 5
      • 字面意思是:我、用本位币、关于食品(参考Abbr.xml)、交易了5元
      • 翻译过来就是:食品开销增加了5元人民币
    • 两个例子合在一起,就表明了“今天我用5元人民币现金购买了5元的食品”
  7. 按Alt+Enter保存记账凭证,可以看到增加了不少信息:
    • ^5edc...^ 这是mongoDB的_id,用于唯一标识记账凭证
    • 20200606 这是交易发生的日期,在保存记账凭证的时刻被记录下来了
    • // 库存现金 这是注释,以免使用者忘记记账科目
    • T1001 -5 与保存之前的写法和语义完全相同
    • T660206 '食品' 5 这是从sp 5翻译过来的完整写法
      • Abbr.xml里面已经规定了sp就是T660206 '食品'的简称,所以在保存记账凭证时变回原样也不足为奇
  8. 按Alt+Delete可以删除已经保存的记账凭证
    • 如果记账凭证尚且没有保存,那么它也就无所谓删除,一旦刷新页面就会丢掉
  9. 对于已经保存了的记账凭证,再次按Alt+Enter可以修改它的内容

注意:记账凭证不能嵌套,如果不小心在一个记账凭证模板里面又嵌套了一个模板,请立即按Ctrl+Z撤销。

检索

检索过程

在命令框中执行检索命令可以列出相应的记账凭证:

注意:执行命令会覆盖下方编辑器中的全部内容;如果你希望在编辑器中添加而非覆盖,请在命令框中按Shift+Enter。

  • . - 今天都发生了什么交易
  • .. - 昨天都发生了什么交易
  • T1001 . - 今天都发生了什么现金交易
  • T660206 食品 0 - 这个月都发生了什么食品交易
    • 注意这里不能使用sp缩写
  • unsafe 2020 - 在2020年都发生了什么交易
    • 由于可能返回非常多的结果,这里需要加上关键词unsafe
  • 关于记账凭证检索式(DSL)的具体语法,可以在命令框中输入?命令调出帮助文档

汇总

汇总过程

在命令框中执行分类汇总命令可以对帐务数据进行统计:

  • ` - 我的基本财务报表
  • 0 ` - 我这个月的资金变动情况
  • ~-1 ` - 我上个月的基本财务报表
  • 关于分类汇总检索式(DSL)的具体语法,可以在命令框中输入?命令调出帮助文档

开发

  • ./scripts/build.sh - 构建各个组件
  • ./scripts/upload.sh - 上传至Docker Hub

项目文件结构

  • nginx - 前端
  • AccountingServer - HTTP Server
  • AccountingServer.Shell - 记账凭证的序列化/反序列化,分类汇总的显示
  • AccountingServer.BLL - 汇率转换,分类汇总,固定资产处理,摊销处理
  • AccountingServer.DAL - mongoDB数据库访问
  • AccountingServer.Entities - 基本对象结构定义
  • AccountingServer.QueryGeneration - 基于Antlr4的DSL Parser
  • AccountingServer.Test - 单元测试和集成测试

本地后端开发环境

在Linux上构建开发环境

  1. 请先安装以下工具:
  2. 启动测试数据库:

    bash docker run -d --rm --name mongo -p 27017:27017 mongo

  3. 启动Rider即可。

在Windows上构建开发环境

  1. 请先安装以下工具:
  2. 启动测试数据库:在services.msc中启动MongoDB服务。
  3. 启动Visual Studio即可。

本地前端开发环境

  1. 请先安装以下工具:
  2. 下载所需npm包:

    bash cd nginx && npm install

  3. 启动webpack开发环境:

    bash npm run serve

许可

本项目以GNU AGPL v3.0协议开源。 This project is licensed under GNU AGPL v3.0 only. (AGPL-3.0-only).

Owner

  • Login: b1f6c1c4
  • Kind: user
  • Location: NJ, USA
  • Company: Princeton University

52BE D143 A92D BE96 2B83 092B 9BAC 0164 9600 1E70

GitHub Events

Total
  • Issues event: 10
  • Watch event: 4
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 19
  • Pull request event: 1
  • Fork event: 2
  • Create event: 2
Last Year
  • Issues event: 10
  • Watch event: 4
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 19
  • Pull request event: 1
  • Fork event: 2
  • Create event: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 15
  • Total pull requests: 24
  • Average time to close issues: 6 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 2
  • Total pull request authors: 4
  • Average comments per issue: 0.27
  • Average comments per pull request: 0.38
  • Merged pull requests: 16
  • Bot issues: 0
  • Bot pull requests: 17
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: 2 months
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.4
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • b1f6c1c4 (13)
  • IoriOikawa (2)
Pull Request Authors
  • dependabot[bot] (17)
  • IoriOikawa (4)
  • KevinZonda (2)
  • b1f6c1c4 (1)
Top Labels
Issue Labels
bug (3) enhancement (3) .NET (1)
Pull Request Labels
dependencies (17) javascript (14) .NET (2)

Dependencies

nginx/package-lock.json npm
  • 406 dependencies
nginx/package.json npm
  • copy-webpack-plugin ^10.0.0 development
  • html-webpack-plugin ^5.5.0 development
  • webpack ^5.64.4 development
  • webpack-bundle-analyzer ^4.5.0 development
  • webpack-cli ^4.9.1 development
  • webpack-dev-server ^4.7.3 development
  • @reduxjs/toolkit ^1.6.2
  • axios ^0.25.0
  • dayjs ^1.10.7
  • lodash-es ^4.17.21
  • modern-normalize ^1.1.0
  • p5 ^1.4.0
  • redux-logger ^3.0.6
  • redux-saga ^1.1.3
AccountingServer.BLL/AccountingServer.BLL.csproj nuget
  • Antlr4.Runtime 4.6.6
  • Newtonsoft.Json 13.0.1
AccountingServer.DAL/AccountingServer.DAL.csproj nuget
  • MongoDB.Bson 2.14.1
  • MongoDB.Driver 2.14.1
  • MongoDB.Driver.Core 2.14.1
  • System.Linq.Async 5.1.0
AccountingServer.QueryGeneration/AccountingServer.QueryGeneration.csproj nuget
  • Antlr4.CodeGenerator 4.6.6 development
  • Antlr4.Runtime 4.6.6
AccountingServer.Shell/AccountingServer.Shell.csproj nuget
  • Microsoft.CodeAnalysis.CSharp 4.0.1
  • System.Runtime.Loader 4.3.0
AccountingServer.Test/AccountingServer.Test.csproj nuget
  • Microsoft.NET.Test.Sdk 17.0.0
  • coverlet.collector 3.1.0
  • xunit 2.4.1
  • xunit.runner.visualstudio 2.4.3
AccountingServer/Dockerfile docker
  • mcr.microsoft.com/dotnet/runtime 7.0 build
docker-compose.yml docker
  • b1f6c1c4/accounting-backend latest
  • b1f6c1c4/accounting-frontend latest
nginx/Dockerfile docker
  • patrikjuvonen/docker-nginx-http3 latest build
docker-compose.local.yml docker
  • b1f6c1c4/accounting-backend latest
  • b1f6c1c4/accounting-frontend local
  • mongo latest
AccountingServer/AccountingServer.csproj nuget
AccountingServer.Entities/AccountingServer.Entities.csproj nuget