Revision 64bdbaca
Von Philip Reetz vor etwa 19 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
472 | 472 |
|
473 | 473 |
my ($self, $myconfig ,$form) = @_; |
474 | 474 |
|
475 |
for my $i (1 .. $form->{rowcount}) { |
|
476 |
|
|
477 |
map { |
|
478 |
$form->{"${_}_$i"} = $form->parse_amount($myconfig, $form->{"${_}_$i"}) |
|
479 |
} qw(qty ship); |
|
480 |
if ($delete_oe_id) { |
|
481 |
$form->{"orderitems_id_$i"} = ""; |
|
482 |
} |
|
483 |
|
|
484 |
if ($form->{"qty_$i"}) { |
|
485 |
|
|
486 |
map { $form->{"${_}_$i"} =~ s/\'/\'\'/g } |
|
487 |
qw(partnumber description unit); |
|
488 |
|
|
489 |
# set values to 0 if nothing entered |
|
490 |
$form->{"discount_$i"} = |
|
491 |
$form->parse_amount($myconfig, $form->{"discount_$i"}) / 100; |
|
492 |
|
|
493 |
$form->{"sellprice_$i"} = |
|
494 |
$form->parse_amount($myconfig, $form->{"sellprice_$i"}); |
|
495 |
$fxsellprice = $form->{"sellprice_$i"}; |
|
496 |
|
|
497 |
my ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/); |
|
498 |
$dec = length $dec; |
|
499 |
my $decimalplaces = ($dec > 2) ? $dec : 2; |
|
500 |
|
|
501 |
$discount = |
|
502 |
$form->round_amount($form->{"sellprice_$i"} * $form->{"discount_$i"}, |
|
503 |
$decimalplaces); |
|
504 |
$form->{"sellprice_$i"} = |
|
505 |
$form->round_amount($form->{"sellprice_$i"} - $discount, |
|
506 |
$decimalplaces); |
|
507 |
|
|
508 |
$form->{"inventory_accno_$i"} *= 1; |
|
509 |
$form->{"expense_accno_$i"} *= 1; |
|
510 |
} |
|
511 |
} |
|
475 | 512 |
# get ids from $form |
476 | 513 |
map { push @ids, $form->{"ordnumber_$_"} if $form->{"ordnumber_$_"} } (1 .. $form->{rowcount}); |
477 | 514 |
|
Auch abrufbar als: Unified diff
Umwandeln eines Sammelauftrags in eine Rechnung ignoriert Nachkommastellen