Revision 5bd7e74d
Von Jan Büren vor fast 11 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
7 | 7 |
|
8 | 8 |
use Carp; |
9 | 9 |
use List::Util qw(first); |
10 |
use List::MoreUtils qw(pairwise); |
|
10 | 11 |
|
11 | 12 |
use SL::DB::MetaSetup::Invoice; |
12 | 13 |
use SL::DB::Manager::Invoice; |
... | ... | |
15 | 16 |
use SL::DB::Helper::PriceTaxCalculator; |
16 | 17 |
use SL::DB::Helper::PriceUpdater; |
17 | 18 |
use SL::DB::Helper::TransNumberGenerator; |
19 |
use SL::DB::CustomVariable; |
|
18 | 20 |
|
19 | 21 |
__PACKAGE__->meta->add_relationship( |
20 | 22 |
invoiceitems => { |
... | ... | |
147 | 149 |
fxsellprice => $source_item->sellprice,); |
148 | 150 |
} @{ $source->items_sorted }; |
149 | 151 |
|
152 |
my $i = 0; |
|
153 |
foreach my $item (@items) { |
|
154 |
my $source_cvars = $source->items_sorted->[$i]->cvars_by_config; |
|
155 |
my $target_cvars = $item->cvars_by_config; |
|
156 |
pairwise { $a->value($b->value) } @{ $target_cvars }, @{ $source_cvars }; |
|
157 |
$i++; |
|
158 |
} |
|
159 |
|
|
150 | 160 |
$invoice->invoiceitems(\@items); |
151 | 161 |
|
152 | 162 |
return $invoice; |
Auch abrufbar als: Unified diff
Überlagerte benutzerdefinierte Variablen werden in wiederkehrende Rechnungen nicht übernommen
closes #2365