Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
c52bd08f
Commit
c52bd08f
authored
May 03, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xbdfhmj
parent
72b344d1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
446 additions
and
94 deletions
+446
-94
AccountCodes.php
app/Modules/Accounting/AccountCodes.php
+161
-0
AccountingIntegrationService.php
...ules/Accounting/Services/AccountingIntegrationService.php
+32
-89
BankReconciliationService.php
...Modules/Accounting/Services/BankReconciliationService.php
+5
-2
PeriodClosingService.php
app/Modules/Accounting/Services/PeriodClosingService.php
+5
-3
Phase_42_001_alter_chart_add_level_name.php
...se/migrations/Phase_42_001_alter_chart_add_level_name.php
+7
-0
Phase_42_001_seed_egyptian_chart_of_accounts.php
...se/seeds/Phase_42_001_seed_egyptian_chart_of_accounts.php
+236
-0
No files found.
app/Modules/Accounting/AccountCodes.php
0 → 100644
View file @
c52bd08f
<?php
declare
(
strict_types
=
1
);
namespace
App\Modules\Accounting
;
final
class
AccountCodes
{
// ══════════════════════════════════════════════════════════
// ASSETS (1)
// ══════════════════════════════════════════════════════════
const
CASH_ON_HAND
=
'12010101'
;
const
CASH_AT_BANK
=
'12010201'
;
const
ACCOUNTS_RECEIVABLE
=
'120103'
;
const
INVENTORY
=
'120105'
;
const
PREPAID_EXPENSES
=
'120106'
;
const
EMPLOYEE_LOANS
=
'120107'
;
const
INPUT_TAX
=
'120108'
;
// Fixed Assets
const
LAND
=
'110101'
;
const
BUILDINGS
=
'110102'
;
const
FURNITURE
=
'110103'
;
const
EQUIPMENT
=
'110104'
;
const
VEHICLES
=
'110105'
;
const
COMPUTERS
=
'110106'
;
const
ACCUMULATED_DEPRECIATION
=
'1102'
;
// ══════════════════════════════════════════════════════════
// LIABILITIES & EQUITY (2)
// ══════════════════════════════════════════════════════════
const
ACCOUNTS_PAYABLE
=
'210101'
;
const
ACCRUED_EXPENSES
=
'210102'
;
const
TAX_PAYABLE
=
'210103'
;
const
INSURANCE_PAYABLE
=
'210104'
;
const
DEFERRED_REVENUE
=
'210105'
;
const
MEMBERSHIP_DEPOSITS
=
'210106'
;
const
RENTAL_DEPOSITS
=
'210107'
;
const
END_OF_SERVICE_PROV
=
'210108'
;
// Equity
const
CAPITAL
=
'220101'
;
const
RETAINED_EARNINGS
=
'220102'
;
const
LEGAL_RESERVE
=
'220103'
;
const
GENERAL_RESERVE
=
'220104'
;
// ══════════════════════════════════════════════════════════
// EXPENSES (3)
// ══════════════════════════════════════════════════════════
const
SALARY_EXPENSE
=
'310101'
;
const
INSURANCE_EXPENSE
=
'310102'
;
const
ALLOWANCES_EXPENSE
=
'310103'
;
const
TRAINING_EXPENSE
=
'310104'
;
const
END_OF_SERVICE_EXP
=
'310105'
;
const
COGS
=
'3102'
;
const
BANK_CHARGES
=
'310301'
;
const
RENT_EXPENSE
=
'310302'
;
const
UTILITIES_EXPENSE
=
'310303'
;
const
MAINTENANCE_EXPENSE
=
'310304'
;
const
DEPRECIATION
=
'310305'
;
const
CLEANING_EXPENSE
=
'310306'
;
const
SECURITY_EXPENSE
=
'310307'
;
const
PROPERTY_INSURANCE
=
'310308'
;
const
COMMUNICATIONS_EXP
=
'310309'
;
const
PRINTING_EXPENSE
=
'310310'
;
const
HOSPITALITY_EXPENSE
=
'310311'
;
const
TRANSPORT_EXPENSE
=
'310312'
;
const
MARKETING_EXPENSE
=
'310313'
;
const
GOVERNMENT_FEES
=
'310314'
;
const
LEGAL_FEES
=
'310315'
;
const
SHIPPING_EXPENSE
=
'310316'
;
const
MISC_EXPENSES
=
'310399'
;
// Sports & Activities Expenses
const
ACADEMY_EXPENSE
=
'310401'
;
const
SPORTS_FACILITIES
=
'310402'
;
const
EVENTS_EXPENSE
=
'310403'
;
// ══════════════════════════════════════════════════════════
// REVENUE (4) — Custom for this club
// ══════════════════════════════════════════════════════════
// Membership Revenue (4101)
const
FORM_FEE_REVENUE
=
'410101'
;
const
MEMBERSHIP_VALUE_REVENUE
=
'410102'
;
const
DEPENDENT_ADDITION_REVENUE
=
'410103'
;
// Subscription Revenue (4102)
const
ANNUAL_SUBSCRIPTION
=
'410201'
;
const
DEVELOPMENT_FEE
=
'410202'
;
// Transfer & Cases Revenue (4103)
const
SEPARATION_FEE_REVENUE
=
'410301'
;
const
DIVORCE_FEE_REVENUE
=
'410302'
;
const
DEATH_TRANSFER_REVENUE
=
'410303'
;
const
WAIVER_FEE_REVENUE
=
'410304'
;
const
SPORTS_CONVERSION_REVENUE
=
'410305'
;
// Special Memberships (4104)
const
SEASONAL_MEMBERSHIP
=
'410401'
;
const
CARNET_REPLACEMENT
=
'410402'
;
const
FOREIGN_MEMBERSHIP
=
'410403'
;
// Activities & Sports (4105)
const
ACTIVITY_SUBSCRIPTION
=
'410501'
;
const
ACADEMY_REVENUE
=
'410502'
;
// Single-level revenue accounts
const
FINE_REVENUE
=
'4106'
;
const
SALES_REVENUE
=
'4107'
;
const
RENTAL_REVENUE
=
'4108'
;
// Installment Revenue (4109)
const
DOWN_PAYMENT_REVENUE
=
'410901'
;
const
INSTALLMENT_REVENUE
=
'410902'
;
// Other Revenue (42)
const
BANK_INTEREST_INCOME
=
'4201'
;
const
MISCELLANEOUS_REVENUE
=
'4202'
;
// Service Revenue (catch-all for deposits reclassification etc.)
const
SERVICE_REVENUE
=
'4110'
;
// ══════════════════════════════════════════════════════════
// HELPERS
// ══════════════════════════════════════════════════════════
public
static
function
debitAccountForMethod
(
string
$method
)
:
string
{
return
match
(
$method
)
{
'cash'
=>
self
::
CASH_ON_HAND
,
'check'
=>
self
::
CASH_AT_BANK
,
'visa'
=>
self
::
CASH_AT_BANK
,
'bank_transfer'
=>
self
::
CASH_AT_BANK
,
default
=>
self
::
CASH_ON_HAND
,
};
}
public
static
function
creditAccountForPaymentType
(
string
$type
)
:
string
{
return
match
(
$type
)
{
'form_fee'
=>
self
::
FORM_FEE_REVENUE
,
'membership_fee'
=>
self
::
MEMBERSHIP_VALUE_REVENUE
,
'addition_fee'
=>
self
::
DEPENDENT_ADDITION_REVENUE
,
'separation_fee'
=>
self
::
SEPARATION_FEE_REVENUE
,
'divorce_fee'
=>
self
::
DIVORCE_FEE_REVENUE
,
'death_fee'
=>
self
::
DEATH_TRANSFER_REVENUE
,
'waiver_fee'
=>
self
::
WAIVER_FEE_REVENUE
,
'sports_conversion'
=>
self
::
SPORTS_CONVERSION_REVENUE
,
'seasonal_fee'
=>
self
::
SEASONAL_MEMBERSHIP
,
'carnet_replacement'
=>
self
::
CARNET_REPLACEMENT
,
'annual_subscription'
=>
self
::
ANNUAL_SUBSCRIPTION
,
'development_fee'
=>
self
::
DEVELOPMENT_FEE
,
'activity_subscription'
=>
self
::
ACTIVITY_SUBSCRIPTION
,
'down_payment'
=>
self
::
ACCOUNTS_RECEIVABLE
,
'installment'
=>
self
::
ACCOUNTS_RECEIVABLE
,
'fine'
=>
self
::
FINE_REVENUE
,
'inventory_sale'
=>
self
::
SALES_REVENUE
,
default
=>
self
::
SERVICE_REVENUE
,
};
}
}
app/Modules/Accounting/Services/AccountingIntegrationService.php
View file @
c52bd08f
This diff is collapsed.
Click to expand it.
app/Modules/Accounting/Services/BankReconciliationService.php
View file @
c52bd08f
...
...
@@ -5,6 +5,7 @@ namespace App\Modules\Accounting\Services;
use
App\Core\App
;
use
App\Core\Logger
;
use
App\Modules\Accounting\AccountCodes
;
use
App\Modules\Accounting\Models\BankReconciliation
;
/**
...
...
@@ -188,7 +189,8 @@ final class BankReconciliationService
if
(
$item
[
'item_type'
]
===
'bank_charge'
)
{
// Dr. Bank Charges Expense, Cr. Bank
$bankChargesAccount
=
$db
->
selectOne
(
"SELECT id FROM chart_of_accounts WHERE account_code = '5201' AND is_archived = 0"
"SELECT id FROM chart_of_accounts WHERE account_code = ? AND is_archived = 0"
,
[
AccountCodes
::
BANK_CHARGES
]
);
if
(
$bankChargesAccount
)
{
$lines
=
[
...
...
@@ -201,7 +203,8 @@ final class BankReconciliationService
}
elseif
(
$item
[
'item_type'
]
===
'bank_interest'
)
{
// Dr. Bank, Cr. Interest Income
$interestAccount
=
$db
->
selectOne
(
"SELECT id FROM chart_of_accounts WHERE account_code = '4301' AND is_archived = 0"
"SELECT id FROM chart_of_accounts WHERE account_code = ? AND is_archived = 0"
,
[
AccountCodes
::
BANK_INTEREST_INCOME
]
);
if
(
$interestAccount
)
{
$lines
=
[
...
...
app/Modules/Accounting/Services/PeriodClosingService.php
View file @
c52bd08f
...
...
@@ -6,6 +6,7 @@ namespace App\Modules\Accounting\Services;
use
App\Core\App
;
use
App\Core\EventBus
;
use
App\Core\Logger
;
use
App\Modules\Accounting\AccountCodes
;
use
App\Modules\Accounting\Models\FiscalYear
;
use
App\Modules\Accounting\Models\PeriodClosing
;
...
...
@@ -207,12 +208,13 @@ final class PeriodClosingService
$netIncome
=
$incomeStatement
[
'net_income'
];
// Retained earnings account
(3102)
// Retained earnings account
$retainedEarnings
=
$db
->
selectOne
(
"SELECT id FROM chart_of_accounts WHERE account_code = '3102' AND is_archived = 0"
"SELECT id FROM chart_of_accounts WHERE account_code = ? AND is_archived = 0"
,
[
AccountCodes
::
RETAINED_EARNINGS
]
);
if
(
!
$retainedEarnings
)
{
return
[
'success'
=>
false
,
'error'
=>
'حساب الأرباح المحتجزة (
3102
) غير موجود'
];
return
[
'success'
=>
false
,
'error'
=>
'حساب الأرباح المحتجزة (
'
.
AccountCodes
::
RETAINED_EARNINGS
.
'
) غير موجود'
];
}
$lines
=
[];
...
...
database/migrations/Phase_42_001_alter_chart_add_level_name.php
0 → 100644
View file @
c52bd08f
<?php
declare
(
strict_types
=
1
);
return
[
'up'
=>
"ALTER TABLE `chart_of_accounts` ADD COLUMN `level_name` VARCHAR(20) NULL AFTER `level`"
,
'down'
=>
"ALTER TABLE `chart_of_accounts` DROP COLUMN `level_name`"
,
];
database/seeds/Phase_42_001_seed_egyptian_chart_of_accounts.php
0 → 100644
View file @
c52bd08f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment