projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d5b215d
)
Auftrags-Controller: Preis nach Preisgruppe setzen, wenn keiner angegeben
author
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Tue, 29 Sep 2015 22:06:56 +0000
(
00:06
+0200)
committer
G. Richardson
<information@kivitendo-premium.de>
Mon, 16 Nov 2015 15:15:58 +0000
(16:15 +0100)
SL/Controller/Order.pm
patch
|
blob
|
history
diff --git
a/SL/Controller/Order.pm
b/SL/Controller/Order.pm
index
3010b5b
..
f275f87
100644
(file)
--- a/
SL/Controller/Order.pm
+++ b/
SL/Controller/Order.pm
@@
-18,6
+18,7
@@
use SL::DB::Employee;
use SL::DB::Project;
use SL::DB::Default;
use SL::DB::Unit;
use SL::DB::Project;
use SL::DB::Default;
use SL::DB::Unit;
+use SL::DB::Price;
use SL::Helper::DateTime;
use SL::Helper::CreatePDF qw(:all);
use SL::Helper::DateTime;
use SL::Helper::CreatePDF qw(:all);
@@
-283,12
+284,17
@@
sub action_add_item {
my $cv_method = $self->cv;
my $cv_discount = $self->order->$cv_method? $self->order->$cv_method->discount : 0.0;
my $cv_method = $self->cv;
my $cv_discount = $self->order->$cv_method? $self->order->$cv_method->discount : 0.0;
+ my $price = $item->sellprice;
+ $price ||= ($self->order->$cv_method && $self->order->$cv_method->klass)
+ ? (SL::DB::Manager::Price->find_by(parts_id => $part->id, pricegroup_id => $self->order->$cv_method->klass)->price || $part->sellprice)
+ : $part->sellprice;
+
my %new_attr;
$new_attr{part} = $part;
$new_attr{description} = $part->description if ! $item->description;
$new_attr{qty} = 1.0 if ! $item->qty;
$new_attr{unit} = $part->unit;
my %new_attr;
$new_attr{part} = $part;
$new_attr{description} = $part->description if ! $item->description;
$new_attr{qty} = 1.0 if ! $item->qty;
$new_attr{unit} = $part->unit;
- $new_attr{sellprice} = $p
art->sellprice if ! $item->sellp
rice;
+ $new_attr{sellprice} = $price;
$new_attr{discount} = $cv_discount if ! $item->discount;
# add_custom_variables adds cvars to an orderitem with no cvars for saving, but
$new_attr{discount} = $cv_discount if ! $item->discount;
# add_custom_variables adds cvars to an orderitem with no cvars for saving, but