Revision 25e65781
Von Jan Büren vor etwa 10 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
492 | 492 |
ORDER BY cp.cp_id |
493 | 493 |
LIMIT 1|; |
494 | 494 |
my $ref = selectfirst_hashref_query($form, $dbh, $query, @values); |
495 |
|
|
495 |
# we have no values, probably a invalid contact person. hotfix and first idea for issue #9 |
|
496 |
if (!$ref) { |
|
497 |
my $customer = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id}); |
|
498 |
$ref->{name} = $customer->name; |
|
499 |
$ref->{street} = $customer->street; |
|
500 |
$ref->{zipcode} = $customer->zipcode; |
|
501 |
$ref->{country} = $customer->country; |
|
502 |
my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id}); |
|
503 |
$ref->{cp_name} = $contact->cp_name; |
|
504 |
$ref->{cp_givenname} = $contact->cp_givenname; |
|
505 |
$ref->{cp_gender} = $contact->cp_gender; |
|
506 |
} |
|
496 | 507 |
# remove id and taxincluded before copy back |
497 | 508 |
delete @$ref{qw(id taxincluded)}; |
498 | 509 |
|
Auch abrufbar als: Unified diff
hotfix für #10 Ansprechpartner auf ungültig setzen löst leeres Adressfeld beim Drucken aus
behebt (teilweise) #9 ggf. wäre es prinzipiell besser die customer_details
auf rose umzuschreiben