mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-09 21:46:34 +02:00
adding sum_total and owner into invoive mailing. calc freed_time fix
This commit is contained in:
parent
76fe0eb26a
commit
8cc46ff9e0
4 changed files with 24 additions and 13 deletions
|
@ -205,16 +205,7 @@ sub preinit(){
|
|||
};
|
||||
$ctt = $dbt->fetch_tablerecord($dbh,$pref_ctt);
|
||||
}
|
||||
my $ctadr = { c_id => 0 };
|
||||
if(looks_like_number($ctt->{int10})){
|
||||
my $pref_adr = {
|
||||
table => "contentadr",
|
||||
fetch => "one",
|
||||
c_id => $ctt->{int10},
|
||||
};
|
||||
$ctadr = $dbt->fetch_tablerecord($dbh,$pref_adr);
|
||||
}
|
||||
|
||||
my $ctadr = { c_id => $ctt->{int10} };
|
||||
$pos_id = $dbt->insert_pos($dbh,$ctt->{c_id},$ct,"",$ctadr,"","","","0",$users_dms->{u_id},"");
|
||||
|
||||
$i_rows += 1 if($pos_id > 0);
|
||||
|
|
|
@ -64,7 +64,7 @@ sub count_freedrental {
|
|||
open(FILE,">>$varenv->{logdir}/count_freedrental.log") if($debug);
|
||||
print FILE "\n*-->$today4db $varenv->{dbname}\n" if($debug);
|
||||
print FILE Dumper($q) if($debug);
|
||||
print FILE "--> c_id:$pos->{c_id} rental_minute_all: $pricing->{rentalog}->{rental_minute_all} > 0\n" if($debug);
|
||||
print FILE "--> pos.c_id:$pos->{c_id}, user:$pos->{ca_id}, bike:$pos->{ct_name} rental_minute_all: $pricing->{rentalog}->{rental_minute_all} > 0\n" if($debug);
|
||||
|
||||
#freed mangement will be only dony on accountable rental
|
||||
if($pricing->{rentalog}->{rental_minute_all} > 0){
|
||||
|
@ -88,7 +88,8 @@ sub count_freedrental {
|
|||
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
||||
$pref_pos->{time_range} = "((start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' and start_time != end_time) OR int10=3)";
|
||||
}
|
||||
my $record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
||||
my $record_pos = { c_id => 0 };
|
||||
$record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
||||
foreach my $pid (sort { $record_pos->{$a}->{c_id} <=> $record_pos->{$b}->{c_id} } keys (%$record_pos)){
|
||||
$freed_count++;
|
||||
print FILE "if($freed_count > 1 && $pos->{c_id} != $record_pos->{$pid}->{c_id})\n" if($debug);
|
||||
|
|
|
@ -974,6 +974,7 @@ EOF
|
|||
::user_name:: → Kunden Name<br />
|
||||
::app_name:: → App Name<br />
|
||||
::invoice_nr:: → Faktura Beleg Nr<br />
|
||||
::sum_total:: → Rechnungsbetrag Summe €<br />
|
||||
::invoice_name:: → Faktura PDF Name<br />
|
||||
::txid:: → Payone TXID<br />
|
||||
::signature:: → eMail Signature<br />
|
||||
|
|
|
@ -178,6 +178,18 @@ sub send_invoice {
|
|||
};
|
||||
my $ctt = { c_id => 0 };
|
||||
$ctt = $dbt->fetch_tablerecord($dbh,$fetchctt);
|
||||
$ctt->{fibu_user} = "";
|
||||
if($ctt->{owner} > 1000){
|
||||
my $adref = {
|
||||
table => "contentadr",
|
||||
fetch => "one",
|
||||
template_id => "202",
|
||||
c_id => $ctt->{owner},
|
||||
};
|
||||
my $fibu_owner = $dbt->fetch_record($dbh,$adref);
|
||||
$ctt->{fibu_user} = "$fibu_owner->{txt01}" if($fibu_owner->{txt01});
|
||||
}
|
||||
|
||||
|
||||
$sendref = prepare_content($sendref,$ctadr,$uadr,$ctt,$varenv{cms}->{$cms_message_key}->{txt},$with_pdf);
|
||||
|
||||
|
@ -472,12 +484,17 @@ sub prepare_content {
|
|||
$app_name = $dbt->{operator}->{$varenv{dbname}}->{app_name};
|
||||
my $invoice_name = "";
|
||||
my $invoice_nr = "";
|
||||
my $sum_total = "";
|
||||
my $sharee_ticket = "";
|
||||
my $fibu_user = "";
|
||||
if(ref($ctt) eq "HASH" && $ctt->{ct_name}){
|
||||
$invoice_name = "$ctt->{txt00}-$varenv{dbname}-$ctt->{ct_name}.pdf";
|
||||
$sendref->{attachment} = "$invoice_name" if($with_pdf);
|
||||
$invoice_nr = "$varenv{dbname}-$ctt->{ct_name}";
|
||||
$sum_total = "$ctt->{int01}";
|
||||
$sum_total =~ s/\./,/;
|
||||
$sharee_ticket = "[$invoice_nr]";
|
||||
$fibu_user = "\n$ctt->{fibu_user}\n" if($ctt->{fibu_user});
|
||||
}
|
||||
|
||||
my $subject = "TeilRad Mietradsystem";#default
|
||||
|
@ -487,7 +504,7 @@ sub prepare_content {
|
|||
$cms_prim =~ s/\n//;
|
||||
|
||||
my $signature = <<EOF
|
||||
--
|
||||
--$fibu_user
|
||||
$uadr->{txt01}
|
||||
$uadr->{txt03}
|
||||
$uadr->{txt06}
|
||||
|
@ -511,6 +528,7 @@ EOF
|
|||
$sendref->{message} =~ s/::user_name::/$ctadr->{txt01}/g;
|
||||
$sendref->{message} =~ s/::app_name::/$app_name/g;
|
||||
$sendref->{message} =~ s/::invoice_nr::/\<b\>$invoice_nr\<\/b\>/g if($invoice_nr);
|
||||
$sendref->{message} =~ s/::sum_total::/\<b\>$sum_total €\<\/b\>/g if($sum_total);
|
||||
$sendref->{message} =~ s/::invoice_name::/$invoice_name/g if($invoice_name);
|
||||
$sendref->{message} =~ s/::txid::/$ctt->{txt16}/;
|
||||
$sendref->{message} =~ s/::email_temppassword::/\<b\>$ctadr->{txt04}\<\/b\>/g;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue