Revision 6c1536aa
Von Sven Schöling vor mehr als 16 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
827 | 827 |
|
828 | 828 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
829 | 829 |
|
830 |
$query = qq|SELECT COUNT(cp_id) AS used FROM ( |
|
831 |
SELECT cp_id FROM oe UNION |
|
832 |
SELECT cp_id FROM ar UNION |
|
833 |
SELECT cp_id FROM ap UNION |
|
834 |
SELECT cp_id FROM delivery_orders |
|
835 |
) AS cpid WHERE cp_id = ? OR ? = 0|; |
|
836 |
($form->{cp_used}) = selectfirst_array_query($form, $dbh, $query, ($form->{cp_id})x2); |
|
837 |
|
|
830 | 838 |
$sth->finish; |
831 | 839 |
$dbh->disconnect; |
832 | 840 |
|
... | ... | |
1003 | 1011 |
$main::lxdebug->leave_sub(); |
1004 | 1012 |
} |
1005 | 1013 |
|
1014 |
sub delete_shipto { |
|
1015 |
$main::lxdebug->enter_sub(); |
|
1016 |
|
|
1017 |
my $self = shift; |
|
1018 |
my $shipto_id = shift; |
|
1019 |
|
|
1020 |
my $form = $main::form; |
|
1021 |
my %myconfig = %main::myconfig; |
|
1022 |
my $dbh = $form->get_standard_dbh(\%myconfig); |
|
1023 |
|
|
1024 |
do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $shipto_id); |
|
1025 |
|
|
1026 |
$dbh->commit(); |
|
1027 |
|
|
1028 |
$main::lxdebug->leave_sub(); |
|
1029 |
} |
|
1030 |
|
|
1006 | 1031 |
1; |
Auch abrufbar als: Unified diff
Contacts loeschbar gemacht (gibt noch kleinere probleme mit dem javascript)