mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-09 21:46:34 +02:00
Mietpreis refactoring
This commit is contained in:
parent
e6ca75a66a
commit
74ecbbd2a8
11 changed files with 169 additions and 242 deletions
|
@ -1087,8 +1087,6 @@ sub booking_update(){
|
|||
$gps = "$latitude,$longitude" if($latitude && $longitude);
|
||||
}
|
||||
|
||||
my $Ilockit_GUID = "";
|
||||
$Ilockit_GUID = $q->escapeHTML($q->param('Ilockit_GUID')) if($q->param('Ilockit_GUID') && $q->param('Ilockit_GUID') =~ /\w+-\w+-\w+-\w+$/);
|
||||
my $gps_age = 0;
|
||||
my $gps_age_minutes = 60;
|
||||
$gps_age = $q->escapeHTML($1) if($q->param('gps_age') =~ /^(\d+)/);#in milli-sec
|
||||
|
@ -1130,8 +1128,6 @@ sub booking_update(){
|
|||
}
|
||||
}else{
|
||||
|
||||
$update_pos->{txt17} = $Ilockit_GUID if($Ilockit_GUID);
|
||||
|
||||
|
||||
#prevent reset occupied values OR only if genkey defined
|
||||
#if(($state eq "occupied" && $record_pos->{txt10} =~ /requested/) || ($state eq "occupied" && $record_pos->{txt10} =~ /occupied/ && $q->param('genkey') eq "1"))
|
||||
|
@ -1168,6 +1164,7 @@ sub booking_update(){
|
|||
#my $pricing = $pri->sharee_pricing($record_pos,"calc_price");
|
||||
#new sharee_pricing
|
||||
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"calc_price");
|
||||
#int03 only used for tarif counting backwards compatibility
|
||||
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||
$update_pos->{int39} = "$counting->{int39}" if(looks_like_number($counting->{int39}));
|
||||
|
@ -1226,6 +1223,7 @@ sub booking_update(){
|
|||
#my $pricing = $pri->sharee_pricing($record_pos,"calc_price");
|
||||
#new sharee_pricing
|
||||
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"calc_price");
|
||||
#int03 only used for tarif counting backwards compatibility
|
||||
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||
$update_pos->{int39} = "$counting->{int39}" if(looks_like_number($counting->{int39}));
|
||||
|
@ -1262,6 +1260,7 @@ sub booking_update(){
|
|||
#my $pricing = $pri->sharee_pricing($record_pos,"calc_price");
|
||||
#new sharee_pricing
|
||||
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"calc_price");
|
||||
#int03 only used for tarif counting backwards compatibility
|
||||
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||
$update_pos->{int39} = "$counting->{int39}" if(looks_like_number($counting->{int39}));
|
||||
|
@ -1321,7 +1320,6 @@ sub booking_update(){
|
|||
#$self->service_automatic($q) if($1 <= 40);
|
||||
}
|
||||
$update_cc->{txt15} = $q->escapeHTML($q->param('firmware')) if($q->param('firmware'));
|
||||
$update_cc->{txt17} = $Ilockit_GUID if($Ilockit_GUID);
|
||||
|
||||
}
|
||||
#end Ilockit || sigo
|
||||
|
@ -1768,7 +1766,6 @@ sub bikes_available(){
|
|||
|
||||
if($record->{$id}->{int11} eq "2"){
|
||||
$return->{$id}->{system} = "Ilockit";
|
||||
$return->{$id}->{Ilockit_GUID} = "$record->{$id}->{txt17}";
|
||||
$return->{$id}->{Ilockit_ID} = "$record->{$id}->{txt18}";
|
||||
#if($users_serviceapp->{int09})
|
||||
#shareetool
|
||||
|
@ -1908,7 +1905,6 @@ sub bikes_all(){
|
|||
|
||||
if($record->{$id}->{int11} eq "2"){
|
||||
$return->{$id}->{system} = "Ilockit";
|
||||
$return->{$id}->{Ilockit_GUID} = "$record->{$id}->{txt17}";
|
||||
$return->{$id}->{Ilockit_ID} = "$record->{$id}->{txt18}";
|
||||
#shareetool
|
||||
if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187 && scalar(@{$user_tour} >= 1)){
|
||||
|
|
|
@ -1330,7 +1330,8 @@ sub insert_pos(){
|
|||
my $station = $ct->{int04} || 0;
|
||||
my $rabatt = 0;
|
||||
|
||||
my $unit_price1 = $ct->{int02} || 0;
|
||||
my $unit_price = $ct->{int02} || 0;#article price
|
||||
my $unit_price1 = 0;
|
||||
my $unit_price2 = 0;
|
||||
my $start_price = 0;
|
||||
my $daymax_price = 0;
|
||||
|
@ -1346,6 +1347,7 @@ sub insert_pos(){
|
|||
my $menge = 0;
|
||||
if(ref($ct_tariff) eq "HASH" && $ct_tariff->{barcode}){
|
||||
$rabatt = $ctadr->{int07} || 0;
|
||||
$unit_price = $ct_tariff->{int02} || 0;#old and should in future not used by rental
|
||||
$unit_price1 = $ct_tariff->{int35} || 0;
|
||||
$unit_price2 = $ct_tariff->{int36} || 0;
|
||||
$start_price = $ct_tariff->{int37} || 0;
|
||||
|
@ -1362,7 +1364,7 @@ sub insert_pos(){
|
|||
my $sth;
|
||||
#Verleihräder
|
||||
if($ct->{template_id} && $ct->{template_id} == 205){#Leihrad_list
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,itime,start_time,end_time,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt17,txt18,int20,int25,int34,txt22,txt10,int35,int36,int37,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}',now(),now(),'$endRental','$unit_price1','$menge','$station','$station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$daymax_price','$abo_price','$free_hours','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','$ct->{int20}','$trackon','$staff','$ct->{txt22}','$reserveid','$unit_price1','$unit_price2','$start_price','$unit_time','$free_time') RETURNING c_id");
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,itime,start_time,end_time,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt18,int20,int25,int34,txt22,txt10,int35,int36,int37,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}',now(),now(),'$endRental','$unit_price','$menge','$station','$station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$daymax_price','$abo_price','$free_hours','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{int20}','$trackon','$staff','$ct->{txt22}','$reserveid','$unit_price1','$unit_price2','$start_price','$unit_time','$free_time') RETURNING c_id");
|
||||
}else{
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int02,int03,txt01,txt06,txt07,int10,int12,owner) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','0','$user_name','$ctadr->{txt09}',now(),'$unit_price1','1','$ct->{txt01}','$ct->{txt06}','$ct->{txt07}','0','$from_main_id','$owner') RETURNING c_id");
|
||||
}
|
||||
|
|
|
@ -640,6 +640,9 @@ sub handler {
|
|||
if(!$users_sharee->{int14}){
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1}?cum=2$session_and\&$returnwww");
|
||||
exit 0;
|
||||
}elsif(!$payable_check){
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}$session");
|
||||
exit 0;
|
||||
}else{
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=2$session_and\&$returnwww");
|
||||
exit 0;
|
||||
|
|
|
@ -14,6 +14,10 @@ use CGI;
|
|||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use CGI ':standard';
|
||||
use Date::Calc qw(:all);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use DateTime;
|
||||
use DateTime::Format::Pg;
|
||||
|
||||
use Lib::Config;
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenz;
|
||||
|
@ -21,6 +25,7 @@ use Mod::Libenzdb;
|
|||
use Mod::DBtank;
|
||||
use Mod::Callib;
|
||||
use Mod::Payment;
|
||||
use Mod::Pricing;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
|
@ -44,6 +49,8 @@ sub preinit(){
|
|||
my $cb = new Callib;
|
||||
my $but = new Buttons;
|
||||
my $payone = new Payment;
|
||||
my $pri = new Pricing;
|
||||
|
||||
my %ib = $but->ibuttons();
|
||||
my %varenv = $cf->envonline();
|
||||
my $script = $q->script_name();
|
||||
|
@ -219,7 +226,7 @@ sub preinit(){
|
|||
$ct_node = $db->get_node4multi($ct->{main_id},$lang);
|
||||
#check if part linked to mandant
|
||||
my $mandant_check;
|
||||
$waren = $db->get_node2($users_dms->{fullurl},"Waren",$lang);
|
||||
$waren = $db->get_node2($varenv{wwwhost},"Waren",$lang);
|
||||
$mandant_check = $db->collect_noderec($waren->{main_id},$lang,"nothing") if($waren->{main_id});
|
||||
$mandant_check =~ s/,/|/g;
|
||||
$users_dms = $db->select_users($users_dms->{u_id}) if($ib_key =~ /new_/);#nur bei new_ mit save_
|
||||
|
@ -278,9 +285,9 @@ sub preinit(){
|
|||
}
|
||||
return "pos_id=$pos_id";#new return-code to get opened Part-Position in Transposition
|
||||
}elsif($ct_name && !$rel->{content_id}){
|
||||
return "failure::Für die Terminzuordnung bitte zuerst einen Verkauf Vorgang öffnen oder neu erzeugen.<br /> ::$script/$users_dms->{fullurl}/Verkauf::Zum Verkauf";
|
||||
return "failure::Für die Terminzuordnung bitte zuerst einen Verkauf Vorgang öffnen oder neu erzeugen.<br /> ::$varenv{wwwhost}/Verkauf::Zum Verkauf";
|
||||
}else{
|
||||
return "failure::Die Artikelnummer ist in der Waren Datenbank nicht angelegt oder einem anderen Lagerort zugeordnet.<br /> ::$script/$users_dms->{fullurl}/Waren::Waren verwalten";
|
||||
return "failure::Die Artikelnummer ist in der Waren Datenbank nicht angelegt oder einem anderen Lagerort zugeordnet.<br /> ::$varenv{wwwhost}/Waren::Waren verwalten";
|
||||
}
|
||||
}
|
||||
#####
|
||||
|
@ -323,22 +330,16 @@ sub preinit(){
|
|||
}elsif($ib_key eq "save_adr" || $ib_key =~ /save_text/){
|
||||
$table = "contenttrans";
|
||||
$c_id = "$R::c_id4trans";
|
||||
}elsif($ib_key =~ /save_tver/){
|
||||
$table = "contenttver";
|
||||
$c_id = "$users_dms->{c_id4trans}";
|
||||
$c_id = $R::c_id if($R::cell_key && $R::c_id);
|
||||
}elsif($ib_key eq "save_pos"){
|
||||
$table = "contenttranspos";
|
||||
$c_id = $R::c_idpos || $R::pos_id;
|
||||
}elsif($ib_key eq "save_verpos"){
|
||||
$table = "contenttverpos";
|
||||
$c_id = $R::c_idpos || $R::pos_id;
|
||||
}
|
||||
|
||||
#Miet- bzw. BaseVA- Zeitraum
|
||||
if($R::start_date =~ /\d{1,2}\.\d{1,2}\.\d{4}/ && $R::end_date =~ /\d{1,2}\.\d{1,2}\.\d{4}/){
|
||||
my $start_date = $q->escapeHTML("$R::start_date");
|
||||
my $end_date = $q->escapeHTML("$R::end_date");
|
||||
if($ib_key =~ /save_pos/ && $R::c_idpos && $R::start_date =~ /\d{1,2}\.\d{1,2}\.\d{4}/ && $R::end_date =~ /\d{1,2}\.\d{1,2}\.\d{4}/){
|
||||
my $pos_id = $R::c_idpos;
|
||||
my $start_date = "$3-$2-$1" if($R::start_date =~ /(\d{1,2})\.(\d{1,2})\.(\d{4})/);
|
||||
my $end_date = "$3-$2-$1" if($R::end_date =~ /(\d{1,2})\.(\d{1,2})\.(\d{4})/);
|
||||
my $s_hh = $q->escapeHTML("$R::s_hh") || "0";
|
||||
my $s_mi = $q->escapeHTML("$R::s_mi") || "0";
|
||||
my $e_hh = $q->escapeHTML("$R::e_hh") || "0";
|
||||
|
@ -347,56 +348,76 @@ sub preinit(){
|
|||
$e_hh = "24" if($e_hh > "24");
|
||||
$s_mi = "59" if($s_mi > "59");
|
||||
$e_mi = "59" if($e_mi > "59");
|
||||
my $start_time="null";
|
||||
my $end_time="null";
|
||||
$start_time = "$start_date $s_hh:$s_mi" if("$start_date $s_hh:$s_mi" =~ /\d{1,2}\.\d{1,2}\.\d{4}\s\d{1,2}:\d{1,2}/);
|
||||
$end_time = "$end_date $e_hh:$e_mi" if("$end_date $e_hh:$e_mi" =~ /\d{1,2}\.\d{1,2}\.\d{4}\s\d{1,2}:\d{1,2}/);
|
||||
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}/);
|
||||
$end_time = "$end_date $e_hh:$e_mi:00" if("$end_date $e_hh:$e_mi" =~ /\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}/);
|
||||
|
||||
if($start_time && $end_time){
|
||||
my $dtnow = DateTime->now( time_zone => "Europe/Berlin" );
|
||||
my $dt0 = DateTime::Format::Pg->parse_datetime($start_time);
|
||||
my $dt1 = DateTime::Format::Pg->parse_datetime($end_time);
|
||||
|
||||
if($ib_key =~ /save_pos/){
|
||||
my $pos_id = $R::c_idpos;
|
||||
my ($start_datetime,$end_datetime,$menge) = $cb->contenttranspos_dating($pos_id,$start_time,$end_time,$today4db);
|
||||
my ($s_yy,$s_mo,$s_dd,$s_hh,$s_mi) = $cb->split_date($start_datetime);
|
||||
my $s_time = Mktime($s_yy,$s_mo,$s_dd,$s_hh,$s_mi,0);
|
||||
my ($e_yy,$e_mo,$e_dd,$e_hh,$e_mi) = $cb->split_date($end_datetime);
|
||||
my $e_time = Mktime($e_yy,$e_mo,$e_dd,$e_hh,$e_mi,0);
|
||||
if($dt0 < $dtnow && $dt1 < $dtnow){
|
||||
|
||||
my $ctpos_id=0;
|
||||
my $cvpos_id=0;
|
||||
$ctpos_id = $pos_id if($table eq "contenttranspos");
|
||||
$cvpos_id = $pos_id if($table eq "contenttverpos");
|
||||
$db->updater($table,"c_id",$pos_id,"start_time","$start_datetime",$users_dms->{u_id});
|
||||
$db->updater($table,"c_id",$pos_id,"end_time","$end_datetime",$users_dms->{u_id});
|
||||
#print "($s_time <= $time && $e_time >= $time) xxxx";
|
||||
#set contentpos status
|
||||
if($s_time <= $time && $e_time >= $time){
|
||||
$db->updater($table,"c_id",$pos_id,"int10","3",$users_dms->{u_id});
|
||||
}else{
|
||||
$db->updater($table,"c_id",$pos_id,"int10","1",$users_dms->{u_id});
|
||||
#2021-08-04 set also bike available
|
||||
$db->updater("content","c_id",$R::cc_id,"int10","1",$users_dms->{u_id}) if($R::cc_id);
|
||||
}
|
||||
#we believe setting by manually insert of int03=$menge via Transposition
|
||||
#$db->updater($table,"c_id",$pos_id,"int03","$menge",$users_dms->{u_id});
|
||||
#set GPS
|
||||
if($R::txt06 && $R::txt06 =~ /^(\d{1,2}\.\d+),\s?(\d{1,2}\.\d+)$/){
|
||||
$db->updater($table,"c_id",$pos_id,"txt06","$R::txt06",$users_dms->{u_id});
|
||||
}
|
||||
#set StationID
|
||||
if($R::int04 =~ /^\d+$/){
|
||||
$db->updater($table,"c_id",$pos_id,"int04","$R::int04",$users_dms->{u_id});
|
||||
#disbaled because we don't know for sure
|
||||
#$db->updater("content","c_id",$R::cc_id,"int04","$R::int04",$users_dms->{u_id}) if($R::cc_id);
|
||||
my $pref = {
|
||||
table => "contenttrans",
|
||||
table_pos => "contenttranspos",
|
||||
fetch => "one",
|
||||
template_id => "218",#Mietjournal tpl_id
|
||||
c_id => $pos_id,
|
||||
"ct.close_time" => "is::null",
|
||||
};
|
||||
|
||||
my $record_pos = {};
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
$record_pos = $dbt->collect_post($dbh,$pref);
|
||||
|
||||
my $update_pos = {
|
||||
table => "contenttranspos",
|
||||
start_time => "$start_time",
|
||||
end_time => "$end_time",
|
||||
owner => $users_dms->{u_id},
|
||||
mtime => "now()",
|
||||
};
|
||||
my $rows = $dbt->update_record($dbh,$update_pos,$record_pos);
|
||||
#again to get setted date-times
|
||||
$record_pos = $dbt->collect_post($dbh,$pref);
|
||||
|
||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"calc_price");
|
||||
|
||||
#int03 only used for tarif counting backwards compatibility
|
||||
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||
$update_pos->{int39} = "$counting->{int39}" if(looks_like_number($counting->{int39}));
|
||||
$update_pos->{int40} = "$counting->{int40}" if(looks_like_number($counting->{int40}));
|
||||
$update_pos->{int41} = "$counting->{int41}" if(looks_like_number($counting->{int41}));
|
||||
|
||||
$update_pos->{int10} = 1;
|
||||
$update_pos->{int04} = $R::int04 if(looks_like_number($R::int04));
|
||||
|
||||
if($R::cc_id =~/^\d+$/){
|
||||
my $ctpref = {
|
||||
table => "content",
|
||||
fetch => "one",
|
||||
c_id => $R::cc_id,
|
||||
};
|
||||
my $ctbike = $dbt->fetch_tablerecord($dbh,$ctpref);
|
||||
|
||||
if($ctbike->{int10} && ($ctbike->{int10} == 2 || $ctbike->{int10} == 3)){
|
||||
$db->updater("content","c_id",$R::cc_id,"int10","1",$users_dms->{u_id});
|
||||
if($R::int04 =~/^\d+$/){
|
||||
$db->updater("content","c_id",$R::cc_id,"int04","$R::int04",$users_dms->{u_id});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->updater("contenttrans","c_id",$ctt->{c_id},"start_time","$start_datetime",$users_dms->{u_id});
|
||||
$db->updater("contenttrans","c_id",$ctt->{c_id},"end_time","$end_datetime",$users_dms->{u_id});
|
||||
|
||||
}elsif($ib_key =~ /save_tver|save_verpos/){
|
||||
$u_rows += $db->updater("contenttver","c_id",$c_id,"start_time","$start_time");
|
||||
$u_rows += $db->updater("contenttver","c_id",$c_id,"end_time","$end_time");
|
||||
$db->users_up("cal_start","$start_time",$users_dms->{u_id}) if($varenv{dataflow} =~ /wiki/);
|
||||
}
|
||||
$rows = $dbt->update_record($dbh,$update_pos,$record_pos);
|
||||
$db->updater("contenttrans","c_id",$ctt->{c_id},"start_time","$start_time",$users_dms->{u_id});
|
||||
$db->updater("contenttrans","c_id",$ctt->{c_id},"end_time","$end_time",$users_dms->{u_id});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#hidden select keys to delete first, marked with off_ (Project.pm)
|
||||
|
@ -676,8 +697,8 @@ sub preinit(){
|
|||
$ctt->{sequence} = $R::payone_sequence || 1;
|
||||
|
||||
#only if int14 = OPOS (set by preauthorization)
|
||||
#if($ctt->{int14}){#TODO doupleclick
|
||||
if(1==1){
|
||||
#if($ctt->{int14})#TODO doupleclick
|
||||
if($state !~ /Zahlungseingang/){
|
||||
#SEPA capture
|
||||
if($ctt->{int03} == 1 && $ctt->{txt16} && $R::state =~ /SEPA/){#SEPA
|
||||
my $payoneret = $payone->captureSEPA_main(\%varenv,$ctadr,$ctt,$users_dms->{u_id});
|
||||
|
@ -693,8 +714,8 @@ sub preinit(){
|
|||
return "failure::$return_text";
|
||||
|
||||
}
|
||||
}else{
|
||||
return "failure::Payone Geldeinzug nicht ausgeführt. Hat der Einzug bereits stattgefunden?";
|
||||
#}else{
|
||||
#return "failure::Payone Geldeinzug nicht ausgeführt. Hat der Einzug bereits stattgefunden?";
|
||||
}
|
||||
}else{
|
||||
$db->updater($table,"c_id",$ctt->{c_id},"int14","null","","","","","");
|
||||
|
|
|
@ -6,7 +6,7 @@ package Pricing;
|
|||
#Rental counting and pricing methods
|
||||
#
|
||||
#perl -cw
|
||||
use lib qw(/var/www/copri-bike/shareeapp-operator/src);
|
||||
#use lib qw(/var/www/copri-bike/shareeapp-operator/src);
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
|
@ -124,10 +124,12 @@ sub counting_rental {
|
|||
}
|
||||
|
||||
#substract free time from rental time ex. 00:30 Min/Gratis
|
||||
my $freed_time = "";
|
||||
if($ctpos->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
||||
$ctpos_freed = $self->only_first_free($ctpos);
|
||||
if(!$ctpos_freed->{c_id}){
|
||||
my ($dhh,$dmm) = split(/:/,$ctpos->{time02});
|
||||
$freed_time = "- $dhh:$dmm" if($dhh || $dmm);
|
||||
#adding free minutes to start_time
|
||||
$dt0->add( hours => $dhh, minutes => $dmm ) if(looks_like_number($dhh) && looks_like_number($dmm));
|
||||
|
||||
|
@ -190,7 +192,7 @@ sub counting_rental {
|
|||
$rental_unit = sprintf('%.2f', $rental_unit);
|
||||
$rental_unit_rounded = $rental_unit;
|
||||
if($rental_unit =~ /(\d+)\.(\d+)$/){
|
||||
$rental_unit_rounded = $1 + 1 if($2 != 0);
|
||||
$rental_unit_rounded = $1 + 1 if($2 > 0);
|
||||
}
|
||||
$rental_time_price = $rental_unit_rounded * $ctpos->{int35};
|
||||
$counting->{int38} = $rental_unit_rounded;#by time
|
||||
|
@ -202,7 +204,7 @@ sub counting_rental {
|
|||
$rental_unit = sprintf('%.2f', $rental_unit);
|
||||
$rental_unit_rounded = $rental_unit;
|
||||
if($rental_unit =~ /(\d+)\.(\d+)/){
|
||||
$rental_unit_rounded = $1 + 1 if($2 != 0);
|
||||
$rental_unit_rounded = $1 + 1 if($2 > 0);
|
||||
}
|
||||
if(!$ctpos->{int36} && $ctpos->{int17} && $ctpos->{int17} > 0){
|
||||
$counting->{int38} = $rental_unit_rounded;#count by time
|
||||
|
@ -231,12 +233,14 @@ sub counting_rental {
|
|||
|
||||
$return->{start_time} = "$ctpos->{start_time}";
|
||||
$return->{end_time} = "$computed_end_time";
|
||||
$return->{freed_time} = "$freed_time";
|
||||
$return->{computed_hours} = "$computed_hours";
|
||||
$return->{unit_price} = "$ctpos->{int35}";
|
||||
$return->{real_clock} = "$real_clock";
|
||||
$return->{total_price} = "$total_price";
|
||||
|
||||
$return->{rentalog}->{real_clock} = "$real_clock";
|
||||
$return->{rentalog}->{freed_time} = "$freed_time";
|
||||
$return->{rentalog}->{computed_clock} = "$computed_clock";
|
||||
$return->{rentalog}->{computed_hours} = "$computed_hours";
|
||||
$return->{rentalog}->{rental_minute} = "$rental_minute";
|
||||
|
@ -324,7 +328,6 @@ sub fetch_rentalfeed {
|
|||
}
|
||||
}#end new tariff_description2
|
||||
|
||||
$return->{Ilockit_GUID} = "$ctpos->{txt17}" if($ctpos->{int11} == 2);
|
||||
$return->{Ilockit_ID} = "$ctpos->{txt18}" if($ctpos->{int11} == 2);
|
||||
($return->{gps}->{latitude},$return->{gps}->{longitude}) = split(/,/,$ctpos->{txt06});
|
||||
$return->{lock_state} = "locked" if($ctpos->{int20} == 1);
|
||||
|
|
|
@ -24,6 +24,7 @@ use Date::Calc qw(:all);
|
|||
use Scalar::Util qw(looks_like_number);
|
||||
use Storable;
|
||||
use Mod::APIfunc;
|
||||
use Mod::Pricing;
|
||||
use Data::Dumper;
|
||||
|
||||
sub new {
|
||||
|
@ -48,6 +49,7 @@ sub tpl(){
|
|||
my $but = new Buttons;
|
||||
my $dbt = new DBtank;
|
||||
my $apif = new APIfunc;
|
||||
my $pri = new Pricing;
|
||||
|
||||
my %varenv = $cf->envonline();
|
||||
my $script = $q->script_name();
|
||||
|
@ -65,7 +67,6 @@ sub tpl(){
|
|||
|
||||
$path =~ s/\/login|\/user|\/manager|\/admin|\/$//;
|
||||
my $user_agent = $q->user_agent();
|
||||
my $fullurl = $users_dms->{fullurl};
|
||||
my $saved_query = $q->url(-query=>1);
|
||||
my %ib = $but->ibuttons();
|
||||
my $main_id = $node_meta->{main_id};
|
||||
|
@ -196,7 +197,7 @@ sub tpl(){
|
|||
my $ctb = $db->get_content1("contentuser","$users_dms->{owner}");
|
||||
|
||||
|
||||
my ($umsatz,$edit,$new_key,$copy_key,$save_key,$delete_key,$c_id4csv);
|
||||
my ($edit,$new_key,$copy_key,$save_key,$delete_key,$c_id4csv);
|
||||
my $ct4rel = {};
|
||||
my $ct4rel_parts = {};
|
||||
my $k=0;
|
||||
|
@ -206,9 +207,6 @@ sub tpl(){
|
|||
print "<div id='Content4list'>\n";
|
||||
|
||||
my $v_journal = $R::v_journal || "";
|
||||
#if($path =~ /(\w+journal)/){
|
||||
# $v_journal = "$1" ;
|
||||
#}
|
||||
if($node_meta->{main_id} == $dbt->{shareeconf_dms}->{invoicejournal}){
|
||||
$v_journal = $node_meta->{node_name};
|
||||
}
|
||||
|
@ -323,15 +321,6 @@ sub tpl(){
|
|||
$tplids = "205,224,225,210,226,227,228,229" if(($table !~ /contentadr|contenttrans|contenttver|contentnel/) && !$export);
|
||||
$tplids = 205 if($path =~ /Waren$/);#Defaults to only Verleih_list
|
||||
|
||||
#collect depends Reparatur_list (AWs) template
|
||||
my $ct_aw; my $ct4aw;
|
||||
if($v_journal){
|
||||
$ct4aw = $db->collect_cid("content",$lang,"199");
|
||||
foreach my $aw_id (keys (%$ct4aw)){
|
||||
$ct_aw .= "$ct4aw->{$aw_id}->{c_id}|"
|
||||
}
|
||||
$ct_aw =~ s/\|$//;
|
||||
}
|
||||
|
||||
my $s_ct_name = $q->escapeHTML($R::s_ct_name) || "";
|
||||
my $s_barcode = $q->escapeHTML($R::s_barcode) || "";
|
||||
|
@ -353,7 +342,6 @@ sub tpl(){
|
|||
if($v_journal){
|
||||
$offset=0;
|
||||
$limit=10000;
|
||||
$umsatz = "AW";
|
||||
}
|
||||
|
||||
#Waren-nodes für Umsatz-Auswertung
|
||||
|
@ -374,8 +362,10 @@ sub tpl(){
|
|||
$lb->failure("Fehler! Es fehlen wichtige Einstellungen. ....journal-ID!");
|
||||
}
|
||||
my $kt_sum=0;
|
||||
my $ct_name_set1;my $ct_name_set2;
|
||||
my $ct_ids;my $ct_aw_ids; my $last_ab;
|
||||
my $ct_name_set1;
|
||||
my $ct_name_set2;
|
||||
my $ct_ids;
|
||||
my $last_ab;
|
||||
|
||||
if($R::detail_search && $R::detail_search eq "suchen"){
|
||||
$offset = 0;
|
||||
|
@ -473,10 +463,6 @@ sub tpl(){
|
|||
#collect invoice ids in kontext of parts
|
||||
foreach my $cp_id (keys (%$ct4rel_parts)){
|
||||
$ct_ids .= "$ct4rel_parts->{$cp_id}->{ct_id}," if($R::detail_search && ($R::s_kontext && $R::s_kontext eq "Waren" || $export eq "FiBu"));
|
||||
#pre collect of trans for AW
|
||||
if(($umsatz eq "AW") && "$ct_aw" && ($ct4rel_parts->{$cp_id}->{cc_id} =~ /$ct_aw/)){
|
||||
$ct_aw_ids .= "$ct4rel_parts->{$cp_id}->{ct_id}|";#
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -503,7 +489,6 @@ sub tpl(){
|
|||
if($v_journal && $v_journal =~ /journal/){
|
||||
my ($a_check,$b_check,$c_check,$d_check,$f_check,$g_check);
|
||||
$a_check = "1" if($R::s_kontext && $R::s_kontext eq "Waren");
|
||||
$umsatz="Summe der gefundenen Waren" if($R::s_kontext && $R::s_kontext eq "Waren");
|
||||
$b_check = "1" if($R::s_kontext && $R::s_kontext eq "Beleg" || !$R::s_kontext);
|
||||
my @_s_time_defaults = ("0,manuelle Eingabe in \"bearbeitet\"","7,1 Woche","14,2 Wochen","28,4 Wochen","365,1 Jahr");
|
||||
#print $q->div({-style=>'float:left;background-color:silver;'}," <b>Suchzeitraum:</b> ",$but->selector("selected_start_mtime","130px","$R::selected_start_mtime",@_s_time_defaults));
|
||||
|
@ -681,7 +666,7 @@ sub tpl(){
|
|||
}
|
||||
#print $q->end_form,"\n";
|
||||
|
||||
my $sum_bar="0";my $sum_ec="0";my $sum_kredit="0";my $sum_abb="0";my $sum_ueb="0";my $sum_geka="0";my $sum_paypal="0";my $sum_SEPApayone="0";my $sum_CCpayone="0";my $sum_ausfall="0";my $sum_kasse="0";my $sum_start="0";my $close_time="";my $payment_time="";my $sum_waren;my $sum_verkauf;my $sum_kaution;my $sum_aw;my $sum_am;my $sum_park; my $sum_radd;my $sum_wst_ek=0; my $sum_wst_vk=0; my $sum_verleih;
|
||||
my $sum_bar="0";my $sum_ec="0";my $sum_kredit="0";my $sum_abb="0";my $sum_ueb="0";my $sum_geka="0";my $sum_paypal="0";my $sum_SEPApayone="0";my $sum_CCpayone="0";my $sum_ausfall="0";my $sum_kasse="0";my $sum_start="0";my $close_time="";my $payment_time="";my $sum_waren;my $sum_verkauf;my $sum_kaution;my $sum_am;my $sum_park; my $sum_radd;my $sum_wst_ek=0; my $sum_wst_vk=0; my $sum_verleih;
|
||||
my $nr=0;my $nx=0;
|
||||
my $check_kaution=0;
|
||||
my $rabatt_key; my $kost_key;
|
||||
|
@ -715,18 +700,18 @@ sub tpl(){
|
|||
$sum_wst_vk += $ct4rel->{$id}->{int02} * $ct4rel->{$id}->{int03};
|
||||
}
|
||||
|
||||
#AWs Faktor from Firma
|
||||
if($table eq "content" && $ctf->{int02} != 0 && $ct4rel->{$id}->{int09} != 0){
|
||||
$ct4rel->{$id}->{int02} = $ctf->{int02} * $ct4rel->{$id}->{int09};
|
||||
$ct4rel->{$id}->{int02} = $lb->cashme($ct4rel->{$id}->{int02});
|
||||
}
|
||||
|
||||
# check sum_pos and sum_buchen
|
||||
my $sum_pos=0;
|
||||
#if($v_journal && $ct4rel->{$id}->{state} ne "Kassenbestand"){
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
if($ct4rel->{$id}->{state} ne "Kassenbestand"){
|
||||
foreach my $cpid (keys (%$ct4rel_parts)){
|
||||
if(($ct4rel->{$id}->{c_id} eq $ct4rel_parts->{$cpid}->{ct_id}) && (looks_like_number($ct4rel_parts->{$cpid}->{int02}) && $ct4rel_parts->{$cpid}->{int02} != 0) && (looks_like_number($ct4rel_parts->{$cpid}->{int03}) && $ct4rel_parts->{$cpid}->{int03} != 0)){
|
||||
if($ct4rel->{$id}->{c_id} eq $ct4rel_parts->{$cpid}->{ct_id}){
|
||||
|
||||
if($ct4rel_parts->{$cpid}->{int35} && $ct4rel_parts->{$cpid}->{start_time} && $ct4rel_parts->{$cpid}->{end_time}){
|
||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$ct4rel_parts->{$cpid},"calc_price");
|
||||
}elsif((looks_like_number($ct4rel_parts->{$cpid}->{int02}) && $ct4rel_parts->{$cpid}->{int02} != 0) && (looks_like_number($ct4rel_parts->{$cpid}->{int03}) && $ct4rel_parts->{$cpid}->{int03} != 0)){
|
||||
|
||||
if($ct4rel_parts->{$cpid}->{int07} != 0){
|
||||
my $rabatt_eur = $ct4rel_parts->{$cpid}->{int07};
|
||||
$rabatt_eur = $ct4rel_parts->{$cpid}->{int02} * $ct4rel_parts->{$cpid}->{int03} * $ct4rel_parts->{$cpid}->{int07}/100 if($ct4rel_parts->{$cpid}->{int08} != 1);#wenn int08 != 1 alias €
|
||||
|
@ -735,7 +720,8 @@ sub tpl(){
|
|||
}else{
|
||||
$sum_pos += $ct4rel_parts->{$cpid}->{int02} * $ct4rel_parts->{$cpid}->{int03};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
my $sum_chk = $ct4rel->{$id}->{int01};
|
||||
$sum_pos = $lb->round($sum_pos);
|
||||
|
@ -981,9 +967,9 @@ sub tpl(){
|
|||
$ct4rel->{$id}->{start_time} = $lb->time4de($ct4rel->{$id}->{start_time},"1") if($ct4rel->{$id}->{start_time});
|
||||
$ct4rel->{$id}->{end_time} = $lb->time4de($ct4rel->{$id}->{end_time},"1") if($ct4rel->{$id}->{end_time});
|
||||
print $q->td({-class=>'tdtxt',-style=>"$txtstyle $set_style", -nowrap=>1},"$ct4rel->{$id}->{start_time} - $ct4rel->{$id}->{end_time}"),"\n";
|
||||
}elsif($key =~ /int01/ && $node_meta->{node_name} eq "Faktura"){
|
||||
}elsif($key =~ /int01/ && ($node_meta->{parent_id} == $dbt->{shareedms_conf}->{faktura} || $node_meta->{main_id} == $dbt->{shareedms_conf}->{faktura})){
|
||||
if($ct4rel->{$id}->{state} eq "Kassenbestand"){
|
||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},$q->b("Tatsächl. $ct4rel->{$id}->{$key}")),"\n";
|
||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
||||
}else{
|
||||
my $betrag = $ct4rel->{$id}->{$key} || "∑ $sum_pos";# pre counting
|
||||
$betrag = $ct4rel->{$id}->{$key} if($v_journal);
|
||||
|
@ -991,7 +977,7 @@ sub tpl(){
|
|||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},"$betrag"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int02/ && $ct4rel->{$id}->{state} eq "Tagesabschluss"){
|
||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},$q->b("Anfangst. $ct4rel->{$id}->{$key}")),"\n";
|
||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
||||
}elsif($key =~ /int03/ && "$table" eq "contenttrans"){
|
||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
||||
}elsif($key =~ /mtime/ && $ct4rel->{$id}->{close_time}){
|
||||
|
@ -1129,7 +1115,7 @@ sub tpl(){
|
|||
#print $q->div({-style=>"position:absolute;margin-left:$daymarker;border-right: solid thin #86cb00;height:1.7em;"}," "),"\n";# if("$mon" eq "$mon_today");
|
||||
my $calpath = "Mietjournal";
|
||||
$calpath = "Alarmjournal" if($ct4rel->{$id}->{int13} == $cttpos->{$ctid}->{int13} && $cttpos->{$ctid}->{int10} == 7);
|
||||
print $q->div({-style=>"position:static;margin-left:$day_stpx;width:$rent_day_px;background-color:$scale_color"},$q->a({-class=>"linknav3",-style=>"$time_style",-href=>"$script/$users_dms->{fullurl}/$calpath/?cttpos_id=$cttpos->{$ctid}->{c_id}",-title=>"Im $calpath öffnen"},"$hh_en:$mm_en")),"\n";
|
||||
print $q->div({-style=>"position:static;margin-left:$day_stpx;width:$rent_day_px;background-color:$scale_color"},$q->a({-class=>"linknav3",-style=>"$time_style",-href=>"$varenv{wwwhost}/$calpath/?cttpos_id=$cttpos->{$ctid}->{c_id}",-title=>"Im $calpath öffnen"},"$hh_en:$mm_en")),"\n";
|
||||
print "</td>\n";
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>'padding-top:1px;'},""),"\n";
|
||||
|
@ -1165,44 +1151,6 @@ sub tpl(){
|
|||
$sum_bar -= $sum_parts;
|
||||
}
|
||||
|
||||
#Umsatz Fkt.
|
||||
#AW Material Summen
|
||||
$ct_aw_ids =~ s/\|$//;
|
||||
#if($umsatz eq "AW" && $ct4rel_parts->{$cpid}->{ct_name} eq $ctf->{txt51}){
|
||||
if($umsatz eq "AW" && $ct4rel_parts->{$cpid}->{cc_id} =~ /$ct_aw/){
|
||||
$sum_aw += $sum_parts;
|
||||
$sum_verkauf -= $sum_parts;
|
||||
#$pos_style .= "background-color:#a69100;";
|
||||
}elsif($ct4rel_parts->{$cpid}->{ct_id} =~ /$ct_aw_ids/){
|
||||
$sum_am += $sum_parts;
|
||||
$sum_verkauf -= $sum_parts;
|
||||
#$pos_style .= "background-color:#c69133;";
|
||||
}
|
||||
|
||||
if($umsatz eq "Rad-Station_Verkauf"){
|
||||
foreach my $nid (keys (%$w_nodes)){
|
||||
if($ct4rel_parts->{$cpid}->{int12} eq $w_nodes->{$nid}->{main_id}){
|
||||
if($w_nodes->{$nid}->{txt01} eq "Raddienst"){
|
||||
$sum_radd += $sum_parts;
|
||||
$sum_verkauf -= $sum_parts;
|
||||
#$pos_style .= "background-color:#a69100;";
|
||||
}elsif($w_nodes->{$nid}->{txt01} eq "Parkhaus"){
|
||||
$sum_park += $sum_parts;
|
||||
$sum_verkauf -= $sum_parts;
|
||||
#$pos_style .= "background-color:#a69100;";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($umsatz eq "Rad-Station_Verleih"){
|
||||
#besser, anhand der Verleih-Kostenstelle
|
||||
foreach my $nid (keys (%$verleih_nodes)){
|
||||
if($ct4rel_parts->{$cpid}->{int12} eq $verleih_nodes->{$nid}->{main_id}){
|
||||
$sum_verleih += $sum_parts;
|
||||
#$pos_style .= "background-color:#a69100;";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $parts_time = "";
|
||||
if($ct4rel_parts->{$cpid}->{start_time} && $ct4rel_parts->{$cpid}->{end_time}){
|
||||
|
@ -1404,72 +1352,6 @@ sub tpl(){
|
|||
}
|
||||
###
|
||||
|
||||
#AW 2020-01-29 disabled
|
||||
if(1==2 && $umsatz && $node_meta->{node_name} eq "Faktura"){
|
||||
my $sum_parts_all;
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdtxt',-style=>'text-align:center;background-color:silver;',-colspan=>"$m"},"Teil Umsätze");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-style=>'background-color:silver;'},"");
|
||||
|
||||
if("$R::s_kontext" eq "Waren"){
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Suchkontext Waren. Die Umsatz Summe der durch Suchbegriffe gefundenen Artikel");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_waren €");
|
||||
}
|
||||
|
||||
if($umsatz eq "Rad-Station_Verkauf"){
|
||||
$sum_radd = $lb->cashme($sum_radd);
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Raddienst Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_radd €");
|
||||
$sum_park = $lb->cashme($sum_park);
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Parkhaus Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_park €");
|
||||
}
|
||||
|
||||
if($umsatz eq "Rad-Station_Verleih"){
|
||||
$sum_verleih = $lb->cashme($sum_verleih);
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},$q->span({-style=>'color:silver;font-weight:normal;'},""),"Verleih Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_verleih €");
|
||||
}
|
||||
|
||||
if($umsatz eq "AW"){
|
||||
$sum_aw = $lb->round($sum_aw);
|
||||
$sum_aw = $lb->cashme($sum_aw);
|
||||
$sum_am = $lb->round($sum_am);
|
||||
$sum_am = $lb->cashme($sum_am);
|
||||
$sum_verkauf = $lb->round($sum_verkauf);
|
||||
$sum_verkauf = $lb->cashme($sum_verkauf);
|
||||
$sum_parts_all += $sum_aw;
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Arbeits-Werte Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_aw €");
|
||||
$sum_parts_all += $sum_am;
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Arbeits-Material Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_am €");
|
||||
$sum_parts_all += $sum_verkauf;
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Verkaufs-Material Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_verkauf €");
|
||||
$sum_parts_all = $lb->cashme($sum_parts_all);
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-class=>'tdsum',-colspan=>"$m"},"Gesamt Summe");
|
||||
print $q->td({-class=>'tdsum',-colspan=>"1",-nowrap=>"1"},"$sum_parts_all €");
|
||||
}
|
||||
}
|
||||
|
||||
if($users_dms->{u_id}){
|
||||
if($v_journal =~ /bericht/ && $j_exist->{main_id}){
|
||||
print $q->Tr();
|
||||
|
|
|
@ -387,8 +387,7 @@ EOF
|
|||
#$u_name = $ct_users->{$ct4rel->{$id}->{$key}}->{txt01} || $ct4rel->{$id}->{$key};
|
||||
print $q->td({-class=>"$tdclass",-style=>"$tdstyle $set_style"},"$u_name"),"\n";
|
||||
}elsif($key eq "barcode" && $node_meta->{ct_table} eq "contentadrpos"){
|
||||
print $q->td({-class=>"$tdclass",-style=>"$tdstyle $set_style"},$q->a({-class=>"linknav3",-href=>"/$users_dms->{fullurl}/Waren/?detail_search=1\&s_barcode=$ct4rel->{$id}->{barcode}",-title=>"zum Rad "},"$ct4rel->{$id}->{barcode}")),"\n";
|
||||
#print $q->td({-class=>"$tdclass",-style=>"$tdstyle $set_style"},$q->a({-class=>"editnav",-href=>"/$users_dms->{fullurl}/Waren/?detail_search=1\&s_barcode=$ct4rel->{$id}->{barcode}",-title=>"zur Liste der Rad $ct4rel->{$id}->{barcode} Servicearbeiten"}, $q->img({-src=>"$varenv{metahost}/glyphicons/glyphicons-440-wrench.png", -style=>'height:1.3em;'}),"$ct4rel->{$id}->{barcode}")),"\n";
|
||||
print $q->td({-class=>"$tdclass",-style=>"$tdstyle $set_style"},$q->a({-class=>"linknav3",-href=>"$varenv{wwwhost}/Waren/?detail_search=1\&s_barcode=$ct4rel->{$id}->{barcode}",-title=>"zum Rad "},"$ct4rel->{$id}->{barcode}")),"\n";
|
||||
|
||||
}elsif($key eq "u_id" && $node_meta->{ct_table} eq "users"){
|
||||
my $adref = {
|
||||
|
|
|
@ -14,6 +14,7 @@ use DateTime;
|
|||
use DateTime::Format::Pg;
|
||||
use Date::Calc::Object qw(:ALL);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use Data::Dumper;
|
||||
use Lib::Config;
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenz;
|
||||
|
@ -217,7 +218,7 @@ EOF
|
|||
|
||||
#1. Spalte
|
||||
print $q->Tr(),"\n";
|
||||
print "<td class='tdtxt'>";
|
||||
print "<td class='tdtxt' nowrap>";
|
||||
if(($c_idpos == $cttpos->{$id}->{c_id}) && ($R::trans2edit && $R::trans2edit =~ /transpos/)){
|
||||
print $q->hidden(-name=>'c_idpos', -value=>"$cttpos->{$id}->{c_id}", -override=>'1');
|
||||
print $q->hidden(-name=>'cc_id', -value=>"$cttpos->{$id}->{cc_id}", -override=>'1');
|
||||
|
@ -265,7 +266,7 @@ EOF
|
|||
|
||||
}elsif($key =~ /int03/){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print $q->td({-class=>'tdint'},"$pricing->{real_clock}"),"\n";
|
||||
print $q->td({-class=>'tdint',nowrap=>1},"$pricing->{real_clock} $pricing->{freed_time}"),"\n";
|
||||
}else{
|
||||
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10, -autofocus=>1)),"\n";
|
||||
}
|
||||
|
@ -317,7 +318,7 @@ EOF
|
|||
print $q->span({-style=>"$txtstyle $set_style"},"Mietzeit: ",
|
||||
$q->textfield(-id=>'datepicker1',-class=>'etxt',-name=>"start_date",-default=>"$s_dd.$s_mo.$s_yy",-size=>"8",-maxlength=>10),
|
||||
$q->textfield(-class=>'etxt',-name=>"s_hh",-default=>"$s_hh",-size=>"1",-maxlength=>2),":",
|
||||
$q->textfield(-class=>'etxt',-name=>"s_mi",-default=>"$s_mi",-size=>"1",-maxlength=>2)," – ",
|
||||
$q->textfield(-class=>'etxt',-name=>"s_mi",-default=>"$s_mi",-size=>"1",-maxlength=>2)," → ",
|
||||
$q->textfield(-id=>'datepicker2',-class=>'etxt',-name=>"end_date",-default=>"$e_dd.$e_mo.$e_yy",-size=>"8",-maxlength=>10),
|
||||
$q->textfield(-class=>'etxt',-name=>"e_hh",-default=>"$e_hh",-size=>"1",-maxlength=>2),":",
|
||||
$q->textfield(-class=>'etxt',-name=>"e_mi",-default=>"$e_mi",-size=>"1",-maxlength=>2)),"\n";
|
||||
|
@ -359,10 +360,10 @@ EOF
|
|||
print $q->td({-class=>'tdint'},"$co2saving");
|
||||
|
||||
}
|
||||
#int03 on parts, int35 on rental
|
||||
#yes, int03=Menge on parts, int35=unit_price1 on rental
|
||||
elsif($key =~ /int03/){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print $q->td({-class=>'tdint'},"$pricing->{real_clock}"),"\n";
|
||||
print $q->td({-class=>'tdint',-nowrap=>1},"$pricing->{real_clock} $pricing->{freed_time}"),"\n";
|
||||
}else{
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key}"),"\n";
|
||||
|
@ -383,10 +384,10 @@ EOF
|
|||
}
|
||||
}elsif($key =~ /int04/){
|
||||
if($pricing->{total_price}){
|
||||
print $q->td({-class=>'tdint'},"$pricing->{total_price} €"),"\n";
|
||||
print $q->td({-class=>'tdint',-nowrap=>1},"$pricing->{total_price} €"),"\n";
|
||||
}else{
|
||||
$gesamt =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €"),"\n";
|
||||
print $q->td({-class=>'tdint',-nowrap=>1},"$gesamt €"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int07/){
|
||||
if(!$cttpos->{$id}->{int35}){
|
||||
|
@ -418,7 +419,16 @@ EOF
|
|||
}
|
||||
if($cttpos->{$id}->{itime} =~ /(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/){
|
||||
print $q->span("$dbt->{copri_conf}->{bike_state}->{$cttpos->{$id}->{int10}} → $dbt->{copri_conf}->{lock_state}->{$cttpos->{$id}->{int20}} → $u_name / $u_name_end"),"\n";
|
||||
print "<br />\n";
|
||||
my $pos_id = "";
|
||||
if($users_dms->{u_id} && $users_dms->{u_id} =~ /1842/){
|
||||
my $pos_details = "";
|
||||
foreach my $did (sort keys (%{$pricing->{rentalog}})){
|
||||
$pos_details .= $did . " = " . $pricing->{rentalog}->{$did} . "</br>" if($pricing->{rentalog}->{$did});
|
||||
}
|
||||
#$pos_details = Dumper($pricing->{rentalog});
|
||||
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$id')"},"$cttpos->{$id}->{c_id}", $q->span({-class=>"popuptext",-id=>"$id"},"$pos_details"));
|
||||
}
|
||||
print "$pos_id<br />\n";
|
||||
}
|
||||
}
|
||||
if($cttpos->{$id}->{txt01} || $cttpos->{$id}->{int09}){
|
||||
|
@ -439,7 +449,7 @@ EOF
|
|||
my $start_time = $lb->time4de($cttpos->{$id}->{start_time},"1");
|
||||
my $end_time = $lb->time4de($cttpos->{$id}->{end_time},"1");
|
||||
print "<br />\n";
|
||||
print $q->span({-style=>"$time_style"}, "Mietzeit: $start_time – $end_time"),"\n";
|
||||
print $q->span({-style=>"$time_style"}, "Mietzeit: $start_time → $end_time"),"\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
}elsif($key =~ /txt/){
|
||||
|
|
|
@ -142,8 +142,8 @@ if(1==1){
|
|||
$mstyle_2 .= "background-color: #$hgcolor1;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_2}");
|
||||
$mstyle_3 .= "background-color: #$hgcolor1;" if("$node1->{$id1}->{node_name}" eq "$varenv->{accounting_3}");
|
||||
|
||||
#Konrad & TINK & sharee AGB
|
||||
if(!$users_sharee->{int14} && !$users_sharee->{int15} && !$users_sharee->{txt30}){
|
||||
#sharee AGB
|
||||
if(!$users_sharee->{int14}){
|
||||
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$node1->{$id1}->{node_name}", -href=>"/$viewsel[0]/Account/$node1->{$id1}->{node_name}$session"}, "$node1->{$id1}->{node_name}")),"\n";
|
||||
}
|
||||
elsif(!$users_sharee->{int03}){
|
||||
|
|
|
@ -340,8 +340,16 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
|||
print $q->Tr(),"\n";
|
||||
|
||||
foreach my $id (sort { lc($cttpos->{$b}->{$scol}) cmp lc($cttpos->{$a}->{$scol}) } keys(%$cttpos)){
|
||||
$j++;
|
||||
$nx++;
|
||||
$j++;
|
||||
$nx++;
|
||||
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
my $rental_feed = {};
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id},"calc_price");
|
||||
$rental_feed = $pri->fetch_rentalfeed($varenv,$cttpos->{$id},$counting);
|
||||
}
|
||||
|
||||
print $q->Tr(),"\n";
|
||||
foreach (@tpl_posorder){
|
||||
|
@ -395,13 +403,17 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
|||
}
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$co2saving");
|
||||
}elsif($key eq "int02"){
|
||||
my $gesamt = 0;
|
||||
my $rabatt = "";
|
||||
($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
||||
$sum += $gesamt;
|
||||
$gesamt = $lb->round($gesamt);
|
||||
$gesamt = $lb->cashme($gesamt,",");
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €");
|
||||
if($pricing->{total_price}){
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$pricing->{total_price} €"),"\n";
|
||||
}else{
|
||||
my $gesamt = 0;
|
||||
my $rabatt = "";
|
||||
($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
||||
$sum += $gesamt;
|
||||
$gesamt = $lb->round($gesamt);
|
||||
$gesamt = $lb->cashme($gesamt,",");
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,9 +71,9 @@ sub tpl(){
|
|||
print "<div style='position:fixed;z-index:10;right:0px;'>\n";
|
||||
|
||||
#cleanup
|
||||
if(!$mandant->{node_name} || "$mandant->{node_name}" ne "$users_dms->{fullurl}"){
|
||||
$db->cleanup_users($users_dms->{owner}) if($users_dms->{owner});
|
||||
}
|
||||
#if(!$mandant->{node_name} || "$mandant->{node_name}" ne "$users_dms->{fullurl}"){
|
||||
# $db->cleanup_users($users_dms->{owner}) if($users_dms->{owner});
|
||||
#}
|
||||
|
||||
if($users_dms->{c_id4trans} && $users_dms->{tpl_id4trans} && $users_dms->{kind_of_trans}){
|
||||
my $table = "contenttrans";
|
||||
|
@ -89,8 +89,7 @@ sub tpl(){
|
|||
$offset += $limit;
|
||||
}
|
||||
my $ctrel = $db->get_ctrel($table,"",$lang,"",$users_dms->{c_id4trans},$users_dms->{tpl_id4trans});
|
||||
my $uri = "/$users_dms->{fullurl}/$users_dms->{kind_of_trans}";
|
||||
print $q->div({-id=>'Headerlogin',-style=>"background-color:$varenv->{term_active_color};"},$q->a({-class=>'elinkbutton1',-title=>"$users_dms->{kind_of_trans} Terminal öffnen",-href=>"$uri?ct_trans=open\&c_id4trans=$users_dms->{c_id4trans}\&tpl_id4trans=$users_dms->{tpl_id4trans}\&kind_of_trans=$users_dms->{kind_of_trans}\&owner=$users_dms->{owner}\&offset=$offset\&limit=$limit\&relids=$R::relids\&no_redirect=1"}," $users_dms->{kind_of_trans} \#$ctrel->{ct_name} $ctrel->{txt01}", $q->span({-id=>"c_id4trans", -style=>"color:$varenv->{term_active_color}"}, "$users_dms->{c_id4trans}"))) if($ctrel->{ct_name});
|
||||
print $q->div({-id=>'Headerlogin',-style=>"background-color:$varenv->{term_active_color};"},$q->a({-class=>'elinkbutton1',-title=>"Faktura Terminal öffnen",-href=>"$varenv->{wwwhost}/DMS/Faktura?ct_trans=open\&c_id4trans=$users_dms->{c_id4trans}\&tpl_id4trans=$users_dms->{tpl_id4trans}\&kind_of_trans=$users_dms->{kind_of_trans}\&owner=$users_dms->{owner}\&offset=$offset\&limit=$limit\&relids=$R::relids\&no_redirect=1"}," $users_dms->{kind_of_trans} \#$ctrel->{ct_name} $ctrel->{txt01}", $q->span({-id=>"c_id4trans", -style=>"color:$varenv->{term_active_color}"}, "$users_dms->{c_id4trans}"))) if($ctrel->{ct_name});
|
||||
}
|
||||
|
||||
print $q->div({-id=>'Headerlogin'},"$users_sharee->{txt08} ", $q->span({-id=>"owner", -style=>"color:silver"}, "($users_dms->{u_id})")),"\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue