256 |
256 |
my $form = $::form;
|
257 |
257 |
my $change_never = $::instance_conf->get_is_changeable == 0;
|
258 |
258 |
my $change_on_same_day_only = $::instance_conf->get_is_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate});
|
259 |
|
my @req_trans_desc = qw(kivi.SalesPurchase.check_transaction_description) x!!$::instance_conf->get_require_transaction_description_ps;
|
260 |
259 |
|
261 |
260 |
for my $bar ($::request->layout->get('actionbar')) {
|
262 |
261 |
$bar->add(
|
... | ... | |
265 |
264 |
submit => [ '#form', { action => "update" } ],
|
266 |
265 |
disabled => $form->{locked} ? t8('The billing period has already been locked.') : undef,
|
267 |
266 |
id => 'update_button',
|
|
267 |
checks => [ 'kivi.validate_form' ],
|
268 |
268 |
accesskey => 'enter',
|
269 |
269 |
],
|
270 |
270 |
|
... | ... | |
272 |
272 |
action => [
|
273 |
273 |
t8('Post'),
|
274 |
274 |
submit => [ '#form', { action => "post" } ],
|
275 |
|
checks => [ @req_trans_desc ],
|
|
275 |
checks => [ 'kivi.validate_form' ],
|
276 |
276 |
disabled => $form->{locked} ? t8('The billing period has already been locked.')
|
277 |
277 |
: $form->{storno} ? t8('A canceled invoice cannot be posted.')
|
278 |
278 |
: ($form->{id} && $change_never) ? t8('Changing invoices has been disabled in the configuration.')
|
... | ... | |
282 |
282 |
action => [
|
283 |
283 |
t8('Post Payment'),
|
284 |
284 |
submit => [ '#form', { action => "post_payment" } ],
|
285 |
|
checks => [ @req_trans_desc ],
|
|
285 |
checks => [ 'kivi.validate_form' ],
|
286 |
286 |
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
|
287 |
287 |
],
|
288 |
288 |
action => [ t8('Mark as paid'),
|
... | ... | |
297 |
297 |
action => [ t8('Storno'),
|
298 |
298 |
submit => [ '#form', { action => "storno" } ],
|
299 |
299 |
confirm => t8('Do you really want to cancel this invoice?'),
|
300 |
|
checks => [ @req_trans_desc ],
|
|
300 |
checks => [ 'kivi.validate_form' ],
|
301 |
301 |
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
|
302 |
302 |
],
|
303 |
303 |
action => [ t8('Delete'),
|
304 |
304 |
submit => [ '#form', { action => "delete" } ],
|
305 |
305 |
confirm => t8('Do you really want to delete this object?'),
|
306 |
|
checks => [ @req_trans_desc ],
|
|
306 |
checks => [ 'kivi.validate_form' ],
|
307 |
307 |
disabled => !$form->{id} ? t8('This invoice has not been posted yet.')
|
308 |
308 |
: $form->{locked} ? t8('The billing period has already been locked.')
|
309 |
309 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.')
|
... | ... | |
319 |
319 |
action => [
|
320 |
320 |
t8('Use As New'),
|
321 |
321 |
submit => [ '#form', { action => "use_as_new" } ],
|
|
322 |
checks => [ 'kivi.validate_form' ],
|
322 |
323 |
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
|
323 |
324 |
],
|
324 |
325 |
action => [
|
325 |
326 |
t8('Credit Note'),
|
326 |
327 |
submit => [ '#form', { action => "credit_note" } ],
|
327 |
|
checks => [ @req_trans_desc ],
|
|
328 |
checks => [ 'kivi.validate_form' ],
|
328 |
329 |
disabled => $form->{type} eq "credit_note" ? t8('Credit notes cannot be converted into other credit notes.')
|
329 |
330 |
: !$form->{id} ? t8('This invoice has not been posted yet.')
|
330 |
331 |
: undef,
|
... | ... | |
332 |
333 |
action => [
|
333 |
334 |
t8('Sales Order'),
|
334 |
335 |
submit => [ '#form', { action => "order" } ],
|
|
336 |
checks => [ 'kivi.validate_form' ],
|
335 |
337 |
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
|
336 |
338 |
],
|
337 |
339 |
], # end of combobox "Workflow"
|
... | ... | |
341 |
343 |
action => [
|
342 |
344 |
($form->{id} ? t8('Print') : t8('Preview')),
|
343 |
345 |
call => [ 'kivi.SalesPurchase.show_print_dialog', $form->{id} ? 'print' : 'preview' ],
|
344 |
|
checks => [ @req_trans_desc ],
|
|
346 |
checks => [ 'kivi.validate_form' ],
|
345 |
347 |
disabled => !$form->{id} && $form->{locked} ? t8('The billing period has already been locked.') : undef,
|
346 |
348 |
],
|
347 |
349 |
action => [ t8('Print and Post'),
|
348 |
350 |
call => [ 'kivi.SalesPurchase.show_print_dialog', $form->{id} ? 'print' : 'print_and_post' ],
|
349 |
|
checks => [ @req_trans_desc ],
|
|
351 |
checks => [ 'kivi.validate_form' ],
|
350 |
352 |
disabled => $form->{id} ? t8('This invoice has already been posted.') : undef,,
|
351 |
353 |
],
|
352 |
354 |
action => [ t8('E Mail'),
|
353 |
355 |
call => [ 'kivi.SalesPurchase.show_email_dialog' ],
|
354 |
|
checks => [ @req_trans_desc ],
|
|
356 |
checks => [ 'kivi.validate_form' ],
|
355 |
357 |
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
|
356 |
358 |
],
|
357 |
359 |
], # end of combobox "Export"
|
... | ... | |
378 |
380 |
], # end of combobox "more"
|
379 |
381 |
);
|
380 |
382 |
}
|
|
383 |
$::request->layout->add_javascripts('kivi.Validator.js');
|
381 |
384 |
}
|
382 |
385 |
|
383 |
386 |
sub form_header {
|
kivi.Validator: In IS Maske als check registriert