X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=15105d31d97cbc9fd2ea8260970ffe438ded23fa;hb=1d1f31407ee1a66af5a0db0d10350bc29a371653;hp=3849ad2ef06c4bbe3dc906609dab733b18f6aee5;hpb=fee85764baaeeecac00c862a979cd52b4655fece;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 3849ad2ef..15105d31d 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -256,6 +256,8 @@ sub setup_is_action_bar { my $form = $::form; my $change_never = $::instance_conf->get_is_changeable == 0; my $change_on_same_day_only = $::instance_conf->get_is_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate}); + my $payments_balanced = ($::form->{oldtotalpaid} == 0); + my $has_storno = ($::form->{storno} && !$::form->{storno_id}); for my $bar ($::request->layout->get('actionbar')) { $bar->add( @@ -298,7 +300,9 @@ sub setup_is_action_bar { submit => [ '#form', { action => "storno" } ], confirm => t8('Do you really want to cancel this invoice?'), checks => [ 'kivi.validate_form' ], - disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef, + disabled => !$form->{id} ? t8('This invoice has not been posted yet.') + : !$payments_balanced ? t8('Cancelling is disallowed. Either undo or balance the current payments until the open amount matches the invoice amount') + : undef, ], action => [ t8('Delete'), submit => [ '#form', { action => "delete" } ], @@ -308,6 +312,7 @@ sub setup_is_action_bar { : $form->{locked} ? t8('The billing period has already been locked.') : $change_never ? t8('Changing invoices has been disabled in the configuration.') : $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') + : $has_storno ? t8('Can only delete the "Storno zu" part of the cancellation pair.') : undef, ], ], # end of combobox "Storno" @@ -771,7 +776,7 @@ sub update { # ask if it is a part or service item if ( $form->{"partsgroup_$i"} - && ($form->{"partsnumber_$i"} eq "") + && ($form->{"partnumber_$i" } eq "") && ($form->{"description_$i"} eq "")) { $form->{rowcount}--; $form->{"discount_$i"} = "";