LedgerSMB icon indicating copy to clipboard operation
LedgerSMB copied to clipboard

`col_business_units` inconsistencies

Open ehuelsmann opened this issue 2 years ago • 0 comments

I'm working to reduce complexity from LedgerSMB::Report in order to be able to use it from our web services. so far nothing new. One of the calls that receives the $request object, is the "show_cols" function. I'd like to remove that, for the somewhat obvious reason of "don't provide the full outer scope to the inner scope". So, I'm looking at that code and much of it can be moved to instance construction time using a BUILDARGS method: what it does is scan the $request object for keys which start with col_. Well, that can be done at construction time too, because the entire request object is passed as arguments to the constructor. So far so good.

then I had to investigate this specific bit of code: https://github.com/ledgersmb/LedgerSMB/blob/master/lib/LedgerSMB/Report.pm#L534-L536

the reason being that my replacement code does not handle this use-case, because it's not accessing the columns return value.

If I'm correct, that code adds all "business unit" columns to the report, if the selection option col_business_units has been selected.

All is well even this far. So, I search for report filter files which offer that option. I get:

12UI/Reports/filters/invoice_search.html: name = 'col_business_units' UI/Reports/filters/invoice_outstanding.html: name = 'col_business_units'

Very well. So, I check which report may generate columns which match the query =~ /bc_/. There I'm stumped:

12$ grep -R bc_ lib/LedgerSMB/Report/ lib/LedgerSMB/Report/GL.pm: push @COLS, {col_id => 'bc_' . $class->id,

it looks like the intersection of the two is the empty set, right?

ehuelsmann avatar Jul 26 '22 21:07 ehuelsmann