Revision 0e7a8b0c
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
@{ CVar->get_configs() };
|
||
|
||
$::form->{"cvar_" . $_->{name} . "_valid"} = 1 for @default_valid_configs;
|
||
} else {
|
||
$::form->{lastcost_modified} = $self->check_lastcost_modified;
|
||
}
|
||
|
||
# $self->part has been loaded, parsed and validated without errors and is ready to be saved
|
||
... | ... | |
|
||
}
|
||
|
||
sub check_lastcost_modified {
|
||
my ($self) = @_;
|
||
|
||
return abs($self->part->lastcost - $self->part->last_price_update->lastcost) < 0.009 ? undef : 1;
|
||
}
|
||
|
||
sub parse_form {
|
||
my ($self, %params) = @_;
|
||
|
Auch abrufbar als: Unified diff
Einkaufspreis von Erzeugnissen/Sortimententen aktualisieren (rekursiv)
Falls sich ein einzelner Bestandteil verändert. Läuft über alle
weiter verbauten Teile durch Aufruf von Parts::after_save.
Benötigt einen boolean Parameter in $::form->{lastcost_modified}, damit
nicht bei jedem Speichern des Artikels ohne Veränderung des EK-Preises
die Rekursion losgetreten wird. Beachtet auch die Veränderungsroutine
innerhalb des EK-Rechnungscodes.