Revision fa5df082
Von Tamino Steinert vor 10 Monaten hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
554 | 554 |
$_[0]->render('part/_inventory_data', { layout => 0 }); |
555 | 555 |
}; |
556 | 556 |
|
557 |
sub action_parent_variant_inventory { |
|
558 |
my ($self) = @_; |
|
559 |
|
|
560 |
$::auth->assert('warehouse_contents'); |
|
561 |
|
|
562 |
$self->render('part/_parent_variant_inventory_data', { layout => 0 }); |
|
563 |
} |
|
564 |
|
|
557 | 565 |
sub action_update_item_totals { |
558 | 566 |
my ($self) = @_; |
559 | 567 |
|
SL/DB/Part.pm | ||
---|---|---|
489 | 489 |
return $stock_info; |
490 | 490 |
} |
491 | 491 |
|
492 |
sub get_simple_stock_parent_variant_sql { |
|
493 |
my ($self, %params) = @_; |
|
494 |
|
|
495 |
return {} unless $self->id; |
|
496 |
|
|
497 |
my $query = <<SQL; |
|
498 |
SELECT |
|
499 |
p.partnumber AS partnumber, |
|
500 |
w.description AS warehouse_description, |
|
501 |
b.description AS bin_description, |
|
502 |
SUM(i.qty) AS qty, |
|
503 |
SUM(i.qty * p.lastcost) AS stock_value, |
|
504 |
p.unit AS unit, |
|
505 |
LEAD(w.description) OVER pt AS wh_lead, -- to detect warehouse changes for subtotals in template |
|
506 |
SUM( SUM(i.qty) ) OVER pt AS run_qty, -- running total of part qty |
|
507 |
SUM( SUM(i.qty) ) OVER wh AS wh_run_qty, -- running total of part warehouse qty |
|
508 |
SUM( SUM(i.qty) ) OVER () AS total_qty, -- running total of all qty |
|
509 |
SUM( SUM(i.qty * p.lastcost)) OVER pt AS run_stock_value, -- running total of part stock_value |
|
510 |
SUM( SUM(i.qty * p.lastcost)) OVER wh AS wh_run_stock_value, -- running total of part warehouse stock_value |
|
511 |
SUM( SUM(i.qty * p.lastcost)) OVER () AS total_stock_value -- running total of all stock_value |
|
512 |
FROM parts_parent_variant_id_parts_variant_id pvv |
|
513 |
LEFT JOIN inventory i ON (pvv.variant_id = i.parts_id) |
|
514 |
LEFT JOIN parts p ON (i.parts_id = p.id) |
|
515 |
LEFT JOIN warehouse w ON (i.warehouse_id = w.id) |
|
516 |
LEFT JOIN bin b ON (i.bin_id = b.id) |
|
517 |
WHERE parent_variant_id = ? |
|
518 |
GROUP BY p.partnumber, w.description, w.sortkey, b.description, p.unit, i.parts_id |
|
519 |
HAVING SUM(qty) != 0 |
|
520 |
WINDOW pt AS (PARTITION BY i.parts_id ORDER BY w.sortkey, b.description, p.unit), |
|
521 |
wh AS (PARTITION by i.parts_id, w.description ORDER BY w.sortkey, b.description, p.unit) |
|
522 |
ORDER BY w.sortkey, b.description, p.unit; |
|
523 |
SQL |
|
524 |
|
|
525 |
my $stock_info = selectall_hashref_query($::form, $self->db->dbh, $query, $self->id); |
|
526 |
|
|
527 |
my %variant_partnumber_to_stock_info; |
|
528 |
for (@$stock_info) { |
|
529 |
push @{$variant_partnumber_to_stock_info{$_->{partnumber}}}, $_; |
|
530 |
} |
|
531 |
return \%variant_partnumber_to_stock_info; |
|
532 |
} |
|
533 |
|
|
492 | 534 |
sub get_mini_journal { |
493 | 535 |
my ($self) = @_; |
494 | 536 |
|
locale/de/all | ||
---|---|---|
2197 | 2197 |
'Job history' => 'Jobverlauf', |
2198 | 2198 |
'Journal' => 'Buchungsjournal', |
2199 | 2199 |
'Journal of Last 10 Transfers' => 'Letzte 10 Lagertransaktionen', |
2200 |
'Journal of Last 10 Transfers for each Variant' => 'Letzte 10 Lagertransaktionen jeder Variante', |
|
2200 | 2201 |
'Jul' => 'Jul', |
2201 | 2202 |
'July' => 'Juli', |
2202 | 2203 |
'Jump to' => 'Springe zu', |
... | ... | |
4806 | 4807 |
'Variant Property Value' => 'Ausprägung', |
4807 | 4808 |
'Variant Property Values' => 'Ausprägungen', |
4808 | 4809 |
'Variants' => 'Varianten', |
4810 |
'Variants Inventories' => 'Varianten Lagerbewegungen/-bestände', |
|
4809 | 4811 |
'Vendor' => 'Lieferant', |
4810 | 4812 |
'Vendor & Order' => 'Lieferant & Bestellung', |
4811 | 4813 |
'Vendor & Transaction' => 'Lieferant & Buchung', |
locale/en/all | ||
---|---|---|
2196 | 2196 |
'Job history' => '', |
2197 | 2197 |
'Journal' => '', |
2198 | 2198 |
'Journal of Last 10 Transfers' => '', |
2199 |
'Journal of Last 10 Transfers for each Variant' => '', |
|
2199 | 2200 |
'Jul' => '', |
2200 | 2201 |
'July' => '', |
2201 | 2202 |
'Jump to' => '', |
... | ... | |
4804 | 4805 |
'Variant Property Value' => '', |
4805 | 4806 |
'Variant Property Values' => '', |
4806 | 4807 |
'Variants' => '', |
4808 |
'Variants Inventories' => '', |
|
4807 | 4809 |
'Vendor' => '', |
4808 | 4810 |
'Vendor & Order' => '', |
4809 | 4811 |
'Vendor & Transaction' => '', |
templates/design40_webpages/part/_parent_variant.html | ||
---|---|---|
316 | 316 |
button_closed=LxERP.t8('Show Convert Part to Variant') |
317 | 317 |
button_open=LxERP.t8('Hide Convert Part to Variant') |
318 | 318 |
%] |
319 |
<div> |
|
319 |
</div>
|
|
320 | 320 |
|
321 | 321 |
</div> |
322 | 322 |
|
templates/design40_webpages/part/form.html | ||
---|---|---|
50 | 50 |
[% IF CUSTOM_VARIABLES.size %] |
51 | 51 |
<li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li> |
52 | 52 |
[% END %] |
53 |
[%- IF (AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service) %] |
|
53 |
[%- IF (AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service AND NOT SELF.part.is_parent_variant) %]
|
|
54 | 54 |
<li><a href="#inventory">[% 'Inventories' | $T8 %]</a></li> |
55 | 55 |
[%- END %] |
56 |
[%- IF (AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND SELF.part.is_parent_variant) %] |
|
57 |
<li><a href="#partent_variant_inventory">[% 'Variants Inventories' | $T8 %]</a></li> |
|
58 |
[%- END %] |
|
56 | 59 |
[% IF AUTH.assert('shop_part_edit', 1) && SELF.part.id && SELF.part.shop %] |
57 | 60 |
<li><a href="#shop_variables">[% 'Shop variables' | $T8 %]</a></li> |
58 | 61 |
[% END %] |
... | ... | |
101 | 104 |
</div> |
102 | 105 |
[% END %] |
103 | 106 |
|
104 |
[% IF AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service %] |
|
107 |
[% IF AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service AND NOT SELF.part.is_parent_variant %]
|
|
105 | 108 |
<div id="inventory"> |
106 | 109 |
[% PROCESS 'part/_inventory.html' %] |
107 | 110 |
</div> |
108 | 111 |
[% END %] |
112 |
[% IF AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND SELF.part.is_parent_variant %] |
|
113 |
<div id="partent_variant_inventory"> |
|
114 |
[% PROCESS 'part/_parent_variant_inventory.html' %] |
|
115 |
</div> |
|
116 |
[% END %] |
|
109 | 117 |
|
110 | 118 |
[% IF CUSTOM_VARIABLES.size %] |
111 | 119 |
<div id="custom_variables" class="ui-tabs-panel"> |
Auch abrufbar als: Unified diff
Varianten: Reiter für Variaten Lagerbestände-/Bewegungen