Commit 11a5bc4
committed
Fix boolean handling for PostgreSQL in ReportTaxes
PostgreSQL returns boolean values as the strings "t"/"f" instead of
1/0 (as MySQL does). In PHP, the string "f" is truthy, so the
condition `$row['suplido'] ? 0 : $pvpTotal` incorrectly evaluates
to 0 for all non-suplido lines, causing the tax report to calculate
a net total of 0.
Use filter_var with FILTER_VALIDATE_BOOLEAN to properly convert the
database value to a PHP boolean regardless of the database backend.1 parent b22e629 commit 11a5bc4
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| |||
0 commit comments