Revision abc941da
Von Udo Spallek vor etwa 19 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
590 | 590 |
$main::lxdebug->enter_sub(); |
591 | 591 |
|
592 | 592 |
my ($self, $myconfig, $amount) = @_; |
593 |
|
|
594 |
if (!(substr($amount, -3, 1) eq ".")) { |
|
595 |
if ( ($myconfig->{numberformat} eq '1.000,00') |
|
596 |
|| ($myconfig->{numberformat} eq '1000,00')) { |
|
597 |
$amount =~ s/\.//g; |
|
598 |
$amount =~ s/,/\./; |
|
599 |
} |
|
600 |
|
|
601 |
$amount =~ s/,//g; |
|
602 |
} |
|
603 |
|
|
593 |
$main::lxdebug->message(LXDebug::DEBUG2, "Start amount: $amount"); |
|
594 |
|
|
595 |
if ($myconfig->{in_numberformat} == 1){ |
|
596 |
# Extra input number format 1000.00 or 1000,00 |
|
597 |
$main::lxdebug->message(LXDebug::DEBUG2, "in_numberformat: " . $main::locale->text('1000,00 or 1000.00')); |
|
598 |
$amount =~ s/,/\./g; |
|
599 |
#$main::lxdebug->message(LXDebug::DEBUG2, "1.Parsed Number: $amount") if ($amount); |
|
600 |
$amount = scalar reverse $amount; |
|
601 |
#$main::lxdebug->message(LXDebug::DEBUG2, "2.Parsed Number: $amount") if ($amount); |
|
602 |
$amount =~ s/\./DOT/; |
|
603 |
#$main::lxdebug->message(LXDebug::DEBUG2, "3.Parsed Number: $amount") if ($amount); |
|
604 |
$amount =~ s/\.//g; |
|
605 |
#$main::lxdebug->message(LXDebug::DEBUG2, "4.Parsed Number: $amount") if ($amount); |
|
606 |
$amount =~ s/DOT/\./; |
|
607 |
#$main::lxdebug->message(LXDebug::DEBUG2, "5.Parsed Number:" . $amount) if ($amount); |
|
608 |
$amount = scalar reverse $amount ; |
|
609 |
$main::lxdebug->message(LXDebug::DEBUG2, "Parsed amount:" . $amount . "\n"); |
|
610 |
|
|
611 |
return ($amount * 1); |
|
612 |
|
|
613 |
} |
|
614 |
$main::lxdebug->message(LXDebug::DEBUG2, "in_numberformat: " . $main::locale->text('equal Outputformat')); |
|
615 |
$main::lxdebug->message(LXDebug::DEBUG2, " = numberformat: $myconfig->{numberformat}"); |
|
616 |
if ( ($myconfig->{numberformat} eq '1.000,00') |
|
617 |
|| ($myconfig->{numberformat} eq '1000,00')) { |
|
618 |
$amount =~ s/\.//g; |
|
619 |
$amount =~ s/,/\./; |
|
620 |
} |
|
621 |
|
|
622 |
if ($myconfig->{numberformat} eq "1'000.00") { |
|
623 |
$amount =~ s/'//g; |
|
624 |
} |
|
625 |
|
|
626 |
$amount =~ s/,//g; |
|
627 |
|
|
628 |
$main::lxdebug->message(LXDebug::DEBUG2, "Parsed amount:" . $amount. "\n") if ($amount); |
|
604 | 629 |
$main::lxdebug->leave_sub(); |
605 |
|
|
630 |
|
|
606 | 631 |
return ($amount * 1); |
607 | 632 |
} |
608 | 633 |
|
SL/User.pm | ||
---|---|---|
839 | 839 |
|
840 | 840 |
my @conf = qw(acs address admin businessnumber charset company countrycode |
841 | 841 |
currency dateformat dbconnect dbdriver dbhost dbport dboptions |
842 |
dbname dbuser dbpasswd email fax name numberformat password |
|
842 |
dbname dbuser dbpasswd email fax name numberformat in_numberformat password
|
|
843 | 843 |
printer role sid signature stylesheet tel templates vclimit angebote bestellungen rechnungen |
844 | 844 |
anfragen lieferantenbestellungen einkaufsrechnungen steuernummer ustid duns menustyle); |
845 | 845 |
|
bin/mozilla/am.pl | ||
---|---|---|
1607 | 1607 |
? "<option selected>$item\n" |
1608 | 1608 |
: "<option>$item\n"; |
1609 | 1609 |
} |
1610 |
|
|
1610 |
|
|
1611 | 1611 |
foreach $item (qw(name company address signature)) { |
1612 | 1612 |
$myconfig{$item} =~ s/\"/"/g; |
1613 | 1613 |
} |
... | ... | |
1627 | 1627 |
: "<option value=$key>$countrycodes{$key}\n"; |
1628 | 1628 |
} |
1629 | 1629 |
$countrycodes = "<option>American English\n$countrycodes"; |
1630 |
|
|
1631 |
# use an other input number format than output numberformat |
|
1632 |
# look at Form.pm, sub parse_amount |
|
1633 |
my $ in_numberformat = ''; |
|
1634 |
$text1 = qq|value="0">| . $locale->text('equal Outputformat'); |
|
1635 |
$text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00'); |
|
1636 |
@in_nf = ($text1, $text2); |
|
1637 |
foreach $item ( @in_nf ) { |
|
1638 |
$in_numberformat .= |
|
1639 |
( substr($item, 7, 1) eq $myconfig{in_numberformat}) |
|
1640 |
? "<option selected $item\n" |
|
1641 |
: "<option $item\n"; |
|
1642 |
} |
|
1643 |
|
|
1630 | 1644 |
|
1645 |
|
|
1631 | 1646 |
foreach $key (keys %{ $form->{IC} }) { |
1632 | 1647 |
foreach $accno (sort keys %{ $form->{IC}{$key} }) { |
1633 | 1648 |
$myconfig{$key} .= |
... | ... | |
1708 | 1723 |
<td><select name=dateformat>$dateformat</select></td> |
1709 | 1724 |
</tr> |
1710 | 1725 |
<tr> |
1711 |
<th align=right>| . $locale->text('Number Format') . qq|</th> |
|
1726 |
<th align=right>| . $locale->text('Output Number Format') . qq|</th>
|
|
1712 | 1727 |
<td><select name=numberformat>$numberformat</select></td> |
1713 | 1728 |
</tr> |
1729 |
<tr> |
|
1730 |
<th align=right>| . $locale->text('Input Number Format') . qq|</th> |
|
1731 |
<td><select name=in_numberformat>$in_numberformat</select></td> |
|
1732 |
</tr> |
|
1733 |
|
|
1714 | 1734 |
<tr> |
1715 | 1735 |
<th align=right>| . $locale->text('Dropdown Limit') . qq|</th> |
1716 | 1736 |
<td><input name=vclimit size=10 value="$myconfig{vclimit}"></td> |
Auch abrufbar als: Unified diff
Bug 233: Neues Zahlenformat für die Eingabe eingefuehrt.
Es ist nun moeglich das Eingabezahlenformat getrennt anzugeben.
Entweder Eingabeformat wie bisher (default) oder '1000.00 oder 1000,00'.
Die zweite Option verhindert bei der Eingabe die Verwechselung von ',' und '.'.
Es ist nun egal welchen Dezimaltrenner man benutzt, der erste Punkt oder Komma
von rechts jedenfalls wird als Dezimaltrenner verwendet, alle anderen Punkte oder
Kommas werden einfach ignoriert, bzw. entfernt.