Revision a33ef0ec
Von Jan Büren vor mehr als 7 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
128 | 128 |
# |
129 | 129 |
# column flags: |
130 | 130 |
# l_partnumber l_description l_listprice l_sellprice l_lastcost l_priceupdate l_weight l_unit l_rop l_image l_drawing l_microfiche l_partsgroup |
131 |
# l_warehouse l_bin |
|
131 | 132 |
# |
132 | 133 |
# exclusives: |
133 | 134 |
# itemstatus = active | onhand | short | obsolete | orphaned |
... | ... | |
136 | 137 |
# joining filters: |
137 | 138 |
# make model - makemodel |
138 | 139 |
# serialnumber transdatefrom transdateto - invoice/orderitems |
140 |
# warehouse - warehouse |
|
141 |
# bin - bin |
|
139 | 142 |
# |
140 | 143 |
# binary flags: |
141 | 144 |
# bought sold onorder ordered rfq quoted - aggreg joins with invoices/orders |
... | ... | |
151 | 154 |
# onhand - as above, but masking the simple itemstatus results (doh!) |
152 | 155 |
# warehouse onhand |
153 | 156 |
# search by overrides of description |
157 |
# soldtotal drops option default warehouse and bin |
|
158 |
# soldtotal can not work if there are no documents checked |
|
154 | 159 |
# |
155 | 160 |
# disabled sanity checks and changes: |
156 | 161 |
# - searchitems = assembly will no longer disable bought |
... | ... | |
167 | 172 |
my ($self, $myconfig, $form) = @_; |
168 | 173 |
my $dbh = $form->get_standard_dbh($myconfig); |
169 | 174 |
|
175 |
# sanity backend check |
|
176 |
croak "Cannot combine soldtotal with default bin or default warehouse" if ($form->{l_soldtotal} && ($form->{l_bin} || $form->{l_warehouse})); |
|
177 |
|
|
170 | 178 |
$form->{parts} = +{ }; |
171 | 179 |
$form->{soldtotal} = undef if $form->{l_soldtotal}; # security fix. top100 insists on putting strings in there... |
172 | 180 |
|
... | ... | |
178 | 186 |
my @like_filters = (@simple_filters, @invoice_oi_filters); |
179 | 187 |
my @all_columns = (@simple_filters, @makemodel_filters, @apoe_filters, @project_filters, qw(serialnumber)); |
180 | 188 |
my @simple_l_switches = (@all_columns, qw(notes listprice sellprice lastcost priceupdate weight unit rop image shop insertdate)); |
189 |
my %no_simple_l_switches = (warehouse => 'wh.description as warehouse', bin => 'bin.description as bin'); |
|
181 | 190 |
my @oe_flags = qw(bought sold onorder ordered rfq quoted); |
182 | 191 |
my @qsooqr_flags = qw(invnumber ordnumber quonumber trans_id name module qty); |
183 | 192 |
my @deliverydate_flags = qw(deliverydate); |
... | ... | |
212 | 221 |
) AS cv ON cv.id = apoe.customer_id OR cv.id = apoe.vendor_id|, |
213 | 222 |
mv => 'LEFT JOIN vendor AS mv ON mv.id = mm.make', |
214 | 223 |
project => 'LEFT JOIN project AS pj ON pj.id = COALESCE(ioi.project_id, apoe.globalproject_id)', |
224 |
warehouse => 'LEFT JOIN warehouse AS wh ON wh.id = p.warehouse_id', |
|
225 |
bin => 'LEFT JOIN bin ON bin.id = p.bin_id', |
|
215 | 226 |
); |
216 |
my @join_order = qw(partsgroup makemodel mv invoice_oi apoe cv pfac project); |
|
227 |
my @join_order = qw(partsgroup makemodel mv invoice_oi apoe cv pfac project warehouse bin);
|
|
217 | 228 |
|
218 | 229 |
my %table_prefix = ( |
219 | 230 |
deliverydate => 'apoe.', serialnumber => 'ioi.', |
... | ... | |
442 | 453 |
$joins_needed{cv} = 1 if $bsooqr; |
443 | 454 |
$joins_needed{apoe} = 1 if $joins_needed{project} || $joins_needed{cv} || grep { $form->{$_} || $form->{"l_$_"} } @apoe_filters; |
444 | 455 |
$joins_needed{invoice_oi} = 1 if $joins_needed{project} || $joins_needed{apoe} || grep { $form->{$_} || $form->{"l_$_"} } @invoice_oi_filters; |
456 |
$joins_needed{bin} = 1 if $form->{l_bin}; |
|
457 |
$joins_needed{warehouse} = 1 if $form->{l_warehouse}; |
|
445 | 458 |
|
446 | 459 |
# special case for description search. |
447 | 460 |
# up in the simple filter section the description filter got interpreted as something like: WHERE description ILIKE '%$form->{description}%' |
... | ... | |
478 | 491 |
my $where_clause = join ' AND ', map { "($_)" } @where_tokens; |
479 | 492 |
my $group_clause = @group_tokens ? ' GROUP BY ' . join ', ', map { $token_builder->($_) } @group_tokens : ''; |
480 | 493 |
|
494 |
# key of %no_simple_l_switch is the logical l_switch. |
|
495 |
# the assigned value is the 'not so simple |
|
496 |
# select token' |
|
497 |
my $no_simple_select_clause; |
|
498 |
foreach my $no_simple_l_switch (keys %no_simple_l_switches) { |
|
499 |
next unless $form->{"l_${no_simple_l_switch}"}; |
|
500 |
$no_simple_select_clause .= ', '. $no_simple_l_switches{$no_simple_l_switch}; |
|
501 |
} |
|
502 |
$select_clause .= $no_simple_select_clause; |
|
503 |
|
|
481 | 504 |
my %oe_flag_to_cvar = ( |
482 | 505 |
bought => 'invoice', |
483 | 506 |
sold => 'invoice', |
bin/mozilla/ic.pl | ||
---|---|---|
167 | 167 |
$form->{title} = $locale->text('Articles'); |
168 | 168 |
|
169 | 169 |
my %column_defs = ( |
170 |
'bin' => { 'text' => $locale->text('Bin'), }, |
|
171 | 170 |
'deliverydate' => { 'text' => $locale->text('deliverydate'), }, |
172 | 171 |
'description' => { 'text' => $locale->text('Part Description'), }, |
173 | 172 |
'notes' => { 'text' => $locale->text('Notes'), }, |
... | ... | |
201 | 200 |
'type_and_classific' => { 'text' => $locale->text('Type'), }, |
202 | 201 |
'projectnumber' => { 'text' => $locale->text('Project Number'), }, |
203 | 202 |
'projectdescription' => { 'text' => $locale->text('Project Description'), }, |
203 |
'warehouse' => { 'text' => $locale->text('Default Warehouse'), }, |
|
204 |
'bin' => { 'text' => $locale->text('Default Bin'), }, |
|
204 | 205 |
); |
205 | 206 |
|
206 | 207 |
$revers = $form->{revers}; |
... | ... | |
327 | 328 |
|
328 | 329 |
if ($form->{l_service} && !$form->{l_assembly} && !$form->{l_part}) { |
329 | 330 |
|
330 |
# remove bin, weight and rop from list |
|
331 |
map { $form->{"l_$_"} = "" } qw(bin weight rop); |
|
331 |
# remove warehouse, bin, weight and rop from list
|
|
332 |
map { $form->{"l_$_"} = "" } qw(bin weight rop warehouse);
|
|
332 | 333 |
|
333 | 334 |
$form->{l_onhand} = ""; |
334 | 335 |
|
... | ... | |
364 | 365 |
|
365 | 366 |
flash('warning', $::locale->text('Soldtotal does not make sense without any bsooqr options')); |
366 | 367 |
} |
368 |
if ($form->{l_soldtotal} && ($form->{l_warehouse} || $form->{l_bin})) { |
|
369 |
delete $form->{"l_$_"} for qw(bin warehouse); |
|
370 |
flash('warning', $::locale->text('Sorry, I am too stupid to figure out the default warehouse/bin and the sold qty. I drop the default warehouse/bin option.')); |
|
371 |
} |
|
367 | 372 |
if ($form->{l_name} && !$bsooqr_mode) { |
368 | 373 |
delete $form->{l_name}; |
369 | 374 |
|
... | ... | |
372 | 377 |
IC->all_parts(\%myconfig, \%$form); |
373 | 378 |
|
374 | 379 |
my @columns = qw( |
375 |
partnumber type_and_classific description notes partsgroup bin onhand rop soldtotal unit listprice |
|
380 |
partnumber type_and_classific description notes partsgroup warehouse bin |
|
381 |
onhand rop soldtotal unit listprice |
|
376 | 382 |
linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost |
377 | 383 |
priceupdate weight image drawing microfiche invnumber ordnumber quonumber |
378 | 384 |
transdate name serialnumber deliverydate ean projectnumber projectdescription |
... | ... | |
416 | 422 |
my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables); |
417 | 423 |
|
418 | 424 |
my @sort_full = qw(partnumber description onhand soldtotal deliverydate insertdate shop); |
419 |
my @sort_no_revers = qw(partsgroup bin priceupdate invnumber ordnumber quonumber name image drawing serialnumber);
|
|
425 |
my @sort_no_revers = qw(partsgroup priceupdate invnumber ordnumber quonumber name image drawing serialnumber); |
|
420 | 426 |
|
421 | 427 |
foreach my $col (@sort_full) { |
422 | 428 |
$column_defs{$col}->{link} = join '&', $callback, "sort=$col", map { "$_=" . E($form->{$_}) } qw(revers lastsort); |
doc/changelog | ||
---|---|---|
8 | 8 |
|
9 | 9 |
- SEPA-XML: alle Sonderzeichen filtern |
10 | 10 |
- SEPA-Export: Export wieder rückgängig machen, falls noch Status offen |
11 |
|
|
11 |
- Stammdaten -> Berichte -> Artikel: Standardlager und Lagerplatz optional anzeigen |
|
12 | 12 |
|
13 | 13 |
2017-07-17 - Release 3.5.0 |
14 | 14 |
|
locale/de/all | ||
---|---|---|
2728 | 2728 |
'Sold order items' => 'Verkaufte Auftragsartikel', |
2729 | 2729 |
'Soldtotal does not make sense without any bsooqr options' => 'Option "Menge in gewählten Belegen" ohne gewählte Belege wird ignoriert.', |
2730 | 2730 |
'Solution' => 'Lösung', |
2731 |
'Sorry, I am too stupid to figure out the default warehouse/bin and the sold qty. I drop the default warehouse/bin option.' => 'Entschuldigung, ich bin nicht in der Lage Standard-Lager und die Menge in gewählten Belegen gleichzeitig anzuzeigen. Ich lass die Standard-Lager weg.', |
|
2731 | 2732 |
'Sort By' => 'Sortiert nach', |
2732 | 2733 |
'Source' => 'Beleg', |
2733 | 2734 |
'Source BIC' => 'Quell-BIC', |
Auch abrufbar als: Unified diff
Artikelbericht (IC.pm): Standardlager und Standardlagerplatz optional anzeigen