Revision 63997e2d
Von Sven Schöling vor mehr als 12 Jahren hinzugefügt
bin/mozilla/ct.pl | ||
---|---|---|
711 | 711 |
} |
712 | 712 |
|
713 | 713 |
sub delete_shipto { |
714 |
$main::lxdebug->enter_sub(); |
|
714 |
$::lxdebug->enter_sub; |
|
715 |
$::auth->assert('customer_vendor_edit'); |
|
715 | 716 |
|
716 |
$main::auth->assert('customer_vendor_edit'); |
|
717 |
if (!$::form->{shipto_id}) { |
|
718 |
flash('error', $::locale->text('No shipto selected to delete')); |
|
719 |
} else { |
|
717 | 720 |
|
718 |
my $form = $main::form; |
|
719 |
my %myconfig = %main::myconfig; |
|
721 |
CT->get_shipto(\%::myconfig, $::form); |
|
720 | 722 |
|
721 |
CT->get_shipto(\%myconfig, \%$form);
|
|
723 |
my $shipto = SL::DB::Manager::Shipto->find_by(shipto_id => $::form->{shipto_id});
|
|
722 | 724 |
|
723 |
unless ($form->{shiptoused}) { |
|
724 |
CT->delete_shipto($form->{shipto_id}); |
|
725 |
@$form{ grep /^shipto/, keys %$form } = undef; |
|
725 |
if ($shipto->used) { |
|
726 |
$shipto->detach->save; |
|
727 |
flash('info', $::locale->text('Shipto is in use and was flagged invalid.')); |
|
728 |
} else { |
|
729 |
$shipto->delete; |
|
730 |
flash('info', $::locale->text('Shipto deleted.')); |
|
731 |
} |
|
732 |
delete $::form->{$_} for grep /^shipto/, keys %$::form; |
|
726 | 733 |
} |
727 | 734 |
|
728 | 735 |
edit(); |
729 | 736 |
|
730 |
$main::lxdebug->leave_sub();
|
|
737 |
$::lxdebug->leave_sub;
|
|
731 | 738 |
} |
732 | 739 |
|
733 | 740 |
sub delete_contact { |
Auch abrufbar als: Unified diff
Lieferadresse löschen ohne CT->delete_shipto