X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FIS.pm;h=d1358dec5c4b7b3673d2922824c3219759b2c293;hb=ce2cccd9e6bf7dca9087912e2421aa2d3adb1be9;hp=8e7dcc9f156464d6bd6fe433c6f127baa63d2b6f;hpb=b320453d39fd9ff512debf8c76e770a59aadfa6d;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 8e7dcc9f1..d1358dec5 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1277,7 +1277,7 @@ sub cogs { # total expenses and inventory # sellprice is the cost of the item - my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ($ref->{price_factor} * ( $basefactor || 1 )), 2); + my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ( ($ref->{price_factor} || 1) * ( $basefactor || 1 )), 2); if (!$main::eur) { $ref->{expense_accno} = ($form->{"expense_accno_$row"}) ? $form->{"expense_accno_$row"} : $ref->{expense_accno}; @@ -2159,4 +2159,21 @@ sub is_storno { return $result; } +sub get_standard_accno_current_assets { + $main::lxdebug->enter_sub(); + + my ($self, $myconfig, $form) = @_; + + my $dbh = $form->dbconnect($myconfig); + + my $query = qq| SELECT accno FROM chart WHERE id = (SELECT ar_paid_accno_id FROM defaults)|; + my ($result) = selectrow_query($form, $dbh, $query); + + $dbh->disconnect(); + + $main::lxdebug->leave_sub(); + + return $result; +} + 1;