fix(accounting): billing sources installed none — information_schema case, and wire cheques
TWO THINGS.
1. Billing sources installed nothing.
validate() read information_schema with lower-case keys (column_name,
data_type) while this server returns them upper case, so every column looked
missing, every source failed validation, and the seed skipped all seven while
reporting success. Columns are now aliased explicitly. The defaults moved into
BillingSourceService::syncDefaults() so they can be re-installed after a schema
change instead of being trapped in a one-shot seed, and anything that still
does not fit is named rather than dropped.
Found by running the validator against the live database instead of trusting
that an empty table meant "nothing to do".
2. The cheque lifecycle now posts.
CheckLifecycleService had a correct state machine and zero journal entries, so
a cheque moving desk → bank → collected, or bouncing, left no trace in the
ledger at all.
Each movement now posts through configurable account pointers:
deposited Dr شيكات تحت التحصيل / Cr أوراق قبض
collected Dr البنك / Cr شيكات تحت التحصيل
bounced Dr مدينون (شيكات مرتدة) / Cr شيكات تحت التحصيل
endorsed Dr الدائن / Cr أوراق قبض
paid Dr أوراق دفع / Cr البنك
The bounce charge posts as its own entry so it can be waived without touching
the restored debt. Re-presenting a bounced cheque moves it back to
under_collection and posts the deposit leg again, so a second and third
presentation each leave their own trail.
Posting happens AFTER the status commit on purpose: a cheque physically moving
to the bank must be recorded even when its accounts are unmapped, otherwise the
paperwork and the system disagree. An unpostable move returns a warning.
Also corrects a real error along the way: AccountCodes sends a cheque payment
straight to the bank. Taking a post-dated cheque is not money in the bank — it
is a note receivable until the bank collects it. The counter account is now a
configurable pointer per payment method (treasury:method_check → أوراق قبض),
so it is fixed from the screen rather than in code, and a header account there
is refused with the pointer name to map.
Co-Authored-By:
Claude Opus 5 (1M context) <noreply@anthropic.com>
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment