Fix für Bug 996.
while (($form->{"klass_$i"}, $form->{"pricegroup_id_$i"},
$form->{"price_$i"}, $form->{"pricegroup_$i"})
= $sth->fetchrow_array()) {
- $form->{"price_$i"} = $form->round_amount($form->{"price_$i"}, 5);
- $form->{"price_$i"} = $form->format_amount($myconfig, $form->{"price_$i"}, -2);
push @pricegroups, $form->{"pricegroup_id_$i"};
$i++;
}
foreach $name (@pricegroups_not_used) {
$form->{"klass_$i"} = "$name->{id}";
- $form->{"price_$i"} = $form->round_amount($form->{sellprice}, 5);
- $form->{"price_$i"} = $form->format_amount($myconfig, $form->{"price_$i"}, -2);
$form->{"pricegroup_id_$i"} = "$name->{id}";
$form->{"pricegroup_$i"} = "$name->{pricegroup}";
$i++;
sub update {
$lxdebug->enter_sub();
+ # parse pricegroups. and no, don't rely on check_form for this...
+ map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows};
+
if ($form->{item} eq "assembly") {
my $i = $form->{assembly_rows};
[%- USE HTML %]
+[%- USE LxERP %]
[%- IF PRICES.size %]
<tr>
<td>
[%- FOREACH row = PRICES %]
<tr>
<td width=50%><input type=hidden name="pricegroup_[% loop.count %]" size=30 value="[% HTML.escape(row.pricegroup) %]">[% HTML.escape(row.pricegroup) %]</td>
- <td width=50%><input name="price_[% loop.count %]" size=11 value="[% HTML.escape(row.price) %]"></td>
- <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% HTML.escape(row.pricegroup_id) %]">
+ <td width=50%><input name="price_[% loop.count %]" size=11 value="[% LxERP.format_amount(row.price, -2) %]"></td>
+ <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% LxERP.format_amount(row.pricegroup_id, -2) %]">
</tr>
[%- END %]
</table>
[%- USE HTML %]
+[%- USE LxERP %]
[%- IF PRICES.size %]
<tr>
<td>
[%- FOREACH row = PRICES %]
<tr>
<td width=50%><input type=hidden name="pricegroup_[% loop.count %]" size=30 value="[% HTML.escape(row.pricegroup) %]">[% HTML.escape(row.pricegroup) %]</td>
- <td width=50%><input name="price_[% loop.count %]" size=11 value="[% HTML.escape(row.price) %]"></td>
- <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% HTML.escape(row.pricegroup_id) %]">
+ <td width=50%><input name="price_[% loop.count %]" size=11 value="[% LxERP.format_amount(row.price, -2) %]"></td>
+ <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% LxERP.format_amount(row.pricegroup_id, -2) %]">
</tr>
[%- END %]
</table>