Revision d9f8d8b4
Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt
bin/mozilla/is.pl | ||
---|---|---|
1192 | 1192 |
# (order) -> invoice for adv. payment 1 -> invoice for adv. payment 2 -> invoice for adv. payment 3 -> final invoice |
1193 | 1193 |
# |
1194 | 1194 |
# we are currently in the last invoice for adv. payment (3 in this example) |
1195 |
my $invoice_obj = SL::DB::Invoice->load_cached($form->{id}); |
|
1196 |
my $links = $invoice_obj->linked_records(direction => 'from', from => ['Invoice'], recursive => 1); |
|
1197 |
my @related_invoices = grep {'SL::DB::Invoice' eq ref $_ && "invoice_for_advance_payment" eq $_->type} @$links; |
|
1198 |
|
|
1199 |
push @related_invoices, $invoice_obj; |
|
1195 |
my $related_invoices = IS->_get_invoices_for_advance_payment($form->{id}); |
|
1200 | 1196 |
|
1201 | 1197 |
delete @{ $form }{qw(printed emailed queued invnumber invdate exchangerate forex deliverydate datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno locked)}; |
1202 | 1198 |
|
... | ... | |
1223 | 1219 |
remove_emptied_rows(1); |
1224 | 1220 |
|
1225 | 1221 |
my $i = 0; |
1226 |
foreach my $ri (@related_invoices) { |
|
1222 |
foreach my $ri (@$related_invoices) {
|
|
1227 | 1223 |
foreach my $item (@{$ri->items_sorted}) { |
1228 | 1224 |
$i++; |
1229 | 1225 |
$form->{"id_$i"} = $item->parts_id; |
Auch abrufbar als: Unified diff
Anzahlungs-Rg.: Gegenbuchung bei Schluss-Rg.