From 087fe3da9ce7b077af826f3684dbde3621e67ee0 Mon Sep 17 00:00:00 2001 From: ragu Date: Tue, 21 Jun 2022 20:47:15 +0200 Subject: [PATCH] sig rental fix --- copri4/main/src/Mod/APIsigclient.pm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/copri4/main/src/Mod/APIsigclient.pm b/copri4/main/src/Mod/APIsigclient.pm index 17326d3..2ea8beb 100755 --- a/copri4/main/src/Mod/APIsigclient.pm +++ b/copri4/main/src/Mod/APIsigclient.pm @@ -372,8 +372,16 @@ sub sig_booking { print FILE "<--- $now_dt failure sig_booking sig_post $todo , reset sig_book hash to empty\n"; } +my $posref = { + table => "contenttranspos", + fetch => "one", + ca_id => "$ctadr->{c_id}", + txt11 => "$sig_book->{rentalId}", + }; +my $ctpos2 = { c_id => 0 }; +$ctpos2 = $dbt->fetch_tablerecord($dbh,$posref) if(1==1); - if($ctpos->{c_id}){ + if($ctpos2->{c_id}){ my $rows = 0; my $update_pos = { table => "contenttranspos", @@ -384,7 +392,7 @@ sub sig_booking { table => "content", mtime => "now()", owner => "169", - c_id => $ctpos->{cc_id}, + c_id => $ctpos2->{cc_id}, }; #rentalId will be only on success! @@ -407,13 +415,13 @@ sub sig_booking { } #keep in mind, all other states will be done on REST, hopefully - $update_pos->{txt25} = "$ctpos->{txt25}\n$sig_book->{return_state}";# if($sig_book->{return_state}); - $rows = $dbt->update_record($dbh,$update_pos,$ctpos); - print FILE "<--- rows: $rows, update_pos: $ctpos->{c_id}, with:" . Dumper($update_pos) . "\n"; + $update_pos->{txt25} = "$ctpos2->{txt25}\n$sig_book->{return_state}";# if($sig_book->{return_state}); + $rows = $dbt->update_record($dbh,$update_pos,$ctpos2); + print FILE "<--- rows: $rows, update_pos: $ctpos2->{c_id}, with:" . Dumper($update_pos) . "\n"; - if($ctpos->{cc_id}){ + if($ctpos2->{cc_id}){ $rows = $dbt->update_record($dbh,$update_content,$update_content); - print FILE "<--- rows: $rows, update_content: $ctpos->{cc_id}, with:" . Dumper($update_content) . "\n"; + print FILE "<--- rows: $rows, update_content: $ctpos2->{cc_id}, with:" . Dumper($update_content) . "\n"; } }