mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
adding freed-time per day and reduce rental-history to max 1 month
This commit is contained in:
parent
91e41f109e
commit
9b05eed19b
5 changed files with 11 additions and 10 deletions
|
@ -1041,7 +1041,7 @@ sub count_freedrental {
|
||||||
my $mon = strftime "%m", localtime;
|
my $mon = strftime "%m", localtime;
|
||||||
my $year = strftime "%Y", localtime;
|
my $year = strftime "%Y", localtime;
|
||||||
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
||||||
$pref_pos->{time_range} = "(start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' OR int10=3)";
|
$pref_pos->{time_range} = "((start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' and start_time != end_time) OR int10=3)";
|
||||||
}
|
}
|
||||||
my $record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
my $record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
||||||
|
|
||||||
|
@ -1257,9 +1257,6 @@ sub booking_update(){
|
||||||
$update_pos->{txt11} = "$sig_book->{rentalId}" if($sig_book->{rentalId});
|
$update_pos->{txt11} = "$sig_book->{rentalId}" if($sig_book->{rentalId});
|
||||||
$update_pos->{txt22} = "$sig_book->{bikeId}" if($sig_book->{bikeId});
|
$update_pos->{txt22} = "$sig_book->{bikeId}" if($sig_book->{bikeId});
|
||||||
|
|
||||||
#on occupied, we don't really know if will be a accountable rental, we try it
|
|
||||||
$self->count_freedrental($q,$varenv,$auth,0,$update_pos);
|
|
||||||
|
|
||||||
$rows = $dbt->update_record($dbh,$update_pos,$record_pos);
|
$rows = $dbt->update_record($dbh,$update_pos,$record_pos);
|
||||||
|
|
||||||
if($rows > 0){
|
if($rows > 0){
|
||||||
|
@ -1815,8 +1812,11 @@ sub rentals(){
|
||||||
|
|
||||||
#$pricing
|
#$pricing
|
||||||
(my $return_counting->{$id}, my $counting) = $pri->counting_rental(\%varenv,$record->{$id},"");
|
(my $return_counting->{$id}, my $counting) = $pri->counting_rental(\%varenv,$record->{$id},"");
|
||||||
#adjusting freed time rental by often called bikes_occupied, only viewable after second call
|
#adjusting freed time rental by often called bikes_occupied
|
||||||
$self->count_freedrental("rentals by user_bikes_occupied",\%varenv,$auth,$return_counting->{$id}->{rentalog}->{rental_minute_all},$record->{$id});
|
$self->count_freedrental("rentals by user_bikes_occupied",\%varenv,$auth,$return_counting->{$id}->{rentalog}->{rental_minute_all},$record->{$id});
|
||||||
|
#yes once again to get the counted freedrental
|
||||||
|
(my $return_counting->{$id}, my $counting) = $pri->counting_rental(\%varenv,$record->{$id},"");
|
||||||
|
|
||||||
#$bw->log("rentals-rentalog",$return_counting->{$id}->{rentalog},"");
|
#$bw->log("rentals-rentalog",$return_counting->{$id}->{rentalog},"");
|
||||||
$return_counting->{$id}->{rentalog} = "";#just for debuggiog, removed to reduce data in json
|
$return_counting->{$id}->{rentalog} = "";#just for debuggiog, removed to reduce data in json
|
||||||
my $return_feed->{$id} = $pri->fetch_rentalfeed(\%varenv,$record->{$id},$return_counting->{$id});
|
my $return_feed->{$id} = $pri->fetch_rentalfeed(\%varenv,$record->{$id},$return_counting->{$id});
|
||||||
|
@ -2003,7 +2003,7 @@ sub bikes_available(){
|
||||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
||||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
||||||
#$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
$time_unit .= " / Tag" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
||||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||||
}
|
}
|
||||||
}#end new rental_description
|
}#end new rental_description
|
||||||
|
|
|
@ -275,7 +275,7 @@ sub sig_available {
|
||||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
||||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
||||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
||||||
}
|
}
|
||||||
}#end new rental_description
|
}#end new rental_description
|
||||||
|
|
||||||
|
|
|
@ -957,7 +957,7 @@ sub update_record(){
|
||||||
$set .= " $key='$value',";
|
$set .= " $key='$value',";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($key =~ /^(barcode|contentadr_id|int\d+|time\d+|owner|start_at\d+|end_at\d+)$/){
|
if($key =~ /^(barcode|contentadr_id|int\d+|time\d+|owner|owner_end|start_at\d+|end_at\d+)$/){
|
||||||
$value =~ s/,/\./ if($value);
|
$value =~ s/,/\./ if($value);
|
||||||
if($key =~ /int\d+|time\d+|start_at\d+|end_at\d+/ && $value && $value =~ /\d+:\d+/){#azn time format
|
if($key =~ /int\d+|time\d+|start_at\d+|end_at\d+/ && $value && $value =~ /\d+:\d+/){#azn time format
|
||||||
$set .= " $key='$value',";
|
$set .= " $key='$value',";
|
||||||
|
|
|
@ -366,6 +366,7 @@ sub fetch_rentalfeed {
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / Tag"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / Tag"];
|
||||||
}elsif($td_template->{$td}->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($ctpos->{time02});
|
$time_unit = $dbt->time_format($ctpos->{time02});
|
||||||
|
$time_unit .= " / Tag" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||||
}elsif($td_template->{$td}->{xduration} && $returned_counting->{real_clock} && $returned_counting->{real_clock} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{xduration} && $returned_counting->{real_clock} && $returned_counting->{real_clock} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($returned_counting->{real_clock});
|
$time_unit = $dbt->time_format($returned_counting->{real_clock});
|
||||||
|
|
|
@ -97,7 +97,7 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit
|
||||||
$ctrel = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id});
|
$ctrel = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id});
|
||||||
#
|
#
|
||||||
#collect rentals on operators and get operator hash with dbname->uri_operator
|
#collect rentals on operators and get operator hash with dbname->uri_operator
|
||||||
#$q->param(-name=>'month',-value=>"18");#disabled because changing to not invoiced positions
|
$q->param(-name=>'month',-value=>"1");
|
||||||
my ($cttpos,$operator_hash) = $apif->user_rentals_history($q,$ctrel);
|
my ($cttpos,$operator_hash) = $apif->user_rentals_history($q,$ctrel);
|
||||||
#print Dumper($cttpos);
|
#print Dumper($cttpos);
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
||||||
}elsif($key =~ /barcode/){
|
}elsif($key =~ /barcode/){
|
||||||
|
|
||||||
if($cttpos_count){
|
if($cttpos_count){
|
||||||
print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"Folgende Positionen liegen zur nächsten Abbuchung vor"),"\n";
|
print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"Folgende Positionen liegen zur nächsten Abbuchung vor (max. 1 Monat)"),"\n";
|
||||||
|
|
||||||
my @tpl_posorder = ("txt01=Beschreibung","int04=Station","ct_name=(Rad) Nummer","int26=CO2","int02=Betrag");
|
my @tpl_posorder = ("txt01=Beschreibung","int04=Station","ct_name=(Rad) Nummer","int26=CO2","int02=Betrag");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue