Revision 0409db7c
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
594 | 594 |
|
595 | 595 |
check_oe_access(); |
596 | 596 |
|
597 |
my $order = _make_record(); |
|
598 |
|
|
599 | 597 |
set_headings($form->{"id"} ? "edit" : "add"); |
600 | 598 |
|
601 | 599 |
$form->{update} = 1; |
... | ... | |
2111 | 2109 |
$::form->error($::locale->text('No action defined.')); |
2112 | 2110 |
} |
2113 | 2111 |
|
2114 |
sub _make_record { |
|
2115 |
my $obj = SL::DB::Order->new; |
|
2116 |
|
|
2117 |
for my $method (keys %$::form) { |
|
2118 |
next unless $obj->can($method); |
|
2119 |
next unless $obj->meta->column($method); |
|
2120 |
|
|
2121 |
if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) { |
|
2122 |
$obj->${\"$method\_as_date"}($::form->{$method}); |
|
2123 |
} elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Integer|Numeric|Float|DoublePrecsion)$/) { |
|
2124 |
$obj->$method($::form->{$method}); |
|
2125 |
} |
|
2126 |
} |
|
2127 |
|
|
2128 |
my @items; |
|
2129 |
for my $i (1 .. $::form->{rowcount}) { |
|
2130 |
next unless $::form->{"id_$i"}; |
|
2131 |
push @items, _make_record_item($i) |
|
2132 |
} |
|
2133 |
|
|
2134 |
$obj->orderitems(@items); |
|
2135 |
|
|
2136 |
return $obj; |
|
2137 |
} |
|
2138 |
|
Auch abrufbar als: Unified diff
PriceSource: Mehr Informationen an Preise übergeben
record + record_item verfügbar gemacht
best_price für pricegroups
Price: spec/source entzerrt