Revision bd5bd05b
Von Tamino Steinert vor etwa 1 Monat hinzugefügt
SL/DB/Helper/ZUGFeRD.pm | ||
---|---|---|
15 | 15 |
|
16 | 16 |
use SL::DB::BankAccount; |
17 | 17 |
use SL::DB::GenericTranslation; |
18 |
use SL::DB::Default; |
|
18 | 19 |
use SL::DB::Chart; |
19 | 20 |
use SL::DB::Tax; |
20 | 21 |
use SL::DB::TaxKey; |
... | ... | |
168 | 169 |
# </ram:PostalTradeAddress> |
169 | 170 |
} |
170 | 171 |
|
172 |
sub _buyer_communication { |
|
173 |
my (%params) = @_; |
|
174 |
my $customer = $params{customer}; |
|
175 |
|
|
176 |
my $buyer_electronic_address = first {$_} ( |
|
177 |
$customer->invoice_mail, |
|
178 |
$customer->email, |
|
179 |
); |
|
180 |
if ($buyer_electronic_address) { |
|
181 |
$params{xml}->startTag("ram:URIUniversalCommunication"); |
|
182 |
$params{xml}->dataElement("ram:URIID", _u8($buyer_electronic_address), schemeID => 'EM'); |
|
183 |
$params{xml}->endTag; |
|
184 |
} elsif ($customer->gln) { |
|
185 |
$params{xml}->startTag("ram:URIUniversalCommunication"); |
|
186 |
$params{xml}->dataElement("ram:URIID", _u8($customer->gln), schemeID => '0088'); |
|
187 |
$params{xml}->endTag; |
|
188 |
} |
|
189 |
} |
|
190 |
|
|
171 | 191 |
sub _tax_rate_and_code { |
172 | 192 |
my ($taxzone, $tax) = @_; |
173 | 193 |
|
... | ... | |
547 | 567 |
# </ram:PostalTradeAddress> |
548 | 568 |
} |
549 | 569 |
|
570 |
my $defaults = SL::DB::Default->get; |
|
571 |
if ($defaults->duns) { |
|
572 |
$params{xml}->startTag("ram:URIUniversalCommunication"); |
|
573 |
$params{xml}->dataElement("ram:URIID", _u8($defaults->duns), schemeID => '0060'); |
|
574 |
$params{xml}->endTag; |
|
575 |
} |
|
576 |
|
|
550 | 577 |
_specified_tax_registration($::instance_conf->get_co_ustid, %params); |
551 | 578 |
|
552 | 579 |
$params{xml}->endTag; |
... | ... | |
563 | 590 |
|
564 | 591 |
_buyer_contact_information($self, %params, contact => $self->contact) if ($self->cp_id); |
565 | 592 |
_customer_postal_trade_address(%params, customer => $self->customer); |
593 |
_buyer_communication(%params, customer => $self->customer); |
|
566 | 594 |
_specified_tax_registration($self->customer->ustid, %params) if $self->customer->ustid; |
567 | 595 |
|
568 | 596 |
$params{xml}->endTag; |
Auch abrufbar als: Unified diff
ZUGFeRD: elektronische Adresse (Käufer/Verkäufer)