mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
storno fix
This commit is contained in:
parent
899cb605f7
commit
009025103f
4 changed files with 11 additions and 16 deletions
|
@ -1388,9 +1388,9 @@ 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,txt12,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,int29,int34,txt22,txt11,int35,int36,int37,int42,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}','$prefix',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->{txt18}','$ct->{int20}','$trackon','$bike_type_id','$staff','$sig_book->{bikeId}','$sig_book->{rentalId}','$unit_price1','$unit_price2','$start_price','$aa_station','$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,txt12,itime,start_time,end_time,int01,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt17,txt18,int20,int25,int29,int34,txt22,txt11,int35,int36,int37,int42,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}','$prefix',now(),now(),'$endRental','1','$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->{txt18}','$ct->{int20}','$trackon','$bike_type_id','$staff','$sig_book->{bikeId}','$sig_book->{rentalId}','$unit_price1','$unit_price2','$start_price','$aa_station','$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_price','1','$ct->{txt01}','$ct->{txt06}','$ct->{txt07}','0','$from_main_id','$owner') RETURNING c_id");
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int01,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(),'1','$unit_price','1','$ct->{txt01}','$ct->{txt06}','$ct->{txt07}','0','$from_main_id','$owner') RETURNING c_id");
|
||||
}
|
||||
my $rows = $sth->execute();
|
||||
my $last_id;
|
||||
|
|
|
@ -295,8 +295,10 @@ sub set_workflow {
|
|||
if($c_idnew > 0){
|
||||
my ($cttpos,$rows) = $db->collect_contentpos("contenttrans",$c_id);
|
||||
foreach my $id (sort { lc($cttpos->{$a}->{sort}) cmp lc($cttpos->{$b}->{sort}) } keys(%$cttpos)){
|
||||
$cttpos->{$id}->{int02} = $cttpos->{$id}->{int02} * -1 if($cttpos->{$id}->{int02} != 0);
|
||||
$cttpos->{$id}->{int07} = $cttpos->{$id}->{int07} * -1 if($cttpos->{$id}->{int07} != 0 && $cttpos->{$id}->{int08} == 1);#if Rabatt int08 != 1 alias €;
|
||||
#reverse pos sum for example by Storno
|
||||
$cttpos->{$id}->{int01} = $cttpos->{$id}->{int01} * -1 if($cttpos->{$id}->{int01} != 0);
|
||||
#$cttpos->{$id}->{int02} = $cttpos->{$id}->{int02} * -1 if($cttpos->{$id}->{int02} != 0);
|
||||
#$cttpos->{$id}->{int07} = $cttpos->{$id}->{int07} * -1 if($cttpos->{$id}->{int07} != 0 && $cttpos->{$id}->{int08} == 1);#if Rabatt int08 != 1 alias €;
|
||||
|
||||
delete $cttpos->{$id}->{c_id};
|
||||
delete $cttpos->{$id}->{ct_id};
|
||||
|
|
|
@ -55,12 +55,11 @@ sub only_first_free(){
|
|||
table => "contenttrans",
|
||||
table_pos => "contenttranspos",
|
||||
fetch => "one",
|
||||
template_id => "218",#Faktura tpl_id
|
||||
ca_id => "=::$ctpos->{ca_id}",
|
||||
ct_id => "=::$ctpos->{ct_id}",
|
||||
c_id => "!=::$ctpos->{c_id}",
|
||||
#txt10 => "IN::('available','canceled')",
|
||||
int10 => "IN::('1','6')",
|
||||
"ct.close_time" => "is::null",
|
||||
};
|
||||
$pref = { %$pref, time_range => "cp.start_time >= '$ctpos->{start_time}' and cp.start_time < '$ctpos->{end_time}' and cp.start_time != cp.end_time" };
|
||||
|
||||
|
@ -246,6 +245,7 @@ sub counting_rental {
|
|||
}
|
||||
|
||||
$total_price = sprintf('%.2f', $total_price);
|
||||
$total_price = $total_price * $ctpos->{int01} if($ctpos->{int01});
|
||||
|
||||
$return->{start_time} = "$ctpos->{start_time}";
|
||||
$return->{end_time} = "$computed_end_time";
|
||||
|
|
|
@ -463,6 +463,8 @@ EOF
|
|||
|
||||
}else{
|
||||
my ($key,$des,$size,$postdes) = split /=/,$_;
|
||||
my $w = $size . "em";
|
||||
$w = "15em" if($size eq "readonly");
|
||||
my $seldes = $des;
|
||||
$des .= " ($key)" if($users_dms->{u_id} eq $varenv{superu_id});
|
||||
|
||||
|
@ -471,7 +473,7 @@ EOF
|
|||
if($key =~ /c_id|ct_name|barcode|txt/ && $size eq "readonly"){
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||
print $q->td({-class=>'content1_cms',-colspan=>2},$q->textfield(-class=>'etxt', -style=>"color:grey;",-name=>"$key", -default=>"$ctrel->{$key}", -readonly=>1)),"\n";
|
||||
print $q->td({-class=>'content1_cms',-colspan=>2},$q->textfield(-class=>'etxt', -style=>"width:$w;color:grey;",-name=>"$key", -default=>"$ctrel->{$key}", -readonly=>1)),"\n";
|
||||
}elsif($key eq "u_id" && $size eq "readonly"){
|
||||
my $adref = {
|
||||
table => "contentadr",
|
||||
|
@ -497,7 +499,6 @@ EOF
|
|||
if(($node_meta->{ct_table} eq "content") && ($tpl->{tpl_order} =~ /barcode/) && ("$ct_name" eq "$ctrel->{barcode}")){
|
||||
$ct_name = "";
|
||||
}
|
||||
my $w = $size . "em";
|
||||
my $oprefix = "";
|
||||
$oprefix = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}-" if($node_meta->{tpl_id} == 224 || $node_meta->{tpl_id} == 228);
|
||||
print $q->Tr();
|
||||
|
@ -505,7 +506,6 @@ EOF
|
|||
print $q->td({-class=>'content1_cms',-colspan=>2}, "$oprefix", $q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1',-default=>"$ct_name"),$postdes),"\n";
|
||||
}
|
||||
elsif($key eq "barcode"){
|
||||
my $w = $size . "em";
|
||||
my $oprefix = "";
|
||||
$oprefix = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}" if($node_meta->{tpl_id} == 205);
|
||||
print $q->Tr();
|
||||
|
@ -543,7 +543,6 @@ EOF
|
|||
print $q->hidden(-name=>"$key",-override=>1,-value=>"null");
|
||||
}
|
||||
elsif($key eq "int04"){
|
||||
my $w = $size . "em";
|
||||
my $oprefix = "";
|
||||
$oprefix = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}" if($node_meta->{tpl_id} == 225 || $node_meta->{tpl_id} == 205);
|
||||
print $q->Tr();
|
||||
|
@ -628,7 +627,6 @@ EOF
|
|||
# print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize",$ctrel->{$key},@_valxx));
|
||||
#}
|
||||
elsif($key =~ /int/){
|
||||
my $w = $size . "em";
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||
print $q->td({-class=>'content1_cms',-colspan=>2},$q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1', -default=>"$ctrel->{$key}"), $postdes),"\n";
|
||||
|
@ -761,7 +759,6 @@ EOF
|
|||
#nothing txt02=Datei aktiv=10=sharee-APP aktivierte Dokument
|
||||
}
|
||||
elsif($key =~ /txt15/ && $varenv{syshost} =~ /sharee/ && $node_meta->{tpl_id} == 202){
|
||||
my $w = $size . "em";
|
||||
my $record_bonus = {c_id => 0};
|
||||
my $pref_cc = {
|
||||
table => "content",
|
||||
|
@ -788,14 +785,12 @@ EOF
|
|||
#Operators or Operators Antrag
|
||||
elsif($key =~ /txt17|txt19/){
|
||||
if($varenv{dbname} eq "sharee_primary"){
|
||||
my $w = $size . "em";
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||
print $q->td({-class=>'content1_cms',-colspan=>'2'},$q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1', -default=>"$ctrel->{$key}"), $postdes),"\n";
|
||||
}
|
||||
}
|
||||
elsif($key =~ /txt/){
|
||||
my $w = $size . "em";
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||
print $q->td({-class=>'content1_cms',-colspan=>'2'},$q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1', -default=>"$ctrel->{$key}"), $postdes),"\n";
|
||||
|
@ -803,13 +798,11 @@ EOF
|
|||
elsif($key =~ /byte/){
|
||||
my $K_int = unpack "H*", $ctrel->{$key};
|
||||
#$K_int =~ s/(.)/sprintf( "%x", ord($1))/eg;
|
||||
my $w = $size . "em";
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'left_italic_cms',-colspan=>1},"$des"),"\n";
|
||||
print $q->td({-class=>'content1_cms',-colspan=>'2'},$q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1', -default=>"$K_int"), $postdes),"\n";
|
||||
}
|
||||
elsif($key =~ /time\d+/){
|
||||
my $w = $size . "em";
|
||||
$ctrel->{$key} =~ s/:00$//;
|
||||
print $q->Tr();
|
||||
print $q->td({-class=>'left_italic_cms',-colspan=>1},"$des"),"\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue