Revision 9f16892d
Von Tamino Steinert vor 6 Tagen hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
561 | 561 |
$_[0]->render('part/_inventory_data', { layout => 0 }); |
562 | 562 |
}; |
563 | 563 |
|
564 |
sub action_parent_variant_inventory { |
|
565 |
my ($self) = @_; |
|
566 |
|
|
567 |
$::auth->assert('warehouse_contents'); |
|
568 |
|
|
569 |
$self->render('part/_parent_variant_inventory_data', { layout => 0 }); |
|
570 |
} |
|
571 |
|
|
564 | 572 |
sub action_update_item_totals { |
565 | 573 |
my ($self) = @_; |
566 | 574 |
|
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 | ||
---|---|---|
2216 | 2216 |
'Job history' => 'Jobverlauf', |
2217 | 2217 |
'Journal' => 'Buchungsjournal', |
2218 | 2218 |
'Journal of Last 10 Transfers' => 'Letzte 10 Lagertransaktionen', |
2219 |
'Journal of Last 10 Transfers for each Variant' => 'Letzte 10 Lagertransaktionen jeder Variante', |
|
2219 | 2220 |
'Journal of Last 20 Transfers' => 'Letzte 20 Lagertransaktionen', |
2220 | 2221 |
'Jul' => 'Jul', |
2221 | 2222 |
'July' => 'Juli', |
... | ... | |
4852 | 4853 |
'Variant Property Value' => 'Ausprägung', |
4853 | 4854 |
'Variant Property Values' => 'Ausprägungen', |
4854 | 4855 |
'Variants' => 'Varianten', |
4856 |
'Variants Inventories' => 'Varianten Lagerbewegungen/-bestände', |
|
4855 | 4857 |
'Vendor' => 'Lieferant', |
4856 | 4858 |
'Vendor & Order' => 'Lieferant & Bestellung', |
4857 | 4859 |
'Vendor & Transaction' => 'Lieferant & Buchung', |
locale/en/all | ||
---|---|---|
2215 | 2215 |
'Job history' => '', |
2216 | 2216 |
'Journal' => '', |
2217 | 2217 |
'Journal of Last 10 Transfers' => '', |
2218 |
'Journal of Last 10 Transfers for each Variant' => '', |
|
2218 | 2219 |
'Journal of Last 20 Transfers' => '', |
2219 | 2220 |
'Jul' => '', |
2220 | 2221 |
'July' => '', |
... | ... | |
4850 | 4851 |
'Variant Property Value' => '', |
4851 | 4852 |
'Variant Property Values' => '', |
4852 | 4853 |
'Variants' => '', |
4854 |
'Variants Inventories' => '', |
|
4853 | 4855 |
'Vendor' => '', |
4854 | 4856 |
'Vendor & Order' => '', |
4855 | 4857 |
'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