Revision 276b6579
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 | ||
---|---|---|
488 | 488 |
return $stock_info; |
489 | 489 |
} |
490 | 490 |
|
491 |
sub get_simple_stock_parent_variant_sql { |
|
492 |
my ($self, %params) = @_; |
|
493 |
|
|
494 |
return {} unless $self->id; |
|
495 |
|
|
496 |
my $query = <<SQL; |
|
497 |
SELECT |
|
498 |
p.partnumber AS partnumber, |
|
499 |
w.description AS warehouse_description, |
|
500 |
b.description AS bin_description, |
|
501 |
SUM(i.qty) AS qty, |
|
502 |
SUM(i.qty * p.lastcost) AS stock_value, |
|
503 |
p.unit AS unit, |
|
504 |
LEAD(w.description) OVER pt AS wh_lead, -- to detect warehouse changes for subtotals in template |
|
505 |
SUM( SUM(i.qty) ) OVER pt AS run_qty, -- running total of part qty |
|
506 |
SUM( SUM(i.qty) ) OVER wh AS wh_run_qty, -- running total of part warehouse qty |
|
507 |
SUM( SUM(i.qty) ) OVER () AS total_qty, -- running total of all qty |
|
508 |
SUM( SUM(i.qty * p.lastcost)) OVER pt AS run_stock_value, -- running total of part stock_value |
|
509 |
SUM( SUM(i.qty * p.lastcost)) OVER wh AS wh_run_stock_value, -- running total of part warehouse stock_value |
|
510 |
SUM( SUM(i.qty * p.lastcost)) OVER () AS total_stock_value -- running total of all stock_value |
|
511 |
FROM parts_parent_variant_id_parts_variant_id pvv |
|
512 |
LEFT JOIN inventory i ON (pvv.variant_id = i.parts_id) |
|
513 |
LEFT JOIN parts p ON (i.parts_id = p.id) |
|
514 |
LEFT JOIN warehouse w ON (i.warehouse_id = w.id) |
|
515 |
LEFT JOIN bin b ON (i.bin_id = b.id) |
|
516 |
WHERE parent_variant_id = ? |
|
517 |
GROUP BY p.partnumber, w.description, w.sortkey, b.description, p.unit, i.parts_id |
|
518 |
HAVING SUM(qty) != 0 |
|
519 |
WINDOW pt AS (PARTITION BY i.parts_id ORDER BY w.sortkey, b.description, p.unit), |
|
520 |
wh AS (PARTITION by i.parts_id, w.description ORDER BY w.sortkey, b.description, p.unit) |
|
521 |
ORDER BY w.sortkey, b.description, p.unit; |
|
522 |
SQL |
|
523 |
|
|
524 |
my $stock_info = selectall_hashref_query($::form, $self->db->dbh, $query, $self->id); |
|
525 |
|
|
526 |
my %variant_partnumber_to_stock_info; |
|
527 |
for (@$stock_info) { |
|
528 |
push @{$variant_partnumber_to_stock_info{$_->{partnumber}}}, $_; |
|
529 |
} |
|
530 |
return \%variant_partnumber_to_stock_info; |
|
531 |
} |
|
532 |
|
|
491 | 533 |
sub get_mini_journal { |
492 | 534 |
my ($self) = @_; |
493 | 535 |
|
locale/de/all | ||
---|---|---|
2164 | 2164 |
'Job history' => 'Jobverlauf', |
2165 | 2165 |
'Journal' => 'Buchungsjournal', |
2166 | 2166 |
'Journal of Last 10 Transfers' => 'Letzte 10 Lagertransaktionen', |
2167 |
'Journal of Last 10 Transfers for each Variant' => 'Letzte 10 Lagertransaktionen jeder Variante', |
|
2167 | 2168 |
'Jul' => 'Jul', |
2168 | 2169 |
'July' => 'Juli', |
2169 | 2170 |
'Jump to' => 'Springe zu', |
... | ... | |
4730 | 4731 |
'Variant Property Value' => 'Ausprägung', |
4731 | 4732 |
'Variant Property Values' => 'Ausprägungen', |
4732 | 4733 |
'Variants' => 'Varianten', |
4734 |
'Variants Inventories' => 'Varianten Lagerbewegungen/-bestände', |
|
4733 | 4735 |
'Vendor' => 'Lieferant', |
4734 | 4736 |
'Vendor & Order' => 'Lieferant & Bestellung', |
4735 | 4737 |
'Vendor & Transaction' => 'Lieferant & Buchung', |
locale/en/all | ||
---|---|---|
2163 | 2163 |
'Job history' => '', |
2164 | 2164 |
'Journal' => '', |
2165 | 2165 |
'Journal of Last 10 Transfers' => '', |
2166 |
'Journal of Last 10 Transfers for each Variant' => '', |
|
2166 | 2167 |
'Jul' => '', |
2167 | 2168 |
'July' => '', |
2168 | 2169 |
'Jump to' => '', |
... | ... | |
4728 | 4729 |
'Variant Property Value' => '', |
4729 | 4730 |
'Variant Property Values' => '', |
4730 | 4731 |
'Variants' => '', |
4732 |
'Variants Inventories' => '', |
|
4731 | 4733 |
'Vendor' => '', |
4732 | 4734 |
'Vendor & Order' => '', |
4733 | 4735 |
'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