From: Moritz Bunkus Date: Mon, 12 Feb 2007 09:50:25 +0000 (+0000) Subject: Stammdatenverwaltung: Anpassung von format_amount()-Aufrufen an die aktuell gültige... X-Git-Tag: release-2.4.2~122 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=88583bb350e24b54422269fc36d6fd740c9c0b98;p=kivitendo-erp.git Stammdatenverwaltung: Anpassung von format_amount()-Aufrufen an die aktuell gültige Syntax. Preise nicht forciert auf zwei Stellen runden. --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index b99fb25f4..df330d3ac 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1309,7 +1309,7 @@ sub addtop100 { $column_data{number} = "" - . $form->format_amount(\%myconfig, $ref->{number}, '', " ") + . $form->format_amount(\%myconfig, $ref->{number}) . ""; $column_data{partnumber} = "$ref->{partnumber} "; @@ -1318,32 +1318,29 @@ sub addtop100 { $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ") + . $form->format_amount(\%myconfig, $ref->{onhand}) . ""; $column_data{sellprice} = "" - . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{sellprice}) . ""; $column_data{listprice} = "" - . $form->format_amount(\%myconfig, $ref->{listprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{listprice}) . ""; $column_data{lastcost} = "" - . $form->format_amount(\%myconfig, $ref->{lastcost}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{lastcost}) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2) . ""; if (!$ref->{assemblyitem}) { @@ -1359,10 +1356,10 @@ sub addtop100 { $column_data{rop} = "" - . $form->format_amount(\%myconfig, $ref->{rop}, '', " ") . ""; + . $form->format_amount(\%myconfig, $ref->{rop}) . ""; $column_data{weight} = "" - . $form->format_amount(\%myconfig, $ref->{weight}, '', " ") + . $form->format_amount(\%myconfig, $ref->{weight}) . ""; $column_data{unit} = "$ref->{unit} "; $column_data{bin} = "$ref->{bin} "; @@ -1419,15 +1416,15 @@ sub addtop100 { map { $column_data{$_} = " " } @column_index; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $totalsellprice, 2, " ") + . $form->format_amount(\%myconfig, $totalsellprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $totallastcost, 2, " ") + . $form->format_amount(\%myconfig, $totallastcost, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $totallistprice, 2, " ") + . $form->format_amount(\%myconfig, $totallistprice, 2) . ""; print ""; @@ -1861,32 +1858,29 @@ sub generate_report { $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ") + . $form->format_amount(\%myconfig, $ref->{onhand}) . ""; $column_data{sellprice} = "" - . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{sellprice}, -2) . ""; $column_data{listprice} = "" - . $form->format_amount(\%myconfig, $ref->{listprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{listprice}, -2) . ""; $column_data{lastcost} = "" - . $form->format_amount(\%myconfig, $ref->{lastcost}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{lastcost}, -2) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2) . ""; if (!$ref->{assemblyitem}) { @@ -1902,10 +1896,10 @@ sub generate_report { $column_data{rop} = "" - . $form->format_amount(\%myconfig, $ref->{rop}, '', " ") . ""; + . $form->format_amount(\%myconfig, $ref->{rop}) . ""; $column_data{weight} = "" - . $form->format_amount(\%myconfig, $ref->{weight}, '', " ") + . $form->format_amount(\%myconfig, $ref->{weight}) . ""; $column_data{unit} = "$ref->{unit} "; $column_data{bin} = "$ref->{bin} "; @@ -1943,7 +1937,7 @@ sub generate_report { $column_data{soldtotal} = "" - . $form->format_amount(\%myconfig, $ref->{soldtotal}, '', " ") + . $form->format_amount(\%myconfig, $ref->{soldtotal}) . ""; $column_data{deliverydate} = "$ref->{deliverydate}"; @@ -1968,15 +1962,15 @@ sub generate_report { map { $column_data{$_} = " " } @column_index; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $totalsellprice, 2, " ") + . $form->format_amount(\%myconfig, $totalsellprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $totallastcost, 2, " ") + . $form->format_amount(\%myconfig, $totallastcost, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $totallistprice, 2, " ") + . $form->format_amount(\%myconfig, $totallistprice, 2) . ""; print ""; @@ -2028,20 +2022,20 @@ sub parts_subtotal { $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $subtotalonhand, '', " ") + . $form->format_amount(\%myconfig, $subtotalonhand) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $subtotalsellprice, 2, " ") + . $form->format_amount(\%myconfig, $subtotalsellprice, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $subtotallistprice, 2, " ") + . $form->format_amount(\%myconfig, $subtotallistprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $subtotallastcost, 2, " ") + . $form->format_amount(\%myconfig, $subtotallastcost, 2) . ""; $subtotalonhand = 0; @@ -2170,31 +2164,8 @@ sub link_part { sub form_header { $lxdebug->enter_sub(); - my $dec = ''; - - #decimalplaces for listprice - ($dec) = ($form->{listprice} =~ /\.(\d+)/); - $dec = length $dec; - my $decimalplaces = ($dec == 2) ? $dec : 2; - $form->{listprice} = - $form->format_amount(\%myconfig, $form->{listprice}, $decimalplaces); - - #decimalplaces for sellprice and gv - ($dec) = ($form->{sellprice} =~ /\.(\d+)/); - $dec = length $dec; - my $decimalplaces = ($dec == 2) ? $dec : 2; - - map { - $form->{$_} = - $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces) - } qw(sellprice gv); - - ($dec) = ($form->{lastcost} =~ /\.(\d+)/); - $dec = length $dec; - my $decimalplaces = ($dec == 2) ? $dec : 2; - - $form->{lastcost} = - $form->format_amount(\%myconfig, $form->{lastcost}, $decimalplaces); + map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) } + qw(sellprice listprice lastcost gv)); map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) } qw(weight rop stock); @@ -3312,11 +3283,11 @@ sub list_assemblies { $column_data{bin} = qq|$ref->{bin} |; $column_data{onhand} = qq|| - . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ") + . $form->format_amount(\%myconfig, $ref->{onhand}) . qq||; $column_data{rop} = qq|| - . $form->format_amount(\%myconfig, $ref->{rop}, '', " ") + . $form->format_amount(\%myconfig, $ref->{rop}) . qq||; $column_data{stock} = qq||;