Change Faktura-Config db-table layout and pdf invoice. coding some cms-texts

This commit is contained in:
ragu 2023-06-27 07:11:08 +02:00
parent cede793cc3
commit 5c6a3111ee
9 changed files with 25 additions and 32 deletions

View file

@ -698,8 +698,8 @@ elsif($q->param('request') eq "stations_available"){
my $lnow = strftime("%Y-%m-%d %H:%M:%S", localtime(time));
my $localtime = Time::Piece->strptime($lnow, "%Y-%m-%d %H:%M:%S");
my $epoch_now = $localtime->epoch;
my $merchant_message_start = Time::Piece->strptime("2023-05-15 00:00:00", "%Y-%m-%d %H:%M:%S");
my $merchant_message_end = Time::Piece->strptime("2023-05-21 23:59:00", "%Y-%m-%d %H:%M:%S");
my $merchant_message_start = Time::Piece->strptime("2023-06-26 00:00:00", "%Y-%m-%d %H:%M:%S");
my $merchant_message_end = Time::Piece->strptime("2023-07-06 23:59:00", "%Y-%m-%d %H:%M:%S");
my $epoch_start = $merchant_message_start->epoch;
my $epoch_end = $merchant_message_end->epoch;

View file

@ -106,7 +106,6 @@ sub preinit(){
$R::kind_of_trans = $R::kind_of_trans || $users_dms->{kind_of_trans};
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");
if(!$parent_trans->{main_id}){
return "failure::Fehler<br /> keine eindeutige Modulzuweisung vorhanden.";
@ -116,12 +115,7 @@ sub preinit(){
my $ct_name = $q->escapeHTML("$R::ct_name");
my $barcode=0;
#Kassen-Abschluss Logik
my $s_owner_id=0;
if(($ctf->{txt06} eq "Benutzer") && ($R::kind_of_trans =~ /Verkauf|Verleih|Faktur/)){
$s_owner_id = $users_dms->{u_id};
}
if($R::cash_sort){
$db->users_up("cash_sort",$R::cash_sort,$users_dms->{u_id});
@ -247,7 +241,6 @@ sub preinit(){
# #like new_adr in Premain.pm
$table = "contentadr";
my $foreign_key="ca_id";
my $p_main_id = $ctf->{txt32};
my $barcode_last = $db->get_barcode("users","$table");#hier gilt: $table=column in users
my $freenr = $lb->get_freenr($table,$barcode_last->{$table});
($ct_name,$barcode) = $lb->barcodeable($table,$freenr);#new nr routine
@ -256,9 +249,8 @@ sub preinit(){
}else{
return "failure::Fehler, neue Nummer kann nicht generiert werden";
}
if($p_main_id && $users_dms->{kind_of_trans}){
#if($address->{main_id} && $users_dms->{kind_of_trans}){
$rel = $db->get_rel4tpl($p_main_id,$lang);
if($users_dms->{kind_of_trans}){
$rel = $db->get_rel4tpl("200011",$lang);
$c_idnew = $db->insert_content2($table,$ct_name,$users_dms->{u_id},"");
$i_rows += 1 if($c_idnew > 0);
$db->update_barcode($table,$c_idnew,$ct_name,$barcode);

View file

@ -355,7 +355,7 @@ td {
print "<td style='border:0px solid black;vertical-align:top;width:60%;height:250px;padding:0 0 0 2em;'>\n";
print $q->start_table({-width=>'100%',-border=>'0',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
print $q->Tr();
print $q->td({-class=>'tdpdf4', -style=>'padding-bottom:0.8em;text-decoration:underline;color:black;'}, "$ctf->{txt01} | $ctf->{txt02} | $ctf->{txt03}"),"\n";
print $q->td({-class=>'tdpdf4', -style=>'padding-bottom:0.8em;text-decoration:underline;color:black;'}, "$ctf->{txt01} | $ctf->{txt03} | $ctf->{txt06}"),"\n";
#print $q->Tr();
#print $q->td({-class=>'tdpdf1'}, "$ctt->{txt02} &nbsp;"),"\n";
print $q->Tr();
@ -1003,9 +1003,9 @@ td {
print "<td style='width:25%;'>";
print $q->start_table({-border=>'0',-align=>'left'});
print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "TEL: $ctf->{txt08}"),"\n";
print $q->td({-class=>'tdpdf2'}, "TEL: $ctf->{txt07}"),"\n";
print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "$ctf->{txt10}"),"\n";
print $q->td({-class=>'tdpdf2'}, "$ctf->{txt08}"),"\n";
print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "$txt11[0]"),"\n";
print $q->Tr();

View file

@ -354,7 +354,7 @@ sub tpl(){
($year_st,$mon_st,$day_st,$hh_st,$mm_st) = $lb->split_date($cttpos->{$pid}->{itime});
}
if($cttpos->{$pid}->{end_time}){
$cttpos->{$pid}->{end_time} = $now_dt if($cttpos->{$pid}->{int10} == 3);
$cttpos->{$pid}->{end_time} = $now_dt if($node_meta->{ct_table} eq "contenttanspos" && $cttpos->{$pid}->{int10} == 3);
($year_en,$mon_en,$day_en,$hh_en,$mm_en) = $lb->split_date($cttpos->{$pid}->{end_time});
}else{
($year_en,$mon_en,$day_en,$hh_en,$mm_en) = $lb->split_date($cttpos->{$pid}->{itime});

View file

@ -122,18 +122,19 @@ sub send_invoice {
my $project = $dbt->{operator}->{$varenv{dbname}}->{project} || "";
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname},"iso-8859-1");
my $pref_ctu = {
table => "contentuser",
fetch => "one",
c_id => "1",#primary hotline#TODO change to Kunden-Fakture, check tablefields
};
my $uadr = { c_id => 0 };
$uadr = $dbt->fetch_tablerecord($dbh_primary,$pref_ctu);
$varenv{cms} = $dbt->fetch_cms($dbh_primary,{ lang => $ctadr->{txt10} });
my $cms_message_key = "email-invoice";
my $dbh = $dbt->dbconnect_extern($dbt->{operator}->{$varenv{dbname}}->{database}->{dbname},"iso-8859-1");
#ex. primary hotline c_id=1# changed to Kunden-Fakture c_is=100002, check tablefields
my $pref_ctu = {
table => "contentuser",
fetch => "one",
c_id => "100002",
};
my $uadr = { c_id => 0 };
$uadr = $dbt->fetch_tablerecord($dbh,$pref_ctu);
my $fetchctt = {
table => "contenttrans",
fetch => "one",
@ -405,7 +406,7 @@ EOF
$sendref->{message} =~ s/::invoice_name::/$invoice_name/;
$sendref->{message} =~ s/::txid::/$ctt->{txt16}/;
$sendref->{message} =~ s/::email_temppassword::/\<b\>$ctadr->{txt04}\<\/b\>/g;
$sendref->{message} =~ s/::email_ack_digest::/\<b\>$ctadr->{txt34}\<\/b\>/g;
$sendref->{message} =~ s/::email_ack_digest::/\<b\>$ctadr->{txt34}\<\/b\>/g;#send_emailack
$sendref->{message} =~ s/::signature::/$signature/;
$sendref->{message} =~ s/\n/\<br \/\>/g;