From: Bernd Bleßmann Date: Mon, 20 Jul 2020 10:49:13 +0000 (+0200) Subject: Wechselkurs pro Angebot/Auftrag: legacy-Methode exchangerate umbenannt X-Git-Tag: release-3.5.6.1~94 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b1817cb6e287a1a338ec7f8fcb2bec625af27ba8;p=kivitendo-erp.git Wechselkurs pro Angebot/Auftrag: legacy-Methode exchangerate umbenannt --- diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index b62823a4f..1aa92b0fb 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -49,7 +49,7 @@ __PACKAGE__->meta->add_relationship( }, ); -SL::DB::Helper::Attr::make(__PACKAGE__, exchangerate => 'numeric'); +SL::DB::Helper::Attr::make(__PACKAGE__, daily_exchangerate => 'numeric'); __PACKAGE__->meta->initialize; @@ -120,7 +120,7 @@ sub is_sales { return !!shift->customer_id; } -sub exchangerate { +sub daily_exchangerate { my ($self, $val) = @_; return 1 if $self->currency_id == $::instance_conf->get_currency_id; @@ -495,6 +495,30 @@ Returns one of the following string types: Returns true if the order is of the given type. +=head2 C + +Gets or sets the exchangerate object's value. This is the value from the +table C depending on the order's currency, the transdate and +if it is a sales or purchase order. + +The order object (respectively the table C) has an own column +C which can be get or set with the accessor C. + +The idea is to drop the legacy table C in the future and to +give all relevant tables it's own C column. + +So, this method is here if you need to access the "legacy" exchangerate via +an order object. + +=over 4 + +=item C<$val> + +(optional) If given, the exchangerate in the "legacy" table is set to this +value, depending on currency, transdate and sales or purchase. + +=back + =head2 C Creates a new delivery order with C<$self> as the basis by calling