mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
end_time fix
This commit is contained in:
parent
f09361320e
commit
cc24aaf6b1
3 changed files with 9 additions and 2 deletions
|
@ -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}/);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Add table
Reference in a new issue