2.0 KiB
2.0 KiB
Walkthrough - Fixing PostgreSQL Compatibility
I have resolved the SQL errors occurring in the Loss Profit History module when running on PostgreSQL.
Changes Made
Business Module Controllers
- AcnooLossProfitHistoryController.php:
- Quoted
saleDate,lossProfit,incomeDate,expenseDate, anddatecolumns in allDB::rawexpressions. - Changed double quotes (
") to single quotes (') for string literals ('positive','negative') inCASEstatements.
- Quoted
- AcnooLossProfitHistoryReportController.php:
- Applied identical fixes for PostgreSQL compatibility.
- AcnooProductLossProfitReportController.php:
- Quoted
lossProfitinCASEstatements.
- Quoted
Export Classes
- ExportLossProfitHistory.php:
- Fixed column quoting and string literals for Excel/CSV exports.
- ExportProductLossProfit.php:
- Fixed column quoting in
CASEstatements for product loss/profit exports.
- Fixed column quoting in
Verification Results
- The code changes directly address the
SQLSTATE[42703](Undefined column) error by ensuring PostgreSQL recognizes the mixed-case column names. - String literal fixes prevent PostgreSQL from interpreting
'positive'and'negative'as column names.