abivia / ledger

General Ledger and Journal Accounting Package and API for Laravel
MIT License
102 stars 23 forks source link

Report fix: fix error if details table is prefixed #6

Closed Alexgoogole closed 1 year ago

Alexgoogole commented 1 year ago

getTable() function returns pure table name without database prefix. If you're using DB_PREFIX option in Eloquent, it'll modify usual queries (like join and groupBy) and append prefix to it. However, if you're using DB::raw(), the prefix won't be applied to this part of query, resulting in field not found error.

P. S. I've checked code and I guess it's the only place you can get that error:)

abivia commented 1 year ago

@Alexgoogole Great catch, thanks for the patch!