diff --git a/copri4/main/src/Mod/Prelogic.pm b/copri4/main/src/Mod/Prelogic.pm index cbbfcef..1a7c050 100755 --- a/copri4/main/src/Mod/Prelogic.pm +++ b/copri4/main/src/Mod/Prelogic.pm @@ -319,6 +319,10 @@ sub preinit(){ $e_hh = "24" if($e_hh > "24"); $s_mi = "59" if($s_mi > "59"); $e_mi = "59" if($e_mi > "59"); + $s_hh = sprintf('%.2d',$s_hh); + $e_hh = sprintf('%.2d',$e_hh); + $s_mi = sprintf('%.2d',$s_mi); + $e_mi = sprintf('%.2d',$e_mi); my $start_time=""; my $end_time=""; $start_time = "$start_date $s_hh:$s_mi:00" if("$start_date $s_hh:$s_mi" =~ /\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}/); diff --git a/copri4/main/src/Mod/Pricing.pm b/copri4/main/src/Mod/Pricing.pm index ad283d8..ea380da 100755 --- a/copri4/main/src/Mod/Pricing.pm +++ b/copri4/main/src/Mod/Pricing.pm @@ -174,7 +174,8 @@ sub counting_rental { $max_fee_daily_minute = $max_daily_unit * $tariff_unitbyminute; my $days_dec = $rental_minute / 1440; - my ($days,$ddec) = split(/\./, $days_dec) if($days_dec =~ /\.\d/); + my $days = $days_dec; + ($days,my $ddec) = split(/\./, $days_dec) if($days_dec =~ /\.\d/); if($days > 0){ $rental_day_price = $days * $ctpos->{int17}; $counting->{int39} = $days;#by day diff --git a/copri4/main/src/Tpl/TransPositionen.pm b/copri4/main/src/Tpl/TransPositionen.pm index 1bff241..71d30ec 100755 --- a/copri4/main/src/Tpl/TransPositionen.pm +++ b/copri4/main/src/Tpl/TransPositionen.pm @@ -49,7 +49,8 @@ sub tpl(){ my $pri = new Pricing; my %varenv = $cf->envonline(); my %ib = $but->ibuttons(); - my $today = strftime("%d.%m.%Y",localtime(time)); + my $today = strftime "%d.%m.%Y",localtime; + my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime; my $dbh = ""; my $channel_map = $dbt->channel_map(); @@ -173,6 +174,7 @@ EOF my $rental_feed = {}; if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){ + $cttpos->{$id}->{end_time} = $now_dt if($cttpos->{$id}->{int10} == 3); ($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id},"calc_price"); $rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos->{$id},$counting); $sum_parts19 += $pricing->{total_price};