24 lines
609 B
PHP
24 lines
609 B
PHP
<?php
|
|
/**
|
|
* AccountingEngine
|
|
*
|
|
* Core double-entry validation and rules.
|
|
* Ensures every journal entry balances (total debit = total credit).
|
|
* All other accounting classes depend on this for validation.
|
|
*/
|
|
class AccountingEngine
|
|
{
|
|
private PDO $pdo;
|
|
private int $companyId;
|
|
|
|
public function __construct(PDO $pdo, int $company_id)
|
|
{
|
|
$this->pdo = $pdo;
|
|
$this->companyId = $company_id;
|
|
}
|
|
|
|
// TODO: validate journal lines balance (sum debit = sum credit)
|
|
// TODO: validate account codes exist and are posting accounts
|
|
// TODO: validate period is open
|
|
}
|