Revision 0af1d584
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
use SL::Helper::UserPreferences::PositionsScrollbar;
|
||
use SL::Helper::UserPreferences::UpdatePositions;
|
||
|
||
use SL::DB::Helper::HardRecordLinks;
|
||
|
||
use SL::Controller::Helper::GetModels;
|
||
|
||
use List::Util qw(first sum0);
|
||
... | ... | |
$has_final_invoice = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->type} @$lr;
|
||
}
|
||
|
||
my $has_hard_links = SL::DB::Helper::HardRecordLinks->get_count($self->order);
|
||
|
||
my $right_for = { map { $_ => $_.'_edit' } @{$self->valid_types} };
|
||
$right_for->{ sales_order_intake_type() } = 'sales_order_edit';
|
||
$right_for->{ purchase_quotation_intake_type() } = 'request_quotation_edit';
|
||
... | ... | |
confirm => $::locale->text('Do you really want to delete this object?'),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$self->order->id ? t8('This object has not been saved yet.')
|
||
: $has_hard_links ? t8('This object has hard links. Please delete them first.')
|
||
: undef,
|
||
only_if => $deletion_allowed,
|
||
],
|
SL/IS.pm | ||
---|---|---|
return $result;
|
||
}
|
||
|
||
sub has_hard_links {
|
||
$main::lxdebug->enter_sub();
|
||
my ($self, $myconfig, $form, $table) = @_;
|
||
$main::lxdebug->leave_sub() and return 0 unless ($form->{id});
|
||
my $result = 0;
|
||
if ($table eq 'ap') {
|
||
require SL::DB::PurchaseInvoice;
|
||
my $record = SL::DB::PurchaseInvoice->new(id => $form->{id})->load;
|
||
$result = SL::DB::Helper::HardRecordLinks->get_count($record);
|
||
}
|
||
$main::lxdebug->leave_sub();
|
||
|
||
return $result;
|
||
}
|
||
|
||
sub is_storno {
|
||
$main::lxdebug->enter_sub();
|
||
|
bin/mozilla/ap.pl | ||
---|---|---|
|
||
my $is_storno = IS->is_storno(\%::myconfig, $::form, 'ap', $::form->{id});
|
||
my $has_storno = IS->has_storno(\%::myconfig, $::form, 'ap');
|
||
my $has_hard_links = IS->has_hard_links(\%::myconfig, $::form, 'ap');
|
||
|
||
my $may_edit_create = $::auth->assert('ap_transactions', 1);
|
||
|
||
... | ... | |
: $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('This invoice has been canceled already.')
|
||
: $has_hard_links ? t8('This invoice has hard links. Please delete them first.')
|
||
: undef,
|
||
],
|
||
], # end of combobox "Storno"
|
Auch abrufbar als: Unified diff
Deaktiviere Löschen-Button bei festen Verknüpfungen (order, ap)