Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0b1cca5d

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 0b1cca5d2b4452f21cae8879c8b9d80196568778
  • Vorgänger 569d24f3
  • Nachfolger d72796a6

Model::Record: Überprüfe ob Positionen vorhanden sind

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
sub save {
my ($self) = @_;
if (scalar @{$self->order->items} == 0 && !grep { $self->type eq $_ } @{$::instance_conf->get_allowed_documents_with_no_positions() || []}) {
return [t8('The action you\'ve chosen has not been executed because the document does not contain any item yet.')];
}
# link records
if ($::form->{converted_from_oe_id}) {
my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id};
SL/Controller/Order.pm
sub save {
my ($self) = @_;
if (scalar @{$self->order->items} == 0 && !grep { $self->type eq $_ } @{$::instance_conf->get_allowed_documents_with_no_positions() || []}) {
return [t8('The action you\'ve chosen has not been executed because the document does not contain any item yet.')];
}
$self->parse_phone_note if $::form->{phone_note}->{subject} || $::form->{phone_note}->{body};
# create first version if none exists
SL/Controller/Reclamation.pm
sub save {
my ($self) = @_;
if (scalar @{$self->reclamation->items} == 0 && !grep { $self->type eq $_ } @{$::instance_conf->get_allowed_documents_with_no_positions() || []}) {
return [t8('The action you\'ve chosen has not been executed because the document does not contain any item yet.')];
}
my $items_to_delete = scalar @{ $self->item_ids_to_delete || [] }
? SL::DB::Manager::ReclamationItem->get_all(where => [id => $self->item_ids_to_delete])
: undef;
SL/Model/Record.pm
sub save {
my ($class, $record, %params) = @_;
# Test for no items
if (scalar @{$record->items} == 0
&& !grep { $record->record_type eq $_ }
@{$::instance_conf->get_allowed_documents_with_no_positions() || []}) {
die t8('The action you\'ve chosen has not been executed because the document does not contain any item yet.');
}
$record->calculate_prices_and_taxes() if $record->type_data->features('price_tax');
foreach my $item (@{ $record->items }) {

Auch abrufbar als: Unified diff