mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
Faktura table-sum option. pdf print only after book payment
This commit is contained in:
parent
7ce6cb6230
commit
eac5a10050
8 changed files with 75 additions and 38 deletions
|
@ -79,7 +79,7 @@ sub loop_sharees {
|
||||||
#every sharee client must have a merchant_id which associate a project
|
#every sharee client must have a merchant_id which associate a project
|
||||||
#if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $op_name->{project}))){
|
#if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $op_name->{project}))){
|
||||||
|
|
||||||
#TODO, to reduce request time by ($return_merchant->{project_id} eq "Freiburg") do it only for shareeweb-sharee.copri.eu
|
#to reduce request time by ($return_merchant->{project_id} eq "Freiburg") we do it only for shareeweb-sharee.copri.eu
|
||||||
if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || $return_merchant->{project_id} eq "Freiburg" || ($return_merchant->{project_id} eq $op_name->{project}))){
|
if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || $return_merchant->{project_id} eq "Freiburg" || ($return_merchant->{project_id} eq $op_name->{project}))){
|
||||||
|
|
||||||
#$bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $op_name->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $op_name->{project} || $users_serviceapp->{u_id} > 0)\n","","");
|
#$bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $op_name->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $op_name->{project} || $users_serviceapp->{u_id} > 0)\n","","");
|
||||||
|
@ -105,6 +105,11 @@ sub loop_sharees {
|
||||||
if($q->param('request') && $q->param('request') =~ /stations_all|stations_available/){
|
if($q->param('request') && $q->param('request') =~ /stations_all|stations_available/){
|
||||||
foreach my $result (keys (%{ $response_in->{shareejson}->{stations} })) {
|
foreach my $result (keys (%{ $response_in->{shareejson}->{stations} })) {
|
||||||
$fetch_hash->{$result} = $response_in->{shareejson}->{stations}->{$result};
|
$fetch_hash->{$result} = $response_in->{shareejson}->{stations}->{$result};
|
||||||
|
#workaround, delete contributor test stations on global sharee project Freiburg
|
||||||
|
if($return_merchant->{project_id} eq "Freiburg" && $return_merchant->{project_id} ne $op_name->{project} && $fetch_hash->{$result}->{description} =~ /Contributor/i){
|
||||||
|
#$bw->log("delete contributor-station $result: $fetch_hash->{$result}->{description}","","");
|
||||||
|
delete $fetch_hash->{$result};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($q->param('request') && $q->param('request') =~ /bikes_all|bikes_available/){
|
if($q->param('request') && $q->param('request') =~ /bikes_all|bikes_available/){
|
||||||
|
|
|
@ -407,12 +407,12 @@ td {
|
||||||
$mandat_nr = " Mandatsreferenz: $ctt->{txt26}" if($ctt->{txt26} =~ /\w{2}-/);
|
$mandat_nr = " Mandatsreferenz: $ctt->{txt26}" if($ctt->{txt26} =~ /\w{2}-/);
|
||||||
|
|
||||||
my $invoice_time = $ctt->{invoice_time} || $ctt->{mtime};
|
my $invoice_time = $ctt->{invoice_time} || $ctt->{mtime};
|
||||||
my $update_ctt = {
|
#my $update_ctt = {
|
||||||
table => "contenttrans",
|
# table => "contenttrans",
|
||||||
pay_time => "$invoice_time",
|
# pay_time => "$invoice_time",
|
||||||
};
|
# };
|
||||||
#necersarry for non payone capture
|
#necersarry for non payone capture
|
||||||
$dbt->update_record($dbh,$update_ctt,$ctt) if(!$ctt->{pay_time});
|
#$dbt->update_record($dbh,$update_ctt,$ctt) if(!$ctt->{pay_time});
|
||||||
my $mtime = $lb->time4de("$invoice_time","");
|
my $mtime = $lb->time4de("$invoice_time","");
|
||||||
|
|
||||||
my $position = "";
|
my $position = "";
|
||||||
|
|
|
@ -58,9 +58,16 @@ sub handler {
|
||||||
}
|
}
|
||||||
print FILE "$_: $valxx\n" if($debug);
|
print FILE "$_: $valxx\n" if($debug);
|
||||||
}
|
}
|
||||||
|
if($table eq "users" && $R::faksum){
|
||||||
|
my $update_users = {
|
||||||
if($table eq "content"){
|
table => "users",
|
||||||
|
u_id => $users_dms->{u_id},
|
||||||
|
change => "no_time",
|
||||||
|
};
|
||||||
|
my $toggle = 1;
|
||||||
|
$toggle = 0 if($users_dms->{faksum});
|
||||||
|
$dbt->update_one($dbh,$update_users,"faksum=$toggle");
|
||||||
|
}elsif($table eq "content"){
|
||||||
my $sth = $db->search_json("$table","$lang","$search","$main_id");
|
my $sth = $db->search_json("$table","$lang","$search","$main_id");
|
||||||
while ( my $row = $sth->fetchrow_hashref ){
|
while ( my $row = $sth->fetchrow_hashref ){
|
||||||
push @query_output, $row;
|
push @query_output, $row;
|
||||||
|
|
|
@ -9,6 +9,7 @@ use warnings;
|
||||||
use CGI;
|
use CGI;
|
||||||
use CGI::Carp qw(fatalsToBrowser);
|
use CGI::Carp qw(fatalsToBrowser);
|
||||||
use CGI ':standard';
|
use CGI ':standard';
|
||||||
|
use Scalar::Util qw(looks_like_number);
|
||||||
use Lib::Config;
|
use Lib::Config;
|
||||||
use Mod::Buttons;
|
use Mod::Buttons;
|
||||||
use Mod::Libenz;
|
use Mod::Libenz;
|
||||||
|
@ -164,13 +165,13 @@ EOF
|
||||||
|
|
||||||
print "</span>\n";
|
print "</span>\n";
|
||||||
|
|
||||||
if(!$ctt->{int01} || $ctt->{ct_name} =~ /-/){
|
if(!looks_like_number($ctt->{int01}) || $ctt->{ct_name} =~ /-/){
|
||||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")," $buchen_users->{txt01} / $invoice_time ", $but->singlesubmit7("ct_trans","remove_chk4rel","$ib{remove_chk4rel}","")),"\n";
|
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, " $buchen_users->{txt01} / $invoice_time ", $but->singlesubmit7("ct_trans","remove_chk4rel","$ib{remove_chk4rel}","")),"\n";
|
||||||
print $q->hidden(-name=>'c_id', -override=>'1', -value=>"$ctt->{content_id}");
|
print $q->hidden(-name=>'c_id', -override=>'1', -value=>"$ctt->{content_id}");
|
||||||
print $q->hidden(-name=>'template_id', -override=>'1', -value=>"$ctt->{template_id}");
|
print $q->hidden(-name=>'template_id', -override=>'1', -value=>"$ctt->{template_id}");
|
||||||
print $q->hidden(-name=>'main_id', -override=>'1', -value=>"$ctt->{main_id}");
|
print $q->hidden(-name=>'main_id', -override=>'1', -value=>"$ctt->{main_id}");
|
||||||
print $q->hidden(-name=>'rel_id', -override=>'1', -value=>"$ctt->{rel_id}");
|
print $q->hidden(-name=>'rel_id', -override=>'1', -value=>"$ctt->{rel_id}");
|
||||||
}else{
|
}elsif(looks_like_number($ctt->{int01})){
|
||||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")," $buchen_users->{txt01} / $invoice_time "),"\n";
|
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")," $buchen_users->{txt01} / $invoice_time "),"\n";
|
||||||
}
|
}
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
|
|
|
@ -331,6 +331,23 @@ sub tpl(){
|
||||||
$q->a({-class=>"linknav",-style=>"padding:0 0.5em;",-title=>"Monat vorwärts",-href=>"?cal_delta_start=0:1:0"}," → "),
|
$q->a({-class=>"linknav",-style=>"padding:0 0.5em;",-title=>"Monat vorwärts",-href=>"?cal_delta_start=0:1:0"}," → "),
|
||||||
"$message"
|
"$message"
|
||||||
)),"\n";
|
)),"\n";
|
||||||
|
}elsif($node_meta->{template_id} =~ /209|218/){
|
||||||
|
print<<EOF
|
||||||
|
<script>
|
||||||
|
function postave(val) {
|
||||||
|
jQuery.ajax({
|
||||||
|
url: "/ajax_json",
|
||||||
|
data: { 'table':'users','faksum':val },
|
||||||
|
type: 'POST',
|
||||||
|
});
|
||||||
|
//console.log('faksum '+ val);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
EOF
|
||||||
|
;
|
||||||
|
my $checked = 0;
|
||||||
|
$checked = 1 if($users_dms->{faksum});
|
||||||
|
print $q->div({-class=>"copri_header",-style=>"background-color:$node_meta->{bg_color};"},"$path $redirect | ",$q->checkbox(-name=>" ∑ sum ", -title=>'Faktura Positionen summieren ∑ — kostet Zeit', -onclick=>"postave(1)", -checked=>"$checked"),$q->span({-style=>"$header_style"},"$message"));
|
||||||
}else{
|
}else{
|
||||||
print $q->div({-class=>"copri_header",-style=>"background-color:$node_meta->{bg_color};"},"$path $redirect",$q->span({-style=>"$header_style"},"$message"));
|
print $q->div({-class=>"copri_header",-style=>"background-color:$node_meta->{bg_color};"},"$path $redirect",$q->span({-style=>"$header_style"},"$message"));
|
||||||
}
|
}
|
||||||
|
@ -423,10 +440,10 @@ sub tpl(){
|
||||||
}
|
}
|
||||||
|
|
||||||
#it will takes only one dataset
|
#it will takes only one dataset
|
||||||
if($node_meta->{ct_table} eq "contenttrans" && $c_id4trans && $c_id4trans =~ /^\d+$/){
|
#if($node_meta->{ct_table} eq "contenttrans" && $c_id4trans && $c_id4trans =~ /^\d+$/){
|
||||||
$ct4rel = $db->collect_cid($table,$lang,$tplids,$R::rel_id,$R::barcode,"c_id",$c_id4trans);
|
# $ct4rel = $db->collect_cid($table,$lang,$tplids,$R::rel_id,$R::barcode,"c_id",$c_id4trans);
|
||||||
}
|
#}els
|
||||||
elsif(!$start_chck && !$end_chck){
|
if(!$start_chck && !$end_chck){
|
||||||
|
|
||||||
#collect search keys
|
#collect search keys
|
||||||
foreach my $postkey (@keywords){
|
foreach my $postkey (@keywords){
|
||||||
|
@ -523,7 +540,8 @@ sub tpl(){
|
||||||
}else{
|
}else{
|
||||||
print $q->a({-class=>'elinkbutton',-style=>'margin:0 0 2px 20px;', -href=>'?accounting_select=1'},"1. Einzüge selektieren"),"\n";
|
print $q->a({-class=>'elinkbutton',-style=>'margin:0 0 2px 20px;', -href=>'?accounting_select=1'},"1. Einzüge selektieren"),"\n";
|
||||||
}
|
}
|
||||||
print "$months[$mon -1] $year\n";
|
print "<b>$months[$mon -1] $year</b>\n";
|
||||||
|
print " (1. selektiert Rechnungen mit Payone Einzug & kein OPOS & kein Storno & keine interne Bemerkung, alle anderen bitte manuell überprüfen und falls i.O. selektieren)\n";
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
}
|
}
|
||||||
print $q->hidden(-name=>'mandant_main_id', -value=>"$dbt->{shareedms_conf}->{parent_id}"),"\n";
|
print $q->hidden(-name=>'mandant_main_id', -value=>"$dbt->{shareedms_conf}->{parent_id}"),"\n";
|
||||||
|
@ -695,7 +713,7 @@ sub tpl(){
|
||||||
$val = "<b>$val</b>" if($key eq $users_dms->{col_sort});
|
$val = "<b>$val</b>" if($key eq $users_dms->{col_sort});
|
||||||
if($key =~ /byte|txt|time|node|int|time\d+|save|state|owner|c_id|ct_name|barcode|sort|public/){
|
if($key =~ /byte|txt|time|node|int|time\d+|save|state|owner|c_id|ct_name|barcode|sort|public/){
|
||||||
$i++;
|
$i++;
|
||||||
print $q->th($q->a({-class=>"sortnav",-href=>"?col_sort=$key\&offset=$searchref->{offset}\&limit=$searchref->{limit}",-title=>"$sort_title"},"$val")),"\n";
|
print $q->th({-nowrap=>1},$q->a({-class=>"sortnav",-href=>"?col_sort=$key\&offset=$searchref->{offset}\&limit=$searchref->{limit}",-title=>"$sort_title"},"$val")),"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -739,7 +757,7 @@ sub tpl(){
|
||||||
my $pricing = {};
|
my $pricing = {};
|
||||||
my $counting = {};
|
my $counting = {};
|
||||||
#pre-sum only if client invoice
|
#pre-sum only if client invoice
|
||||||
if($ct4rel->{$id}->{template_id} == 218 && $ct4rel->{$id}->{int10} != 2){
|
if($ct4rel->{$id}->{template_id} == 218 && $ct4rel->{$id}->{int10} != 2 && $users_dms->{faksum} == 1){
|
||||||
foreach my $cpid (keys (%$ct4rel_parts)){
|
foreach my $cpid (keys (%$ct4rel_parts)){
|
||||||
if($ct4rel->{$id}->{c_id} == $ct4rel_parts->{$cpid}->{ct_id}){
|
if($ct4rel->{$id}->{c_id} == $ct4rel_parts->{$cpid}->{ct_id}){
|
||||||
|
|
||||||
|
@ -972,10 +990,15 @@ sub tpl(){
|
||||||
if($ct4rel->{$id}->{state} eq "Kassenbestand"){
|
if($ct4rel->{$id}->{state} eq "Kassenbestand"){
|
||||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
||||||
}else{
|
}else{
|
||||||
my $betrag = $ct4rel->{$id}->{$key} || "∑ $sum_pos";# pre counting
|
my $betrag = "";
|
||||||
|
if($ct4rel->{$id}->{$key}){
|
||||||
|
$betrag = $ct4rel->{$id}->{$key};
|
||||||
|
}elsif($users_dms->{faksum}){
|
||||||
|
$betrag = "∑ $sum_pos";
|
||||||
|
}
|
||||||
$betrag = $ct4rel->{$id}->{$key} if($v_journal);
|
$betrag = $ct4rel->{$id}->{$key} if($v_journal);
|
||||||
$betrag =~ s/\./,/;
|
$betrag =~ s/\./,/;
|
||||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},"$betrag"),"\n";
|
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style",-nowrap=>1},"$betrag"),"\n";
|
||||||
}
|
}
|
||||||
}elsif($key =~ /int02/ && $ct4rel->{$id}->{state} eq "Tagesabschluss"){
|
}elsif($key =~ /int02/ && $ct4rel->{$id}->{state} eq "Tagesabschluss"){
|
||||||
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
print $q->td({-class=>'tdint',-style=>"$txtstyle $set_style"},""),"\n";
|
||||||
|
|
|
@ -147,7 +147,9 @@ sub tpl(){
|
||||||
$i++;
|
$i++;
|
||||||
$line_count2++;
|
$line_count2++;
|
||||||
if($i==1){
|
if($i==1){
|
||||||
if($cttpos->{$id}->{pay_time} =~ /(\d+)\-(\d+)\-(\d+)/){
|
#pay_time only if payone capture, else invoice_time
|
||||||
|
my $pitime = $cttpos->{$id}->{pay_time} || $cttpos->{$id}->{invoice_time};
|
||||||
|
if($pitime && $pitime =~ /(\d+)\-(\d+)\-(\d+)/){
|
||||||
my $year = $1;
|
my $year = $1;
|
||||||
my $month = $2;
|
my $month = $2;
|
||||||
my $days4month = Days_in_Month($year,$month);
|
my $days4month = Days_in_Month($year,$month);
|
||||||
|
@ -342,11 +344,13 @@ sub tpl(){
|
||||||
if(!$ctt->{close_time}){
|
if(!$ctt->{close_time}){
|
||||||
my $send_invoice_checkbox = 0;
|
my $send_invoice_checkbox = 0;
|
||||||
#$send_invoice_checkbox = 0 if($ctt->{txt30});
|
#$send_invoice_checkbox = 0 if($ctt->{txt30});
|
||||||
print $q->div({-class=>'element6',-style=>'float:right;'},
|
print $q->div({-class=>'element6',-style=>'float:right;'}, $q->b("$ctt->{txt00}"),
|
||||||
"buchen incl. drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""),
|
" PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""),
|
||||||
" eMail Versand ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""),
|
" eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""),
|
||||||
$but->singlesubmit1("set_state","buchen"),
|
" Zahlungsart ",
|
||||||
$but->selector("state","250px",$kind_of_payment,@_paymentstate)),"\n";
|
$but->selector("state","250px",$kind_of_payment,@_paymentstate),
|
||||||
|
$but->singlesubmit1("set_state","buchen")),
|
||||||
|
"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -547,7 +547,7 @@ EOF
|
||||||
|
|
||||||
if($ctt->{state} && $ctt->{int01}){
|
if($ctt->{state} && $ctt->{int01}){
|
||||||
$kind_of_payment = "$ctt->{state}";
|
$kind_of_payment = "$ctt->{state}";
|
||||||
}elsif($ctt->{int06} && $ctt->{int06} >= 3){
|
}elsif($ctt->{int06} && $ctt->{int06} >= 3 || $ctt->{ct_name} =~ /\d-\d/){
|
||||||
#default to Überw.
|
#default to Überw.
|
||||||
$kind_of_payment = "$_paymentstate[2]";
|
$kind_of_payment = "$_paymentstate[2]";
|
||||||
}
|
}
|
||||||
|
@ -563,11 +563,13 @@ EOF
|
||||||
if(!$ctt->{close_time}){
|
if(!$ctt->{close_time}){
|
||||||
my $send_invoice_checkbox = 1;
|
my $send_invoice_checkbox = 1;
|
||||||
$send_invoice_checkbox = 0 if($ctt->{txt30} || $ctt->{ct_name} =~ /\d-\d/);
|
$send_invoice_checkbox = 0 if($ctt->{txt30} || $ctt->{ct_name} =~ /\d-\d/);
|
||||||
print $q->div({-class=>'element6',-style=>'float:right;'},
|
print $q->div({-class=>'element6',-style=>'float:right;'}, $q->b("$ctt->{txt00}"),
|
||||||
"buchen incl. drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""),
|
" PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""),
|
||||||
" eMail Versand ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""),
|
" eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""),
|
||||||
$but->singlesubmit1("set_state","buchen"),
|
" Zahlungart ",
|
||||||
$but->selector("state","250px",$kind_of_payment,@_paymentstate)),"\n";
|
$but->selector("state","250px",$kind_of_payment,@_paymentstate),
|
||||||
|
$but->singlesubmit1("set_state","buchen")),
|
||||||
|
"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#disabled 2022-11-23, needs more testing. Add +10.- on preauth
|
#disabled 2022-11-23, needs more testing. Add +10.- on preauth
|
||||||
|
|
|
@ -72,11 +72,6 @@ sub tpl(){
|
||||||
print "<div style='position:fixed;z-index:10;left:0px;width:100%;height:24px;background-color:#5c5c5c;'>\n";
|
print "<div style='position:fixed;z-index:10;left:0px;width:100%;height:24px;background-color:#5c5c5c;'>\n";
|
||||||
print "<div style='position:fixed;z-index:10;right:0px;'>\n";
|
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($users_dms->{c_id4trans} && $users_dms->{tpl_id4trans}){
|
if($users_dms->{c_id4trans} && $users_dms->{tpl_id4trans}){
|
||||||
my $table = "contenttrans";
|
my $table = "contenttrans";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue