Revision 0956f2d4
Von Felix Eichler vor mehr als 4 Jahren hinzugefügt
SL/DB/Order.pm | ||
---|---|---|
18 | 18 |
use SL::DB::Helper::PriceTaxCalculator; |
19 | 19 |
use SL::DB::Helper::PriceUpdater; |
20 | 20 |
use SL::DB::Helper::TransNumberGenerator; |
21 |
use SL::Locale::String qw(t8); |
|
21 | 22 |
use SL::RecordLinks; |
22 | 23 |
use Rose::DB::Object::Helpers qw(as_tree); |
23 | 24 |
|
... | ... | |
124 | 125 |
|
125 | 126 |
return 1 if $self->currency_id == $::instance_conf->get_currency_id; |
126 | 127 |
|
128 |
# unable to determine if sales or purchase |
|
129 |
return undef if !$self->has_customervendor; |
|
130 |
|
|
127 | 131 |
my $rate = $self->is_sales ? 'buy' : 'sell'; |
128 | 132 |
|
129 | 133 |
if (defined $val) { |
130 |
croak 'exchange rate has to be positive' if $val <= 0;
|
|
134 |
croak t8('exchange rate has to be positive') if $val <= 0;
|
|
131 | 135 |
if (!$self->exchangerate_obj) { |
132 | 136 |
$self->exchangerate_obj(SL::DB::Exchangerate->new( |
133 | 137 |
currency_id => $self->currency_id, |
... | ... | |
137 | 141 |
} elsif (!defined $self->exchangerate_obj->$rate) { |
138 | 142 |
$self->exchangerate_obj->$rate($val); |
139 | 143 |
} else { |
140 |
croak 'exchange rate already exists, no update allowed';
|
|
144 |
croak t8('exchange rate already exists, no update allowed');
|
|
141 | 145 |
} |
142 | 146 |
} |
143 | 147 |
return $self->exchangerate_obj->$rate if $self->exchangerate_obj; |
Auch abrufbar als: Unified diff
Auftragsschnellerfassung: Korrekturen für Währung/Wechselkurs
- Feld auf disabled setzen wenn nicht gebraucht
- _as_null_number damit undef nicht zu 0 wird
- Übersetzte Fehlermeldungen
ticket #9491
(cherry picked from commit c581e4685a217bdd5b73380b1f808037a473dd9f)
(cherry pick von odyn)