mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
operator accounting Invoices
This commit is contained in:
parent
dd84259e6d
commit
819592a77d
14 changed files with 604 additions and 148 deletions
|
@ -645,23 +645,7 @@ sub service_update(){
|
|||
$update->{$key} = $q->escapeHTML($q->param('work_val'));
|
||||
}
|
||||
}
|
||||
}elsif(1==2){#TODO template key REST mapping
|
||||
my @keywords = $q->param;
|
||||
foreach (@tpl_order){
|
||||
my ($key,$val,$size,$interval) = split /=/,$_;
|
||||
foreach(@keywords){
|
||||
if($_ eq $key){
|
||||
#key validation will be done by update_record
|
||||
$update->{$_} = $q->escapeHTML($q->param($key));
|
||||
}
|
||||
}
|
||||
#unchecked checkbox doesn't deliver values. Thats the solution
|
||||
#disabled delete values at all. Test with json API conflicts because we disabled checkboxes
|
||||
#$update->{$key} = "null" if($key =~ /^int\d+$/ && $key !~ /^int04/ && !looks_like_number($update->{$key}));
|
||||
#$update->{$key} = "NaN" if($key =~ /^txt01$/ && !$update->{$key});#sepcial on TINK Service
|
||||
}
|
||||
}
|
||||
|
||||
my $rows = $dbt->update_record($dbh,$update,$record) if($record->{c_id} > 0);
|
||||
|
||||
return $rows;
|
||||
|
@ -689,7 +673,7 @@ sub bikestate_update(){
|
|||
if(ref($update_hash) eq "HASH" && looks_like_number($update_hash->{int04})){
|
||||
$update->{int04} = "$update_hash->{int04}";
|
||||
}
|
||||
$bw->log("check state on bikestate_update 1.",$update,"");
|
||||
$bw->log("bikestate_update bike to state c_id $c_id | $update->{int04} | $state | auth:$auth->{c_id}",$update,"");
|
||||
|
||||
my $record = { c_id => $c_id };
|
||||
my $rows = $dbt->update_record($dbh,$update,$record) if($record->{c_id} > 0);
|
||||
|
@ -1913,10 +1897,10 @@ sub bikes_available(){
|
|||
my $max_bars = 5;
|
||||
my $current_bars = 0;
|
||||
my $charge_view_hidden = 1;#1=hide charge view
|
||||
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);
|
||||
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /BVB|FR|KN/);
|
||||
my $backend_accessible = 1;
|
||||
#$backend_accessible = 0 if($record->{$id}->{int11} eq "2");#for asking user
|
||||
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);#for asking user
|
||||
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /BVB|FR|KN/);#for asking user
|
||||
$return->{$id}->{bike_type}->{battery}->{charge_max_bars} = "$max_bars";
|
||||
$return->{$id}->{bike_type}->{battery}->{charge_current_bars} = "$current_bars";
|
||||
$return->{$id}->{bike_type}->{battery}->{charge_current_percent} = "0";
|
||||
|
@ -2087,10 +2071,10 @@ sub bikes_all(){
|
|||
my $max_bars = 5;
|
||||
my $current_bars = 0;
|
||||
my $charge_view_hidden = 1;#1=hide charge view
|
||||
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);
|
||||
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /BVB|FR|KN/);
|
||||
my $backend_accessible = 1;#1=battery charge from backend, 0=asking user
|
||||
#$backend_accessible = 0 if($record->{$id}->{int11} eq "2");#for asking user
|
||||
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);#for asking user
|
||||
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /BVB|FR|KN/);#for asking user
|
||||
$return->{$id}->{bike_type}->{battery}->{charge_max_bars} = "$max_bars";
|
||||
$return->{$id}->{bike_type}->{battery}->{charge_current_bars} = "$current_bars";
|
||||
$return->{$id}->{bike_type}->{battery}->{charge_current_percent} = "0";
|
||||
|
|
|
@ -30,7 +30,6 @@ sub ibuttons(){
|
|||
'barcode' => 'Barcode Label drucken',
|
||||
'buchen' => 'buchen',
|
||||
'send_invoice_again' => 'senden',
|
||||
'order_state' => 'Auftragsstatus',
|
||||
'new_contenttver' => 'Neues Arbeitsprofil',
|
||||
'new_content' => 'NEUER Datensatz',
|
||||
'new_content_2' => 'Add New Optical Instrument',
|
||||
|
|
|
@ -531,6 +531,20 @@ sub select_worktime {
|
|||
return $record;
|
||||
}
|
||||
|
||||
#all accounting position of contenttrans
|
||||
sub collect_contenttrans(){
|
||||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $ct_id = shift || "";
|
||||
|
||||
my $sth = $dbh->prepare("SELECT * FROM contenttrans where int20 = $ct_id");
|
||||
my $rc = $sth->execute();
|
||||
my $cpos = $sth->fetchall_hashref("c_id");
|
||||
my $rows = $sth->rows;
|
||||
return ($cpos,$rows);
|
||||
}
|
||||
|
||||
|
||||
#all position of contenttrans
|
||||
sub collect_contentpos(){
|
||||
my $self = shift;
|
||||
|
|
|
@ -376,7 +376,8 @@ sub handler {
|
|||
if($R::ct_trans =~ /set_workflow2invoice|set_workflow2storno/){
|
||||
$return = $pl->set_workflow($users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
|
||||
}elsif($R::detail_search && $R::detail_search eq "operator_accounting"){
|
||||
$return = $pl->operator_accounting($users_dms,$users_sharee,$R::accounting_type,$R::ck4ex);
|
||||
my $ck4ex = "@R::ck4ex" || "";
|
||||
$return = $pl->operator_accounting($users_dms,$users_sharee,$R::accounting_type,$ck4ex);
|
||||
}else{
|
||||
$return .= "|";
|
||||
$return .= $pre->preinit($users_dms,$lang);#transactions logic
|
||||
|
|
|
@ -648,29 +648,31 @@ sub payone_capture(){
|
|||
int14 => 2,
|
||||
};
|
||||
|
||||
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
||||
|
||||
my $node_faktura = $dbt->get_node($dbh,$dbt->{shareedms_conf}->{faktura});
|
||||
my $node = $dbt->get_node($dbh,$main_id);#Rechnung node
|
||||
if($node->{invoice_nr} > 0){
|
||||
|
||||
if($node_faktura->{invoice_nr} > 0){
|
||||
if($ctt->{ct_name} !~ /\d/){
|
||||
my $nextNr = $node->{invoice_nr};
|
||||
my $nextNr = $node_faktura->{invoice_nr};
|
||||
$update_ctt->{ct_name} = "$nextNr";
|
||||
$update_ctt->{barcode} = "$nextNr";
|
||||
my $update_node = {
|
||||
table => "nodes",
|
||||
main_id => "$main_id",
|
||||
main_id => "$dbt->{shareedms_conf}->{faktura}",
|
||||
change => "no_time",
|
||||
};
|
||||
my $invoice_nr = $node->{invoice_nr} + 1;
|
||||
my $invoice_nr = $node_faktura->{invoice_nr} + 1;
|
||||
$dbt->update_one($dbh,$update_node,"invoice_nr='$invoice_nr'");
|
||||
}
|
||||
}else{
|
||||
$return_text = "payone_cron Payment.pm exit, $node->{invoice_nr} | $ctt->{ct_name} can not generate invoice number\n";
|
||||
$return_text = "payone_cron Payment.pm exit, $node_faktura->{invoice_nr} | $ctt->{ct_name} can not generate invoice number\n";
|
||||
return $return_text;
|
||||
}
|
||||
|
||||
my $state = $ctt->{state};
|
||||
if($varenv->{Zahlungsweise}){
|
||||
my @_paymentstate = split(/\|/,$varenv->{Zahlungsweise});
|
||||
if($dbt->{shareedms_conf}->{payment_state}){
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
if($ctadr->{int03} && $ctadr->{int03} == 1 && $ctadr->{ct_name} =~ /\w{2}-\d+/){
|
||||
$state = "$_paymentstate[0]";
|
||||
}else{
|
||||
|
|
|
@ -431,7 +431,7 @@ sub set_workflow {
|
|||
}
|
||||
$db->update_users4trans($c_idnew,"218","",$users_dms->{u_id});
|
||||
|
||||
my $uri_path = $dbt->recurse_node("",$node->{main_id});
|
||||
my $uri_path = $dbt->recurse_node($dbh,$node->{main_id});
|
||||
print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n";
|
||||
print redirect("$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows");
|
||||
exit 0;
|
||||
|
@ -518,7 +518,7 @@ sub new_relation {
|
|||
|
||||
close(FILE) if($debug);
|
||||
|
||||
my $uri_path = $dbt->recurse_node("",$new_main_id);
|
||||
my $uri_path = $dbt->recurse_node($dbh,$new_main_id);
|
||||
print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n";
|
||||
print redirect("$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows");
|
||||
exit 0;
|
||||
|
@ -606,7 +606,7 @@ sub save_relation {
|
|||
mkdir("$varenv{data}/$main_id-resize",0777);
|
||||
}
|
||||
}
|
||||
my $uri_path = $dbt->recurse_node("",$main_id);
|
||||
my $uri_path = $dbt->recurse_node($dbh,$main_id);
|
||||
print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n";
|
||||
print redirect("$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows");
|
||||
exit 0;
|
||||
|
@ -821,29 +821,55 @@ sub operator_accounting {
|
|||
my $ck4ex = shift || "";
|
||||
my $dbh = "";
|
||||
my %varenv = $cf->envonline();
|
||||
my $print_return = "";
|
||||
my $exit_code = 1;
|
||||
|
||||
my $ctt = {
|
||||
ct_name => "Abrechnung-123",
|
||||
txt00 => "Abrechnung",
|
||||
};
|
||||
my $praefix = "$ctt->{txt00}-$varenv{praefix}";
|
||||
open(FILE,">>$varenv{logdir}/operator_accounting.log") if($debug);
|
||||
print FILE "\n*--> $now_dt| accounting_type: $accounting_type | owner: $users_dms->{u_id}\n" if($debug);
|
||||
|
||||
print FILE "Invoice c_id's ck4ex: $ck4ex\n";
|
||||
|
||||
close FILE;
|
||||
|
||||
my $accounting_main_id = 300029;
|
||||
my $node_faktura = $dbt->get_node($dbh,$dbt->{shareedms_conf}->{faktura});
|
||||
my $node = $dbt->get_node($dbh,$accounting_main_id);
|
||||
|
||||
my $praefix = "$node->{node_name}-$varenv{praefix}";
|
||||
my $ret = "";
|
||||
my $auth = $users_sharee;#workaround, must be operator addr.
|
||||
my $c_idnew = "";
|
||||
|
||||
if($ck4ex){
|
||||
$c_idnew = $dbt->insert_contenttrans($dbh,$auth,$accounting_main_id,"208","----",$users_dms->{u_id});
|
||||
|
||||
if($c_idnew){
|
||||
$i_rows++;
|
||||
my $ctt = { c_id => $c_idnew };
|
||||
my $update_ctt = {
|
||||
table => "contenttrans",
|
||||
int12 => $node->{main_id},
|
||||
txt00 => $node->{node_name},
|
||||
mtime => "now()",
|
||||
owner => $users_dms->{u_id},
|
||||
};
|
||||
$dbt->update_record($dbh,$update_ctt,$ctt);
|
||||
|
||||
if(1==1){#TODO
|
||||
my $auth = $users_sharee;#workaround, must be operator addr.
|
||||
my $ct_id = $dbt->insert_contenttrans($dbh,$auth,$accounting_main_id,"208","----",$users_dms->{u_id});
|
||||
my $pref = {
|
||||
table => "contenttrans",
|
||||
fetch => "one",
|
||||
main_id => $accounting_main_id,
|
||||
template_id => 208,
|
||||
c_id => $ct_id
|
||||
c_id => $c_idnew,
|
||||
};
|
||||
$ctt = $dbt->fetch_record($dbh,$pref);
|
||||
$bw->log("operator_accounting used invoice c_id:",$ctt->{c_id},"");
|
||||
|
||||
$ck4ex =~ s/\s/,/g;
|
||||
$dbt->update_sql($dbh,"UPDATE contenttrans set int20='$ctt->{c_id}' where c_id IN ($ck4ex)");
|
||||
|
||||
|
||||
if(1==2){#should only be done on buchen
|
||||
my $print_return = "";
|
||||
my $exit_code = 1;
|
||||
my $psize="A4";
|
||||
my $wc_line=0;
|
||||
#$wc_line= $ctt->{int04};#Adresse.Tabelle
|
||||
|
@ -857,15 +883,26 @@ sub operator_accounting {
|
|||
print EMA "$now_dt\n$topdf --page-size $psize $varenv{wwwhost}/Printpreview?printer_id=operator_accounting\&mandant_main_id=$dbt->{shareedms_conf}->{parent_id}\&main_id=$accounting_main_id\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$ctt->{c_id}\&u_id=$users_dms->{u_id}\&wc=$wc_line $varenv{pdf}/$praefix-$ctt->{ct_name}.pdf\n $print_return\nfilesize: $filesize\nexit_code: $exit_code\n\n";
|
||||
close EMA;
|
||||
#exit 0;
|
||||
}
|
||||
|
||||
if( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf"){
|
||||
print "<script type=\"text/javascript\">window.open('$varenv{wwwhost}/pdf/$praefix-$ctt->{ct_name}.pdf');</script>";
|
||||
}else{
|
||||
return "failure::PDF konnte nicht generiert werden\n $varenv{wwwhost}/pdf/$praefix-$ctt->{ct_name}.pdf";
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
$db->update_users4trans($c_idnew,"208","",$users_dms->{u_id});
|
||||
}
|
||||
|
||||
my $uri_path = $dbt->recurse_node($dbh,$node->{main_id});
|
||||
print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n";
|
||||
print redirect("$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows");
|
||||
exit 0;
|
||||
|
||||
}else{
|
||||
$ret = "failure::Abbruch, es wurden keine Belege selektiert.";
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -114,7 +114,6 @@ sub preinit(){
|
|||
my $mandant_main_id = 100002;
|
||||
my $parent_trans = $db->get_node3("$mandant_main_id","Faktura","$lang") if($mandant_main_id);
|
||||
my $ctf = $db->get_content1("contentuser","$mandant_main_id");
|
||||
my $ctb = $db->get_content1("contentuser","$users_dms->{u_id}");
|
||||
|
||||
if(!$parent_trans->{main_id}){
|
||||
return "failure::Fehler<br /> keine eindeutige Modulzuweisung vorhanden.";
|
||||
|
@ -451,7 +450,7 @@ sub preinit(){
|
|||
$add_menge = - $ct_exist2->{$_} + $intxx if($op eq "+");
|
||||
my $rows = $db->update_content4comp("contenttranspos",$R::ct_name,$R::c_idpos,"$op","$add_menge","$R::kind_of_trans");
|
||||
if($rows){
|
||||
$u_rows += $db->update_content4comp("content",$R::ct_name,"$R::cc_id","-","$add_menge","$R::kind_of_trans","$ct_exist2->{txt12}") if(($R::kind_of_trans =~ /Faktur|Verleih/) && ($ctt->{txt00} !~ /Angebot|Kostenvoranschlag|Auftrag/) && ("$ctb->{txt02}" ne "aus"));
|
||||
$u_rows += $db->update_content4comp("content",$R::ct_name,"$R::cc_id","-","$add_menge","$R::kind_of_trans","$ct_exist2->{txt12}");
|
||||
}
|
||||
}else{
|
||||
$u_rows +=$db->updater("$table","c_id",$c_id,"$_","$valxx");
|
||||
|
@ -502,16 +501,10 @@ sub preinit(){
|
|||
$table = "contenttrans" if($ib_key =~ /delete_trans/);
|
||||
my $ctt = $db->get_content1("$table","$c_id4del");
|
||||
|
||||
if(($R::kind_of_trans =~ /Faktur|Verleih/) && ($ctt->{txt00} !~ /Angebot|Kostenvoranschlag|Auftrag|Storno/) && ("$ctb->{txt02}" ne "aus")){
|
||||
my ($cttpos,$rows) = $db->collect_contentpos("$table","$c_id4del");
|
||||
foreach my $id (sort { lc($cttpos->{$a}->{sort}) cmp lc($cttpos->{$b}->{sort}) } keys(%$cttpos)){
|
||||
$db->update_content4comp("content",$cttpos->{$id}->{ct_name},"$cttpos->{$id}->{cc_id}","+","$cttpos->{$id}->{int03}","$users_dms->{kind_of_trans}","$cttpos->{$id}->{txt12}");
|
||||
#my @packc_ids = split(/,/,$cttpos->{$id}->{txt05});
|
||||
#foreach(@packc_ids){
|
||||
# $db->update_content4comp("content","","$_","+","$cttpos->{$id}->{int03}","$R::kind_of_trans","$cttpos->{$id}->{txt12}");
|
||||
#}
|
||||
}
|
||||
}
|
||||
|
||||
$d_rows += $db->delete_content("$table","$c_id4del");
|
||||
$db->update_users4trans("0","0","",$users_dms->{u_id});
|
||||
|
@ -543,13 +536,7 @@ sub preinit(){
|
|||
$d_rows += $db->delete_content("$table","$pos_id");
|
||||
$db->users_up("ctpos_activ","0",$users_dms->{u_id}) if("$pos_id" eq "$users_dms->{ctpos_activ}");
|
||||
$ct_name = $1 if($R::ct_name =~ /^(\d+)/);
|
||||
if(($R::kind_of_trans =~ /Faktur|Verleih/) && ($ctt->{txt00} !~ /Angebot|Kostenvoranschlag|Auftrag/) && ("$ctb->{txt02}" ne "aus")){
|
||||
$u_rows += $db->update_content4comp("content",$ct_name,"$cttpos->{cc_id}","+","$cttpos->{int03}","$R::kind_of_trans","$cttpos->{txt12}");
|
||||
#my @packc_ids = split(/,/,$cttpos->{txt05});
|
||||
# foreach(@packc_ids){
|
||||
# $db->update_content4comp("content","","$_","+","$cttpos->{int03}","$R::kind_of_trans","$cttpos->{txt12}");
|
||||
# }
|
||||
}
|
||||
$u_rows += $db->update_content4comp("content",$ct_name,"$cttpos->{cc_id}","+","$cttpos->{int03}","$R::kind_of_trans","$cttpos->{txt12}");
|
||||
}
|
||||
###
|
||||
|
||||
|
@ -574,15 +561,11 @@ sub preinit(){
|
|||
my $ctt = { c_id => 0 };
|
||||
my $rel = $db->get_rel4tpl("",$lang,$users_dms->{c_id4trans},$users_dms->{tpl_id4trans});
|
||||
$ctt = $db->get_content1("contenttrans",$rel->{content_id});
|
||||
my ($node,$ct_exist);
|
||||
return "failure::Bitte erst einen Formular-Typ wählen" if($R::set_main_id <= "300000");
|
||||
$u_rows += $db->update_relation2("",$lang,$R::set_main_id,"",$rel->{rel_id}) if(!$R::close_time && $rel->{rel_id});
|
||||
#$node = $db->get_node4multi($R::set_main_id,$lang);
|
||||
$node = $dbt->get_node($dbh,$R::set_main_id);
|
||||
#if($node->{main_id} > 300000){
|
||||
# my $rows = $node->{int10} + 1;
|
||||
# $db->updater("nodes","main_id",$node->{main_id},"int10",$rows);
|
||||
#}
|
||||
|
||||
my $node_faktura = $dbt->get_node($dbh,$dbt->{shareedms_conf}->{faktura});
|
||||
my $node = $dbt->get_node($dbh,$R::set_main_id);
|
||||
|
||||
my $update_ctt = {
|
||||
table => "contenttrans",
|
||||
|
@ -590,36 +573,22 @@ sub preinit(){
|
|||
owner => $users_dms->{u_id},
|
||||
};
|
||||
|
||||
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
||||
if(($node->{invoice_nr} > 0) && ("$ctt->{ct_name}" !~ /\d/ || "$R::set_main_id" != "$rel->{main_id}")){
|
||||
if(($node_faktura->{invoice_nr} > 0) && ("$ctt->{ct_name}" !~ /\d/ || "$R::set_main_id" != "$rel->{main_id}")){
|
||||
|
||||
my $nextNr = $node->{invoice_nr};
|
||||
my $nextNr = $node_faktura->{invoice_nr};
|
||||
$update_ctt->{ct_name} = "$nextNr";
|
||||
$update_ctt->{barcode} = "$nextNr";
|
||||
my $update_node = {
|
||||
table => "nodes",
|
||||
main_id => "$R::set_main_id",
|
||||
main_id => "$dbt->{shareedms_conf}->{faktura}",
|
||||
change => "no_time",
|
||||
};
|
||||
my $invoice_nr = $node->{invoice_nr} + 1;
|
||||
my $invoice_nr = $node_faktura->{invoice_nr} + 1;
|
||||
$dbt->update_one($dbh,$update_node,"invoice_nr='$invoice_nr'");
|
||||
|
||||
|
||||
#}elsif($ctt->{ct_name} !~ /\d/){
|
||||
#$db->update_content4change($table,$c_id,$c_id,$c_id,"barcode") ;
|
||||
}
|
||||
|
||||
#Change Formular Type -----------------------------------------------
|
||||
#if("$R::set_main_id" != "$rel->{main_id}"){
|
||||
if(($R::ct_trans =~ /print_pdf|print/i) || ("$R::set_main_id" != "$rel->{main_id}")){
|
||||
my $table = "contenttrans";
|
||||
|
||||
$u_rows += $db->update_content4change($table,$c_id,"",$R::set_main_id,"int12");#zusätzl. Formtyp
|
||||
$db->update_content4change($table,$c_id,"",$node->{node_name},"txt00");#node_name
|
||||
$db->update_content4change($table,$c_id,"",$ctb->{txt06},"txt13") if($ctb->{txt06});#vendor name
|
||||
$db->update_content4change($table,$c_id,"","txt61,txt63","txt21") if($node->{node_name} =~ /Mietvertrag/);#Text-3
|
||||
$db->update_content4change($table,$c_id,"","txt64","txt21") if($node->{node_name} =~ /Rückgabe/);#Text-4
|
||||
$db->update_content4change($table,$c_id,"","$R::mtime_changed","mtime") if($today !~ /$R::mtime_changed/);#invoice date
|
||||
$update_ctt->{int12} = $node->{main_id};
|
||||
$update_ctt->{txt00} = $node->{node_name};
|
||||
$u_rows += $dbt->update_record($dbh,$update_ctt,$ctt);
|
||||
}
|
||||
|
||||
#SET state alias Zahlung buchen
|
||||
|
@ -634,7 +603,7 @@ sub preinit(){
|
|||
$update_ctt->{int01} = "$sum_paid";
|
||||
$update_ctt->{state} = "$state";
|
||||
$update_ctt->{int14} = 2 if($state =~ /payone/);#set OPOS
|
||||
$dbt->update_record($dbh,$update_ctt,$ctt);
|
||||
$u_rows += $dbt->update_record($dbh,$update_ctt,$ctt);
|
||||
|
||||
if($state =~ /payone/){
|
||||
my $ctadr = $db->get_content1("contentadr",$ctt->{int10});
|
||||
|
|
|
@ -341,9 +341,6 @@ sub save_account(){
|
|||
owner => "198",
|
||||
};
|
||||
my $c_id_op = $dbt->insert_contentoid($dbh_operator,$insert_op,"reset_adropkeys");
|
||||
if($bonus_record->{c_id} > 3){#means if not file greped with static kn c_id
|
||||
$dbt->update_content4comp($dbh_operator,$bonus_record->{c_id},"-","1");
|
||||
}
|
||||
|
||||
if($bonus_collect->{1}->{int22} && $bonus_collect->{2}->{int22} && $bonus_collect->{3}->{int22}){
|
||||
@txt30_op = ("$bonus_collect->{1}->{int22}","$bonus_collect->{2}->{int22}","$bonus_collect->{3}->{int22}");
|
||||
|
@ -364,8 +361,17 @@ sub save_account(){
|
|||
owner => $owner,
|
||||
ret => $ret,
|
||||
};
|
||||
$ctadr_operator = $dbt->fetch_record($dbh_operator,$authref);
|
||||
|
||||
print FILE "operator adr update preview with bonusnr:\n" . Dumper($adr_bonus) . "\n";
|
||||
$ret = $pl->set_usertarif($dbh,$operator_conf->{database}->{dbname},$adr_bonus,$bonus_collect);
|
||||
|
||||
#count down only if not file greped with static kn c_id and not still used
|
||||
print FILE "bonus_record update_content4comp by: $bonus_record->{c_id} > 3 && $bonus_record->{int03} > 0 && (!$ctadr_operator->{txt15} || $bonus_record->{ct_name} !~ /$ctadr_operator->{txt15}/i)\n";
|
||||
if($bonus_record->{c_id} > 3 && $bonus_record->{int03} > 0 && (!$ctadr_operator->{txt15} || $bonus_record->{ct_name} !~ /$ctadr_operator->{txt15}/i)){
|
||||
$dbt->update_content4comp($dbh_operator,$bonus_record->{c_id},"-","1");
|
||||
}
|
||||
|
||||
}else{
|
||||
$ret = "failure::txt15#top7";
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ use Mod::Libenz;
|
|||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
use Tpl::TransPositionen;
|
||||
use Tpl::TransInvoices;
|
||||
use Data::Dumper;
|
||||
|
||||
sub new {
|
||||
|
@ -37,10 +38,12 @@ sub tpl(){
|
|||
my $dbt = new DBtank;
|
||||
my $but = new Buttons;
|
||||
my $transp = new TransPositionen;
|
||||
my $trin = new TransInvoices;
|
||||
my %varenv = $cf->envonline();
|
||||
my $lang = "de";
|
||||
my %ib = $but->ibuttons();
|
||||
my $line_count1 = 0;
|
||||
my $line_count2 = 0;
|
||||
|
||||
#get Firma
|
||||
my $ctf = $db->get_content1("contentuser",$dbt->{shareedms_conf}->{parent_id});
|
||||
|
@ -273,7 +276,7 @@ EOF
|
|||
#$ctt = $ctx
|
||||
#$ctt will partly overwritten by contentadr if address changes
|
||||
my $pay_sequence = " | sequencenr: $ctt->{int18}" if($ctt->{int18});
|
||||
my @_paymentstate = split(/\|/,$varenv{Zahlungsweise});
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
my $kind_of_payment = "fehlt";
|
||||
$kind_of_payment = "$_paymentstate[0]" if($ctadr->{int03} == 1);
|
||||
$kind_of_payment = "$_paymentstate[1]" if($ctadr->{int03} == 2);
|
||||
|
@ -287,7 +290,7 @@ EOF
|
|||
print $q->td({-class=>'tdescr'},"Payone Saldo"),"\n";
|
||||
print $q->td({-class=>'tdval'},"$ctt->{int16} $pay_sequence"),"\n";
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdescr'},"Payone Reference"),"\n";
|
||||
print $q->td({-class=>'tdescr'},"Payone Referenz"),"\n";
|
||||
print $q->td({-class=>'tdval'},"$ctt->{txt25}"),"\n";
|
||||
|
||||
|
||||
|
@ -308,8 +311,12 @@ EOF
|
|||
###Content #Edit Parts
|
||||
print "<tr><td colspan='5' style='font-size:1em;'>\n";
|
||||
|
||||
#require "Tpl/TransPositionen.pm";
|
||||
my $line_count2 = $transp->tpl($node_meta,$users_dms,$set_main_id,$rel4tpl,$return);
|
||||
#operator invoices else position accounting
|
||||
if($node_meta->{tpl_id} == 208){
|
||||
$line_count2 = $trin->tpl($node_meta,$users_dms,$set_main_id,$rel4tpl,$return);
|
||||
}else{
|
||||
$line_count2 = $transp->tpl($node_meta,$users_dms,$set_main_id,$rel4tpl,$return);
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
###end Edit Parts
|
||||
|
@ -330,9 +337,9 @@ EOF
|
|||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdval4',-colspan=>"2"},$q->span({-style=>'font-weight:bold;'},"Internas und Bearbeitungstatus")),"\n";
|
||||
print $q->td({-class=>'tdval4',-colspan=>"2"},$q->span({-style=>'font-weight:bold;'},"PDF Formular Texte "),$q->span({-style=>'color:silver;font-weight:normal;'}," ( für den Kunden sichtbar )")),"\n";
|
||||
if($varenv{order_state}){
|
||||
if($dbt->{shareedms_conf}->{order_state}){
|
||||
print $q->Tr(),"\n";
|
||||
my @_orderstate = split(/\|/,$varenv{order_state});
|
||||
my @_orderstate = split(/\|/,$dbt->{shareedms_conf}->{order_state});
|
||||
print $q->td({-class=>'tdval4',-colspan=>2},$but->selector("txt22","180px",$ctt->{txt22},@_orderstate)),"\n";
|
||||
}
|
||||
$ctt->{txt23} = $q->unescapeHTML("$ctt->{txt23}") if($ctt->{txt23});
|
||||
|
|
|
@ -42,7 +42,7 @@ sub tpl(){
|
|||
my $pri = new Pricing;
|
||||
|
||||
my $lang = "de";
|
||||
my @tpl_order = ('c_id=ID=5=Datensatz ID (nur intern),date_time=Mietzeit','txt08=Name=15','int06=Start Station=5','int04=End Station=5','barcode=Bike Nr.=5','int12=Flotte=select','int10=Rental State=select','int20=Lock State=select','owner=User=select','txt23=Comment=15');
|
||||
my @tpl_order = ('c_id=ID=5=Datensatz ID (nur intern)','date_time=Mietzeit','txt08=Name=15','int06=Start Station=5','int04=End Station=5','barcode=Bike Nr.=5','int12=Flotte=select','int10=Rental State=select','int20=Lock State=select','owner=User=select','txt23=Comment=15');
|
||||
|
||||
my %varenv = $cf->envonline();
|
||||
my %ib = $but->ibuttons();
|
||||
|
@ -323,14 +323,13 @@ sub tpl(){
|
|||
my $stamm_style = "padding:0 5px;border: 2px solid #98c13b;";
|
||||
my $part_style = "padding:0 5px;border: 2px solid #dcd77f;";
|
||||
|
||||
my ($ct_name,$ct_txt00,$ct_txt01,$ct_phone,$c_id4trans,$tpl_id4trans,$u_name,$order_state22);
|
||||
my ($ct_name,$ct_txt00,$ct_txt01,$ct_phone,$c_id4trans,$tpl_id4trans,$u_name);
|
||||
my $id = $cttpos->{$pid}->{ct_id};
|
||||
if($ct4rel->{$id}->{c_id} == $cttpos->{$pid}->{ct_id}){
|
||||
$ct_name = $ct4rel->{$id}->{ct_name};
|
||||
$ct_txt00 = $ct4rel->{$id}->{txt00};
|
||||
$ct_txt01 = $ct4rel->{$id}->{txt01};
|
||||
$ct_phone = $ct4rel->{$id}->{txt07};
|
||||
$order_state22 = $ct4rel->{$id}->{txt22};
|
||||
$c_id4trans = $ct4rel->{$id}->{c_id};
|
||||
$tpl_id4trans = $ct4rel->{$id}->{template_id};
|
||||
$trans_style .= "background-color:#f7ae37;" if($ct4rel->{$id}->{c_id} == $users_dms->{c_id4trans});
|
||||
|
|
|
@ -80,7 +80,6 @@ sub tpl(){
|
|||
my $time = time;
|
||||
my $today = strftime("%d.%m.%Y",localtime(time));
|
||||
my $now_date = strftime("%Y-%m-%d",localtime(time));
|
||||
#steht auch in Libenz
|
||||
my @months = ("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
|
||||
my $mon = strftime "%m", localtime;
|
||||
my $hh;my $mm;
|
||||
|
@ -89,7 +88,6 @@ sub tpl(){
|
|||
my $year = strftime "%Y", localtime;
|
||||
($year,$mon,$day,$hh,$mm) = $lb->split_date($users_dms->{cal_start}) if($users_dms->{cal_start});
|
||||
|
||||
################### new from Callib for collect_pos() ################
|
||||
|
||||
my $start_date_time = $R::start_date_time;
|
||||
my $end_date_time = $R::end_date_time;
|
||||
|
@ -110,10 +108,8 @@ sub tpl(){
|
|||
$message .= ">>> Datum Eingabefehler: $end_date_time <<<" if($end_chck);
|
||||
}
|
||||
|
||||
#sammle alle termine im definierten Zeitraum
|
||||
my $search_startdt = $start_date_time;
|
||||
my $search_enddt = $end_date_time;
|
||||
#FIXME
|
||||
$end_date_time .= " 23:59" if($end_date_time !~ / \d\:\d/);
|
||||
|
||||
if("$start_date_time" eq "01.$mon.$year"){
|
||||
|
@ -143,15 +139,11 @@ sub tpl(){
|
|||
|
||||
$cttpos = { %$cttpos_trans, %$cttpos_theft };
|
||||
|
||||
#####################################################################
|
||||
|
||||
my $table = $node_meta->{ct_table} || "content";
|
||||
|
||||
my $hashfile = "$varenv{logdir}/$users_dms->{u_id}-$table-searchhash";
|
||||
|
||||
if((!$users_dms->{ek_view}) && ($table eq "content")){
|
||||
$node_meta->{tpl_order} =~ s/int01=EK €=5,//;
|
||||
}
|
||||
if($table eq "content"){
|
||||
$node_meta->{tpl_order} =~ s/txt17=[\w\s=]+,//;
|
||||
$node_meta->{tpl_order} =~ s/byte01=[\w\s=]+,//;
|
||||
|
@ -181,9 +173,6 @@ sub tpl(){
|
|||
|
||||
my $limit = $R::limit || $varenv{limit};
|
||||
my $offset = $R::offset || "0";
|
||||
#if($node_meta->{int10} && $node_meta->{int10} < $varenv{limit}){
|
||||
# $offset = 0;
|
||||
#}
|
||||
|
||||
#backward | forward
|
||||
if($R::go && $R::go eq "backward_list"){
|
||||
|
@ -195,7 +184,6 @@ sub tpl(){
|
|||
my ($daymarker,$raster_mmpx,$day4month) = $lb->month_line($users_dms);
|
||||
my $rows = 0;
|
||||
|
||||
#get Firma
|
||||
my $ctf = $db->get_content1("contentuser","$dbt->{sharedms_conf}->{parent_id}");
|
||||
|
||||
my ($edit,$new_key,$copy_key,$save_key,$delete_key,$c_id4csv);
|
||||
|
@ -234,9 +222,9 @@ sub tpl(){
|
|||
my $main_ids = "";
|
||||
|
||||
#Faktura actions
|
||||
if($node_meta->{template_id} =~ /209|218/){
|
||||
if($node_meta->{template_id} =~ /208|209|218/){
|
||||
$main_id = $dbt->{shareedms_conf}->{faktura};
|
||||
$tplids = "218";
|
||||
$tplids = "208,218";
|
||||
|
||||
if($node_meta->{node_name} =~ /OPOS/){
|
||||
$R::detail_search="suchen";
|
||||
|
@ -253,7 +241,7 @@ sub tpl(){
|
|||
$message .= ">>> es wurden die letzten Suchparameter oder Filter geladen <<<";
|
||||
$offset=0;
|
||||
$limit=10000;
|
||||
$tplids = "209,218";
|
||||
$tplids = "208,209,218";
|
||||
}
|
||||
|
||||
elsif($node_meta->{node_name} eq "Tagesbericht"){
|
||||
|
@ -281,9 +269,13 @@ sub tpl(){
|
|||
$main_id = 300009;
|
||||
$tplids = 218;
|
||||
}
|
||||
elsif($node_meta->{node_name} eq "Abrechnung"){
|
||||
$main_id = 300029;
|
||||
$tplids = 208;
|
||||
}
|
||||
|
||||
elsif($R::detail_search eq "suchen"){
|
||||
$tplids = "209,218";
|
||||
$tplids = "208,209,218";
|
||||
}
|
||||
}
|
||||
$main_ids = "$main_id,";
|
||||
|
@ -373,8 +365,8 @@ sub tpl(){
|
|||
}
|
||||
}
|
||||
|
||||
my $node = { template_id => 205,#Leihrad_liste
|
||||
parent_id => 200013,#Waren
|
||||
my $node = { template_id => 205,
|
||||
parent_id => 200013,
|
||||
fetch => "all",
|
||||
keyfield => "main_id",
|
||||
};
|
||||
|
@ -396,16 +388,12 @@ sub tpl(){
|
|||
$c_id4trans = $users_dms->{c_id4trans};
|
||||
}
|
||||
|
||||
#without limit it will takes only one dataset
|
||||
#it will takes only one dataset
|
||||
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);
|
||||
}
|
||||
|
||||
#Suchen
|
||||
elsif(!$start_chck && !$end_chck){
|
||||
#2020-12-01 changed to get last tablecontent, not only 1 by edit
|
||||
#testing state
|
||||
#if(!$start_chck && !$end_chck)
|
||||
$rows = $db->count_content($table,"$main_ids","$tplids");
|
||||
|
||||
#collect search keys
|
||||
|
@ -597,8 +585,8 @@ sub tpl(){
|
|||
}elsif($key =~ /owner/){
|
||||
print $q->td({-class=>'search_line'},$but->selector("s_$key","120px","$s_val",@_users)),"\n";
|
||||
}elsif($key =~ /state/){
|
||||
my @_states = split(/\|/,$varenv{Zahlungsweise});
|
||||
my @_orderstates = split(/\|/,$varenv{order_state});
|
||||
my @_states = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
my @_orderstates = split(/\|/,$dbt->{shareedms_conf}->{order_state});
|
||||
push (@_states,@_orderstates);
|
||||
print $q->td({-class=>'search_line'},$but->selector("s_$key","120px","$s_val",@_states)),"\n";
|
||||
}
|
||||
|
@ -655,20 +643,15 @@ sub tpl(){
|
|||
}
|
||||
}
|
||||
|
||||
#TODO, chrome breaks timeline
|
||||
#print $q->th(" "),"\n";
|
||||
my $tdcal = scalar @tpl_order;
|
||||
#$tdcal++;
|
||||
#print "$tdcal xxxxxxxxx";
|
||||
if($tpl_id == "205"){#205=Verleih
|
||||
if($tpl_id == "205"){
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>'background-color:silver;'},""),"\n";
|
||||
print $q->td({-class=>'tdtxt',-style=>'background-color:silver;',-colspan=>2},"$months[$mon -1] $year"),"\n";
|
||||
print $q->td({-style=>"font-size:0.71em;padding:0;border:0px solid green;",-colspan=>"$tdcal",-nowrap=>"1"},"$day4month"),"\n";
|
||||
}
|
||||
#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_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 $nr=0;my $nx=0;
|
||||
my $check_kaution=0;
|
||||
my $rabatt_key = "";
|
||||
|
@ -751,7 +734,6 @@ sub tpl(){
|
|||
$payment_time = $ct4rel->{$id}->{payment_time};
|
||||
$payment_time = $lb->time4de($payment_time,"1");
|
||||
}
|
||||
$sum_bar += $ct4rel->{$id}->{int01} if($ct4rel->{$id}->{state} && $ct4rel->{$id}->{state} =~ /^Bar/);
|
||||
$sum_ec += $ct4rel->{$id}->{int01} if($ct4rel->{$id}->{state} && $ct4rel->{$id}->{state} =~ /EC/);
|
||||
#$sum_kredit += $ct4rel->{$id}->{int01} if($ct4rel->{$id}->{state} && $ct4rel->{$id}->{state} =~ /Kredit/);
|
||||
$sum_abb += $ct4rel->{$id}->{int01} if($ct4rel->{$id}->{state} && $ct4rel->{$id}->{state} =~ /Abbuchung/);
|
||||
|
@ -1167,8 +1149,6 @@ sub tpl(){
|
|||
#print "($nr > 0) && ($v_journal || $R::v_abschluss || $close_time) && (!$R::rel_id)";
|
||||
$k="9" if(!$k);
|
||||
my $m = $k;
|
||||
$sum_bar = $lb->round($sum_bar);
|
||||
$sum_bar = $lb->cashme($sum_bar);
|
||||
$sum_ec = $lb->round($sum_ec);
|
||||
$sum_ec = $lb->cashme($sum_ec);
|
||||
#$sum_kredit = $lb->round($sum_kredit);
|
||||
|
|
461
copri4/main/src/Tpl/TransInvoices.pm
Executable file
461
copri4/main/src/Tpl/TransInvoices.pm
Executable file
|
@ -0,0 +1,461 @@
|
|||
package TransInvoices;
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
use CGI;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use CGI ':standard';
|
||||
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;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
use Mod::APIfunc;
|
||||
use Mod::Pricing;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {};
|
||||
bless($self,$class);
|
||||
return $self;
|
||||
}
|
||||
|
||||
#Template
|
||||
sub tpl(){
|
||||
my $self = shift;
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift;
|
||||
my $set_main_id = shift;
|
||||
my $rel4tpl = shift;
|
||||
my $return = shift || "";
|
||||
|
||||
my $q = new CGI;
|
||||
my $cf = new Config;
|
||||
my $lb = new Libenz;
|
||||
my $db = new Libenzdb;
|
||||
my $dbt = new DBtank;
|
||||
my $apif = new APIfunc;
|
||||
my $but = new Buttons;
|
||||
my $pri = new Pricing;
|
||||
my %varenv = $cf->envonline();
|
||||
my %ib = $but->ibuttons();
|
||||
my $today = strftime "%d.%m.%Y",localtime;
|
||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||
my $dbh = "";
|
||||
my $channel_map = $dbt->channel_map();
|
||||
my $coo = $q->cookie(-name=>'domcookie');
|
||||
|
||||
my $mapref = {};
|
||||
my $ct_users = $dbt->users_map($dbh,$mapref);#get serviceAPP and DMS users from contentadr
|
||||
my $line_count2 = 0;
|
||||
my $k=0;
|
||||
my $spart_ct_name = $R::spart_ct_name || "";
|
||||
my $c_idpos = $R::c_idpos || $R::pos_id || "";
|
||||
|
||||
my $ctf = $db->get_content1("contentuser",$dbt->{shareedms_conf}->{parent_id});
|
||||
my $ctt = $db->get_content1("contenttrans",$rel4tpl->{content_id});
|
||||
|
||||
my $ctadr = $db->get_content1("contentadr",$ctt->{int10});
|
||||
my $buchen_mtime = $lb->time4de($ctt->{mtime});
|
||||
my $vibuchen_mtime = "";
|
||||
$vibuchen_mtime = "payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time});
|
||||
|
||||
my @tpl_order = ("txt01=Bezeichnung/Leistung","int03=Anzahl","int02=Einzelpreis","int01=Betrag");
|
||||
my $tplf = $db->get_tpl("201");#Firma tpl
|
||||
my @tplf_order = split /,/,$tplf->{tpl_order};
|
||||
|
||||
my $txt20 = $R::txt20 || $ctt->{txt20} || "";#Leistungsdatum
|
||||
my $int05 = $R::int05 || $ctt->{int05} || "";#manuell
|
||||
my $cttpos = { c_id => 0 };
|
||||
my $rows = 0;
|
||||
|
||||
($cttpos,$rows) = $dbt->collect_contenttrans($dbh,$rel4tpl->{content_id});
|
||||
|
||||
#TODO collect payment types
|
||||
#foreach my $id (keys(%$cttpos)){
|
||||
# if(ref($cttpos->{$id}) eq "HASH"){
|
||||
# if($cttpos->{$id}->{int26}){
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
|
||||
print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'});
|
||||
|
||||
print $q->hidden(-name=>'offset', -override=>'1', -value=>"$R::offset") if($R::offset);
|
||||
print $q->hidden(-name=>'limit', -override=>'1', -value=>"$R::limit") if($R::limit);
|
||||
print $q->hidden(-name=>'c_id4trans', -override=>'1', -value=>"$rel4tpl->{content_id}");
|
||||
print $q->hidden(-name=>'tpl_id4trans', -override=>'1', -value=>"$node_meta->{tpl_id}");
|
||||
|
||||
$line_count2++;
|
||||
print $q->Tr();
|
||||
print $q->th("Pos."),"\n";
|
||||
foreach (@tpl_order){
|
||||
my ($key,$val) = split /=/,$_;
|
||||
$k++ if($val);
|
||||
print $q->th("$val");
|
||||
}
|
||||
|
||||
|
||||
print $q->start_form(-name=>'transposform'),"\n";
|
||||
|
||||
#Tablecontent (buttons and ct_name(primary key))
|
||||
#my $scol = "c_id";#changed to itime because of Storno resorts
|
||||
my $scol = "itime";
|
||||
my $sum_parts19=0;
|
||||
my $diff19 = 100 + 19;
|
||||
my $sum_umst19=0;
|
||||
my $i=0;
|
||||
my $accounting_start = "";
|
||||
my $accounting_end = "";
|
||||
|
||||
foreach my $id (sort { $cttpos->{$b}->{$scol} cmp $cttpos->{$a}->{$scol} } keys(%$cttpos)){
|
||||
|
||||
my $gesamt = 0;
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
my $rental_feed = {};
|
||||
|
||||
#accounting prices
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
$cttpos->{$id}->{end_time} = $now_dt if($cttpos->{$id}->{int10} == 3);
|
||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id},"calc_price");
|
||||
$rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos->{$id},$counting);
|
||||
$sum_parts19 += $pricing->{total_price};
|
||||
$gesamt = $pri->round($pricing->{total_price});
|
||||
$gesamt = sprintf('%.2f', $gesamt);
|
||||
}else{
|
||||
($gesamt,my $rabatt) = $pri->price2calc($cttpos->{$id});
|
||||
$sum_parts19 += $gesamt;
|
||||
$gesamt = $pri->round($gesamt);
|
||||
$gesamt = sprintf('%.2f', $gesamt);
|
||||
}
|
||||
|
||||
my $set_style="";
|
||||
my $occupied_style = "";
|
||||
my $time_style = "";
|
||||
$occupied_style = "color:#ff1493" if($cttpos->{$id}->{int10} == 2 ||$cttpos->{$id}->{int10} == 3 || $cttpos->{$id}->{int10} == 6);
|
||||
|
||||
if(1==1){
|
||||
$i++;
|
||||
if($i==1){
|
||||
$accounting_end = "$3.$2.$1" if($cttpos->{$id}->{pay_time} =~ /(\d+)\-(\d+)\-(\d+)/);
|
||||
$accounting_start = $accounting_end;
|
||||
}else{
|
||||
$accounting_start = "$3.$2.$1" if($cttpos->{$id}->{pay_time} =~ /(\d+)\-(\d+)\-(\d+)/);
|
||||
}
|
||||
#print "$accounting_start - $accounting_end<br>";
|
||||
|
||||
my @line_txt01 = split(/\n/,$cttpos->{$id}->{txt01});
|
||||
if($cttpos->{$id}->{int02} != 0){
|
||||
$line_count2++;
|
||||
#$line_count2 += scalar(@line_txt01);
|
||||
}
|
||||
|
||||
#1. Spalte
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{c_id}"),"\n";
|
||||
|
||||
#Tablecontent (parameter)
|
||||
foreach (@tpl_order){
|
||||
my ($key,$val,$inputsize) = split /=/,$_;
|
||||
$cttpos->{$id}->{$key} = $q->unescapeHTML($cttpos->{$id}->{$key});
|
||||
$cttpos->{$id}->{$key} = $lb->newline($cttpos->{$id}->{$key},"",$R::trans2edit) if($R::trans2edit);
|
||||
my $ct_pos = "$cttpos->{$id}->{ct_name}";
|
||||
my $txtstyle = "text-align:left;min-width:130px;";
|
||||
my $isize = "30";
|
||||
$isize = $inputsize if($inputsize);
|
||||
if($key =~ /int\d+/){
|
||||
$txtstyle = "text-align:right;min-width:50px;";
|
||||
$isize = "5";
|
||||
}
|
||||
|
||||
if(1==1){
|
||||
if($key =~ /ct_name/){
|
||||
#print $q->td({-class=>'tdint',-style=>"min-width:60px;"},"$ct_pos");
|
||||
my $stamm_style = "background-color:#98c13b;padding:2px;";
|
||||
my $article = $cttpos->{$id}->{ct_name};
|
||||
if($cttpos->{$id}->{int09}){
|
||||
print $q->td({-class=>'tdint',-style=>"min-width:60px;padding-top:5px;"}, $q->a({-class=>"linknav3",-style=>"$stamm_style",-href=>"/DMS/Waren/?detail_search=1&s_barcode=$cttpos->{$id}->{barcode}",-title=>"Im Warenstamm"},"$article")),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint'},"$article"),"\n";
|
||||
}
|
||||
}elsif($key eq "int26"){
|
||||
my $co2saving = "";
|
||||
if($cttpos->{$id}->{int26}){
|
||||
$co2saving = "Einsparung</br>";
|
||||
my $co2diff = $pri->co2calc($cttpos->{$id});
|
||||
my $sprit_price = $pri->sprit2calc($cttpos->{$id});
|
||||
$co2saving .= "$co2diff kg CO²<br />";
|
||||
$co2saving .= "$sprit_price EUR<br />";
|
||||
$cttpos->{$id}->{int26} =~ s/\./,/;
|
||||
$co2saving .= "bei $cttpos->{$id}->{int26} KM";
|
||||
}
|
||||
print $q->td({-class=>'tdint'},"$co2saving");
|
||||
|
||||
}
|
||||
#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',-nowrap=>1},"$pricing->{real_clock} $pricing->{freed_time}"),"\n";
|
||||
}else{
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key}"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int02/){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print "<td class='tdint'>\n";
|
||||
foreach my $fid (sort keys(%{ $rental_feed->{rental_description}->{tarif_elements} })){
|
||||
if(ref($rental_feed->{rental_description}->{tarif_elements}->{$fid}) eq "ARRAY"){
|
||||
print "$rental_feed->{rental_description}->{tarif_elements}->{$fid}[0]: $rental_feed->{rental_description}->{tarif_elements}->{$fid}[1]<br />\n";
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}else{
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key} €"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int04/){
|
||||
$gesamt =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint',-nowrap=>1},"$gesamt €"),"\n";
|
||||
}elsif($key =~ /int07/){
|
||||
my $proz="";
|
||||
$proz = "%" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0);
|
||||
$proz = "€" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0 && $cttpos->{$id}->{int08} && $cttpos->{$id}->{int08} == 1);
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$cttpos->{$id}->{$key} $proz"),"\n";
|
||||
}elsif($key =~ /txt01/){
|
||||
$cttpos->{$id}->{$key} = $q->unescapeHTML("$cttpos->{$id}->{$key}");
|
||||
$cttpos->{$id}->{$key} = $lb->newline($cttpos->{$id}->{$key},"","");
|
||||
print "<td class='tdtxt', style='$occupied_style;'>\n";
|
||||
if($cttpos->{$id}->{barcode} && $cttpos->{$id}->{int09}){#bike with tariff-nr
|
||||
my $u_name = $cttpos->{$id}->{owner};
|
||||
my $u_name_end = $cttpos->{$id}->{owner_end};
|
||||
foreach my $ctu_id (keys (%$ct_users)){
|
||||
if($channel_map->{$u_name}){
|
||||
$u_name = $channel_map->{$u_name};
|
||||
}elsif($cttpos->{$id}->{owner} eq $ct_users->{$ctu_id}->{c_id}){
|
||||
$u_name = $ct_users->{$ctu_id}->{txt01};
|
||||
}
|
||||
if($channel_map->{$u_name_end}){
|
||||
$u_name_end = $channel_map->{$u_name_end};
|
||||
}elsif($cttpos->{$id}->{owner_end} eq $ct_users->{$ctu_id}->{c_id}){
|
||||
$u_name_end = $ct_users->{$ctu_id}->{txt01};
|
||||
}
|
||||
}
|
||||
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";
|
||||
my $pos_raw = "";
|
||||
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_raw = $q->div({-class=>"popup",-onclick=>"toggle_box('$id')"},"$cttpos->{$id}->{c_id}", $q->span({-class=>"popuptext",-id=>"$id"},"$pos_details"));
|
||||
print "(raw $pos_raw)<br />\n";
|
||||
}
|
||||
}
|
||||
print "<br />\n";
|
||||
}
|
||||
if($cttpos->{$id}->{txt01} || $cttpos->{$id}->{int09}){
|
||||
#$line_count2++;
|
||||
$cttpos->{$id}->{txt01} =~ s/fixed/\<span style='color:red'\>fixed\<\/span\>/;
|
||||
$cttpos->{$id}->{txt01} =~ s/defect/\<span style='color:red'\>defect\<\/span\>/;
|
||||
my $bike="";
|
||||
my $tariff = "";
|
||||
$bike = "$cttpos->{$id}->{$key}" if($cttpos->{$id}->{$key});
|
||||
$tariff = ", Tarif: $cttpos->{$id}->{int09} $cttpos->{$id}->{txt04}" if($cttpos->{$id}->{txt04});
|
||||
print $q->span("$bike $tariff<br />"),"\n";
|
||||
}
|
||||
if($cttpos->{$id}->{int06} || $cttpos->{$id}->{int04}){
|
||||
print $q->span("Start/End Station: $cttpos->{$id}->{int06} / $cttpos->{$id}->{int04}, GPS: $cttpos->{$id}->{txt06}"),"\n";
|
||||
}
|
||||
if($cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
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 "</td>\n";
|
||||
}elsif($key =~ /txt/){
|
||||
print $q->td({-class=>'tdtxt'},"$cttpos->{$id}->{$key}");
|
||||
}elsif($key =~ /int/){
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"}," \n");
|
||||
}
|
||||
}#end view position
|
||||
|
||||
}
|
||||
}
|
||||
}#foreach end
|
||||
|
||||
if($sum_parts19 && $sum_parts19 != 0){
|
||||
$sum_umst19 = $sum_parts19 / $diff19 * 19;
|
||||
$sum_umst19 = $pri->round($sum_umst19);
|
||||
}
|
||||
my $sum_netto19 = $sum_parts19 - $sum_umst19;
|
||||
$sum_netto19 = sprintf('%.2f', $sum_netto19);
|
||||
$sum_netto19 =~ s/\./,/;
|
||||
|
||||
my $sum_paid = $sum_parts19;
|
||||
$sum_paid = $pri->round($sum_paid);
|
||||
my $sum_preauth = $sum_paid || 0;
|
||||
$sum_paid = sprintf('%.2f', $sum_paid);
|
||||
$sum_paid =~ s/\./,/;
|
||||
|
||||
$sum_parts19 = sprintf('%.2f', $sum_parts19);
|
||||
$sum_umst19 = sprintf('%.2f', $sum_umst19);
|
||||
$sum_umst19 =~ s/\./,/;
|
||||
|
||||
my $payment_text = "";
|
||||
foreach(@tplf_order){
|
||||
my ($key,$des,$size) = split /=/,$_;
|
||||
if($key =~ /txt5\d/){
|
||||
$ctf->{$key} = $q->unescapeHTML("$ctf->{$key}");
|
||||
$ctf->{$key} = $lb->newline($ctf->{$key},"","");
|
||||
$ctt->{state} =~ s/\(payone.*//;
|
||||
if($des =~ /$ctt->{state}/){
|
||||
if($sum_parts19 < 0){
|
||||
$payment_text = "$ctf->{txt58}";
|
||||
}else{
|
||||
$payment_text = "$ctf->{$key}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $n="5";
|
||||
my $m= 1 + $k - $n;
|
||||
$m++;
|
||||
print "<tr>\n";
|
||||
print "<td colspan='$m'><div style='font-size:0.81em;padding:0.3em 0em;border:0px;'>$payment_text</div></td>\n";
|
||||
print "<td style='font-size:1em;' colspan='$n'>\n";
|
||||
|
||||
print $q->start_table({-class=>'list',-style=>'border-top:1px;border-style:solid;border-color:black;', -border=>'0', -width=>'100%',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
|
||||
print $q->Tr("\n");
|
||||
print $q->td(" ");
|
||||
|
||||
if($node_meta->{node_name} !~ /steuerfrei/){
|
||||
print $q->Tr("\n"); $line_count2++;
|
||||
print $q->td({-class=>'tdint'},"Nettobetrag:");
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_netto19 €");
|
||||
|
||||
if($sum_netto19 != 0){
|
||||
print $q->Tr("\n");$line_count2++;
|
||||
#print $q->td({-class=>'tdint',-nowrap=>"1"},"$umst1619% UmSt auf $sum_netto19 €:");
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"19% UmSt auf $sum_netto19 €:");
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_umst19 €");
|
||||
}
|
||||
}
|
||||
my $summe = "Summe";
|
||||
print $q->Tr("\n");$line_count2++;
|
||||
print $q->td({-class=>'tdsum'},"<b>$summe:</b>");
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"<b>$sum_paid €<b/>");
|
||||
print $q->hidden(-name=>'sum_paid', -override=>'1',-value=>"$sum_paid");
|
||||
|
||||
print $q->end_table;
|
||||
print "</td><td> </td>";
|
||||
print "</tr>";
|
||||
print $q->end_table;
|
||||
|
||||
print $q->hidden(-name=>'owner', -override=>'1', -value=>"$users_dms->{u_id}");
|
||||
print $q->hidden(-name=>'c_id4trans', -override=>'1', -value=>"$rel4tpl->{content_id}");
|
||||
print $q->hidden(-name=>'tpl_id4trans', -override=>'1', -value=>"$node_meta->{tpl_id}");
|
||||
print $q->hidden(-name=>'offset', -override=>'1', -value=>"$R::offset") if($R::offset);
|
||||
print $q->hidden(-name=>'limit', -override=>'1', -value=>"$R::limit") if($R::limit);
|
||||
print $q->hidden(-name=>'relids', -override=>'1', -value=>"$R::relids") if($R::relids);
|
||||
|
||||
$set_main_id=$rel4tpl->{main_id} if($rel4tpl->{main_id} && $rel4tpl->{main_id} > "300000");
|
||||
print $q->hidden(-name=>'set_main_id', -value=>"$set_main_id", -override=>'1');
|
||||
|
||||
|
||||
if($users_dms->{int03} == 2){
|
||||
#only if user is also a primary DMS user with invoice rw
|
||||
print $q->hidden(-name=>'printer_id', -value=>"PDF", -override=>'1');
|
||||
my $dbh_primary = $dbt->dbconnect_extern("sharee_primary");
|
||||
my $users_dms_primary = { u_id => 0 };
|
||||
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"and int03=2");
|
||||
|
||||
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2 && !$ctt->{close_time}){
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
push @_paymentstate, "";
|
||||
my $kind_of_payment = "";
|
||||
if($ctadr->{int03} == 1 && ($ctadr->{ct_name} =~ /PO-\d+/ || $ctadr->{ct_name} =~ /TM-\d+/)){
|
||||
$kind_of_payment = "$_paymentstate[0]";
|
||||
}else{
|
||||
undef $_paymentstate[0];
|
||||
}
|
||||
if($ctadr->{int03} == 2 && length($ctadr->{ct_name}) >= 19){
|
||||
$kind_of_payment = "$_paymentstate[1]";
|
||||
}else{
|
||||
undef $_paymentstate[1];
|
||||
}
|
||||
$kind_of_payment = "$ctt->{state}" if($ctt->{state} && $ctt->{int01});
|
||||
|
||||
|
||||
my $send_invoice_checkbox = 1;
|
||||
$send_invoice_checkbox = 0 if($ctt->{txt30});
|
||||
print $q->div({-class=>'element6',-style=>'float:right;'},
|
||||
"buchen incl. drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""),
|
||||
" eMail Versand ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail Rechnung",""),
|
||||
$but->singlesubmit1("set_state","buchen"),
|
||||
$but->selector("state","250px",$kind_of_payment,@_paymentstate)),"\n";
|
||||
}
|
||||
#further payone capture are only allowed if OPOS && sequence && TXID is set
|
||||
if($ctt->{int14} && $ctt->{int18} && $ctt->{txt16}){
|
||||
print $q->div({-class=>'element6',-style=>'clear:both;'},"Weitere Payone Einzüge über die vorhandene TXID $ctt->{txt16} (vorautorisiert Summe beachten) durch manuelle inkrement der Sequencenr mit +1", $q->textfield(-class=>'etxt',-name=>"payone_sequence",-default=>"", -override=>'1',-size=>"1",-maxlength=>1)),"\n";
|
||||
}
|
||||
#Payone reset if OPOS and TXID
|
||||
if($ctt->{int14} && $ctt->{txt16}){
|
||||
print $q->div({-class=>'element6',-style=>'clear:both;'},"Payone reset löscht den Vorgang mit der TXID $ctt->{txt16} und versucht einen erneuten Einzug", $but->checkbox("1","payone_reset","0","Payone reset","")),"\n";
|
||||
}
|
||||
|
||||
}
|
||||
print $q->end_form;
|
||||
|
||||
my $praefix = "$ctt->{txt00}-$varenv{praefix}";
|
||||
print $q->div({-style=>"clear:both;height:0.1px;"},""),"\n";
|
||||
if($ctt->{txt30}){
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "$ctt->{txt30}"),"\n";
|
||||
}elsif( -f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" ){
|
||||
print $q->start_form(),"\n";
|
||||
print $q->hidden(-name=>'offset', -override=>'1', -value=>"$R::offset") if($R::offset);
|
||||
print $q->hidden(-name=>'limit', -override=>'1', -value=>"$R::limit") if($R::limit);
|
||||
print $q->hidden(-name=>'relids', -override=>'1', -value=>"$R::relids") if($R::relids);
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "eMail wurde nicht versandt! Rechnung eMail ", $but->singlesubmit1("ct_trans","send_invoice_again","send_invoice_again")),"\n" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
|
||||
print $q->end_form;
|
||||
}
|
||||
if($ctt->{state} && $ctt->{int01}){
|
||||
$ctt->{int01} =~ s/\./,/;
|
||||
my $style = "color:red;" if($ctt->{int01} ne $sum_paid);
|
||||
my $opos = "";
|
||||
$opos = "OPOS" if($ctt->{int14} && $ctt->{int14} > 0);
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> $vibuchen_mtime Gebucht $ctt->{int01} € \"$ctt->{state}\"") if($ctt->{state});
|
||||
}
|
||||
|
||||
if( -f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf"){
|
||||
#print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "Download: ", $q->a({-href=>"$varenv{metahost}/pdf/$praefix-$ctt->{ct_name}.pdf", -target=>'_blank'},"$praefix-$ctt->{ct_name}.pdf"));
|
||||
print $q->div({-style=>'padding:0.5em;font-size:0.81em;width:98%;text-align:right;'}, "Download: ", $q->a({-href=>"$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf&sessionid=$coo", -target=>"_blank" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}), "Rechnung $ctt->{ct_name}.pdf"),"\n";
|
||||
}
|
||||
|
||||
|
||||
if($ctt->{state} && $ctt->{state} =~ /payone/ && $ctt->{txt28} && $ctt->{txt28} =~ /error/i){
|
||||
print $q->div({-style=>"clear:both;padding:0.5em;font-size:0.81em;width:98%;text-align:right;color:red;"}, "Payone error: $ctt->{txt28}"),"\n";
|
||||
}elsif($ctt->{txt28} =~ /settleaccount=yes/i){
|
||||
print $q->div({-style=>"clear:both;padding:0.5em;font-size:0.81em;width:98%;text-align:right;color:green;"}, "Payone SEPA-Lastschrifteinzug war erfolgreich"),"\n";
|
||||
}
|
||||
|
||||
$db->updater("contenttrans","c_id","$rel4tpl->{content_id}","txt20","$accounting_start - $accounting_end","","","","","no_time") if(!$int05 && $accounting_start && $accounting_end);
|
||||
$db->updater("contenttrans","c_id","$rel4tpl->{content_id}","int15","$sum_preauth","","","","","no_time") if($sum_preauth || $sum_preauth == 0);
|
||||
return "$line_count2";
|
||||
}
|
||||
1;
|
|
@ -69,7 +69,7 @@ sub tpl(){
|
|||
my $ctadr = $db->get_content1("contentadr",$ctt->{int10});
|
||||
my $buchen_mtime = $lb->time4de($ctt->{mtime});
|
||||
my $vibuchen_mtime = "";
|
||||
$vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time});
|
||||
$vibuchen_mtime = "payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time});
|
||||
|
||||
my @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=timerange","int03=Menge (Miet - Gratis Zeit)","int02=Preis","int07=Rabatt","int04=Gesamt");
|
||||
my $tplf = $db->get_tpl("201");#Firma tpl
|
||||
|
@ -79,6 +79,7 @@ sub tpl(){
|
|||
my $int05 = $R::int05 || $ctt->{int05} || "";#manuell
|
||||
my $cttpos = { c_id => 0 };
|
||||
my $rows = 0;
|
||||
|
||||
($cttpos,$rows) = $dbt->collect_contentpos($dbh,"contenttrans",$rel4tpl->{content_id});
|
||||
|
||||
foreach my $id (keys(%$cttpos)){
|
||||
|
@ -521,7 +522,6 @@ EOF
|
|||
print $q->hidden(-name=>'set_main_id', -value=>"$set_main_id", -override=>'1');
|
||||
|
||||
|
||||
#if(!$ctt->{close_time} && $varenv{Zahlungsweise} && $users_dms->{u_id} == $dbt->{copri_conf}->{superu_id}){
|
||||
if($users_dms->{int03} == 2){
|
||||
#only if user is also a primary DMS user with invoice rw
|
||||
print $q->hidden(-name=>'printer_id', -value=>"PDF", -override=>'1');
|
||||
|
@ -529,8 +529,8 @@ EOF
|
|||
my $users_dms_primary = { u_id => 0 };
|
||||
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"and int03=2");
|
||||
|
||||
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2 && !$ctt->{close_time} && $varenv{Zahlungsweise}){
|
||||
my @_paymentstate = split(/\|/,$varenv{Zahlungsweise});
|
||||
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2 && !$ctt->{close_time}){
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
push @_paymentstate, "";
|
||||
my $kind_of_payment = "";
|
||||
if($ctadr->{int03} == 1 && ($ctadr->{ct_name} =~ /PO-\d+/ || $ctadr->{ct_name} =~ /TM-\d+/)){
|
||||
|
|
|
@ -77,11 +77,8 @@ sub tpl(){
|
|||
# $db->cleanup_users($users_dms->{owner}) if($users_dms->{owner});
|
||||
#}
|
||||
|
||||
if($users_dms->{c_id4trans} && $users_dms->{tpl_id4trans} && $users_dms->{kind_of_trans}){
|
||||
if($users_dms->{c_id4trans} && $users_dms->{tpl_id4trans}){
|
||||
my $table = "contenttrans";
|
||||
if($users_dms->{kind_of_trans} =~ /Veranstaltung|Proje/){
|
||||
$table = "contenttver";
|
||||
}
|
||||
|
||||
my $limit = $R::limit || $varenv->{limit};
|
||||
my $offset = $R::offset || "0";
|
||||
|
@ -91,7 +88,7 @@ sub tpl(){
|
|||
$offset += $limit;
|
||||
}
|
||||
my $ctrel = $db->get_ctrel($table,"",$lang,"",$users_dms->{c_id4trans},$users_dms->{tpl_id4trans});
|
||||
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',-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}\&owner=$users_dms->{owner}\&offset=$offset\&limit=$limit\&relids=$R::relids\&no_redirect=1"}," Faktura \#$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";
|
||||
|
@ -288,7 +285,7 @@ sub tpl(){
|
|||
print $q->div({-style=>'width:100%;margin:0;'}, $q->ul({-id=>'BigNavi'},$big2menu)),"\n";
|
||||
}
|
||||
|
||||
$debug = "syshost: $varenv->{syshost}, merchant_id: $varenv->{merchant_id}, (c_id4trans:$users_dms->{c_id4trans} && tpl_id4trans:$users_dms->{tpl_id4trans} && kind_of_trans:$users_dms->{kind_of_trans}) $node_meta->{tpl_name},$node_meta->{tpl_id},$node_meta->{ct_table},$parent_id,$main_id, permissions: ($users_dms->{int01},$users_dms->{int02},$users_dms->{int03},$users_dms->{int07},$users_dms->{int08},$users_dms->{int09})" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
|
||||
$debug = "syshost: $varenv->{syshost}, merchant_id: $varenv->{merchant_id}, (c_id4trans:$users_dms->{c_id4trans} && tpl_id4trans:$users_dms->{tpl_id4trans}) $node_meta->{tpl_name},$node_meta->{tpl_id},$node_meta->{ct_table},$parent_id,$main_id, permissions: ($users_dms->{int01},$users_dms->{int02},$users_dms->{int03},$users_dms->{int07},$users_dms->{int08},$users_dms->{int09})" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
|
||||
print $q->div({-style=>'position:fixed;bottom:0%;right:1%;z-index:10;padding:2px;font-size:13px;'},"$debug",$q->a({-style=>'color:black;text-decoration: none;',-href=>'https://sharee.bike',-target=>'_blank'},"sharee.bike © TeilRad GmbH 2022")),"\n";
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue