Revision 048a4ee5
Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
37 | 37 |
__PACKAGE__->run_before('_check_auth'); |
38 | 38 |
|
39 | 39 |
__PACKAGE__->run_before('_recalc', |
40 |
only => [ qw(edit update save create_pdf send_email) ]); |
|
40 |
only => [ qw(edit update save save_and_delivery_order create_pdf send_email) ]);
|
|
41 | 41 |
|
42 | 42 |
__PACKAGE__->run_before('_get_unalterable_data', |
43 | 43 |
only => [ qw(save save_and_delivery_order create_pdf send_email) ]); |
... | ... | |
241 | 241 |
->render($self); |
242 | 242 |
} |
243 | 243 |
|
244 |
sub action_save_and_delivery_order { |
|
245 |
my ($self) = @_; |
|
246 |
|
|
247 |
my $errors = $self->_save(); |
|
248 |
|
|
249 |
if (scalar @{ $errors }) { |
|
250 |
$self->js->flash('error', $_) foreach @{ $errors }; |
|
251 |
return $self->js->render(); |
|
252 |
} |
|
253 |
flash_later('info', $::locale->text('The order has been saved')); |
|
254 |
|
|
255 |
my @redirect_params = ( |
|
256 |
controller => 'oe.pl', |
|
257 |
action => 'oe_delivery_order_from_order', |
|
258 |
id => $self->order->id, |
|
259 |
); |
|
260 |
|
|
261 |
$self->redirect_to(@redirect_params); |
|
262 |
} |
|
244 | 263 |
|
245 | 264 |
sub action_customer_vendor_changed { |
246 | 265 |
my ($self) = @_; |
bin/mozilla/oe.pl | ||
---|---|---|
1934 | 1934 |
$main::lxdebug->leave_sub(); |
1935 | 1935 |
} |
1936 | 1936 |
|
1937 |
sub oe_delivery_order_from_order { |
|
1938 |
|
|
1939 |
return if !$::form->{id}; |
|
1940 |
|
|
1941 |
my $order = SL::DB::Order->new(id => $::form->{id})->load; |
|
1942 |
$order->flatten_to_form($::form, format_amounts => 1); |
|
1943 |
|
|
1944 |
# fake last empty row |
|
1945 |
$::form->{rowcount}++; |
|
1946 |
|
|
1947 |
delivery_order(); |
|
1948 |
} |
|
1949 |
|
|
1937 | 1950 |
sub e_mail { |
1938 | 1951 |
$main::lxdebug->enter_sub(); |
1939 | 1952 |
|
locale/de/all | ||
---|---|---|
2371 | 2371 |
'Save and AP Transaction' => 'Speichern und Kreditorenbuchung erfassen', |
2372 | 2372 |
'Save and AR Transaction' => 'Speichern und Debitorenbuchung erfassen', |
2373 | 2373 |
'Save and Close' => 'Speichern und schließen', |
2374 |
'Save and Delivery Order' => 'Speichern und Lieferschein', |
|
2374 | 2375 |
'Save and Invoice' => 'Speichern und Rechnung erfassen', |
2375 | 2376 |
'Save and Order' => 'Speichern und Auftrag erfassen', |
2376 | 2377 |
'Save and Quotation' => 'Speichern und Angebot', |
templates/webpages/order/form.html | ||
---|---|---|
33 | 33 |
[% L.button_tag('save()', LxERP.t8('Save')) %] |
34 | 34 |
[% L.button_tag('create_pdf()', LxERP.t8('Create PDF')) %] |
35 | 35 |
[% L.button_tag('email()', LxERP.t8('E-mail')) %] |
36 |
[% L.button_tag('save_and_delivery_order()', LxERP.t8('Save and Delivery Order')) %] |
|
36 | 37 |
[%- IF SELF.order.id && ( (SELF.cv == 'customer' && INSTANCE_CONF.get_sales_order_show_delete) || (SELF.cv == 'vendor' && INSTANCE_CONF.get_purchase_order_show_delete) ) %] |
37 | 38 |
[% L.button_tag('delete_order()', LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %] |
38 | 39 |
[%- END %] |
... | ... | |
81 | 82 |
$.post("controller.pl", data, kivi.eval_json_result); |
82 | 83 |
} |
83 | 84 |
|
85 |
function save_and_delivery_order() { |
|
86 |
if (!check_cv()) return; |
|
87 |
var data = $('#order_form').serialize(); |
|
88 |
data += '&action=Order/save_and_delivery_order'; |
|
89 |
|
|
90 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
91 |
} |
|
92 |
|
|
84 | 93 |
function check_cv() { |
85 | 94 |
if ($('#order_[%- cv_id %]').val() == '') { |
86 | 95 |
[%- IF SELF.cv == 'customer' %] |
Auch abrufbar als: Unified diff
Auftrags-Controller: Funktion "Speichern und Lieferschein".