- call => [ 'kivi.SalesPurchase.show_print_dialog', $form->{id} ? 'print' : 'print_and_post' ],
- checks => [ @req_trans_desc ],
- disabled => $form->{id} ? t8('This invoice has already been posted.') : undef,,
+ call => [ 'kivi.SalesPurchase.show_print_dialog', 'print_and_post' ],
+ checks => [ 'kivi.validate_form' ],
+ confirm => t8('The invoice is not linked with a sales delivery order. Post anyway?') x !!$warn_unlinked_delivery_order,
+ disabled => !$may_edit_create ? t8('You must not change this invoice.')
+ : $form->{locked} ? t8('The billing period has already been locked.')
+ : $form->{storno} ? t8('A canceled invoice cannot be posted.')
+ : ($form->{id} && $change_never) ? t8('Changing invoices has been disabled in the configuration.')
+ : ($form->{id} && $change_on_same_day_only) ? t8('Invoices can only be changed on the day they are posted.')
+ : $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.')
+ : undef,