Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 276b6579

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 276b65798ca1f52f2ea5a14d913887b7f04a53ad
  • Vorgänger 267268a3
  • Nachfolger f744a501

Varianten: Reiter für Variaten Lagerbestände-/Bewegungen

Unterschiede anzeigen:

SL/Controller/Part.pm
$_[0]->render('part/_inventory_data', { layout => 0 });
};
sub action_parent_variant_inventory {
my ($self) = @_;
$::auth->assert('warehouse_contents');
$self->render('part/_parent_variant_inventory_data', { layout => 0 });
}
sub action_update_item_totals {
my ($self) = @_;
SL/DB/Part.pm
return $stock_info;
}
sub get_simple_stock_parent_variant_sql {
my ($self, %params) = @_;
return {} unless $self->id;
my $query = <<SQL;
SELECT
p.partnumber AS partnumber,
w.description AS warehouse_description,
b.description AS bin_description,
SUM(i.qty) AS qty,
SUM(i.qty * p.lastcost) AS stock_value,
p.unit AS unit,
LEAD(w.description) OVER pt AS wh_lead, -- to detect warehouse changes for subtotals in template
SUM( SUM(i.qty) ) OVER pt AS run_qty, -- running total of part qty
SUM( SUM(i.qty) ) OVER wh AS wh_run_qty, -- running total of part warehouse qty
SUM( SUM(i.qty) ) OVER () AS total_qty, -- running total of all qty
SUM( SUM(i.qty * p.lastcost)) OVER pt AS run_stock_value, -- running total of part stock_value
SUM( SUM(i.qty * p.lastcost)) OVER wh AS wh_run_stock_value, -- running total of part warehouse stock_value
SUM( SUM(i.qty * p.lastcost)) OVER () AS total_stock_value -- running total of all stock_value
FROM parts_parent_variant_id_parts_variant_id pvv
LEFT JOIN inventory i ON (pvv.variant_id = i.parts_id)
LEFT JOIN parts p ON (i.parts_id = p.id)
LEFT JOIN warehouse w ON (i.warehouse_id = w.id)
LEFT JOIN bin b ON (i.bin_id = b.id)
WHERE parent_variant_id = ?
GROUP BY p.partnumber, w.description, w.sortkey, b.description, p.unit, i.parts_id
HAVING SUM(qty) != 0
WINDOW pt AS (PARTITION BY i.parts_id ORDER BY w.sortkey, b.description, p.unit),
wh AS (PARTITION by i.parts_id, w.description ORDER BY w.sortkey, b.description, p.unit)
ORDER BY w.sortkey, b.description, p.unit;
SQL
my $stock_info = selectall_hashref_query($::form, $self->db->dbh, $query, $self->id);
my %variant_partnumber_to_stock_info;
for (@$stock_info) {
push @{$variant_partnumber_to_stock_info{$_->{partnumber}}}, $_;
}
return \%variant_partnumber_to_stock_info;
}
sub get_mini_journal {
my ($self) = @_;
locale/de/all
'Job history' => 'Jobverlauf',
'Journal' => 'Buchungsjournal',
'Journal of Last 10 Transfers' => 'Letzte 10 Lagertransaktionen',
'Journal of Last 10 Transfers for each Variant' => 'Letzte 10 Lagertransaktionen jeder Variante',
'Jul' => 'Jul',
'July' => 'Juli',
'Jump to' => 'Springe zu',
......
'Variant Property Value' => 'Ausprägung',
'Variant Property Values' => 'Ausprägungen',
'Variants' => 'Varianten',
'Variants Inventories' => 'Varianten Lagerbewegungen/-bestände',
'Vendor' => 'Lieferant',
'Vendor & Order' => 'Lieferant & Bestellung',
'Vendor & Transaction' => 'Lieferant & Buchung',
locale/en/all
'Job history' => '',
'Journal' => '',
'Journal of Last 10 Transfers' => '',
'Journal of Last 10 Transfers for each Variant' => '',
'Jul' => '',
'July' => '',
'Jump to' => '',
......
'Variant Property Value' => '',
'Variant Property Values' => '',
'Variants' => '',
'Variants Inventories' => '',
'Vendor' => '',
'Vendor & Order' => '',
'Vendor & Transaction' => '',
templates/design40_webpages/part/_parent_variant.html
button_closed=LxERP.t8('Show Convert Part to Variant')
button_open=LxERP.t8('Hide Convert Part to Variant')
%]
<div>
</div>
</div>
templates/design40_webpages/part/form.html
[% IF CUSTOM_VARIABLES.size %]
<li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
[% END %]
[%- IF (AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service) %]
[%- IF (AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service AND NOT SELF.part.is_parent_variant) %]
<li><a href="#inventory">[% 'Inventories' | $T8 %]</a></li>
[%- END %]
[%- IF (AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND SELF.part.is_parent_variant) %]
<li><a href="#partent_variant_inventory">[% 'Variants Inventories' | $T8 %]</a></li>
[%- END %]
[% IF AUTH.assert('shop_part_edit', 1) && SELF.part.id && SELF.part.shop %]
<li><a href="#shop_variables">[% 'Shop variables' | $T8 %]</a></li>
[% END %]
......
</div>
[% END %]
[% IF AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service %]
[% IF AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND NOT SELF.part.is_service AND NOT SELF.part.is_parent_variant %]
<div id="inventory">
[% PROCESS 'part/_inventory.html' %]
</div>
[% END %]
[% IF AUTH.assert('warehouse_contents', 1) AND SELF.part.id AND SELF.part.is_parent_variant %]
<div id="partent_variant_inventory">
[% PROCESS 'part/_parent_variant_inventory.html' %]
</div>
[% END %]
[% IF CUSTOM_VARIABLES.size %]
<div id="custom_variables" class="ui-tabs-panel">

Auch abrufbar als: Unified diff