Revision e3760b76
Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt
SL/DB/ShopOrder.pm | ||
---|---|---|
9 | 9 |
use SL::DB::Manager::ShopOrder; |
10 | 10 |
use SL::DB::Helper::LinkedRecords; |
11 | 11 |
use SL::Locale::String qw(t8); |
12 |
use Carp; |
|
12 | 13 |
|
13 | 14 |
__PACKAGE__->meta->add_relationships( |
14 | 15 |
shop_order_items => { |
... | ... | |
23 | 24 |
sub convert_to_sales_order { |
24 | 25 |
my ($self, %params) = @_; |
25 | 26 |
|
26 |
my $customer = $params{customer}; |
|
27 |
my $employee = $params{employee}; |
|
28 |
die unless ref($customer) eq 'SL::DB::Customer';
|
|
29 |
die unless ref($employee) eq 'SL::DB::Employee';
|
|
27 |
my $customer = delete $params{customer};
|
|
28 |
my $employee = delete $params{employee};
|
|
29 |
croak "param customer is missing" unless ref($customer) eq 'SL::DB::Customer';
|
|
30 |
croak "param employee is missing" unless ref($employee) eq 'SL::DB::Employee';
|
|
30 | 31 |
|
31 | 32 |
require SL::DB::Order; |
32 | 33 |
require SL::DB::OrderItem; |
Auch abrufbar als: Unified diff
ShopOrder - carp statt die bei Prüfung von externen Parametern