承接 otim-otim/bookkeeper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

otim-otim/bookkeeper

Composer 安装命令:

composer require otim-otim/bookkeeper

包简介

A Laravel package for double-entry bookkeeping and accounting statements.

README 文档

README

A double-entry bookkeeping package for Laravel. Install it in any Laravel application to get a full chart of accounts, journal entry recording, and financial statement generation out of the box.

Installation

1. Add the package via Composer

composer require otimdibossman/bookkeeper

Laravel auto-discovery will automatically register the BookKeeperServiceProvider and the BookKeeper facade.

2. Run the migrations

php artisan migrate

Or publish the migrations to customise them first:

php artisan vendor:publish --tag=bookkeeper-migrations
php artisan migrate

Quick Start

Create accounts

use OtimOtim\BookKeeper\Facades\BookKeeper;
use OtimOtim\BookKeeper\Enums\AccountType;

// Chart of accounts
BookKeeper::createAccount('1000', 'Cash',             AccountType::Asset);
BookKeeper::createAccount('1100', 'Accounts Receivable', AccountType::Asset);
BookKeeper::createAccount('2000', 'Accounts Payable', AccountType::Liability);
BookKeeper::createAccount('3000', 'Owner Capital',    AccountType::Equity);
BookKeeper::createAccount('4000', 'Sales Revenue',    AccountType::Revenue);
BookKeeper::createAccount('5000', 'Cost of Goods',    AccountType::Expense);

Record a journal entry (double-entry)

BookKeeper::record([
    ['account' => '1000', 'type' => 'debit',  'amount' => 1500.00, 'memo' => 'Cash received'],
    ['account' => '4000', 'type' => 'credit', 'amount' => 1500.00, 'memo' => 'Sale of goods'],
], [
    'date'      => '2024-03-01',
    'memo'      => 'Cash sale to customer',
    'reference' => 'INV-2024-001',
]);

The package will throw UnbalancedEntryException if debits ≠ credits.

Transfer (convenience method)

// Debit Cash, Credit Revenue — in one call
BookKeeper::transfer('1000', '4000', 2000.00, [
    'memo'      => 'Payment received',
    'reference' => 'PAY-001',
]);

Check an account balance

$balance = BookKeeper::balance('1000');           // current balance
$balance = BookKeeper::balanceAsOf('1000', '2024-12-31'); // historical

Financial Statements

Balance Sheet

$sheet = BookKeeper::balanceSheet('2024-12-31');

// Returns: assets, liabilities, equity, totals, balanced (bool)
dump($sheet['totals']);
// ['assets' => 50000, 'liabilities' => 20000, 'equity' => 30000, 'liabilities_equity' => 50000]

Income Statement (Profit & Loss)

$pl = BookKeeper::incomeStatement('2024-01-01', '2024-12-31');

dump($pl['totals']);
// ['revenue' => 80000, 'expenses' => 45000, 'net_income' => 35000]

Trial Balance

$trial = BookKeeper::trialBalance('2024-12-31');

dump($trial['balanced']); // true
dump($trial['totals']);   // ['debits' => 120000, 'credits' => 120000]

General Ledger

$account = BookKeeper::account('1000');
$ledger  = BookKeeper::generalLedger($account, '2024-01-01', '2024-12-31');

// Returns all transaction lines for the account with running details

Direct Service Access

You can also inject the services directly:

use OtimOtim\BookKeeper\Services\AccountService;
use OtimOtim\BookKeeper\Services\LedgerService;
use OtimOtim\BookKeeper\Services\StatementService;

class MyController
{
    public function __construct(
        private AccountService   $accounts,
        private LedgerService    $ledger,
        private StatementService $statements,
    ) {}
}

Account Types

Type Normal Balance Statement
Asset Debit Balance Sheet
Liability Credit Balance Sheet
Equity Credit Balance Sheet
Revenue Credit Income Statement
Expense Debit Income Statement

Database Tables

Table Purpose
bookkeeper_accounts Chart of accounts
bookkeeper_journal_entries Groups of balanced debits/credits
bookkeeper_transactions Individual debit/credit lines

Running Tests

composer install
vendor/bin/phpunit

License

MIT

otim-otim/bookkeeper 适用场景与选型建议

otim-otim/bookkeeper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 221 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「ledger」 「Accounting」 「bookkeeping」 「double-entry」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 otim-otim/bookkeeper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 otim-otim/bookkeeper 我们能提供哪些服务?
定制开发 / 二次开发

基于 otim-otim/bookkeeper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 221
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-02