Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3d449940

Von Sven Schöling vor etwa 7 Jahren hinzugefügt

  • ID 3d44994029eca9d82030740d7feed1506c52b0b4
  • Vorgänger 05309930
  • Nachfolger 6d9c7f67

SL::DB::ShopOrder: Warnings

Unterschiede anzeigen:

SL/DB/ShopOrder.pm
59 59
  if(!scalar(@error_report)){
60 60

  
61 61
    my $shipto_id;
62
    if ($self->billing_firstname ne $self->delivery_firstname || $self->billing_lastname ne $self->delivery_lastname || $self->billing_city ne $self->delivery_city || $self->billing_street ne $self->delivery_street) {
63
      if(my $address = SL::DB::Manager::Shipto->find_by( shiptoname   => $self->delivery_firstname . " " . $self->delivery_lastname,
62
    if ($self->has_differing_delivery_address) {
63
      if(my $address = SL::DB::Manager::Shipto->find_by( shiptoname   => $self->delivery_fullname,
64 64
                                                         shiptostreet => $self->delivery_street,
65 65
                                                         shiptocity   => $self->delivery_city,
66 66
                                                        )) {
......
68 68
      } else {
69 69
        my $deliveryaddress = SL::DB::Shipto->new;
70 70
        $deliveryaddress->assign_attributes(
71
          shiptoname         => $self->delivery_firstname . " " . $self->delivery_lastname,
71
          shiptoname         => $self->delivery_fullname,
72 72
          shiptodepartment_1 => $self->delivery_company,
73 73
          shiptodepartment_2 => $self->delivery_department,
74 74
          shiptostreet       => $self->delivery_street,
......
245 245
  return 0;
246 246
}
247 247

  
248
sub has_differing_delivery_address {
249
  my ($self) = @_;
250
  ($self->billing_firstname // '') ne ($self->delivery_firstname // '') ||
251
  ($self->billing_lastname  // '') ne ($self->delivery_lastname  // '') ||
252
  ($self->billing_city      // '') ne ($self->delivery_city      // '') ||
253
  ($self->billing_street    // '') ne ($self->delivery_street    // '')
254
}
255

  
256
sub delivery_fullname {
257
  ($_[0]->delivery_firstname // '') . " " . ($_[0]->delivery_lastname // '')
258
}
259

  
248 260
1;
249 261

  
250 262
__END__

Auch abrufbar als: Unified diff