Revision 72e545d6
Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt
bin/mozilla/is.pl | ||
---|---|---|
336 | 336 |
$has_final_invoice = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->invoice_type} @$lr; |
337 | 337 |
} |
338 | 338 |
|
339 |
my $is_invoice_for_advance_payment_from_order; |
|
340 |
if ($form->{id} && $form->{type} eq "invoice_for_advance_payment") { |
|
341 |
my $invoice_obj = SL::DB::Invoice->load_cached($form->{id}); |
|
342 |
my $lr = $invoice_obj->linked_records(direction => 'from', from => ['Order']); |
|
343 |
$is_invoice_for_advance_payment_from_order = scalar @$lr >= 1; |
|
344 |
} |
|
345 |
|
|
339 | 346 |
for my $bar ($::request->layout->get('actionbar')) { |
340 | 347 |
$bar->add( |
341 | 348 |
action => [ |
... | ... | |
428 | 435 |
: !$form->{id} ? t8('This invoice has not been posted yet.') |
429 | 436 |
: $has_further_invoice_for_advance_payment ? t8('This invoice has already a further invoice for advanced payment.') |
430 | 437 |
: $has_final_invoice ? t8('This invoice has already a final invoice.') |
438 |
: $is_invoice_for_advance_payment_from_order ? t8('This invoice was added from an order. See there.') |
|
431 | 439 |
: undef, |
432 | 440 |
only_if => $form->{type} eq "invoice_for_advance_payment", |
433 | 441 |
], |
... | ... | |
439 | 447 |
: !$form->{id} ? t8('This invoice has not been posted yet.') |
440 | 448 |
: $has_further_invoice_for_advance_payment ? t8('This invoice has a further invoice for advanced payment.') |
441 | 449 |
: $has_final_invoice ? t8('This invoice has already a final invoice.') |
450 |
: $is_invoice_for_advance_payment_from_order ? t8('This invoice was added from an order. See there.') |
|
442 | 451 |
: undef, |
443 | 452 |
only_if => $form->{type} eq "invoice_for_advance_payment", |
444 | 453 |
], |
... | ... | |
1213 | 1222 |
|
1214 | 1223 |
$main::auth->assert('invoice_edit'); |
1215 | 1224 |
|
1216 |
# search all related invoices for advance payment |
|
1217 |
# |
|
1218 |
# (order) -> invoice for adv. payment 1 -> invoice for adv. payment 2 -> invoice for adv. payment 3 -> final invoice |
|
1219 |
# |
|
1220 |
# we are currently in the last invoice for adv. payment (3 in this example) |
|
1221 | 1225 |
my $related_invoices = IS->_get_invoices_for_advance_payment($form->{id}); |
1222 | 1226 |
|
1223 | 1227 |
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)}; |
Auch abrufbar als: Unified diff
Anzahlungs-Rg.: Workflow vom Auftrag: alle Anzahlugns-Rg. und Schluss-Rg.
Wird der Workflow vom Auftrag aus begonnen, so werden alle Anzahlungs- und
die Schlussrechnung vom Auftrag aus gemacht.
Der Einstieg über eine Anzahlungs-Rg. und dann der Workflow
"weitere Anzahlungs-Rg." (...) und hieraus Schluss-Rg. bleibt bestehen.