Revision 6c6cf6d9
Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
56 | 56 |
__PACKAGE__->run_before('check_auth'); |
57 | 57 |
|
58 | 58 |
__PACKAGE__->run_before('recalc', |
59 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_ap_transaction |
|
59 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction
|
|
60 | 60 |
print send_email) ]); |
61 | 61 |
|
62 | 62 |
__PACKAGE__->run_before('get_unalterable_data', |
63 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_ap_transaction |
|
63 |
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_ap_transaction
|
|
64 | 64 |
print send_email) ]); |
65 | 65 |
|
66 | 66 |
# |
... | ... | |
653 | 653 |
); |
654 | 654 |
} |
655 | 655 |
|
656 |
sub action_save_and_invoice_for_advance_payment { |
|
657 |
my ($self) = @_; |
|
658 |
|
|
659 |
$self->save_and_redirect_to( |
|
660 |
controller => 'oe.pl', |
|
661 |
action => 'oe_invoice_from_order', |
|
662 |
new_invoice_type => 'invoice_for_advance_payment', |
|
663 |
); |
|
664 |
} |
|
665 |
|
|
656 | 666 |
# workflow from sales order to sales quotation |
657 | 667 |
sub action_sales_quotation { |
658 | 668 |
$_[0]->workflow_sales_or_request_for_quotation(); |
... | ... | |
1935 | 1945 |
my @req_trans_cost_art = qw(kivi.Order.check_transport_cost_article_presence) x!!$::instance_conf->get_transport_cost_reminder_article_number_id; |
1936 | 1946 |
my @req_cusordnumber = qw(kivi.Order.check_cusordnumber_presence) x($self->type eq sales_order_type() && $::instance_conf->get_order_warn_no_cusordnumber); |
1937 | 1947 |
|
1948 |
my $has_invoice_for_advance_payment; |
|
1949 |
if ($self->order->id && $self->type eq sales_order_type()) { |
|
1950 |
my $lr = $self->order->linked_records(direction => 'to', to => ['Invoice']); |
|
1951 |
$has_invoice_for_advance_payment = any {'SL::DB::Invoice' eq ref $_ && "invoice_for_advance_payment" eq $_->type} @$lr; |
|
1952 |
} |
|
1953 |
|
|
1938 | 1954 |
for my $bar ($::request->layout->get('actionbar')) { |
1939 | 1955 |
$bar->add( |
1940 | 1956 |
combobox => [ |
... | ... | |
2001 | 2017 |
@req_trans_cost_art, @req_cusordnumber, |
2002 | 2018 |
], |
2003 | 2019 |
], |
2020 |
action => [ |
|
2021 |
t8('Save and Invoice for Advance Payment'), |
|
2022 |
call => [ 'kivi.Order.save', 'save_and_invoice_for_advance_payment', $::instance_conf->get_order_warn_duplicate_parts ], |
|
2023 |
checks => [ 'kivi.Order.check_save_active_periodic_invoices', |
|
2024 |
@req_trans_cost_art, @req_cusordnumber, |
|
2025 |
], |
|
2026 |
disabled => $has_invoice_for_advance_payment ? t8('This order has already an invoice for advanced payment.') |
|
2027 |
: undef, |
|
2028 |
only_if => (any { $self->type eq $_ } (sales_order_type())), |
|
2029 |
], |
|
2004 | 2030 |
action => [ |
2005 | 2031 |
t8('Save and AP Transaction'), |
2006 | 2032 |
call => [ 'kivi.Order.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ], |
Auch abrufbar als: Unified diff
Anzahlungs-Rg.: Workflow Auftrag -> Anzahlungs-Rg.