Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3cb3fcdf

Von Cem Aydin vor etwa 1 Jahr hinzugefügt

Schweizer QR-Rechnung: Adressen auf Adresstyp S umstellen

- innerhalb des QR-Code Adresstyp S verwenden
- Validierung angepasst: Strasse und Hausnummer können leer sein
- changelog Eintrag
- locale update

Unterschiede anzeigen:

SL/Template/OpenDocument.pm
13 13
use SL::Template::OpenDocument::Styles;
14 14

  
15 15
use SL::Helper::QrBill;
16
use SL::Helper::QrBillFunctions qw(get_ref_number_formatted get_iban_formatted get_amount_formatted);
16
use SL::Helper::QrBillFunctions qw(
17
  get_ref_number_formatted get_iban_formatted get_amount_formatted
18
  get_street_name_from_address_line get_building_number_from_address_line
19
);
17 20

  
18 21
use Cwd;
19 22
# use File::Copy;
......
492 495
    $::form->error($::locale->text('Error mapping biller countrycode.'));
493 496
  }
494 497
  my %biller_data = (
495
    address_type => 'K',
498
    address_type => 'S',
496 499
    company => $::instance_conf->get_company(),
497
    address_row1 => $::instance_conf->get_address_street1(),
498
    address_row2 => $::instance_conf->get_address_zipcode() . ' ' . $::instance_conf->get_address_city(),
500
    street => get_street_name_from_address_line($::instance_conf->get_address_street1()),
501
    street_no => get_building_number_from_address_line($::instance_conf->get_address_street1()),
502
    postalcode => $::instance_conf->get_address_zipcode(),
503
    city => $::instance_conf->get_address_city(),
499 504
    countrycode => $form->{qrbill_biller_countrycode},
500 505
  );
501 506

  
......
518 523
    currency => $form->{currency},
519 524
  );
520 525

  
526
  # get address data from billing address if given, otherwise from invoice
527
  my $street_name = get_street_name_from_address_line($form->{billing_address_id} ?
528
      $form->{billing_address_street} :
529
      $form->{street});
530
  my $building_number = get_building_number_from_address_line($form->{billing_address_id} ?
531
      $form->{billing_address_street} :
532
      $form->{street});
533
  my $postalcode = $form->{billing_address_id} ?
534
      $form->{billing_address_zipcode} :
535
      $form->{zipcode};
536
  my $city = $form->{billing_address_id} ?
537
      $form->{billing_address_city} :
538
      $form->{city};
539

  
521 540
  # validate address data
522
  if (!$form->{'street'}) {
523
    $::form->error($::locale->text('No street given.'));
524
  }
525
  if ($form->{'zipcode'} !~ m/^\d{4,}$/) {
541
  if ($postalcode !~ m/^\d{4,}$/) {
526 542
    $::form->error($::locale->text('Zipcode missing or wrong format.'));
527 543
  }
528
  if (!$form->{'city'}) {
544
  if (!$city) {
529 545
    $::form->error($::locale->text('No city given.'));
530 546
  }
531

  
532 547
  if (!$form->{qrbill_customer_countrycode}) {
533 548
    $::form->error($::locale->text('Error mapping customer countrycode.'));
534 549
  }
535 550

  
536 551
  my %invoice_recipient_data = (
537
    address_type => 'K',
552
    address_type => 'S',
538 553
    name => $form->{billing_address_id} ?
539 554
              $form->{billing_address_name} :
540 555
              $form->{name},
541
    address_row1 => $form->{billing_address_id} ?
542
                      $form->{billing_address_street} :
543
                      $form->{street},
544
    address_row2 => $form->{billing_address_id} ?
545
                      $form->{billing_address_zipcode} . ' ' . $form->{billing_address_city} :
546
                      $form->{zipcode} . ' ' . $form->{city},
556
    street => $street_name,
557
    street_no => $building_number,
558
    postalcode => $postalcode,
559
    city => $city,
547 560
    countrycode => $form->{qrbill_customer_countrycode},
548 561
  );
549 562

  

Auch abrufbar als: Unified diff