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
6d44324b
Commit
6d44324b
authored
Apr 18, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kokowawa
parent
6291dcf2
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
175 additions
and
37 deletions
+175
-37
AccountingIntegrationService.php
...ules/Accounting/Services/AccountingIntegrationService.php
+57
-37
Phase_36_001_seed_expanded_chart_of_accounts.php
...se/seeds/Phase_36_001_seed_expanded_chart_of_accounts.php
+118
-0
No files found.
app/Modules/Accounting/Services/AccountingIntegrationService.php
View file @
6d44324b
...
@@ -64,30 +64,49 @@ final class AccountingIntegrationService
...
@@ -64,30 +64,49 @@ final class AccountingIntegrationService
};
};
// Determine credit account (revenue type)
// Determine credit account (revenue type)
// Uses granular sub-accounts (4110+) with fallback to legacy accounts (4101+)
$creditAccountCode
=
match
(
$type
)
{
$creditAccountCode
=
match
(
$type
)
{
'form_fee'
,
'membership_fee'
,
'addition_fee'
,
'separation_fee'
,
'form_fee'
=>
'4110'
,
// Form Fee Revenue
'divorce_fee'
,
'death_fee'
,
'waiver_fee'
,
'sports_conversion'
,
'membership_fee'
=>
'4111'
,
// Membership Value Revenue
'carnet_replacement'
,
'seasonal_fee'
'addition_fee'
=>
'4112'
,
// Dependent Addition Revenue
=>
'4101'
,
// Membership Revenue
'separation_fee'
=>
'4120'
,
// Separation Fee Revenue
'divorce_fee'
=>
'4121'
,
// Divorce Fee Revenue
'annual_subscription'
,
'development_fee'
'death_fee'
=>
'4122'
,
// Death Transfer Fee Revenue
=>
'4102'
,
// Subscription Revenue
'waiver_fee'
=>
'4123'
,
// Waiver Fee Revenue
'sports_conversion'
=>
'4124'
,
// Sports Conversion Revenue
'down_payment'
,
'installment'
'seasonal_fee'
=>
'4130'
,
// Seasonal Membership Revenue
=>
'1103'
,
// Accounts Receivable (reducing AR)
'carnet_replacement'
=>
'4131'
,
// Carnet Replacement Revenue
'annual_subscription'
=>
'4140'
,
// Annual Subscription Revenue
'fine'
'development_fee'
=>
'4141'
,
// Development Fee Revenue
=>
'4104'
,
// Fine Revenue
'activity_subscription'
=>
'4150'
,
// Activity Subscription Revenue
'down_payment'
=>
'1103'
,
// Accounts Receivable (reducing AR)
'inventory_sale'
'installment'
=>
'1103'
,
// Accounts Receivable (reducing AR)
=>
'4103'
,
// Sales Revenue
'fine'
=>
'4104'
,
// Fine Revenue
'inventory_sale'
=>
'4103'
,
// Sales Revenue
default
default
=>
'4105'
,
// Service Revenue (catch-all)
=>
'4105'
,
// Service Revenue
};
};
$debitAccount
=
self
::
getAccountByCode
(
$debitAccountCode
);
// Fallback: if the granular account doesn't exist yet, use legacy grouping
$creditAccount
=
self
::
getAccountByCode
(
$creditAccountCode
);
$creditAccount
=
self
::
getAccountByCode
(
$creditAccountCode
);
if
(
!
$creditAccount
)
{
$fallbackCode
=
match
(
$type
)
{
'form_fee'
,
'membership_fee'
,
'addition_fee'
,
'separation_fee'
,
'divorce_fee'
,
'death_fee'
,
'waiver_fee'
,
'sports_conversion'
,
'carnet_replacement'
,
'seasonal_fee'
=>
'4101'
,
// Membership Revenue (legacy)
'annual_subscription'
,
'development_fee'
=>
'4102'
,
// Subscription Revenue (legacy)
'activity_subscription'
=>
'4105'
,
// Service Revenue (legacy)
default
=>
null
,
};
if
(
$fallbackCode
)
{
$creditAccountCode
=
$fallbackCode
;
$creditAccount
=
self
::
getAccountByCode
(
$creditAccountCode
);
}
}
$debitAccount
=
self
::
getAccountByCode
(
$debitAccountCode
);
if
(
!
$debitAccount
||
!
$creditAccount
)
{
if
(
!
$debitAccount
||
!
$creditAccount
)
{
Logger
::
error
(
"Accounting auto-post failed: account not found"
,
[
Logger
::
error
(
"Accounting auto-post failed: account not found"
,
[
...
@@ -1198,23 +1217,24 @@ final class AccountingIntegrationService
...
@@ -1198,23 +1217,24 @@ final class AccountingIntegrationService
private
static
function
getPaymentTypeLabel
(
string
$type
)
:
string
private
static
function
getPaymentTypeLabel
(
string
$type
)
:
string
{
{
return
match
(
$type
)
{
return
match
(
$type
)
{
'form_fee'
=>
'رسوم استمارة'
,
'form_fee'
=>
'رسوم استمارة'
,
'membership_fee'
=>
'قيمة العضوية'
,
'membership_fee'
=>
'قيمة العضوية'
,
'addition_fee'
=>
'رسوم إضافة'
,
'addition_fee'
=>
'رسوم إضافة'
,
'annual_subscription'
=>
'اشتراك سنوي'
,
'annual_subscription'
=>
'اشتراك سنوي'
,
'development_fee'
=>
'رسوم تنمية'
,
'development_fee'
=>
'رسوم تنمية'
,
'down_payment'
=>
'مقدم تقسيط'
,
'down_payment'
=>
'مقدم تقسيط'
,
'installment'
=>
'قسط شهري'
,
'installment'
=>
'قسط شهري'
,
'fine'
=>
'غرامة'
,
'fine'
=>
'غرامة'
,
'separation_fee'
=>
'رسوم فصل'
,
'separation_fee'
=>
'رسوم فصل'
,
'divorce_fee'
=>
'رسوم طلاق'
,
'divorce_fee'
=>
'رسوم طلاق'
,
'death_fee'
=>
'رسوم نقل وفاة'
,
'death_fee'
=>
'رسوم نقل وفاة'
,
'waiver_fee'
=>
'رسوم تنازل'
,
'waiver_fee'
=>
'رسوم تنازل'
,
'carnet_replacement'
=>
'بدل فاقد كارنيه'
,
'carnet_replacement'
=>
'بدل فاقد كارنيه'
,
'seasonal_fee'
=>
'رسوم عضوية موسمية'
,
'seasonal_fee'
=>
'رسوم عضوية موسمية'
,
'sports_conversion'
=>
'رسوم تحويل رياضي'
,
'sports_conversion'
=>
'رسوم تحويل رياضي'
,
'inventory_sale'
=>
'مبيعات مخزون'
,
'inventory_sale'
=>
'مبيعات مخزون'
,
default
=>
$type
,
'activity_subscription'
=>
'اشتراك نشاط'
,
default
=>
$type
,
};
};
}
}
}
}
database/seeds/Phase_36_001_seed_expanded_chart_of_accounts.php
0 → 100644
View file @
6d44324b
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