Revision 64ba4cbb
Von Cem Aydin vor etwa 2 Jahren hinzugefügt
SL/Template/OpenDocument.pm | ||
---|---|---|
482 | 482 |
# assemble data for QR-Code |
483 | 483 |
|
484 | 484 |
# get qr-account data |
485 |
my $qr_account = get_qrbill_account(); |
|
485 |
my ($qr_account, $error) = get_qrbill_account(); |
|
486 |
if (!$qr_account) { |
|
487 |
$::form->error($error); |
|
488 |
} |
|
486 | 489 |
|
487 | 490 |
my %biller_information = ( |
488 | 491 |
'iban' => $qr_account->{'iban'} |
... | ... | |
501 | 504 |
'countrycode' => $biller_countrycode, |
502 | 505 |
); |
503 | 506 |
|
504 |
my $amount;
|
|
507 |
my ($amount, $amount_formatted);
|
|
505 | 508 |
if ($form->{'qrbill_without_amount'}) { |
506 | 509 |
$amount = ''; |
510 |
$amount_formatted = ''; |
|
507 | 511 |
} else { |
508 | 512 |
$amount = sprintf("%.2f", $form->parse_amount(\%::myconfig, $form->{'total'})); |
513 |
|
|
514 |
# format amount for template |
|
515 |
$amount_formatted = get_amount_formatted($amount); |
|
516 |
if (!$amount_formatted) { |
|
517 |
$::form->error($::locale->text('Amount has wrong format.')); |
|
518 |
} |
|
509 | 519 |
} |
510 | 520 |
|
511 | 521 |
my %payment_information = ( |
... | ... | |
529 | 539 |
my %ref_nr_data; |
530 | 540 |
if ($::instance_conf->get_create_qrbill_invoices == 1) { |
531 | 541 |
# generate ref.-no. with check digit |
532 |
my $ref_number = assemble_ref_number(
|
|
542 |
my ($ref_number, $error) = assemble_ref_number(
|
|
533 | 543 |
$qr_account->{'bank_account_id'}, |
534 | 544 |
$form->{'customernumber'}, |
535 | 545 |
$form->{'ordnumber'}, |
536 | 546 |
$form->{'invnumber'}, |
537 | 547 |
); |
548 |
if (!$ref_number) { |
|
549 |
$::form->error($error); |
|
550 |
} |
|
538 | 551 |
%ref_nr_data = ( |
539 | 552 |
'type' => 'QRR', |
540 | 553 |
'ref_number' => $ref_number, |
... | ... | |
556 | 569 |
$form->{'biller_information'} = \%biller_information; |
557 | 570 |
$form->{'biller_data'} = \%biller_data; |
558 | 571 |
$form->{'iban_formatted'} = get_iban_formatted($qr_account->{'iban'}); |
559 |
|
|
560 |
# format amount for template |
|
561 |
$form->{'amount_formatted'} = get_amount_formatted( |
|
562 |
sprintf( |
|
563 |
"%.2f", |
|
564 |
$form->parse_amount(\%::myconfig, $form->{'total'}) |
|
565 |
) |
|
566 |
); |
|
567 |
|
|
572 |
$form->{'amount_formatted'} = $amount_formatted; |
|
573 |
|
|
568 | 574 |
# set outfile |
569 | 575 |
my $outfile = $form->{"tmpdir"} . '/' . 'qr-code.png'; |
570 | 576 |
|
Auch abrufbar als: Unified diff
Swiss QR-Bill: QrBillFunctions.pm Fehlerrückgabe angepasst