Revision 72e545d6
Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
57 | 57 |
__PACKAGE__->run_before('check_auth'); |
58 | 58 |
|
59 | 59 |
__PACKAGE__->run_before('recalc', |
60 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction |
|
60 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_final_invoice save_and_ap_transaction
|
|
61 | 61 |
print send_email) ]); |
62 | 62 |
|
63 | 63 |
__PACKAGE__->run_before('get_unalterable_data', |
64 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction |
|
64 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_final_invoice save_and_ap_transaction
|
|
65 | 65 |
print send_email) ]); |
66 | 66 |
|
67 | 67 |
# |
... | ... | |
698 | 698 |
); |
699 | 699 |
} |
700 | 700 |
|
701 |
sub action_save_and_final_invoice { |
|
702 |
my ($self) = @_; |
|
703 |
|
|
704 |
$self->save_and_redirect_to( |
|
705 |
controller => 'oe.pl', |
|
706 |
action => 'oe_invoice_from_order', |
|
707 |
new_invoice_type => 'final_invoice', |
|
708 |
); |
|
709 |
} |
|
710 |
|
|
701 | 711 |
# workflow from sales order to sales quotation |
702 | 712 |
sub action_sales_quotation { |
703 | 713 |
$_[0]->workflow_sales_or_request_for_quotation(); |
... | ... | |
1990 | 2000 |
$has_invoice_for_advance_payment = any {'SL::DB::Invoice' eq ref $_ && "invoice_for_advance_payment" eq $_->type} @$lr; |
1991 | 2001 |
} |
1992 | 2002 |
|
2003 |
my $has_final_invoice; |
|
2004 |
if ($self->order->id && $self->type eq sales_order_type()) { |
|
2005 |
my $lr = $self->order->linked_records(direction => 'to', to => ['Invoice']); |
|
2006 |
$has_final_invoice = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->type} @$lr; |
|
2007 |
} |
|
2008 |
|
|
1993 | 2009 |
for my $bar ($::request->layout->get('actionbar')) { |
1994 | 2010 |
$bar->add( |
1995 | 2011 |
combobox => [ |
... | ... | |
2057 | 2073 |
], |
2058 | 2074 |
], |
2059 | 2075 |
action => [ |
2060 |
t8('Save and Invoice for Advance Payment'),
|
|
2076 |
($has_invoice_for_advance_payment ? t8('Save and Further Invoice for Advance Payment') : t8('Save and Invoice for Advance Payment')),
|
|
2061 | 2077 |
call => [ 'kivi.Order.save', 'save_and_invoice_for_advance_payment', $::instance_conf->get_order_warn_duplicate_parts ], |
2062 | 2078 |
checks => [ 'kivi.Order.check_save_active_periodic_invoices', |
2063 | 2079 |
@req_trans_cost_art, @req_cusordnumber, |
2064 | 2080 |
], |
2065 |
disabled => $has_invoice_for_advance_payment ? t8('This order has already an invoice for advanced payment.')
|
|
2066 |
: undef,
|
|
2081 |
disabled => $has_final_invoice ? t8('This order has already a final invoice.')
|
|
2082 |
: undef, |
|
2067 | 2083 |
only_if => (any { $self->type eq $_ } (sales_order_type())), |
2068 | 2084 |
], |
2085 |
action => [ |
|
2086 |
t8('Save and Final Invoice'), |
|
2087 |
call => [ 'kivi.Order.save', 'save_and_final_invoice', $::instance_conf->get_order_warn_duplicate_parts ], |
|
2088 |
checks => [ 'kivi.Order.check_save_active_periodic_invoices', |
|
2089 |
@req_trans_cost_art, @req_cusordnumber, |
|
2090 |
], |
|
2091 |
disabled => $has_final_invoice ? t8('This order has already a final invoice.') |
|
2092 |
: undef, |
|
2093 |
only_if => (any { $self->type eq $_ } (sales_order_type())) && $has_invoice_for_advance_payment, |
|
2094 |
], |
|
2069 | 2095 |
action => [ |
2070 | 2096 |
t8('Save and AP Transaction'), |
2071 | 2097 |
call => [ 'kivi.Order.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ], |
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.