Revision 9cb9a448
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
1692 | 1692 |
: $::form->{type} eq sales_order_type() ? purchase_order_type() |
1693 | 1693 |
: ''; |
1694 | 1694 |
|
1695 |
# check for direct delivery |
|
1696 |
# copy shipto in custom shipto (custom shipto will be copied by new_from() in case) |
|
1697 |
my $custom_shipto; |
|
1698 |
if ( $::form->{type} eq sales_order_type() && $destination_type eq purchase_order_type() |
|
1699 |
&& $::form->{use_shipto} && $self->order->shipto) { |
|
1700 |
$custom_shipto = $self->order->shipto->clone('SL::DB::Order'); |
|
1701 |
} |
|
1702 |
|
|
1695 | 1703 |
$self->order(SL::DB::Order->new_from($self->order, destination_type => $destination_type)); |
1696 | 1704 |
$self->{converted_from_oe_id} = delete $::form->{id}; |
1697 | 1705 |
|
... | ... | |
1700 | 1708 |
$item->{new_fake_id} = join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000); |
1701 | 1709 |
} |
1702 | 1710 |
|
1711 |
if ($::form->{type} eq sales_order_type() && $destination_type eq purchase_order_type()) { |
|
1712 |
if ($::form->{use_shipto}) { |
|
1713 |
$self->order->custom_shipto($custom_shipto) if $custom_shipto; |
|
1714 |
} else { |
|
1715 |
# remove any custom shipto if not wanted |
|
1716 |
$self->order->custom_shipto(SL::DB::Shipto->new(module => 'OE', custom_variables => [])); |
|
1717 |
} |
|
1718 |
} |
|
1719 |
|
|
1703 | 1720 |
# change form type |
1704 | 1721 |
$::form->{type} = $destination_type; |
1705 | 1722 |
$self->type($self->init_type); |
... | ... | |
1825 | 1842 |
], |
1826 | 1843 |
action => [ |
1827 | 1844 |
t8('Save and Purchase Order'), |
1828 |
submit => [ '#order_form', { action => "Order/purchase_order" } ],
|
|
1829 |
only_if => (any { $self->type eq $_ } (sales_order_type(), request_quotation_type())), |
|
1845 |
call => [ 'kivi.Order.purchase_order_check_for_direct_delivery' ],
|
|
1846 |
only_if => (any { $self->type eq $_ } (sales_order_type(), request_quotation_type())),
|
|
1830 | 1847 |
], |
1831 | 1848 |
action => [ |
1832 | 1849 |
t8('Save and Delivery Order'), |
Auch abrufbar als: Unified diff
Auftrags-Controller: Workflow VK->EK: Lieferadresse für direkte Lieferung
Falls beim Workflow Kundenauftrag->Lieferantenauftrag eine Lieferadresse
ausgewählt oder eine indiv. Lieferadresse eingetragen ist, wir gefragt,
ob diese Lieferadresse als (indiv.) Lieferadresse in den Lieferantenauftrag
übernommen werden soll.